@sebastianpiskorski opened this issue on June 19th 2015

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 LocationProvider::getCurrentProvider()->getInfo();

@mattab commented on June 22nd 2015

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

@sebastianpiskorski commented on June 22nd 2015

I think that throwing Exception would be proper solution here.

This issue was closed on June 22nd 2015
Powered by GitHub Issue Mirror