I think that returning Object or false in one method might be misleading since php allow to call method directly after earlier call without assigning result to variable like this
since php allow to call method directly after earlier call without assigning result to variable like this
PHP allows to call in this way, but it does not mean one should do it. One should check the instance is set before calling methods on an object instance. I guess getCurrentProvider should return
null instead of
false. What would you suggest instead? I guess throwing exception would be an alternative. since there is no real value to developer or user to change this at this stage, closing
I think that throwing Exception would be proper solution here.