-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
PSR-12 #2907
PSR-12 #2907
Conversation
To complete this PR, I created a "sub-branch". You can have a diff just here. I'm using uopz extension to change the return value of our 5 functions during tests. |
This also effectively resolves #2881 right? I'm in favor of this. Will need to do on Slim-Http, Slim-Psr7 and Slim-Skeleton I don't see any added value from using the UOPZ extension, I suppose it makes the code more uniform. What do you think @adriansuter? This PR works both ways. |
Yes, let's move to PSR-12. Concerning the override, I once started a project that could be used to override global (root) namespace functions. But it is not completed yet. https://github.com/adriansuter/php-autoload-override The idea is, that we can define classes for which we can define functions that should be overridden. The tool then intercepts the loading of these classes (using stream wrappers) and overwrites the function calls. It actually works. |
Yes it closes #2881 @adriansuter your library is amazing, and really easy to use. It is what we need here ! Do you want to keep all that code in the bootstrap.php file ? Or move code in Assets folder ? |
I think what we can do for now is merge this and we can decide/finish the rest in a different PR. The scope of this PR is already pretty big. |
PSR-12 expanded and replaced PSR-2. Can Slim switch to PSR-12 ?
PSR-12: Extended Coding Style
I also add fully-qualified function calls (
use function xxxx
). I didn't add 5 functions (headers_sent
,header
,connection_status
,is_readable
andis_writable
) since we override them during tests (used onResponseEmitter
andRouting/RouteCollector
classes).