public function set($name, $value = null)
Impossible to define explicitly a null value:
$container->set('service', null);
because:
if null, returns a ClassDefinitionHelper
so it will create a ClassDefinition for the entry name ("service" in the example).
One solution would be to check the numbers of arguments given: if $value was given and specified explicitly to null, then we define a null value.
Another would be to return a more generic helper that would allow:
$container->set('service')->value(null);
but that seems complex because of how it currently works with the ClassDefinitionHelper.
Finally, by adding a NullValue class:
$container->set('service', new NullValue());
Impossible to define explicitly a null value:
because:
so it will create a
ClassDefinitionfor the entry name ("service" in the example).One solution would be to check the numbers of arguments given: if
$valuewas given and specified explicitly tonull, then we define a null value.Another would be to return a more generic helper that would allow:
but that seems complex because of how it currently works with the
ClassDefinitionHelper.Finally, by adding a
NullValueclass: