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