Skip to content

[DX] Enable polyfill rules on withPhpSets() config#5981

Merged
TomasVotruba merged 1 commit intomainfrom
tv-polyfills-register
Jun 20, 2024
Merged

[DX] Enable polyfill rules on withPhpSets() config#5981
TomasVotruba merged 1 commit intomainfrom
tv-polyfills-register

Conversation

@TomasVotruba
Copy link
Copy Markdown
Member

@TomasVotruba TomasVotruba commented Jun 20, 2024

Polyfill rules are now enabled, once withPhpSets() is in the place. To pick up used packages in composer.json 👍

Follow up to #5388

StrEndsWithRector::class,
StrContainsRector::class,
]);
};
Copy link
Copy Markdown
Member Author

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 😉

@TomasVotruba TomasVotruba merged commit e007104 into main Jun 20, 2024
@TomasVotruba TomasVotruba deleted the tv-polyfills-register branch June 20, 2024 02:49
Comment on lines +460 to +461
// make use of polyfill packages in composer.json
$this->sets[] = SetList::PHP_POLYFILLS;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The 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 withPhpSets(php53: true), it doesn't make sense to have str_starts_with() change? That will make too much change when it on step by step migration.

I think user needs to enable it by, eg: withPhpSets(php53: true, polyfill: true)

wdyt?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think add new method: withPhpPolyfill() can be the way to go

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, thanks 👍

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.

2 participants