I create PHP-DI container with PDO. It looks like this:
$containerBuilder->addDefinitions(__DIR__ . '/ConfigPDO.php');
my ConfigPDO definitions:
// ConfigPDO.php
return [
myPDO::class => function () {
return new myPDO();
}
];
And I also have myPDO class:
//myPDO.php
class myPDO extends PDO {};
I have placed class myPDO in separate file myPDO.php in the same Config folder. However, when I use in ConfigPDO.php syntax: use Config\myPDO;
I have an error: Fatal error: Uncaught DI\NotFoundException: No entry or class found for 'myPDO'
and if I make include('myPDO.php');
everything works fine. Is it right to use include instead of use in this place?