I created a named instance like so:
$rules = [
'$logger2' => [
Dice::INSTANCE => function () use ($config) {
//do stuff;
return $thing;
}
]
];
$dice = $dice->addRules($rules);
And I tried to get it like so:
$logger2 = $dice->create('$logger2');
But it did not work because create() only expects class names. It throws:
PHP Fatal error: Uncaught ReflectionException: Class $logger2 does not exist in //vendor/level-2/dice/Dice.php:107
I understand I can make it a dependency of a class and then create the class, but what if I just want to access it as is?