Skip to content

Commit

Permalink
fix string class name, skip a rector rule on files
Browse files Browse the repository at this point in the history
  • Loading branch information
JoMessina committed Jan 15, 2024
1 parent b2f33c8 commit 4242650
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 18 deletions.
16 changes: 16 additions & 0 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
declare(strict_types=1);

use Rector\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector;
use Rector\CodingStyle\Rector\String_\UseClassKeywordForClassNameResolutionRector;
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;
Expand All @@ -20,4 +22,18 @@
PHPUnitLevelSetList::UP_TO_PHPUNIT_100,
SymfonyLevelSetList::UP_TO_SYMFONY_60,
]);

$rectorConfig->skip([StringClassNameToClassConstantRector::class => [
__DIR__ . '/src/Plugin/Filtering/Builder/Drop.php',
__DIR__ . '/src/Plugin/Filtering/Builder/Reject.php',
__DIR__ . '/src/Plugin/SFTP/Builder/Extractor.php',
__DIR__ . '/src/Plugin/SFTP/Builder/Loader.php',
__DIR__ . '/src/Plugin/Batching/Builder/Fork.php',
__DIR__ . '/src/Plugin/Batching/Builder/Merge.php',
__DIR__ . '/src/Feature/Rejection/Builder/RabbitMQBuilder.php',
__DIR__ . '/src/Feature/Rejection/Builder/Rejection.php',
__DIR__ . '/src/Pipeline/Extractor.php',
__DIR__ . '/src/Pipeline/Loader.php',
__DIR__ . '/src/Pipeline/Transformer.php',
]]);
};
2 changes: 1 addition & 1 deletion src/Action/SFTP/Builder/Action.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function withState(Node\Expr $state): self
public function getNode(): Node
{
return new Node\Expr\New_(
class: new Node\Name\FullyQualified('Kiboko\Component\Action\Flow\SFTP\UploadFile'),
class: new Node\Name\FullyQualified('Kiboko\\Component\\Action\\Flow\\SFTP\\UploadFile'),
args: [
new Node\Arg(
value: $this->host,
Expand Down
8 changes: 4 additions & 4 deletions src/Builder/Workflow.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function addPipeline(string $code, string $pipelineFilename): self
args: [
new Node\Arg(
new Node\Expr\StaticCall(
new Node\Name\FullyQualified('Kiboko\Component\Workflow\JobCode'),
new Node\Name\FullyQualified('Kiboko\\Component\\Workflow\\JobCode'),
new Node\Identifier('fromString'),
[
new Node\Arg(new Node\Scalar\String_($code)),
Expand All @@ -37,7 +37,7 @@ public function addPipeline(string $code, string $pipelineFilename): self
args: [
new Node\Arg(
new Node\Expr\StaticCall(
new Node\Name\FullyQualified('Kiboko\Component\Workflow\JobCode'),
new Node\Name\FullyQualified('Kiboko\\Component\\Workflow\\JobCode'),
new Node\Identifier('fromString'),
[
new Node\Arg(new Node\Scalar\String_($code)),
Expand Down Expand Up @@ -72,7 +72,7 @@ public function addAction(string $code, string $pipelineFilename): self
args: [
new Node\Arg(
new Node\Expr\StaticCall(
new Node\Name\FullyQualified('Kiboko\Component\Workflow\JobCode'),
new Node\Name\FullyQualified('Kiboko\\Component\\Workflow\\JobCode'),
new Node\Identifier('fromString'),
[
new Node\Arg(new Node\Scalar\String_($code)),
Expand All @@ -86,7 +86,7 @@ public function addAction(string $code, string $pipelineFilename): self
args: [
new Node\Arg(
new Node\Expr\StaticCall(
new Node\Name\FullyQualified('Kiboko\Component\Workflow\JobCode'),
new Node\Name\FullyQualified('Kiboko\\Component\\Workflow\\JobCode'),
new Node\Identifier('fromString'),
[
new Node\Arg(new Node\Scalar\String_($code)),
Expand Down
4 changes: 2 additions & 2 deletions src/Builder/Workflow/WorkflowRuntime.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ final class WorkflowRuntime implements Builder
public function getNode(): Node\Expr
{
return new Node\Expr\New_(
class: new Node\Name\FullyQualified('Kiboko\Component\Runtime\Workflow\Console'),
class: new Node\Name\FullyQualified('Kiboko\\Component\\Runtime\\Workflow\\Console'),
args: [
new Node\Arg(
value: new Node\Expr\New_(
Expand All @@ -21,7 +21,7 @@ class: new Node\Name\FullyQualified(\Symfony\Component\Console\Output\ConsoleOut
),
new Node\Arg(
new Node\Expr\New_(
class: new Node\Name\FullyQualified('Kiboko\Component\Pipeline\PipelineRunner'),
class: new Node\Name\FullyQualified('Kiboko\\Component\\Pipeline\\PipelineRunner'),
args: [
new Node\Arg(
value: new Node\Expr\New_(
Expand Down
2 changes: 1 addition & 1 deletion src/Feature/Rejection/Builder/Rejection.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function withRejection(Node\Expr $rejection): void
private static function nullRejection(): Node\Expr
{
return new Node\Expr\New_(
new Node\Name\FullyQualified(\Kiboko\Contract\Pipeline\NullRejection::class)
new Node\Name\FullyQualified('Kiboko\\Contract\\Pipeline\\NullRejection')
);
}

Expand Down
4 changes: 2 additions & 2 deletions src/Pipeline/Loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function __invoke(array $config, Pipeline $pipeline, StepRepositoryInterf
$rejection = $compiled->getBuilder()->getNode();
} else {
$rejection = new Node\Expr\New_(
new Node\Name\FullyQualified(\Kiboko\Contract\Pipeline\NullStepRejection::class),
new Node\Name\FullyQualified('Kiboko\\Contract\\Pipeline\\NullStepRejection'),
);
}

Expand All @@ -61,7 +61,7 @@ public function __invoke(array $config, Pipeline $pipeline, StepRepositoryInterf
$state = $compiled->getBuilder()->getNode();
} else {
$state = new Node\Expr\New_(
new Node\Name\FullyQualified(\Kiboko\Contract\Pipeline\NullStepState::class),
new Node\Name\FullyQualified('Kiboko\\Contract\\Pipeline\\NullStepState'),
);
}

Expand Down
4 changes: 2 additions & 2 deletions src/Pipeline/Transformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function __invoke(array $config, Pipeline $pipeline, StepRepositoryInterf
$rejection = $compiled->getBuilder()->getNode();
} else {
$rejection = new Node\Expr\New_(
new Node\Name\FullyQualified(\Kiboko\Contract\Pipeline\NullStepRejection::class),
new Node\Name\FullyQualified('Kiboko\\Contract\\Pipeline\\NullStepRejection'),
);
}

Expand All @@ -61,7 +61,7 @@ public function __invoke(array $config, Pipeline $pipeline, StepRepositoryInterf
$state = $compiled->getBuilder()->getNode();
} else {
$state = new Node\Expr\New_(
new Node\Name\FullyQualified(\Kiboko\Contract\Pipeline\NullStepState::class),
new Node\Name\FullyQualified('Kiboko\\Contract\\Pipeline\\NullStepState'),
);
}

Expand Down
3 changes: 1 addition & 2 deletions src/Plugin/Batching/Service.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@

namespace Kiboko\Component\Satellite\Plugin\Batching;

// FIXME: hidden dependency to php-etl/fast-map
use Kiboko\Component\SatelliteToolbox\Builder\PropertyPathBuilder;
use Kiboko\Component\Satellite\ExpressionLanguage as Satellite;
use Kiboko\Component\Satellite\Plugin\Batching\Builder\Fork;
use Kiboko\Component\Satellite\Plugin\Batching\Builder\Merge;
use Kiboko\Component\SatelliteToolbox\Builder\PropertyPathBuilder;
use Kiboko\Contract\Configurator;
use PhpParser\Node\Expr\Variable;
use Symfony\Component\Config\Definition\Exception as Symfony;
Expand Down
3 changes: 0 additions & 3 deletions src/Plugin/Filtering/Builder/Drop.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@

namespace Kiboko\Component\Satellite\Plugin\Filtering\Builder;

use Kiboko\Component\Bucket\AcceptanceResultBucket;
use Kiboko\Component\Bucket\RejectionResultBucket;
use Kiboko\Contract\Configurator\StepBuilderInterface;
use Kiboko\Contract\Pipeline\TransformerInterface;
use PhpParser\Builder;
use PhpParser\Node;

Expand Down
1 change: 0 additions & 1 deletion src/Plugin/Filtering/Builder/Reject.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
namespace Kiboko\Component\Satellite\Plugin\Filtering\Builder;

use Kiboko\Contract\Configurator\StepBuilderInterface;
use Kiboko\Contract\Pipeline\TransformerInterface;
use PhpParser\Builder;
use PhpParser\Node;

Expand Down

0 comments on commit 4242650

Please sign in to comment.