Skip to content

Commit e663e82

Browse files
committed
Improve readability.
1 parent 4ef784d commit e663e82

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/Console/CommandCollection.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ public function add($name, $command)
6666
"Cannot use '$class' for command '$name' it is not a subclass of Cake\Console\Shell."
6767
);
6868
}
69+
6970
$this->commands[$name] = $command;
7071

7172
return $this;
@@ -176,6 +177,7 @@ public function autoDiscover()
176177
if (empty($shells[$key])) {
177178
return $out;
178179
}
180+
179181
foreach ($shells[$key] as $info) {
180182
$name = $info['name'];
181183
$addLong = $name !== $info['fullName'];

src/Console/CommandScanner.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
class CommandScanner
3030
{
3131
/**
32-
* Scan the application, cakephp and plugins for shells
32+
* Scan CakePHP core, the applications and plugins for shell classes
3333
*
3434
* @return array
3535
*/
@@ -51,6 +51,7 @@ public function scanAll()
5151
'',
5252
['command_list']
5353
);
54+
5455
$plugins = [];
5556
foreach (Plugin::loaded() as $plugin) {
5657
$plugins[$plugin] = $this->scanDir(
@@ -82,16 +83,19 @@ protected function scanDir($path, $namespace, $prefix, array $hide)
8283
if (empty($contents[1])) {
8384
return [];
8485
}
86+
8587
$shells = [];
8688
foreach ($contents[1] as $file) {
8789
if (substr($file, -4) !== '.php') {
8890
continue;
8991
}
92+
9093
$shell = substr($file, 0, -4);
9194
$name = Inflector::underscore(str_replace('Shell', '', $shell));
9295
if (in_array($name, $hide, true)) {
9396
continue;
9497
}
98+
9599
$shells[] = [
96100
'file' => $path . $file,
97101
'fullName' => $prefix . $name,

0 commit comments

Comments
 (0)