You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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();
The text was updated successfully, but these errors were encountered:
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 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();
The text was updated successfully, but these errors were encountered: