Skip to content

[BUGFIX] Ensure proper reprint with attributes for finalized classes#4585

Merged
samsonasik merged 1 commit intorectorphp:mainfrom
cngJo:8080-improve-reprint-of-finalized-classes
Jul 23, 2023
Merged

[BUGFIX] Ensure proper reprint with attributes for finalized classes#4585
samsonasik merged 1 commit intorectorphp:mainfrom
cngJo:8080-improve-reprint-of-finalized-classes

Conversation

@cngJo
Copy link
Copy Markdown
Contributor

@cngJo cngJo commented Jul 23, 2023

Previously, a finalized class would be printed on the same line as the attribute above, like this:

#[SomeAttribute]final class ClassWithAttribute
{
}

for the new provided test case.


Fixes #8080

@cngJo cngJo requested a review from TomasVotruba as a code owner July 23, 2023 09:36
@cngJo cngJo force-pushed the 8080-improve-reprint-of-finalized-classes branch from ec0447d to de8ebf2 Compare July 23, 2023 09:36
@samsonasik samsonasik enabled auto-merge (squash) July 23, 2023 09:38
@samsonasik
Copy link
Copy Markdown
Member

Thank you @cngJo

@samsonasik samsonasik merged commit 50a5bb4 into rectorphp:main Jul 23, 2023
@@ -0,0 +1,21 @@
<?php

namespace Rector\Tests\Php82\Rector\Class_\ReadOnlyClassRector\Fixture;
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.

oh, the namespace need to be changed based on the test namespace, I will change that :)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ah damit, totally missed that. Thank you for taking care of that.

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.

@cngJo
Copy link
Copy Markdown
Contributor Author

cngJo commented Jul 23, 2023

wow that was fast, thank you 🎉

@TomasVotruba
Copy link
Copy Markdown
Member

Thank you @cngJo 👍

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.

FinalizeClassesWithoutChildrenRector removed newline before final when class has Attributes

3 participants