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

feature: PHP8.2 - "readonly" class support #6624

Closed

Conversation

SpacePossum
Copy link
Contributor

@SpacePossum SpacePossum commented Sep 6, 2022

This fixes the current the rules and code so these handle the new readonly classes as added in PHP8.2.
The class_definition rule will now also sort the class `modifiers following: https://github.com/php-fig/per-coding-style/blob/9dc210da72285afd5ab10ab0bd34659ff5b0529f/spec.md#46-modifier-keywords

@SpacePossum SpacePossum changed the title featue: PHP8.2 - "readonly" class support feature: PHP8.2 - "readonly" class support Sep 6, 2022
@coveralls
Copy link

coveralls commented Sep 6, 2022

Coverage Status

Coverage decreased (-0.06%) to 92.854% when pulling fb4a429 on SpacePossum:m_readonly_class_support into 531eaeb on FriendsOfPHP:master.

@SpacePossum SpacePossum force-pushed the m_readonly_class_support branch 4 times, most recently from ae53bc7 to 2e96eac Compare September 6, 2022 11:52
@SpacePossum SpacePossum marked this pull request as ready for review September 6, 2022 11:56
@SpacePossum SpacePossum force-pushed the m_readonly_class_support branch 3 times, most recently from 28ede6c to 980360f Compare September 7, 2022 04:52
@keradus keradus added the topic/PHP8.2 Related to features available in PHP 8.2+ label Sep 8, 2022
@Wirone
Copy link
Member

Wirone commented Sep 9, 2022

@SpacePossum we should wait for #6621 to be merged, then rebase this one and change fixture in integration test, so keywords are in wrong order (now only casing is verified, order is preserved).

@SpacePossum
Copy link
Contributor Author

There is a utest for the feature to order, so there is no need to wait.
We've a lot of features that are covered by utest only and not part of integration tests as well. As such I don't see why it would be a requirement now.
I would like to see 6621 merged though, would be great 👍

@SpacePossum SpacePossum force-pushed the m_readonly_class_support branch 2 times, most recently from 69abed4 to 358988c Compare September 12, 2022 06:35
Copy link
Member

@Wirone Wirone left a comment

Choose a reason for hiding this comment

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

Great work 🙂 I left some comments, hope you'll find them useful.

src/Fixer/ClassNotation/ClassDefinitionFixer.php Outdated Show resolved Hide resolved
src/Fixer/ClassNotation/FinalInternalClassFixer.php Outdated Show resolved Hide resolved
src/Fixer/ClassNotation/ProtectedToPrivateFixer.php Outdated Show resolved Hide resolved
src/Tokenizer/TokensAnalyzer.php Outdated Show resolved Hide resolved
tests/Fixer/ClassNotation/ClassDefinitionFixerTest.php Outdated Show resolved Hide resolved
src/Fixer/ClassNotation/ClassDefinitionFixer.php Outdated Show resolved Hide resolved
tests/Tokenizer/TokensAnalyzerTest.php Show resolved Hide resolved
src/AbstractDoctrineAnnotationFixer.php Show resolved Hide resolved
src/Tokenizer/TokensAnalyzer.php Show resolved Hide resolved
src/Tokenizer/TokensAnalyzer.php Outdated Show resolved Hide resolved
@SpacePossum SpacePossum marked this pull request as draft September 21, 2022 05:53
@SpacePossum SpacePossum force-pushed the m_readonly_class_support branch 2 times, most recently from f971b6b to 3f4aa21 Compare September 29, 2022 16:03
@SpacePossum SpacePossum marked this pull request as ready for review September 29, 2022 16:09
@SpacePossum SpacePossum closed this Oct 3, 2022
@SpacePossum SpacePossum deleted the m_readonly_class_support branch October 3, 2022 18:37
@Wirone
Copy link
Member

Wirone commented Oct 3, 2022

@SpacePossum why did you close this PR? 🤔

Wirone pushed a commit to Wirone/PHP-CS-Fixer that referenced this pull request Jan 9, 2023
These are changes initially proposed by SpacePossum in PHP-CS-Fixer#6624 but abandoned due to personal reasons. Since it's accepted by the author to use these changes, I just apply the full patch, so we can continue work.
Wirone pushed a commit to Wirone/PHP-CS-Fixer that referenced this pull request Jan 9, 2023
These are changes initially proposed by SpacePossum in PHP-CS-Fixer#6624 but abandoned due to personal reasons. Since it's accepted by the author to use these changes, I've just applied the full patch, so we can continue work.
Wirone pushed a commit to Wirone/PHP-CS-Fixer that referenced this pull request Feb 27, 2023
These are changes initially proposed by SpacePossum in PHP-CS-Fixer#6624 but abandoned due to personal reasons. Since it's accepted by the author to use these changes, I've just applied the full patch, so we can continue work.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic/PHP8.2 Related to features available in PHP 8.2+
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants