| Total Complexity | 4 |
| Total Lines | 39 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | final class UploadCommand extends AbstractCommand |
||
| 14 | { |
||
| 15 | protected static $defaultName = 'dictionary:upload'; |
||
| 16 | |||
| 17 | private WordsStorageUpload $wordsStorageUpload; |
||
| 18 | |||
| 19 | public function __construct(WordsStorageUpload $wordsStorageUpload) |
||
| 20 | { |
||
| 21 | parent::__construct(); |
||
| 22 | |||
| 23 | $this->wordsStorageUpload = $wordsStorageUpload; |
||
| 24 | } |
||
| 25 | |||
| 26 | protected function configure(): void |
||
| 27 | { |
||
| 28 | $this->setDescription('Upload a new words and his definition to the storage.'); |
||
| 29 | $this->addArgument('file-path', InputArgument::REQUIRED, 'File path'); |
||
| 30 | $this->setHelp( |
||
| 31 | <<<HELP |
||
| 32 | The command upload a new words and his definition to the storage |
||
| 33 | <info>php %command.full_name% file.csv</info> |
||
| 34 | HELP |
||
| 35 | ); |
||
| 36 | } |
||
| 37 | |||
| 38 | protected function doExecute(InputInterface $input): string |
||
| 39 | { |
||
| 40 | $criteria = new WordsStorageUploadCriteria((string) $input->getArgument('file-path')); |
||
| 41 | $count = $this->wordsStorageUpload->execute($criteria); |
||
| 42 | |||
| 43 | return sprintf('Upload %s words.', $count); |
||
| 44 | } |
||
| 45 | |||
| 46 | /** |
||
| 47 | * @psalm-suppress PossiblyInvalidCast |
||
| 48 | */ |
||
| 49 | protected function validateInput(InputInterface $input): void |
||
| 52 | } |
||
| 53 | } |
||
| 54 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths