From d1357cb3e94d07c69dfe289eeeb703abb8a081dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9gory=20Planchat?= Date: Tue, 21 Nov 2023 18:01:03 +0100 Subject: [PATCH] Updated generated code dependencies --- src/Pipeline/Extractor.php | 12 +++++++++--- src/Pipeline/Loader.php | 12 +++++++++--- src/Pipeline/Transformer.php | 12 +++++++++--- 3 files changed, 27 insertions(+), 9 deletions(-) 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)