Using a php definition file I have created this definition
return [
'auth' => \DI\object('MyProject\Users\Handlers\Permissions')->lazy()
];
But when I use the has() function to check if the definition exists i.e.
$container->has('auth'); //this returns FALSE
but the get() function manages to return the object.
$container->get('auth') //returns the referenced object
EDIT: The application is a bit complex so cant put all the code here but its meant to bypass an error Im getting when I implement the definitions this way
$containerBuilder->addDefinitions([
'auth' => \DI\object('MyProject\Users\Handlers\Permissions')->lazy()
]);
The error is:
Fatal error: Uncaught exception 'InvalidArgumentException' with message 'ContainerBuilder::addDefinitions() parameter must be a string or implement ChainableDefinitionSource, array given
Thanks for the quick response.