1 | <?php |
||
2 | |||
3 | namespace hidev\helpers; |
||
4 | |||
5 | class Sys |
||
6 | { |
||
7 | public static function mkdir(string $dir) |
||
8 | { |
||
9 | self::passthru("mkdir -p $dir"); |
||
10 | } |
||
11 | |||
12 | public static function chmod($mode, $path) |
||
13 | { |
||
14 | self::passthru("sudo chmod $mode $path"); |
||
15 | } |
||
16 | |||
17 | public static function passthru(string $cmd) |
||
18 | { |
||
19 | echo "> $cmd\n"; |
||
20 | $res = \passthru($cmd, $exitcode); |
||
0 ignored issues
–
show
|
|||
21 | if ($exitcode) { |
||
22 | echo "! failed $cmd"; |
||
23 | } |
||
24 | } |
||
25 | } |
||
26 |
This check looks for function or method calls that always return null and whose return value is assigned to a variable.
The method
getObject()
can return nothing but null, so it makes no sense to assign that value to a variable.The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.