Skip to content

[Demo] Add "Tips" config to demonstrate rule on specific PHP version #3057

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

Merged
merged 4 commits into from
Jul 10, 2025

Conversation

samsonasik
Copy link
Member

Screenshot 2025-05-22 at 13 19 45

@samsonasik samsonasik changed the title [Demo] Add "Tips" div to demontrate rule on specific PHP version [Demo] Add "Tips" div to demonstrate rule on specific PHP version May 22, 2025
@samsonasik samsonasik requested a review from TomasVotruba May 22, 2025 06:20
@samsonasik
Copy link
Member Author

@TomasVotruba ready for review 👍

@TomasVotruba
Copy link
Member

I like the idea 👍 This could be better in the config itself, like rules and sets.
Otherwise we make this page much bigger.

@samsonasik
Copy link
Member Author

samsonasik commented May 22, 2025

@TomasVotruba sure, moved to config 301317f

Screenshot 2025-05-22 at 13 44 57

@samsonasik samsonasik changed the title [Demo] Add "Tips" div to demonstrate rule on specific PHP version [Demo] Add "Tips" to demonstrate rule on specific PHP version May 22, 2025
@samsonasik samsonasik changed the title [Demo] Add "Tips" to demonstrate rule on specific PHP version [Demo] Add "Tips" config to demonstrate rule on specific PHP version May 22, 2025
@samsonasik
Copy link
Member Author

Ready to merge 👍


return RectorConfig::configure()
// A. whole set
->withPreparedSets(typeDeclarations: true)
// B. or few rules
->withRules([
TypedPropertyFromAssignsRector::class
]);
])
->withPhpVersion(PhpVersion::PHP_82);
Copy link
Member

Choose a reason for hiding this comment

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

I think the 8.4 would be better, as this one would disable all the new rules.

Why should we have this option here? It's rarely used in practice. I'd like to avoid spreading configuration, that's only for hackers 😁

Copy link
Member Author

Choose a reason for hiding this comment

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

sure, updated to php 8.4 👍 c0dcb1c

Copy link
Member Author

Choose a reason for hiding this comment

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

The reason config here is when people try php 8.3+ rule, while our server still on php 8.2, we don't have composer.json included in demo page, so defined config may needed.

upgrading to latest php 8.4 on server will currently a little bit challenging imo, last time I upgraded to php 8.2, it took some time to up correctly.

@TomasVotruba TomasVotruba merged commit 0e07c8e into main Jul 10, 2025
8 checks passed
@TomasVotruba TomasVotruba deleted the dx-tips branch July 10, 2025 11:12
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