1 | <?php |
||
12 | class Exec |
||
13 | { |
||
14 | /** |
||
15 | * @var string |
||
16 | */ |
||
17 | const REDIRECT_STDERR_TO_STDOUT = ' 2>&1'; |
||
18 | |||
19 | /** |
||
20 | * @var int (0-255) |
||
21 | */ |
||
22 | const CODE_CLEAN_EXIT = 0; |
||
23 | |||
24 | /** |
||
25 | * Every error in a pipe will be exited with an error code |
||
26 | */ |
||
27 | const SET_O_PIPEFAIL = 'set -o pipefail; '; |
||
28 | |||
29 | /** |
||
30 | * @param string $command |
||
31 | * @param string|null $output |
||
32 | * @param int $returnCode |
||
|
|||
33 | */ |
||
34 | public static function run($command, &$output = null, &$returnCode = null) |
||
56 | |||
57 | /** |
||
58 | * Exec class is allowed to run |
||
59 | * |
||
60 | * @return bool |
||
61 | */ |
||
62 | public static function allowed() |
||
66 | |||
67 | /** |
||
68 | * string from array of strings representing one line per entry |
||
69 | * |
||
70 | * @param array $commandOutput |
||
71 | * @return string |
||
72 | */ |
||
73 | private static function parseCommandOutput(array $commandOutput) |
||
77 | |||
78 | /** |
||
79 | * @return bool |
||
80 | */ |
||
81 | private static function isPipefailOptionAvailable() |
||
87 | } |
||
88 |
This check looks for
@param
annotations where the type inferred by our type inference engine differs from the declared type.It makes a suggestion as to what type it considers more descriptive.
Most often this is a case of a parameter that can be null in addition to its declared types.