zendframework / zend-servicemanager

ServiceManager component from Zend Framework
BSD 3-Clause "New" or "Revised" License
188 stars 89 forks source link

Use default values for type-hinted arguments if type not found in container #243

Closed weierophinney closed 6 years ago

weierophinney commented 6 years ago

Per #239, currently when an argument is type-hinted but has a default value (typically null), the factory raises an exception about not being able to retrieve the value from the container. In such cases, we can use the default value for the argument during injection.

Fixes #239.