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