1 | <?php declare(strict_types=1); |
||
9 | class ScriptFinder |
||
10 | { |
||
11 | const VALID_EXTENSIONS = [ |
||
12 | 'sh', |
||
13 | 'psh' |
||
14 | ]; |
||
15 | |||
16 | /** |
||
17 | * @var string[] |
||
18 | */ |
||
19 | private $scriptPaths; |
||
20 | |||
21 | /** |
||
22 | * @param string[] $scriptPaths |
||
23 | */ |
||
24 | public function __construct(array $scriptPaths) |
||
28 | |||
29 | /** |
||
30 | * @return Script[] |
||
31 | * @throws ScriptPathNotValidException |
||
32 | */ |
||
33 | public function getAllScripts(): array |
||
65 | |||
66 | /** |
||
67 | * @param string $scriptName |
||
68 | * @return Script |
||
69 | * @throws ScriptNotFoundException |
||
70 | */ |
||
71 | public function findScriptByName(string $scriptName): Script |
||
81 | } |
||
82 |