Completed
Push — master ( a6e3aa...690e08 )
by Vincenzo
01:57
created

DatabaseHelperCommand::run()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 6
c 1
b 0
f 0
rs 9.4285
cc 1
eloc 4
nc 1
nop 0
1
<?php
2
3
4
namespace App\Lib\Slime\Console;
5
6
7
abstract class DatabaseHelperCommand extends SlimeCommand
8
{
9
    protected $classesPath = null;
10
    /**
11
     * @return int
12
     */
13
    public function run()
14
    {
15
        $files = glob($this->classesPath . '/*.php');
16
        $this->runFiles($files);
17
        return 0;
18
    }
19
20
    protected function runFiles($files)
21
    {
22
        foreach ($files as $file) {
23
            require_once($file);
24
            $class = basename($file, '.php');
25
            $obj = new $class;
26
            $obj->run();
27
        }
28
    }
29
}