diff --git a/src/Config/RectorConfig.php b/src/Config/RectorConfig.php index 0697c6ef53a..ac3ed8bcd80 100644 --- a/src/Config/RectorConfig.php +++ b/src/Config/RectorConfig.php @@ -7,7 +7,6 @@ use Composer\Semver\Semver; use Deprecated; use Entropy\Container\Container; -use Override; use Rector\Caching\Contract\ValueObject\Storage\CacheStorageInterface; use Rector\Composer\InstalledPackageResolver; use Rector\Configuration\Option; diff --git a/src/VendorLocker/ParentClassMethodTypeOverrideGuard.php b/src/VendorLocker/ParentClassMethodTypeOverrideGuard.php index 7e269c88868..c11b762200f 100644 --- a/src/VendorLocker/ParentClassMethodTypeOverrideGuard.php +++ b/src/VendorLocker/ParentClassMethodTypeOverrideGuard.php @@ -4,6 +4,8 @@ namespace Rector\VendorLocker; +use PhpParser\Node\Stmt\Class_; +use PhpParser\Node\Stmt\Interface_; use PhpParser\Node; use PhpParser\Node\Stmt\ClassMethod; use PHPStan\Reflection\ClassReflection; @@ -38,7 +40,7 @@ public function __construct( * classes, so type-declaration rules must leave it untouched. Final classes are never guarded, * as they cannot be extended. */ - public function isTypeGuardedClass(Node\Stmt\Class_|Node\Stmt\Interface_|ClassMethod $node): bool + public function isTypeGuardedClass(Class_|Interface_|ClassMethod $node): bool { $guardedClasses = SimpleParameterProvider::provideArrayParameter(Option::TYPE_GUARDED_CLASSES); if ($guardedClasses === []) { diff --git a/tests/Issues/AddClassDependency/AddClassDependencyTest.php b/tests/Issues/AddClassDependency/AddClassDependencyTest.php deleted file mode 100644 index 6cc977287ad..00000000000 --- a/tests/Issues/AddClassDependency/AddClassDependencyTest.php +++ /dev/null @@ -1,28 +0,0 @@ -doTestFile($filePath); - } - - public static function provideData(): Iterator - { - return self::yieldFilesFromDirectory(__DIR__ . '/Fixture'); - } - - public function provideConfigFilePath(): string - { - return __DIR__ . '/config/configured_rule.php'; - } -} diff --git a/tests/Issues/AddClassDependency/Fixture/fixture.php.inc b/tests/Issues/AddClassDependency/Fixture/fixture.php.inc deleted file mode 100644 index a57efc90db8..00000000000 --- a/tests/Issues/AddClassDependency/Fixture/fixture.php.inc +++ /dev/null @@ -1,57 +0,0 @@ -someAutowiredService = $someAutowiredService; - } - - public function configure() - { - $someType = $this->get('validator'); - } -} - -?> ------ -someAutowiredService = $someAutowiredService; - $this->validator = $validator; - } - - public function configure() - { - $someType = $this->validator; - } -} - -?> diff --git a/tests/Issues/AddClassDependency/Fixture/strick_with_constructor.php.inc b/tests/Issues/AddClassDependency/Fixture/strick_with_constructor.php.inc deleted file mode 100644 index 11e65dfb871..00000000000 --- a/tests/Issues/AddClassDependency/Fixture/strick_with_constructor.php.inc +++ /dev/null @@ -1,43 +0,0 @@ -get('validator'); - } -} - -?> ------ -validator; - } -} - -?> diff --git a/tests/Issues/AddClassDependency/Source/SomeAutowiredService.php b/tests/Issues/AddClassDependency/Source/SomeAutowiredService.php deleted file mode 100644 index 8c4ca1776e4..00000000000 --- a/tests/Issues/AddClassDependency/Source/SomeAutowiredService.php +++ /dev/null @@ -1,9 +0,0 @@ -withRules([GetBySymfonyStringToConstructorInjectionRector::class]); diff --git a/tests/Issues/ConstructorPromoAnnotationToAttribute/ConstructorPromoAnnotationToAttributeTest.php b/tests/Issues/ConstructorPromoAnnotationToAttribute/ConstructorPromoAnnotationToAttributeTest.php deleted file mode 100644 index 9842ae4271c..00000000000 --- a/tests/Issues/ConstructorPromoAnnotationToAttribute/ConstructorPromoAnnotationToAttributeTest.php +++ /dev/null @@ -1,28 +0,0 @@ -doTestFile($filePath); - } - - public static function provideData(): Iterator - { - return self::yieldFilesFromDirectory(__DIR__ . '/Fixture'); - } - - public function provideConfigFilePath(): string - { - return __DIR__ . '/config/configured_rule.php'; - } -} diff --git a/tests/Issues/ConstructorPromoAnnotationToAttribute/Fixture/fixture.php.inc b/tests/Issues/ConstructorPromoAnnotationToAttribute/Fixture/fixture.php.inc deleted file mode 100644 index 0d50e53ab52..00000000000 --- a/tests/Issues/ConstructorPromoAnnotationToAttribute/Fixture/fixture.php.inc +++ /dev/null @@ -1,44 +0,0 @@ -items = $items; - } -} -?> ------ - diff --git a/tests/Issues/ConstructorPromoAnnotationToAttribute/config/configured_rule.php b/tests/Issues/ConstructorPromoAnnotationToAttribute/config/configured_rule.php deleted file mode 100644 index 3d2b7a54895..00000000000 --- a/tests/Issues/ConstructorPromoAnnotationToAttribute/config/configured_rule.php +++ /dev/null @@ -1,15 +0,0 @@ -rule(ClassPropertyAssignToConstructorPromotionRector::class); - $rectorConfig->ruleWithConfiguration(AnnotationToAttributeRector::class, [ - new AnnotationToAttribute('OldTag', 'NewAttribute'), - ]); -}; diff --git a/tests/Issues/Issue6420/Fixture/fixture.php.inc b/tests/Issues/Issue6420/Fixture/fixture.php.inc deleted file mode 100644 index 3afa09ada7a..00000000000 --- a/tests/Issues/Issue6420/Fixture/fixture.php.inc +++ /dev/null @@ -1,27 +0,0 @@ - ------ - diff --git a/tests/Issues/Issue6420/RenameFunctionWithRemoveDeadStmtRectorTest.php b/tests/Issues/Issue6420/RenameFunctionWithRemoveDeadStmtRectorTest.php deleted file mode 100644 index 22a723b7d55..00000000000 --- a/tests/Issues/Issue6420/RenameFunctionWithRemoveDeadStmtRectorTest.php +++ /dev/null @@ -1,31 +0,0 @@ -doTestFile($filePath); - } - - public static function provideData(): Iterator - { - return self::yieldFilesFromDirectory(__DIR__ . '/Fixture'); - } - - public function provideConfigFilePath(): string - { - return __DIR__ . '/config/configured_rule.php'; - } -} diff --git a/tests/Issues/Issue6420/config/configured_rule.php b/tests/Issues/Issue6420/config/configured_rule.php deleted file mode 100644 index c1c5b84d400..00000000000 --- a/tests/Issues/Issue6420/config/configured_rule.php +++ /dev/null @@ -1,16 +0,0 @@ -rule(RemoveDeadStmtRector::class); - - $rectorConfig - ->ruleWithConfiguration(RenameFunctionRector::class, [ - 'preg_replace' => 'Safe\preg_replace', - ]); -};