| Conditions | 3 |
| Paths | 3 |
| Total Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php declare(strict_types=1); |
||
| 20 | public function parseContent(string $content, Script $script): array |
||
| 21 | { |
||
| 22 | if (strpos($content, self::TYPE_DIRECT_EXECUTE) === false) { |
||
| 23 | throw new ScriptNotSupportedByParser('Marker for execution missing'); |
||
| 24 | } |
||
| 25 | |||
| 26 | if (!is_executable($script->getPath())) { |
||
| 27 | throw new \RuntimeException('Bash scripts can only be executed if they are executable please execute chmod + ' . $script->getPath()); |
||
| 28 | } |
||
| 29 | |||
| 30 | return [new BashCommand($script)]; |
||
| 31 | } |
||
| 32 | } |
||
| 33 |