| Conditions | 2 |
| Paths | 2 |
| Total Lines | 17 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 2.032 |
| Changes | 0 | ||
| 1 | <?php |
||
| 35 | 1 | protected function execute(InputInterface $input, OutputInterface $output): int |
|
| 36 | { |
||
| 37 | 1 | $this->ensureExtensionLoaded('apcu'); |
|
| 38 | |||
| 39 | 1 | $key = $input->getArgument('key'); |
|
| 40 | |||
| 41 | 1 | $success = new \stdClass(); |
|
| 42 | 1 | $value = $this->getCacheTool()->apcu_fetch($key, $success); |
|
| 43 | |||
| 44 | 1 | if ($success->success) { |
|
| 45 | $output->writeln(sprintf("<comment>APCu key=<info>{$key}</info> has value=<info>%1\$s</info></comment>", var_export($value, true))); |
||
| 46 | } else { |
||
| 47 | 1 | $output->writeln("<comment>APCu key=<info>{$key}</info> does not exist.</comment>"); |
|
| 48 | 1 | return 1; |
|
| 49 | } |
||
| 50 | |||
| 51 | return 0; |
||
| 52 | } |
||
| 54 |