| Conditions | 3 |
| Paths | 2 |
| Total Lines | 26 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 3 |
| Changes | 8 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 25 | 2 | public function execute(InputInterface $input, OutputInterface $output) : int |
|
| 26 | { |
||
| 27 | 2 | $cacheFilename = static::tempnamCheck($output); |
|
| 28 | |||
| 29 | 2 | if ( ! is_string($cacheFilename)) { |
|
| 30 | 1 | return self::INT_RETURN_FAIL; |
|
| 31 | } |
||
| 32 | |||
| 33 | 1 | unlink($cacheFilename); |
|
| 34 | |||
| 35 | 1 | $cacheFilename .= '.cache'; |
|
| 36 | |||
| 37 | /** |
||
| 38 | * @var string[] |
||
| 39 | * |
||
| 40 | * @psalm-var array<int, class-string<\SignpostMarv\DaftRouter\DaftSource>> |
||
| 41 | */ |
||
| 42 | 1 | $sources = $input->getArgument('sources'); |
|
| 43 | |||
| 44 | 1 | Compiler::ObtainDispatcher(['cacheFile' => $cacheFilename], ...$sources); |
|
| 45 | |||
| 46 | 1 | $output->write(file_get_contents($cacheFilename) ?: 'false'); |
|
| 47 | |||
| 48 | 1 | unlink($cacheFilename); |
|
| 49 | |||
| 50 | 1 | return self::INT_RETURN_OK; |
|
| 51 | } |
||
| 64 |