-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #123 from php-etl/feature/hook-api
fix runtimes: http-api + hook
- Loading branch information
Showing
20 changed files
with
1,078 additions
and
323 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Kiboko\Component\Satellite\Builder\API; | ||
|
||
use PhpParser\Node; | ||
|
||
final class APIRuntime | ||
{ | ||
public function getNode(): Node\Expr | ||
{ | ||
return new Node\Expr\New_( | ||
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), | ||
args: [ | ||
new Node\Arg( | ||
value: new Node\Expr\New_( | ||
class: new Node\Name\FullyQualified(\Kiboko\Component\Pipeline\PipelineRunner::class), | ||
args: [ | ||
new Node\Arg( | ||
value: new Node\Expr\New_( | ||
class: new Node\Name\FullyQualified(\Psr\Log\NullLogger::class) | ||
) | ||
), | ||
] | ||
) | ||
), | ||
] | ||
), | ||
), | ||
new Node\Arg( | ||
value: new Node\Expr\New_( | ||
class: new Node\Name\FullyQualified('ProjectServiceContainer') | ||
), | ||
), | ||
] | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Kiboko\Component\Satellite\Builder\API; | ||
|
||
use PhpParser\Builder; | ||
use PhpParser\Node; | ||
|
||
final readonly class PipelineBuilder | ||
{ | ||
public function __construct(private Builder $builder) | ||
{ | ||
} | ||
|
||
public function getNode(): Node\Expr | ||
{ | ||
return new Node\Expr\Closure( | ||
subNodes: [ | ||
'static' => true, | ||
'params' => [ | ||
new Node\Param( | ||
var: new Node\Expr\Variable('runtime'), | ||
type: new Node\Name\FullyQualified('Kiboko\\Component\\Runtime\\Hook\\HookRuntimeInterface'), | ||
), | ||
], | ||
'stmts' => [ | ||
new Node\Stmt\Expression( | ||
$this->builder->getNode() | ||
), | ||
new Node\Stmt\Return_( | ||
expr: new Node\Expr\Variable('runtime') | ||
), | ||
], | ||
] | ||
); | ||
} | ||
} |
Oops, something went wrong.