-
-
Notifications
You must be signed in to change notification settings - Fork 324
Impossible do define "null" value #79
Copy link
Copy link
Closed
Description
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());Reactions are currently unavailable