Passed
Push — master ( 2d5f12...bded11 )
by Choquet
01:24
created

initialize   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 8
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 4
eloc 6
dl 0
loc 8
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A dependencies() 0 5 4
1
<?php
2
3
/**
4
 * © 2018 - Phoponent
5
 * Author: Nicolas Choquet
6
 * Email: [email protected]
7
 * LICENSE GPL ( GNU General Public License )
8
 */
9
10
namespace phoponent\framework\command;
11
12
13
use phoponent\framework\traits\command;
14
15
class initialize {
16
    use command;
17
18
    public function dependencies() {
19
        $dir = opendir("phoponent/external_libs");
20
        while (($directory = readdir($dir)) !== false) {
0 ignored issues
show
Bug introduced by
It seems like $dir can also be of type false; however, parameter $dir_handle of readdir() does only seem to accept resource, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

20
        while (($directory = readdir(/** @scrutinizer ignore-type */ $dir)) !== false) {
Loading history...
21
            if($directory !== '..' && $directory !== '.') {
22
                exec("cd phoponent/external_libs/{$directory} && composer install");
23
            }
24
        }
25
    }
26
}