-
Notifications
You must be signed in to change notification settings - Fork 10
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
More than enough freedom #13
Comments
You should give an example of what you're suggesting. I don't think it encourages abnormally structured code. When I use this I also run PHPCS with WPCS. From Updating the Coding standards for modern PHP:
This library doesn't handle traits yet. One of the reasons I was looking at it again yesterday was to see how to better handle e.g. I use it here: https://github.com/BrianHenryIE/bh-wp-autologin-urls/ |
Core says everything should begin with |
Core was saying. After taking a look at that linked announcement: I'm out. This is insanely complex. I'm not up to it. My brains could only process PSR-4 simplicity: filesystem equals namespaces. |
wp-namespace-autoloader has several options: you could violate both PSR-4 and WPCS at the same time. That is abnormally structured code. My suggestionHave no option for standard: always WPCS.
|
I know, I know: this would exclude Billlions of WPCS violators :) |
@BrianHenryIE BTW having different prefixes (class- trait- interface-) makes autoloading slow by design as you cannot get the reflection of the unloaded class! |
Hello!
Does this project encourage developers to write custom - meaning abnormally structured - code?
I think when you write code for WordPress and you have class autoloading on mind you use PHP >= 5.3.0 namespaces and follow WPCS or PSR-4.
e.g. https://github.com/szepeviktor/debian-server-tools/blob/master/webserver/wp-install/wordpress-autoloader.php
e.g. simply use Composer's generated autoloader (
vendor/composer/*.php
) for PSR-4How do you see this?
The text was updated successfully, but these errors were encountered: