Skip to content
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

[8.2] make AddAllowDynamicPropertiesAttributeRector configurable #1391

Merged

Conversation

mallardduck
Copy link
Contributor

Per the talk in #1225 this expands on that by making it configurable for namespaces.

@@ -7,5 +7,10 @@

return static function (ContainerConfigurator $containerConfigurator): void {
$services = $containerConfigurator->services();
$services->set(AddAllowDynamicPropertiesAttributeRector::class);
$services->set(AddAllowDynamicPropertiesAttributeRector::class)
Copy link
Member

Choose a reason for hiding this comment

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

please add 1 more test class with no config to fallback to change all classes, even without namespace

Comment on lines 11 to 15
->call('configure', [[
AddAllowDynamicPropertiesAttributeRector::TRANSFORM_ON_NAMESPACES => [
'*\Fixture\Process\*'
]
]]);
Copy link
Member

Choose a reason for hiding this comment

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

can be changed to:

Suggested change
->call('configure', [[
AddAllowDynamicPropertiesAttributeRector::TRANSFORM_ON_NAMESPACES => [
'*\Fixture\Process\*'
]
]]);
->configure(
[
'*\Fixture\Process\*'
]
);

Copy link
Member

Choose a reason for hiding this comment

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

We should have probably PHPStan rule for this one 👍

In /~https://github.com/rectorphp/phpstan-rules

@mallardduck mallardduck force-pushed the configurable-allow-dynamic-props branch from 9f68afa to c5e362c Compare December 9, 2021 17:17
@TomasVotruba TomasVotruba merged commit 6012e41 into rectorphp:main Dec 10, 2021
@TomasVotruba
Copy link
Member

Thanks again 👏 👍

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.

3 participants