| Conditions | 3 |
| Paths | 3 |
| Total Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 16 | public static function isTtySupported() |
||
| 17 | { |
||
| 18 | // Start off by checking STDIN with `posix_isatty`, as that appears to be more reliable |
||
| 19 | if (function_exists('posix_isatty')) { |
||
| 20 | return posix_isatty(STDIN); |
||
| 21 | } |
||
| 22 | if (method_exists('\Symfony\Component\Process\Process', 'isTtySupported')) { |
||
| 23 | return Process::isTtySupported(); |
||
| 24 | } |
||
| 25 | return (bool) @proc_open('echo 1 >/dev/null', array(array('file', '/dev/tty', 'r'), array('file', '/dev/tty', 'w'), array('file', '/dev/tty', 'w')), $pipes); |
||
| 26 | } |
||
| 27 | } |
||
| 28 |