Skip to content

Commit

Permalink
Update MatrixEvent.php
Browse files Browse the repository at this point in the history
Signed-off-by: Nathanael Esayeas <nathanael.esayeas@protonmail.com>
  • Loading branch information
ghostwriter committed Aug 21, 2023
1 parent ad6e564 commit cbe399c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Event/MatrixEvent.php
Expand Up @@ -16,6 +16,7 @@ final class MatrixEvent extends AbstractEvent
* include:array<array-key,array{
* name:string,
* command:string,
* extensions:array<string>,
* os:string,
* php:string,
* dependency:string,
Expand All @@ -28,6 +29,9 @@ final class MatrixEvent extends AbstractEvent
'exclude' => [],
];

/**
* @param array $matrices
*/
public function exclude(array $matrices): void
{
/** @var string $matrix */
Expand All @@ -41,6 +45,11 @@ public function exclude(array $matrices): void
*/
public function getMatrix(): string
{
$matrix = $this->matrix['include'];
if ($matrix === []) {
$this->include(new Job('No tests', 'echo "No tests"', [], 'locked'));
}

return Json::encode($this->matrix);
}

Expand Down

0 comments on commit cbe399c

Please sign in to comment.