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
https://github.com/opis/closure/blob/4.x/composer.json#L33 loads a functions.php file. Note that this will lead to a fatal error if someone globally installs opis and also locally installs it. I'd instead recommend making the init function a static class method. PHP's autoloader was built to load classes, not functions, basically.
NB Other libraries like illuminate/support get around this by conditionally defining their functions, but this would not be a good solution for opis, since it really matters you get the correct function. This also really matters for Guzzle, which is why we moved to static class methods after we got bitten by this: guzzle/guzzle#2511, guzzle/guzzle#2548, guzzle/guzzle#2546.
The text was updated successfully, but these errors were encountered:
https://github.com/opis/closure/blob/4.x/composer.json#L33 loads a functions.php file. Note that this will lead to a fatal error if someone globally installs opis and also locally installs it. I'd instead recommend making the init function a static class method. PHP's autoloader was built to load classes, not functions, basically.
NB Other libraries like illuminate/support get around this by conditionally defining their functions, but this would not be a good solution for opis, since it really matters you get the correct function. This also really matters for Guzzle, which is why we moved to static class methods after we got bitten by this: guzzle/guzzle#2511, guzzle/guzzle#2548, guzzle/guzzle#2546.
The text was updated successfully, but these errors were encountered: