Conditions | 2 |
Paths | 2 |
Total Lines | 18 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 12 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
32 | 5 | public function getCommands() |
|
33 | { |
||
34 | 5 | $finder = new Finder(); |
|
35 | $finder |
||
36 | 5 | ->files() |
|
37 | 5 | ->in($this->libDir . '/Command') |
|
38 | 5 | ->name('/(\w+)Command.php/'); |
|
39 | |||
40 | 5 | $commands = array(); |
|
41 | /** @var \SplFileInfo $file */ |
||
42 | 5 | foreach ($finder as $file) { |
|
43 | 5 | $className = str_replace('.php', '', $file->getFilename()); |
|
44 | 5 | $className = '\\SyncFS\\Command\\' . $className; |
|
45 | 5 | $commands[] = new $className(); |
|
46 | 5 | } |
|
47 | |||
48 | 5 | return $commands; |
|
49 | } |
||
50 | } |
||
51 |