| Conditions | 3 |
| Paths | 2 |
| Total Lines | 26 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 3.0416 |
| Changes | 0 | ||
| 1 | <?php |
||
| 21 | 2 | public function execute(InputInterface $input, OutputInterface $output) : int |
|
| 22 | { |
||
| 23 | 2 | $cacheFilename = tempnam(sys_get_temp_dir(), static::class); |
|
| 24 | |||
| 25 | 2 | if ( ! is_string($cacheFilename)) { |
|
|
|
|||
| 26 | $output->writeln('could not get temporary filename!'); |
||
| 27 | |||
| 28 | return 1; |
||
| 29 | } |
||
| 30 | |||
| 31 | 2 | unlink($cacheFilename); |
|
| 32 | |||
| 33 | 2 | $cacheFilename .= '.cache'; |
|
| 34 | |||
| 35 | /** |
||
| 36 | * @var string[] $sources |
||
| 37 | */ |
||
| 38 | 2 | $sources = $input->getArgument('sources'); |
|
| 39 | |||
| 40 | 2 | Compiler::ObtainDispatcher(['cacheFile' => $cacheFilename], ...$sources); |
|
| 41 | |||
| 42 | 2 | $output->write(file_get_contents($cacheFilename) ?: 'false'); |
|
| 43 | |||
| 44 | 2 | unlink($cacheFilename); |
|
| 45 | |||
| 46 | 2 | return 0; |
|
| 47 | } |
||
| 60 |