| Conditions | 2 |
| Paths | 2 |
| Total Lines | 20 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 30 | protected function execute(InputInterface $input, OutputInterface $output) |
||
| 31 | { |
||
| 32 | $fqcnRepository = new FqcnRepository(new FileRepository(), new ParserFactory()); |
||
| 33 | |||
| 34 | $isoCodesClasses = array_map(function ($fqcn) { |
||
| 35 | return str_replace('IsoCodes\\', '', $fqcn); |
||
| 36 | }, $fqcnRepository->findIn(__DIR__.'/../../../vendor/ronanguilloux/isocodes/src/IsoCodes')); |
||
| 37 | |||
| 38 | $constraintClasses = array_filter(array_map(function ($fqcn) { |
||
| 39 | return str_replace('SLLH\\IsoCodesValidator\\Constraints\\', '', $fqcn); |
||
| 40 | }, $fqcnRepository->findIn(__DIR__.'/../../../src/Constraints')), function ($className) { |
||
| 41 | return !empty(trim($className)); |
||
| 42 | }); |
||
| 43 | |||
| 44 | foreach (array_udiff($isoCodesClasses, $constraintClasses, 'strcasecmp') as $missingConstraint) { |
||
| 45 | $output->writeln("Generate <comment>${missingConstraint}</comment> constraint."); |
||
| 46 | } |
||
| 47 | |||
| 48 | return 0; |
||
| 49 | } |
||
| 50 | } |
||
| 51 |