Conditions | 3 |
Paths | 3 |
Total Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 3.1406 |
Changes | 0 |
1 | <?php |
||
21 | 520 | public static function getFD($num) { |
|
22 | $folders = array( |
||
23 | 520 | '/proc/self/fd', |
|
24 | 520 | '/dev/fd' |
|
25 | 520 | ); |
|
26 | 520 | foreach ($folders as $folder) { |
|
27 | if (file_exists($folder)) { |
||
28 | return $folder . '/' . $num; |
||
29 | } |
||
30 | } |
||
31 | throw new Exception('Cant find file descriptor path'); |
||
32 | 520 | } |
|
33 | 520 | ||
65 |