-
Notifications
You must be signed in to change notification settings - Fork 31
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
Write cutting edge code and release it to legacy platforms #319
Comments
Hmm, do you know any WP plugin which is using this? It looks interesting! |
I'm not in the WordPress business, just playing with PHP technologies. |
https://github.com/rectorphp/rector/issues?q=WordPress 🖱️ <?php
use Rector\Core\Configuration\Option;
use Rector\Set\ValueObject\SetList;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
return static function (ContainerConfigurator $containerConfigurator): void {
$parameters = $containerConfigurator->parameters();
$parameters->set(Option::SETS, [
SetList::DOWNGRADE_PHP74,
SetList::DOWNGRADE_PHP73,
SetList::DOWNGRADE_PHP72,
SetList::DOWNGRADE_PHP71,
SetList::DOWNGRADE_PHP70,
SetList::DOWNGRADE_PHP56,
]);
}; |
WordPress is very specific and bloated, looking at all the problems with ie with PHPUnit I wouldn't be surprised if it fail miserably. I will take a closer look at this package and its usage with WP though |
You can audit the changes. |
Found one: https://github.com/leoloso/PoP/blob/master/rector-downgrade-code.php |
These are not Wordpress plugins. Also, seems like support of autoload and includes (WordPress beloved stuffs) is still a work in progress rectorphp/rector#4330. |
I think using Composer autoloader (not the tool!) in a WordPress plugin is okay. Please see Yoast SEO for example. |
This is how I try to break away from WordPress legacy technologies. |
We're good with Composer itself because all its loaders are backward compatible. There are problems with a few things:
I'm looking into using the Rector within this project and I'd like to find out if all the packages processed by Imposter can be rectified to older PHP versions. |
Highly interesting topic 👀 Time traveling 101! |
Public testing with Rectorizer 🤖 |
Wow, this truly seems to work! |
Problem
We want to write PHP 7.4/8.0 code but users run PHP 5.6
Solution
Use Rector in the release process!
Alternatives you've considered
Sleep.
The text was updated successfully, but these errors were encountered: