Conditions | 2 |
Paths | 1 |
Total Lines | 7 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 1 |
CRAP Score | 4.048 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
42 | public static function ephimeral_port($host, $range_start = 1000, $range_end = 5000, $timeout = 1000) |
||
43 | { |
||
44 | return Attempt::make(function() use ($host, $range_start, $range_end) { |
||
45 | $port = rand($range_start, $range_end); |
||
46 | return Network::is_port_open($host, $port) ? $port : FALSE; |
||
47 | }, $timeout); |
||
48 | 2 | } |
|
49 | } |
||
50 |