diff --git a/src/Pipeline/Extractor.php b/src/Pipeline/Extractor.php index 2a3920b6..0c1d7ec9 100644 --- a/src/Pipeline/Extractor.php +++ b/src/Pipeline/Extractor.php @@ -67,13 +67,19 @@ public function __invoke(array $config, Pipeline $pipeline, StepRepositoryInterf } if (array_key_exists('code', $config)) { - $code = new Node\Scalar\String_($config['code']); + $code = $config['code']; } else { - $code = new node\Scalar\String_(sprintf('%s.%s', $this->plugin, $this->key)); + $code = sprintf('%s.%s', $this->plugin, $this->key); } $pipeline->addExtractor( - $code, + new Node\Expr\StaticCall( + new Node\Name\FullyQualified('Kiboko\\Component\\Pipeline\\StepCode'), + new Node\Identifier('fromString'), + [ + new Node\Arg(new Node\Scalar\String_($code)) + ] + ), $repository->getBuilder() ->withLogger($logger) ->withRejection($rejection) diff --git a/src/Pipeline/Loader.php b/src/Pipeline/Loader.php index bf402e2e..a4d6748b 100644 --- a/src/Pipeline/Loader.php +++ b/src/Pipeline/Loader.php @@ -67,13 +67,19 @@ public function __invoke(array $config, Pipeline $pipeline, StepRepositoryInterf } if (array_key_exists('code', $config)) { - $code = new Node\Scalar\String_($config['code']); + $code = $config['code']; } else { - $code = new node\Scalar\String_(sprintf('%s.%s', $this->plugin, $this->key)); + $code = sprintf('%s.%s', $this->plugin, $this->key); } $pipeline->addLoader( - $code, + new Node\Expr\StaticCall( + new Node\Name\FullyQualified('Kiboko\\Component\\Pipeline\\StepCode'), + new Node\Identifier('fromString'), + [ + new Node\Arg(new Node\Scalar\String_($code)) + ] + ), $repository->getBuilder() ->withLogger($logger) ->withRejection($rejection) diff --git a/src/Pipeline/Transformer.php b/src/Pipeline/Transformer.php index 70566d6d..24226233 100644 --- a/src/Pipeline/Transformer.php +++ b/src/Pipeline/Transformer.php @@ -67,13 +67,19 @@ public function __invoke(array $config, Pipeline $pipeline, StepRepositoryInterf } if (array_key_exists('code', $config)) { - $code = new Node\Scalar\String_($config['code']); + $code = $config['code']; } else { - $code = new node\Scalar\String_(sprintf('%s.%s', $this->plugin, $this->key)); + $code = sprintf('%s.%s', $this->plugin, $this->key); } $pipeline->addTransformer( - $code, + new Node\Expr\StaticCall( + new Node\Name\FullyQualified('Kiboko\\Component\\Pipeline\\StepCode'), + new Node\Identifier('fromString'), + [ + new Node\Arg(new Node\Scalar\String_($code)) + ] + ), $repository->getBuilder() ->withLogger($logger) ->withRejection($rejection)