Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"phpstan/phpstan-webmozart-assert": "^2.0",
"phpunit/phpunit": "^13.3",
"rector/jack": "^1.1",
"rector/swiss-knife": "^2.4.1",
"rector/swiss-knife": "^2.6",
"shipmonk/composer-dependency-analyser": "^1.8",
"symfony/process": "^8.1",
"symplify/easy-coding-standard": "^13.2.13",
Expand All @@ -70,8 +70,7 @@
"src"
],
"Rector\\Utils\\": "utils",
"Rector\\Utils\\PHPStan\\": "utils/phpstan/src",
"Rector\\Utils\\Duplicates\\": "utils/duplicates/src"
"Rector\\Utils\\PHPStan\\": "utils/phpstan/src"
},
"files": [
"src/functions/node_helper.php"
Expand All @@ -84,7 +83,6 @@
"tests"
],
"Rector\\Utils\\PHPStan\\Tests\\": "utils/phpstan/tests",
"Rector\\Utils\\Duplicates\\Tests\\": "utils/duplicates/tests",
"E2e\\Parallel\\Reflection\\Resolver\\": "e2e/parallel-reflection-resolver/src/",
"Rector\\Scripts\\": "scripts/src"
},
Expand All @@ -106,12 +104,12 @@
"@phpstan",
"@test"
],
"test": "vendor/bin/fastunit tests rules-tests utils/phpstan/tests utils/duplicates/tests",
"test": "vendor/bin/fastunit tests rules-tests utils/phpstan/tests",
"check-cs": "vendor/bin/ecs check --ansi",
"fix-cs": "vendor/bin/ecs check --fix --ansi",
"phpstan": "vendor/bin/phpstan analyse --ansi --memory-limit=512M",
"rector": "bin/rector process --ansi",
"duplicated-code": "php utils/duplicates/bin/duplicates.php --min-lines 5 --min-tokens 150 src rules",
"duplicated-code": "vendor/bin/swiss-knife duplicated-code src rules --min-tokens 150 --min-lines 5",
"preload": "php build/build-preload.php .",
"release": "vendor/bin/rng --from-commit X --to-commit Y --remote-repository rectorphp/rector-symfony --remote-repository rectorphp/rector-doctrine --remote-repository rectorphp/rector-phpunit"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

namespace Rector\Tests\TypeDeclaration\Rector\Property\TypedPropertyFromStrictConstructorRector\Fixture;

use Rector\Tests\TypeDeclaration\Rector\Property\TypedPropertyFromStrictConstructorRector\Source\SomeFrame;

class ParentFrameReflower
{
protected $frame;

public function __construct(SomeFrame $frame)
{
$this->frame = $frame;
}
}

class ChildFrameReflower extends ParentFrameReflower
{
protected $frame;

public function __construct(SomeFrame $frame)
{
parent::__construct($frame);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php

declare(strict_types=1);

namespace Rector\Tests\TypeDeclaration\Rector\Property\TypedPropertyFromStrictConstructorRector\Source;

final class SomeFrame
{
}
5 changes: 4 additions & 1 deletion rules/TypeDeclaration/Guard/PropertyTypeOverrideGuard.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ public function __construct(

public function isLegal(Property $property, ClassReflection $classReflection): bool
{
if (! $this->makePropertyTypedGuard->isLegal($property, $classReflection)) {
// protected property on a non-final class may be redeclared untyped in a child class,
// which would cause a covariance fatal error once only the parent is typed
$inlinePublic = ! $property->isProtected();
if (! $this->makePropertyTypedGuard->isLegal($property, $classReflection, $inlinePublic)) {
return false;
}

Expand Down
19 changes: 0 additions & 19 deletions utils/duplicates/README.md

This file was deleted.

109 changes: 0 additions & 109 deletions utils/duplicates/bin/duplicates.php

This file was deleted.

Loading
Loading