Addition
Thxs, with the help of the answers it is working now. I saw the excellent video, change the statements, disable my own autoloading procedure.
As a result of this I should add in my classes the use statement for every object I use. The only thing I find a little bit strange is the following.
In every php file with a class I should add the use statement for every object.
Example 1.
// Define namespaces and objects
namespace Drupal\tb\library;
use SplFileInfo;
class log{
}
Example 2
namespace Drupal\tb;
use Drupal\tb\library\log;
use Drupal\tb\datacollector\datacollector;
use Drupal\tb\datacalculator\datacalculator;
use Drupal\tb\scenario\scenario;
class traderbot{
public function start(){
(new log)->add(0,"Start data collector");
$collector = new datacollector;
...
(new log)->add(0,"Start data calculator");
$indicators = new datacalculator;
...
(new log)->add(0,"Start scenario handler");
$sc_handler = new scenario;
...
}
}
I red some other documentation and QA and understand dat wild card loading of namespacing is not possible. https://stackoverflow.com/questions/29851099/how-to-load-all-classes-of-a-namespace but I also red somewhere that as long as the class is in the same namespace it is not needed to put the use statement for this object. So then I come to the following questions for verification:
Q1) Adding a standard use statement for SPL looks very strange for me. Is this correct?
Q2) Adding a long list of several use statements from unique objects in the same namespace is very strange for me as well. Is this correct?