Conditions | 3 |
Paths | 3 |
Total Lines | 17 |
Code Lines | 6 |
Lines | 17 |
Ratio | 100 % |
Changes | 0 |
1 | <?php |
||
43 | View Code Duplication | private function loadTheConsoles($directory) |
|
|
|||
44 | { |
||
45 | if (File::isDirectory($directory)) { |
||
46 | |||
47 | $files = File::allFiles($directory); |
||
48 | |||
49 | foreach ($files as $consoleFile) { |
||
50 | |||
51 | $consoleClass = LoaderHelper::getClassFullNameFromFile($consoleFile->getPathname()); |
||
52 | |||
53 | // when user from the Main Service Provider, which extends Laravel |
||
54 | // service provider you get access to `$this->commands` |
||
55 | $this->commands([$consoleClass]); |
||
56 | } |
||
57 | |||
58 | } |
||
59 | } |
||
60 | |||
63 |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.