From 96216d40c4c45a265c115ecc4bba97f2af54472b Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Thu, 11 Jan 2024 10:08:18 +0000 Subject: [PATCH] [rector] Rector fixes --- rector.php | 5 +++++ src/Builder/API/APIRuntime.php | 2 +- src/Builder/Hook/HookRuntime.php | 2 +- src/Builder/Pipeline/ConsoleRuntime.php | 4 ++-- src/Builder/Workflow/WorkflowRuntime.php | 4 ++-- src/Plugin/Batching/Builder/Fork.php | 2 +- src/Plugin/Batching/Builder/Merge.php | 6 +++--- src/Plugin/FTP/Builder/Loader.php | 4 ++-- src/Plugin/Filtering/Builder/Drop.php | 2 +- src/Plugin/Filtering/Builder/Reject.php | 2 +- src/Plugin/SFTP/Builder/Extractor.php | 2 +- src/Plugin/SFTP/Builder/Loader.php | 2 +- 12 files changed, 21 insertions(+), 16 deletions(-) diff --git a/rector.php b/rector.php index 672403ab..a73a8cdc 100644 --- a/rector.php +++ b/rector.php @@ -4,6 +4,7 @@ use Rector\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector; use Rector\Config\RectorConfig; +use Rector\Php55\Rector\String_\StringClassNameToClassConstantRector; use Rector\Set\ValueObject\LevelSetList; use Rector\PHPUnit\Set\PHPUnitLevelSetList; use Rector\Symfony\Set\SymfonyLevelSetList; @@ -20,4 +21,8 @@ PHPUnitLevelSetList::UP_TO_PHPUNIT_100, SymfonyLevelSetList::UP_TO_SYMFONY_60, ]); + + $rectorConfig->skip([ + StringClassNameToClassConstantRector::class + ]); }; diff --git a/src/Builder/API/APIRuntime.php b/src/Builder/API/APIRuntime.php index 84f36637..312c06af 100644 --- a/src/Builder/API/APIRuntime.php +++ b/src/Builder/API/APIRuntime.php @@ -23,7 +23,7 @@ class: new Node\Name\FullyQualified('Kiboko\\Component\\Pipeline\\PipelineRunner args: [ new Node\Arg( value: new Node\Expr\New_( - class: new Node\Name\FullyQualified('Psr\\Log\\NullLogger') + class: new Node\Name\FullyQualified(\Psr\Log\NullLogger::class) ) ), ] diff --git a/src/Builder/Hook/HookRuntime.php b/src/Builder/Hook/HookRuntime.php index f9cce9fa..64d4e1e2 100644 --- a/src/Builder/Hook/HookRuntime.php +++ b/src/Builder/Hook/HookRuntime.php @@ -23,7 +23,7 @@ class: new Node\Name\FullyQualified('Kiboko\\Component\\Pipeline\\PipelineRunner args: [ new Node\Arg( value: new Node\Expr\New_( - class: new Node\Name\FullyQualified('Psr\\Log\\NullLogger') + class: new Node\Name\FullyQualified(\Psr\Log\NullLogger::class) ) ), ] diff --git a/src/Builder/Pipeline/ConsoleRuntime.php b/src/Builder/Pipeline/ConsoleRuntime.php index 1c42e17f..87fe608f 100644 --- a/src/Builder/Pipeline/ConsoleRuntime.php +++ b/src/Builder/Pipeline/ConsoleRuntime.php @@ -16,7 +16,7 @@ class: new Node\Name\FullyQualified('Kiboko\\Component\\Runtime\\Pipeline\\Conso args: [ new Node\Arg( value: new Node\Expr\New_( - class: new Node\Name\FullyQualified('Symfony\\Component\\Console\\Output\\ConsoleOutput'), + class: new Node\Name\FullyQualified(\Symfony\Component\Console\Output\ConsoleOutput::class), ) ), new Node\Arg( @@ -29,7 +29,7 @@ class: new Node\Name\FullyQualified('Kiboko\\Component\\Pipeline\\PipelineRunner args: [ new Node\Arg( value: new Node\Expr\New_( - class: new Node\Name\FullyQualified('Psr\\Log\\NullLogger'), + class: new Node\Name\FullyQualified(\Psr\Log\NullLogger::class), ) ), ], diff --git a/src/Builder/Workflow/WorkflowRuntime.php b/src/Builder/Workflow/WorkflowRuntime.php index 7e97f832..5100c839 100644 --- a/src/Builder/Workflow/WorkflowRuntime.php +++ b/src/Builder/Workflow/WorkflowRuntime.php @@ -16,7 +16,7 @@ class: new Node\Name\FullyQualified('Kiboko\\Component\\Runtime\\Workflow\\Conso args: [ new Node\Arg( value: new Node\Expr\New_( - class: new Node\Name\FullyQualified('Symfony\\Component\\Console\\Output\\ConsoleOutput'), + class: new Node\Name\FullyQualified(\Symfony\Component\Console\Output\ConsoleOutput::class), ) ), new Node\Arg( @@ -25,7 +25,7 @@ class: new Node\Name\FullyQualified('Kiboko\\Component\\Pipeline\\PipelineRunner args: [ new Node\Arg( value: new Node\Expr\New_( - class: new Node\Name\FullyQualified('Psr\\Log\\NullLogger'), + class: new Node\Name\FullyQualified(\Psr\Log\NullLogger::class), ) ), ], diff --git a/src/Plugin/Batching/Builder/Fork.php b/src/Plugin/Batching/Builder/Fork.php index cb23858c..0e6d7dea 100644 --- a/src/Plugin/Batching/Builder/Fork.php +++ b/src/Plugin/Batching/Builder/Fork.php @@ -52,7 +52,7 @@ class: new Node\Stmt\Class_( name: null, subNodes: [ 'implements' => [ - new Node\Name\FullyQualified('Kiboko\\Contract\\Pipeline\\TransformerInterface'), + new Node\Name\FullyQualified(\Kiboko\Contract\Pipeline\TransformerInterface::class), ], 'stmts' => [ new Node\Stmt\ClassMethod( diff --git a/src/Plugin/Batching/Builder/Merge.php b/src/Plugin/Batching/Builder/Merge.php index ec32ee89..df3732b9 100644 --- a/src/Plugin/Batching/Builder/Merge.php +++ b/src/Plugin/Batching/Builder/Merge.php @@ -45,8 +45,8 @@ class: new Node\Stmt\Class_( name: null, subNodes: [ 'implements' => [ - new Node\Name\FullyQualified('Kiboko\\Contract\\Pipeline\\TransformerInterface'), - new Node\Name\FullyQualified('Kiboko\\Contract\\Pipeline\\FlushableInterface'), + new Node\Name\FullyQualified(\Kiboko\Contract\Pipeline\TransformerInterface::class), + new Node\Name\FullyQualified(\Kiboko\Contract\Pipeline\FlushableInterface::class), ], 'stmts' => [ new Node\Stmt\Property( @@ -226,7 +226,7 @@ class: new Node\Name\FullyQualified('Kiboko\\Component\\Bucket\\AcceptanceResult ) ), ], - 'returnType' => new Node\Name\FullyQualified('Kiboko\\Contract\\Bucket\\ResultBucketInterface'), + 'returnType' => new Node\Name\FullyQualified(\Kiboko\Contract\Bucket\ResultBucketInterface::class), ], ), ], diff --git a/src/Plugin/FTP/Builder/Loader.php b/src/Plugin/FTP/Builder/Loader.php index dce6bac4..f566d653 100644 --- a/src/Plugin/FTP/Builder/Loader.php +++ b/src/Plugin/FTP/Builder/Loader.php @@ -228,7 +228,7 @@ class: new Node\Stmt\Class_( 'params' => [ new Node\Param( var: new Node\Expr\Variable('logger'), - type: new Node\Name\FullyQualified(name: 'Psr\\Log\\LoggerInterface'), + type: new Node\Name\FullyQualified(name: \Psr\Log\LoggerInterface::class), flags: Node\Stmt\Class_::MODIFIER_PRIVATE, ), ], @@ -510,7 +510,7 @@ class: new Node\Name\FullyQualified('Kiboko\\Component\\Bucket\\ComplexResultBuc ], ), args: [ - new Node\Arg(value: $this->logger ?? new Node\Expr\New_(new Node\Name\FullyQualified('Psr\\Log\\NullLogger'))), + new Node\Arg(value: $this->logger ?? new Node\Expr\New_(new Node\Name\FullyQualified(\Psr\Log\NullLogger::class))), ] ); } diff --git a/src/Plugin/Filtering/Builder/Drop.php b/src/Plugin/Filtering/Builder/Drop.php index 32ae3f7e..a94848d9 100644 --- a/src/Plugin/Filtering/Builder/Drop.php +++ b/src/Plugin/Filtering/Builder/Drop.php @@ -95,7 +95,7 @@ public function getNode(): Node return new Node\Expr\New_( class: new Node\Stmt\Class_(null, [ 'implements' => [ - new Node\Name\FullyQualified('Kiboko\\Contract\\Pipeline\\TransformerInterface'), + new Node\Name\FullyQualified(\Kiboko\Contract\Pipeline\TransformerInterface::class), ], 'stmts' => [ (new Builder\Method('transform')) diff --git a/src/Plugin/Filtering/Builder/Reject.php b/src/Plugin/Filtering/Builder/Reject.php index 12bfdfb6..0317f298 100644 --- a/src/Plugin/Filtering/Builder/Reject.php +++ b/src/Plugin/Filtering/Builder/Reject.php @@ -95,7 +95,7 @@ public function getNode(): Node return new Node\Expr\New_( class: new Node\Stmt\Class_(null, [ 'implements' => [ - new Node\Name\FullyQualified('Kiboko\\Contract\\Pipeline\\TransformerInterface'), + new Node\Name\FullyQualified(\Kiboko\Contract\Pipeline\TransformerInterface::class), ], 'stmts' => [ (new Builder\Method('transform')) diff --git a/src/Plugin/SFTP/Builder/Extractor.php b/src/Plugin/SFTP/Builder/Extractor.php index 3f362576..72e112f7 100644 --- a/src/Plugin/SFTP/Builder/Extractor.php +++ b/src/Plugin/SFTP/Builder/Extractor.php @@ -89,7 +89,7 @@ class: new Node\Stmt\Class_( name: null, subNodes: [ 'implements' => [ - new Node\Name\FullyQualified('Kiboko\\Contract\\Pipeline\\LoaderInterface'), + new Node\Name\FullyQualified(\Kiboko\Contract\Pipeline\LoaderInterface::class), ], 'stmts' => [ new Node\Stmt\ClassMethod( diff --git a/src/Plugin/SFTP/Builder/Loader.php b/src/Plugin/SFTP/Builder/Loader.php index 7f1629c4..86c07d76 100644 --- a/src/Plugin/SFTP/Builder/Loader.php +++ b/src/Plugin/SFTP/Builder/Loader.php @@ -89,7 +89,7 @@ class: new Node\Stmt\Class_( name: null, subNodes: [ 'implements' => [ - new Node\Name\FullyQualified('Kiboko\\Contract\\Pipeline\\LoaderInterface'), + new Node\Name\FullyQualified(\Kiboko\Contract\Pipeline\LoaderInterface::class), ], 'stmts' => [ new Node\Stmt\ClassMethod(