Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
allow to select the triggers to run on each change
- Loading branch information
Showing
17 changed files
with
426 additions
and
32 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 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
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,45 @@ | ||
<?php | ||
declare(strict_types = 1); | ||
|
||
namespace Innmind\LabStation; | ||
|
||
/** | ||
* @psalm-immutable | ||
*/ | ||
enum Triggers | ||
{ | ||
case codingStandard; | ||
case composerUpdate; | ||
case dockerCompose; | ||
case psalm; | ||
case tests; | ||
|
||
/** | ||
* @psalm-pure | ||
*/ | ||
public static function of(string $value): self | ||
{ | ||
return match ($value) { | ||
'cs', 'codingStandard' => self::codingStandard, | ||
'composer', 'composerUpdate' => self::composerUpdate, | ||
'docker', 'dockerCompose' => self::dockerCompose, | ||
'psalm' => self::psalm, | ||
'tests', 'phpunit' => self::tests, | ||
}; | ||
} | ||
|
||
/** | ||
* @psalm-pure | ||
*/ | ||
public static function allow(string $value): bool | ||
{ | ||
return match ($value) { | ||
'cs', 'codingStandard' => true, | ||
'composer', 'composerUpdate' => true, | ||
'docker', 'dockerCompose' => true, | ||
'psalm' => true, | ||
'tests', 'phpunit' => true, | ||
default => false, | ||
}; | ||
} | ||
} |
Oops, something went wrong.