Conditions | 3 |
Paths | 3 |
Total Lines | 67 |
Code Lines | 49 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
1 | <?php declare(strict_types=1); |
||
29 | protected function execute(InputInterface $input, OutputInterface $output): int |
||
30 | { |
||
31 | $helper = $this->getHelper('question'); |
||
32 | |||
33 | $question = new ConfirmationQuestion('This will delete all files necessary to build the administration. Do you want to continue? (y/n) ', false); |
||
34 | |||
35 | if (!$helper->ask($input, $output, $question)) { |
||
36 | $output->writeln('Command aborted!'); |
||
37 | |||
38 | return 0; |
||
39 | } |
||
40 | |||
41 | $adminDir = \dirname((string) (new \ReflectionClass(Administration::class))->getFileName()); |
||
42 | $output->writeln('Deleting uneccessary files of the administration after the build process...'); |
||
43 | $progressBar = new ProgressBar($output, 100); |
||
44 | |||
45 | $finder = new Finder(); |
||
46 | |||
47 | // Find all files in Administration/Resources/app/administration/src/module except for de-DE.json and en-GB.json |
||
48 | $finder->in($adminDir . '/Resources/app/administration/src/module') |
||
49 | ->notName('de-DE.json') |
||
50 | ->notName('en-GB.json') |
||
51 | ->files(); |
||
52 | |||
53 | foreach ($finder as $file) { |
||
54 | unlink($file->getRealPath()); |
||
55 | } |
||
56 | $progressBar->advance(25); |
||
57 | |||
58 | $this->deleteEmptyDirectories($adminDir . '/Resources/app/administration/src/module'); |
||
59 | $progressBar->advance(25); |
||
60 | |||
61 | // Find all the following directories and files and delete them |
||
62 | $this->removeDirectory($adminDir . '/Resources/app/administration/src/app/adapter'); |
||
63 | $this->removeDirectory($adminDir . '/Resources/app/administration/src/app/assets'); |
||
64 | $this->removeDirectory($adminDir . '/Resources/app/administration/src/app/asyncComponent'); |
||
65 | $this->removeDirectory($adminDir . '/Resources/app/administration/src/app/component'); |
||
66 | $this->removeDirectory($adminDir . '/Resources/app/administration/src/app/decorator'); |
||
67 | $this->removeDirectory($adminDir . '/Resources/app/administration/src/app/directive'); |
||
68 | $this->removeDirectory($adminDir . '/Resources/app/administration/src/app/filter'); |
||
69 | $this->removeDirectory($adminDir . '/Resources/app/administration/src/app/init'); |
||
70 | $this->removeDirectory($adminDir . '/Resources/app/administration/src/app/init-post'); |
||
71 | $this->removeDirectory($adminDir . '/Resources/app/administration/src/app/init-pre'); |
||
72 | $this->removeDirectory($adminDir . '/Resources/app/administration/src/app/mixin'); |
||
73 | $this->removeDirectory($adminDir . '/Resources/app/administration/src/app/plugin'); |
||
74 | $this->removeDirectory($adminDir . '/Resources/app/administration/src/app/route'); |
||
75 | $this->removeDirectory($adminDir . '/Resources/app/administration/src/app/service'); |
||
76 | $this->removeDirectory($adminDir . '/Resources/app/administration/src/app/state'); |
||
77 | $this->removeDirectory($adminDir . '/Resources/app/administration/src/core'); |
||
78 | $this->removeDirectory($adminDir . '/Resources/app/administration/src/meta'); |
||
79 | $this->removeDirectory($adminDir . '/Resources/app/administration/src/scripts'); |
||
80 | $this->removeDirectory($adminDir . '/Resources/app/administration/patches'); |
||
81 | unlink($adminDir . '/Resources/app/administration/package-lock.json'); |
||
82 | $progressBar->advance(25); |
||
83 | |||
84 | $this->removeDirectory($adminDir . '/Resources/app/administration/static'); |
||
85 | $this->removeDirectory($adminDir . '/Resources/app/administration/build'); |
||
86 | $this->removeDirectory($adminDir . '/Resources/app/administration/scripts'); |
||
87 | $this->removeDirectory($adminDir . '/Resources/app/administration/eslint-rules'); |
||
88 | $this->removeDirectory($adminDir . '/Resources/app/administration/test'); |
||
89 | $progressBar->advance(25); |
||
90 | $progressBar->finish(); |
||
91 | |||
92 | $output->writeln(''); |
||
93 | $output->writeln('All uneccessary files of the administration after the build process have been deleted.'); |
||
94 | |||
95 | return 0; |
||
96 | } |
||
152 |
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