diff --git a/config/set/instanceof.php b/config/set/instanceof.php index 6a3888cc5c8..67a22c50530 100644 --- a/config/set/instanceof.php +++ b/config/set/instanceof.php @@ -7,9 +7,9 @@ use Rector\CodeQuality\Rector\Identical\GetClassToInstanceOfRector; use Rector\Config\RectorConfig; use Rector\DeadCode\Rector\If_\RemoveDeadInstanceOfRector; +use Rector\Instanceof_\Rector\Ternary\FlipNegatedTernaryInstanceofRector; use Rector\TypeDeclaration\Rector\BooleanAnd\BinaryOpNullableToInstanceofRector; use Rector\TypeDeclaration\Rector\Empty_\EmptyOnNullableObjectToInstanceOfRector; -use Rector\TypeDeclaration\Rector\Ternary\FlipNegatedTernaryInstanceofRector; use Rector\TypeDeclaration\Rector\While_\WhileNullableToInstanceofRector; return static function (RectorConfig $rectorConfig): void { diff --git a/rules-tests/TypeDeclaration/Rector/Ternary/FlipNegatedTernaryInstanceofRector/Fixture/skip_no_cond.php.inc b/rules-tests/Instanceof_/Rector/Ternary/FlipNegatedTernaryInstanceofRector/Fixture/skip_no_cond.php.inc similarity index 100% rename from rules-tests/TypeDeclaration/Rector/Ternary/FlipNegatedTernaryInstanceofRector/Fixture/skip_no_cond.php.inc rename to rules-tests/Instanceof_/Rector/Ternary/FlipNegatedTernaryInstanceofRector/Fixture/skip_no_cond.php.inc diff --git a/rules-tests/TypeDeclaration/Rector/Ternary/FlipNegatedTernaryInstanceofRector/Fixture/some_class.php.inc b/rules-tests/Instanceof_/Rector/Ternary/FlipNegatedTernaryInstanceofRector/Fixture/some_class.php.inc similarity index 100% rename from rules-tests/TypeDeclaration/Rector/Ternary/FlipNegatedTernaryInstanceofRector/Fixture/some_class.php.inc rename to rules-tests/Instanceof_/Rector/Ternary/FlipNegatedTernaryInstanceofRector/Fixture/some_class.php.inc diff --git a/rules-tests/TypeDeclaration/Rector/Ternary/FlipNegatedTernaryInstanceofRector/FlipNegatedTernaryInstanceofRectorTest.php b/rules-tests/Instanceof_/Rector/Ternary/FlipNegatedTernaryInstanceofRector/FlipNegatedTernaryInstanceofRectorTest.php similarity index 87% rename from rules-tests/TypeDeclaration/Rector/Ternary/FlipNegatedTernaryInstanceofRector/FlipNegatedTernaryInstanceofRectorTest.php rename to rules-tests/Instanceof_/Rector/Ternary/FlipNegatedTernaryInstanceofRector/FlipNegatedTernaryInstanceofRectorTest.php index 3448b830821..45e9f9d760b 100644 --- a/rules-tests/TypeDeclaration/Rector/Ternary/FlipNegatedTernaryInstanceofRector/FlipNegatedTernaryInstanceofRectorTest.php +++ b/rules-tests/Instanceof_/Rector/Ternary/FlipNegatedTernaryInstanceofRector/FlipNegatedTernaryInstanceofRectorTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Rector\Tests\TypeDeclaration\Rector\Ternary\FlipNegatedTernaryInstanceofRector; +namespace Rector\Tests\Instanceof_\Rector\Ternary\FlipNegatedTernaryInstanceofRector; use Iterator; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/rules-tests/TypeDeclaration/Rector/Ternary/FlipNegatedTernaryInstanceofRector/config/configured_rule.php b/rules-tests/Instanceof_/Rector/Ternary/FlipNegatedTernaryInstanceofRector/config/configured_rule.php similarity index 71% rename from rules-tests/TypeDeclaration/Rector/Ternary/FlipNegatedTernaryInstanceofRector/config/configured_rule.php rename to rules-tests/Instanceof_/Rector/Ternary/FlipNegatedTernaryInstanceofRector/config/configured_rule.php index 60d4baf60ae..a88cbf75b17 100644 --- a/rules-tests/TypeDeclaration/Rector/Ternary/FlipNegatedTernaryInstanceofRector/config/configured_rule.php +++ b/rules-tests/Instanceof_/Rector/Ternary/FlipNegatedTernaryInstanceofRector/config/configured_rule.php @@ -4,7 +4,7 @@ use Rector\Config\RectorConfig; -use Rector\TypeDeclaration\Rector\Ternary\FlipNegatedTernaryInstanceofRector; +use Rector\Instanceof_\Rector\Ternary\FlipNegatedTernaryInstanceofRector; return static function (RectorConfig $rectorConfig): void { $rectorConfig->rule(FlipNegatedTernaryInstanceofRector::class); diff --git a/rules/TypeDeclaration/Rector/Ternary/FlipNegatedTernaryInstanceofRector.php b/rules/Instanceof_/Rector/Ternary/FlipNegatedTernaryInstanceofRector.php similarity index 89% rename from rules/TypeDeclaration/Rector/Ternary/FlipNegatedTernaryInstanceofRector.php rename to rules/Instanceof_/Rector/Ternary/FlipNegatedTernaryInstanceofRector.php index 1e6da1b9727..bff6dff701c 100644 --- a/rules/TypeDeclaration/Rector/Ternary/FlipNegatedTernaryInstanceofRector.php +++ b/rules/Instanceof_/Rector/Ternary/FlipNegatedTernaryInstanceofRector.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Rector\TypeDeclaration\Rector\Ternary; +namespace Rector\Instanceof_\Rector\Ternary; use PhpParser\Node; use PhpParser\Node\Expr; @@ -14,7 +14,7 @@ use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; /** - * @see \Rector\Tests\TypeDeclaration\Rector\Ternary\FlipNegatedTernaryInstanceofRector\FlipNegatedTernaryInstanceofRectorTest + * @see \Rector\Tests\Instanceof_\Rector\Ternary\FlipNegatedTernaryInstanceofRector\FlipNegatedTernaryInstanceofRectorTest */ final class FlipNegatedTernaryInstanceofRector extends AbstractRector { diff --git a/utils/Command/MissingInSetCommand.php b/utils/Command/MissingInSetCommand.php index d1d2012546f..b4d9ef34cbd 100644 --- a/utils/Command/MissingInSetCommand.php +++ b/utils/Command/MissingInSetCommand.php @@ -9,7 +9,6 @@ use Rector\Core\Contract\Rector\ConfigurableRectorInterface; use Rector\TypeDeclaration\Rector\BooleanAnd\BinaryOpNullableToInstanceofRector; use Rector\TypeDeclaration\Rector\StmtsAwareInterface\DeclareStrictTypesRector; -use Rector\TypeDeclaration\Rector\Ternary\FlipNegatedTernaryInstanceofRector; use Rector\TypeDeclaration\Rector\While_\WhileNullableToInstanceofRector; use Rector\Utils\Finder\RectorClassFinder; use Rector\Utils\Finder\SetRectorClassesResolver; @@ -45,6 +44,7 @@ final class MissingInSetCommand extends Command __DIR__ . '/../../rules/Php81/Rector' => __DIR__ . '/../../config/set/php81.php', __DIR__ . '/../../rules/Php82/Rector' => __DIR__ . '/../../config/set/php82.php', __DIR__ . '/../../rules/Strict/Rector' => __DIR__ . '/../../config/set/strict-booleans.php', + __DIR__ . '/../../rules/Instanceof_/Rector' => __DIR__ . '/../../config/set/instanceof.php', // doctrine __DIR__ . '/../../vendor/rector/rector-doctrine/rules/CodeQuality' => __DIR__ . '/../../vendor/rector/rector-doctrine/config/sets/doctrine-code-quality.php', @@ -94,7 +94,6 @@ final class MissingInSetCommand extends Command DeclareStrictTypesRector::class, // optional DataProviderArrayItemsNewlinedRector::class, - FlipNegatedTernaryInstanceofRector::class, BinaryOpNullableToInstanceofRector::class, WhileNullableToInstanceofRector::class, ];