[Php81][Php82][Privatization] Handle extends non-readonly class on ReadOnlyPropertyRector+ReadOnlyClassRector+FinalizeClassesWithoutChildrenRector#4524
Merged
samsonasik merged 10 commits intomainfrom Jul 16, 2023
Conversation
…adOnlyPropertyRector+ReadOnlyClassRector+FinalizeClassesWithoutChildrenRector
Member
Author
|
This is strange that it is not reproducible in CI unit test, while error on local ➜ rector-src git:(readonly-extends-non-readonly) vendor/bin/phpunit tests/Issues/ExtendsNonReadonlyClass/ExtendsNonReadonlyClassTest.php
PHPUnit 10.2.5 by Sebastian Bergmann and contributors.
Runtime: PHP 8.2.5
Configuration: /Users/samsonasik/www/rector-src/phpunit.xml
F 1 / 1 (100%)
Time: 00:01.264, Memory: 90.50 MB
There was 1 failure:
1) Rector\Core\Tests\Issues\ExtendsNonReadonlyClass\ExtendsNonReadonlyClassTest::test with data set #0
Failed on fixture file "fixture.php.inc"
Failed asserting that string matches format description.
--- Expected
+++ Actual
@@ @@
use Rector\Core\Tests\Issues\ExtendsNonReadonlyClass\Source\NonReadonlyClass;
-final class Fixture extends NonReadonlyClass
+final readonly class Fixture extends NonReadonlyClass
{
public function __construct(
- private readonly string $foo
+ private string $foo
) {} |
6b8a2ad to
d65ee3f
Compare
Member
Author
|
Ok, the error is now reproduced with rename fixture dir https://github.com/rectorphp/rector-src/actions/runs/5564649404/jobs/10164374851?pr=4524 |
Member
Author
Member
Author
|
All checks have passed 🎉 @TomasVotruba I am merging it ;) Current solution is by verify ClassReflection from Scope on ReadonlyClassRector 9190a86 this is not ideal solution yet, as the real solution should be on but at least it fixed on this use case ;) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes rectorphp/rector#8058