Repository navigation
[DX] Enable polyfill rules on withPhpSets() config #5981
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| use Rector\Config\RectorConfig; | ||
| use Rector\Php73\Rector\BooleanOr\IsCountableRector; | ||
| use Rector\Php73\Rector\FuncCall\ArrayKeyFirstLastRector; | ||
| use Rector\Php80\Rector\Identical\StrEndsWithRector; | ||
| use Rector\Php80\Rector\Identical\StrStartsWithRector; | ||
| use Rector\Php80\Rector\NotIdentical\StrContainsRector; | ||
| use Rector\Php80\Rector\Ternary\GetDebugTypeRector; | ||
|
|
||
| // these rules can be used ahead of PHP version, | ||
| // as long composer.json includes particular symfony/php-polyfill package | ||
| return static function (RectorConfig $rectorConfig): void { | ||
| $rectorConfig->rules([ | ||
| ArrayKeyFirstLastRector::class, | ||
| IsCountableRector::class, | ||
| GetDebugTypeRector::class, | ||
| StrStartsWithRector::class, | ||
| StrEndsWithRector::class, | ||
| StrContainsRector::class, | ||
| ]); | ||
| }; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -457,6 +457,9 @@ public function withPhpSets( | |
| $this->sets[] = LevelSetList::UP_TO_PHP_84; | ||
| } | ||
|
|
||
| // make use of polyfill packages in composer.json | ||
| $this->sets[] = SetList::PHP_POLYFILLS; | ||
|
Comment on lines
+460
to
+461
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this should be enabled manually via passed config, for example, we use I think user needs to enable it by, eg: wdyt?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think add new method:
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Makes sense, thanks 👍 |
||
|
|
||
| return $this; | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If anyone notices this set should be more complete, let us know 😉