Completed
Push — master ( 6da921...c1c191 )
by Greg
01:24
created

Tty::isTtySupported()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 0
1
<?php
2
namespace Consolidation\SiteProcess\Util;
3
4
use Symfony\Component\Process\Process;
5
6
/**
7
 * Wrapper for universal support of TTY-related functionality across versions of
8
 * Symfony Process.
9
 */
10
class Tty
11
{
12
    /**
13
     * In Symfony Process 4+, this is simply a wrapper for Process::isTtySupported().
14
     * In lower versions, it mimics the same functionality.
15
     */
16
    public static function isTtySupported()
17
    {
18
        if (method_exists('\Symfony\Component\Process\Process', 'isTtySupported')) {
19
            return Process::isTtySupported();
0 ignored issues
show
Bug introduced by
The method isTtySupported() does not exist on Symfony\Component\Process\Process. Did you maybe mean isPtySupported()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
20
        }
21
        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);
22
    }
23
}
24