@@ -120,7 +120,7 @@ |
||
| 120 | 120 | { |
| 121 | 121 | self::dirExists($directory); |
| 122 | 122 | |
| 123 | - $pattern = is_array(($pattern)) ? '{' . implode(',', $pattern) . '}' : $pattern; |
|
| 123 | + $pattern = is_array(($pattern)) ? '{' . implode(',', $pattern) . '}' : $pattern; |
|
| 124 | 124 | if ($pattern === null) |
| 125 | 125 | { |
| 126 | 126 | return array_diff(glob($directory . '/*'), ['.', '..']); |
@@ -257,7 +257,7 @@ |
||
| 257 | 257 | */ |
| 258 | 258 | final public static function tmpdir($template = null) |
| 259 | 259 | { |
| 260 | - $template = ($template === null) ? "tmpXXXXXXXXXXXXXX" : "{$template}XXXXXXXXXXXXXX"; |
|
| 260 | + $template = ($template === null) ? "tmpXXXXXXXXXXXXXX" : "{$template}xxxxxxxxxxxxxx"; |
|
| 261 | 261 | $tempdir = shell_exec("mktemp -p /tmp -d {$template}"); |
| 262 | 262 | return rtrim($tempdir); |
| 263 | 263 | } |
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | final public static function chmod($path, $mode, $recursive = false, $strict = true) |
| 16 | 16 | { |
| 17 | 17 | $mode = self::fixFileModeFormat($mode); |
| 18 | - $recursive = ($recursive === false) ? '': '-R'; |
|
| 18 | + $recursive = ($recursive === false) ? '' : '-R'; |
|
| 19 | 19 | system("chmod {$recursive} {$mode} {$path} 2> /dev/null", $retval); |
| 20 | 20 | |
| 21 | 21 | if ($strict === false && $retval != 0) |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | */ |
| 41 | 41 | final public static function chgrp($file, $group, $recursive = false, $strict = true) |
| 42 | 42 | { |
| 43 | - $recursive = ($recursive === false) ?'': '-R'; |
|
| 43 | + $recursive = ($recursive === false) ? '' : '-R'; |
|
| 44 | 44 | system("chgrp {$recursive} {$group} {$file} 2> /dev/null", $retval); |
| 45 | 45 | |
| 46 | 46 | if ($strict === false && $retval != 0) |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | { |
| 69 | 69 | if (preg_match('/^-.*$/', $key, $matches)) |
| 70 | 70 | { |
| 71 | - $options[] = is_bool($value) ? $key : str_pad($key, strlen($key) + 1, ' ', STR_PAD_RIGHT).$value; |
|
| 71 | + $options[] = is_bool($value) ? $key : str_pad($key, strlen($key) + 1, ' ', STR_PAD_RIGHT) . $value; |
|
| 72 | 72 | } |
| 73 | 73 | if (preg_match('/^-.*$/', $value, $matches)) |
| 74 | 74 | { |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | { |
| 93 | 93 | if (preg_match('/^-.*$/', $key, $matches)) |
| 94 | 94 | { |
| 95 | - $arguments[] = is_bool($value) ? $key : str_pad($key, strlen($key) + 1, ' ', STR_PAD_RIGHT).$value; |
|
| 95 | + $arguments[] = is_bool($value) ? $key : str_pad($key, strlen($key) + 1, ' ', STR_PAD_RIGHT) . $value; |
|
| 96 | 96 | } else |
| 97 | 97 | { |
| 98 | 98 | $arguments[] = is_array($value) ? implode(' ', $value) : $value; |
@@ -97,13 +97,11 @@ discard block |
||
| 97 | 97 | if ($GLOBALS['stderrfile'] !== null) |
| 98 | 98 | { |
| 99 | 99 | file_put_contents($GLOBALS['stderrfile'], $buffer, FILE_APPEND | LOCK_EX); |
| 100 | - } |
|
| 101 | - else |
|
| 100 | + } else |
|
| 102 | 101 | { |
| 103 | 102 | file_put_contents($GLOBALS['stdoutfile'], $buffer, FILE_APPEND | LOCK_EX); |
| 104 | 103 | } |
| 105 | - } |
|
| 106 | - else |
|
| 104 | + } else |
|
| 107 | 105 | { |
| 108 | 106 | file_put_contents($GLOBALS['stdoutfile'], $buffer, FILE_APPEND | LOCK_EX); |
| 109 | 107 | } |
@@ -119,7 +117,8 @@ discard block |
||
| 119 | 117 | */ |
| 120 | 118 | final protected function stream_to_stdout(Process $process) |
| 121 | 119 | { |
| 122 | - $process->run(function($type, $buffer) { |
|
| 120 | + $process->run(function($type, $buffer) |
|
| 121 | + { |
|
| 123 | 122 | if (Process::ERR === $type) |
| 124 | 123 | { |
| 125 | 124 | fwrite(STDERR, $buffer); |
@@ -151,7 +150,8 @@ discard block |
||
| 151 | 150 | $GLOBALS['stdoutfile'] = $stdoutfile; |
| 152 | 151 | $GLOBALS['stderrfile'] = $stderrfile; |
| 153 | 152 | |
| 154 | - $process->run(function($type, $buffer) { |
|
| 153 | + $process->run(function($type, $buffer) |
|
| 154 | + { |
|
| 155 | 155 | if (Process::ERR === $type) |
| 156 | 156 | { |
| 157 | 157 | if ($GLOBALS['stderrfile'] !== null) |