From 45dc906d27d31d203793ad735c93f82ca2ac956a Mon Sep 17 00:00:00 2001 From: sebprt Date: Thu, 26 Oct 2023 15:56:40 +0200 Subject: [PATCH] Fixed PHPStan errors --- src/Cloud/DTO/JobList.php | 6 +----- src/Cloud/Workflow.php | 7 ++----- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/src/Cloud/DTO/JobList.php b/src/Cloud/DTO/JobList.php index 6cea5cbc..f4798011 100644 --- a/src/Cloud/DTO/JobList.php +++ b/src/Cloud/DTO/JobList.php @@ -8,6 +8,7 @@ readonly class JobList implements \Countable, \IteratorAggregate { + /** @var DTO\Workflow\JobInterface[] */ private array $jobs; public function __construct( @@ -27,11 +28,6 @@ public function getIterator(): \Traversable public function codes(): array { $jobs = $this->jobs; - - /** - * @var DTO\Workflow\Pipeline|DTO\Workflow\Action $left - * @var DTO\Workflow\Pipeline|DTO\Workflow\Action $right - */ usort($jobs, fn (DTO\Workflow\JobInterface $left, DTO\Workflow\JobInterface $right) => $left->order <=> $right->order); return array_map(fn (DTO\Workflow\JobInterface $job) => $job->code->asString(), $jobs); diff --git a/src/Cloud/Workflow.php b/src/Cloud/Workflow.php index d3b63b7a..bb247201 100644 --- a/src/Cloud/Workflow.php +++ b/src/Cloud/Workflow.php @@ -183,11 +183,8 @@ private static function fromApiModel(Api\Client $client, Api\Model\WorkflowRead $step->getLabel(), new StepCode($step->getCode()), $step->getConfiguration(), - new ProbeList(...array_map( - fn (Api\Model\Probe $probe, int $order) => new Probe($probe->getLabel(), $probe->getCode(), $order), - $probes = $step->getProbes(), - range(0, is_countable($probes) ? \count($probes) : 0), - )), + /** TODO : implement probes when it is enabled */ + new ProbeList(), $order ), $steps = $job->getPipeline()->getSteps(),