Skip to content

Commit

Permalink
Fixed PHPStan issues
Browse files Browse the repository at this point in the history
  • Loading branch information
sebprt committed Jan 11, 2024
1 parent 088a627 commit befc4bb
Show file tree
Hide file tree
Showing 21 changed files with 52 additions and 58 deletions.
2 changes: 1 addition & 1 deletion src/Action/Action.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function __invoke(array $config, ActionBuilder $action, RepositoryInterfa
$state = $compiled->getBuilder()->getNode();
} else {
$state = new Node\Expr\New_(
new Node\Name\FullyQualified(\Kiboko\Contract\Action\NullState::class),
new Node\Name\FullyQualified('Kiboko\\Contract\\Action\\NullState'),
);
}

Expand Down
6 changes: 3 additions & 3 deletions src/Builder/API/APIRuntime.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ class: new Node\Name\FullyQualified('Kiboko\\Component\\Runtime\\API\\APIRuntime
args: [
new Node\Arg(
value: new Node\Expr\New_(
class: new Node\Name\FullyQualified(\Kiboko\Component\Pipeline\Pipeline::class),
class: new Node\Name\FullyQualified('Kiboko\\Component\\Pipeline\\Pipeline'),
args: [
new Node\Arg(
value: new Node\Expr\New_(
class: new Node\Name\FullyQualified(\Kiboko\Component\Pipeline\PipelineRunner::class),
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)
class: new Node\Name\FullyQualified('Psr\\Log\\NullLogger')
)
),
]
Expand Down
6 changes: 3 additions & 3 deletions src/Builder/Hook/HookRuntime.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ class: new Node\Name\FullyQualified('Kiboko\\Component\\Runtime\\Hook\\HookRunti
args: [
new Node\Arg(
value: new Node\Expr\New_(
class: new Node\Name\FullyQualified(\Kiboko\Component\Pipeline\Pipeline::class),
class: new Node\Name\FullyQualified('Kiboko\\Component\\Pipeline\\Pipeline'),
args: [
new Node\Arg(
value: new Node\Expr\New_(
class: new Node\Name\FullyQualified(\Kiboko\Component\Pipeline\PipelineRunner::class),
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)
class: new Node\Name\FullyQualified('Psr\\Log\\NullLogger')
)
),
]
Expand Down
10 changes: 5 additions & 5 deletions src/Builder/Pipeline/ConsoleRuntime.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,24 @@ final class ConsoleRuntime implements Builder
public function getNode(): Node\Expr
{
return new Node\Expr\New_(
class: new Node\Name\FullyQualified(\Kiboko\Component\Runtime\Pipeline\Console::class),
class: new Node\Name\FullyQualified('Kiboko\\Component\\Runtime\\Pipeline\\Console'),
args: [
new Node\Arg(
value: new Node\Expr\New_(
class: new Node\Name\FullyQualified(\Symfony\Component\Console\Output\ConsoleOutput::class),
class: new Node\Name\FullyQualified('Symfony\\Component\\Console\\Output\\ConsoleOutput'),
)
),
new Node\Arg(
value: new Node\Expr\New_(
class: new Node\Name\FullyQualified(\Kiboko\Component\Pipeline\Pipeline::class),
class: new Node\Name\FullyQualified('Kiboko\\Component\\Pipeline\\Pipeline'),
args: [
new Node\Arg(
new Node\Expr\New_(
class: new Node\Name\FullyQualified(\Kiboko\Component\Pipeline\PipelineRunner::class),
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),
class: new Node\Name\FullyQualified('Psr\\Log\\NullLogger'),
)
),
],
Expand Down
8 changes: 4 additions & 4 deletions src/Builder/Workflow.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,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::class),
new Node\Name\FullyQualified('Kiboko\\Component\\Workflow\\JobCode'),
new Node\Identifier('fromString'),
[
new Node\Arg(new Node\Scalar\String_($code)),
Expand All @@ -38,7 +38,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::class),
new Node\Name\FullyQualified('Kiboko\\Component\\Workflow\\JobCode'),
new Node\Identifier('fromString'),
[
new Node\Arg(new Node\Scalar\String_($code)),
Expand Down Expand Up @@ -73,7 +73,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::class),
new Node\Name\FullyQualified('Kiboko\\Component\\Workflow\\JobCode'),
new Node\Identifier('fromString'),
[
new Node\Arg(new Node\Scalar\String_($code)),
Expand All @@ -87,7 +87,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::class),
new Node\Name\FullyQualified('Kiboko\\Component\\Workflow\\JobCode'),
new Node\Identifier('fromString'),
[
new Node\Arg(new Node\Scalar\String_($code)),
Expand Down
2 changes: 1 addition & 1 deletion src/Builder/Workflow/ActionBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function getNode(): Node\Expr
'params' => [
new Node\Param(
var: new Node\Expr\Variable('runtime'),
type: new Node\Name\FullyQualified(\Kiboko\Component\Runtime\Action\ActionRuntimeInterface::class),
type: new Node\Name\FullyQualified('Kiboko\\Component\\Runtime\\Action\\ActionRuntimeInterface'),
),
],
'stmts' => [
Expand Down
2 changes: 1 addition & 1 deletion src/Builder/Workflow/PipelineBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function getNode(): Node\Expr
'params' => [
new Node\Param(
var: new Node\Expr\Variable('runtime'),
type: new Node\Name\FullyQualified(\Kiboko\Component\Runtime\Pipeline\PipelineRuntimeInterface::class),
type: new Node\Name\FullyQualified('Kiboko\\Component\\Runtime\\Pipeline\\PipelineRuntimeInterface'),
),
],
'stmts' => [
Expand Down
8 changes: 4 additions & 4 deletions src/Builder/Workflow/WorkflowRuntime.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,20 @@ 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),
class: new Node\Name\FullyQualified('Kiboko\\Component\\Runtime\\Workflow\\Console'),
args: [
new Node\Arg(
value: new Node\Expr\New_(
class: new Node\Name\FullyQualified(\Symfony\Component\Console\Output\ConsoleOutput::class),
class: new Node\Name\FullyQualified('Symfony\\Component\\Console\\Output\\ConsoleOutput'),
)
),
new Node\Arg(
new Node\Expr\New_(
class: new Node\Name\FullyQualified(\Kiboko\Component\Pipeline\PipelineRunner::class),
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),
class: new Node\Name\FullyQualified('Psr\\Log\\NullLogger'),
)
),
],
Expand Down
4 changes: 2 additions & 2 deletions src/Plugin/Batching/Builder/Fork.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class: new Node\Stmt\Class_(
name: null,
subNodes: [
'implements' => [
new Node\Name\FullyQualified(\Kiboko\Contract\Pipeline\TransformerInterface::class),
new Node\Name\FullyQualified('Kiboko\\Contract\\Pipeline\\TransformerInterface'),
],
'stmts' => [
new Node\Stmt\ClassMethod(
Expand All @@ -72,7 +72,7 @@ class: new Node\Stmt\Class_(
expr: new Node\Expr\Yield_(
new Node\Expr\New_(
class: new Node\Name\FullyQualified(
name: \Kiboko\Component\Bucket\AcceptanceResultBucket::class
name: 'Kiboko\\Component\\Bucket\\AcceptanceResultBucket'
),
args: [
new Node\Arg(
Expand Down
12 changes: 6 additions & 6 deletions src/Plugin/Batching/Builder/Merge.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ class: new Node\Stmt\Class_(
name: null,
subNodes: [
'implements' => [
new Node\Name\FullyQualified(\Kiboko\Contract\Pipeline\TransformerInterface::class),
new Node\Name\FullyQualified(\Kiboko\Contract\Pipeline\FlushableInterface::class),
new Node\Name\FullyQualified('Kiboko\\Contract\\Pipeline\\TransformerInterface'),
new Node\Name\FullyQualified('Kiboko\\Contract\\Pipeline\\FlushableInterface'),
],
'stmts' => [
new Node\Stmt\Property(
Expand Down Expand Up @@ -146,7 +146,7 @@ class: new Node\Stmt\Class_(
var: new Node\Expr\Variable('line'),
expr: new Node\Expr\Yield_(
value: new Node\Expr\New_(
class: new Node\Name\FullyQualified(\Kiboko\Component\Bucket\AcceptanceResultBucket::class),
class: new Node\Name\FullyQualified('Kiboko\\Component\\Bucket\\AcceptanceResultBucket:'),
args: [
new Node\Arg(
new Node\Expr\PropertyFetch(
Expand Down Expand Up @@ -192,7 +192,7 @@ class: new Node\Name\FullyQualified(\Kiboko\Component\Bucket\AcceptanceResultBuc
var: new Node\Expr\Variable('line'),
expr: new Node\Expr\Yield_(
value: new Node\Expr\New_(
class: new Node\Name\FullyQualified(\Kiboko\Component\Bucket\EmptyResultBucket::class)
class: new Node\Name\FullyQualified('Kiboko\\Component\\Bucket\\EmptyResultBucket')
),
),
),
Expand All @@ -214,7 +214,7 @@ class: new Node\Name\FullyQualified(\Kiboko\Component\Bucket\EmptyResultBucket::
'stmts' => [
new Node\Stmt\Return_(
expr: new Node\Expr\New_(
class: new Node\Name\FullyQualified(\Kiboko\Component\Bucket\AcceptanceResultBucket::class),
class: new Node\Name\FullyQualified('Kiboko\\Component\\Bucket\\AcceptanceResultBucket'),
args: [
new Node\Arg(
new Node\Expr\PropertyFetch(
Expand All @@ -226,7 +226,7 @@ class: new Node\Name\FullyQualified(\Kiboko\Component\Bucket\AcceptanceResultBuc
)
),
],
'returnType' => new Node\Name\FullyQualified(\Kiboko\Contract\Bucket\ResultBucketInterface::class),
'returnType' => new Node\Name\FullyQualified('Kiboko\\Contract\\Bucket\\ResultBucketInterface'),
],
),
],
Expand Down
8 changes: 4 additions & 4 deletions src/Plugin/FTP/Builder/Loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ class: new Node\Stmt\Class_(
name: null,
subNodes: [
'implements' => [
new Node\Name\FullyQualified(\Kiboko\Contract\Pipeline\LoaderInterface::class),
new Node\Name\FullyQualified('Kiboko\\Contract\\Pipeline\\LoaderInterface:'),
],
'stmts' => [
new Node\Stmt\ClassMethod(
Expand All @@ -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::class),
type: new Node\Name\FullyQualified(name: 'Psr\\Log\\LoggerInterface'),
flags: Node\Stmt\Class_::MODIFIER_PRIVATE,
),
],
Expand Down Expand Up @@ -291,7 +291,7 @@ class: new Node\Stmt\Class_(
new Node\Expr\Assign(
var: new Node\Expr\Variable('bucket'),
expr: new Node\Expr\New_(
class: new Node\Name\FullyQualified(\Kiboko\Component\Bucket\ComplexResultBucket::class)
class: new Node\Name\FullyQualified('Kiboko\\Component\\Bucket\\ComplexResultBucket')
)
)
),
Expand Down Expand Up @@ -510,7 +510,7 @@ class: new Node\Name\FullyQualified(\Kiboko\Component\Bucket\ComplexResultBucket
],
),
args: [
new Node\Arg(value: $this->logger ?? new Node\Expr\New_(new Node\Name\FullyQualified(\Psr\Log\NullLogger::class))),
new Node\Arg(value: $this->logger ?? new Node\Expr\New_(new Node\Name\FullyQualified('Psr\\Log\\NullLogger'))),
]
);
}
Expand Down
11 changes: 4 additions & 7 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 Expand Up @@ -98,12 +95,12 @@ public function getNode(): Node
return new Node\Expr\New_(
class: new Node\Stmt\Class_(null, [
'implements' => [
new Node\Name\FullyQualified(TransformerInterface::class),
new Node\Name\FullyQualified('Kiboko\\Contract\\Pipeline\\TransformerInterface'),
],
'stmts' => [
(new Builder\Method('transform'))
->makePublic()
->setReturnType(new Node\Name\FullyQualified(\Generator::class))
->setReturnType(new Node\Name\FullyQualified('Generator'))
->addStmts([
new Node\Stmt\Expression(
new Node\Expr\Assign(
Expand All @@ -125,7 +122,7 @@ class: new Node\Stmt\Class_(null, [
new Node\Expr\Variable('input'),
new Node\Expr\Yield_(
new Node\Expr\New_(
new Node\Name\FullyQualified(RejectionResultBucket::class),
new Node\Name\FullyQualified('Kiboko\\Component\\Bucket\\RejectionResultBucket'),
),
),
),
Expand All @@ -139,7 +136,7 @@ class: new Node\Stmt\Class_(null, [
new Node\Expr\Variable('input'),
new Node\Expr\Yield_(
new Node\Expr\New_(
new Node\Name\FullyQualified(AcceptanceResultBucket::class),
new Node\Name\FullyQualified('Kiboko\\Component\\Bucket\\AcceptanceResultBucket'),
[
new Node\Arg(new Node\Expr\Variable('input')),
]
Expand Down
Loading

0 comments on commit befc4bb

Please sign in to comment.