> On Jan 18, 2017, at 09:02, Laurens Verspeek <
l.ver...@gmail.com> wrote:
>
> I think I found the bug:
>
> When you return null in the lazy function, it will run the function again when you resolve the service again.
Ah so. Yes, the service remains "unset" if it contains null, and so the container considers the service un-instantiated.
Perhaps the thing to do is throw an exception if the factory does not return an object ... ?
--
Paul M. Jones
pmjo...@gmail.com
http://paul-m-jones.com
Modernizing Legacy Applications in PHP
https://leanpub.com/mlaphp
Solving the N+1 Problem in PHP
https://leanpub.com/sn1php