Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
salahhusa9 committed Oct 22, 2023
1 parent 783de73 commit 8be3a8d
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/Updater.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,14 @@ private function updateTo($version): string
}

// check if pipelines is array and not empty and items is implemented Pipeline contract
if (is_array($pipelines) && count($pipelines) > 0 && array_reduce($pipelines, function ($carry, $item) {
return $carry && in_array(Pipeline::class, class_implements($item));
}, true)) {
$pipelines = array_map(function ($item) {
return new $item();
}, $pipelines);
if (is_array($pipelines) && count($pipelines) > 0) {

Check failure on line 77 in src/Updater.php

View workflow job for this annotation

GitHub Actions / phpstan

Comparison operation ">" between int<1, 10> and 0 is always true.

Check failure on line 77 in src/Updater.php

View workflow job for this annotation

GitHub Actions / phpstan

Result of && is always true.
foreach ($pipelines as $pipeline) {
if (!is_subclass_of($pipeline, \Salahhusa9\Updater\Contracts\Pipeline::class)) {
throw new \Exception('Pipeline '. $pipeline .' is not implemented Pipeline contract:' . \Salahhusa9\Updater\Contracts\Pipeline::class);
}
}
} else {
throw new \Exception('Pipelines is not array or empty or not implemented Pipeline contract');
throw new \Exception('Pipelines is not array or empty');
}

Pipeline::send([
Expand Down

0 comments on commit 8be3a8d

Please sign in to comment.