Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace global DI library functions with corresponding objects for PRS-4 compliance #238

Merged
merged 1 commit into from
May 1, 2024

Conversation

phpfui
Copy link
Contributor

@phpfui phpfui commented May 1, 2024

This PR makes the library fully PSR-4 compliant.

The php-di/php-di library supports global functions for various setup configurations. The problem is global functions are not PRS-4 compliant, so using a super fast and minimal memory footprint autoloader fails.

The solution is simple, use the corresponding classes called by the global functions. It turns out the php-di library does not use these global functions, and it is considered bad form to use global functions, as they are not PSR-4 compliant. Guzzle has recently depreciated global functions for example.

@zbateson
Copy link
Owner

zbateson commented May 1, 2024

Ooh, interesting... yeah sure, happy to change that so different autoloaders don't complain.

Want me to do a quick 3.0.2 for it right away? Or do you want to have a look around and see if there's anything else you might want to update in the next week or so?

@zbateson zbateson merged commit 9a24052 into zbateson:master May 1, 2024
9 checks passed
@phpfui
Copy link
Contributor Author

phpfui commented May 1, 2024 via email

@phpfui phpfui deleted the PSR-4Autoloading branch May 1, 2024 22:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants