@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | foreach ($paths as $path) { |
56 | 56 | if (preg_match('/\.php$/i', $path)) { |
57 | 57 | // Prevent variable leak into deploy.php file |
58 | - call_user_func(function () use ($path) { |
|
58 | + call_user_func(function() use ($path) { |
|
59 | 59 | // Reorder autoload stack |
60 | 60 | $originStack = spl_autoload_functions(); |
61 | 61 | |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | } else if (preg_match('/\.ya?ml$/i', $path)) { |
73 | 73 | self::$recipeFilename = basename($path); |
74 | 74 | self::$recipeSource = file_get_contents($path, true); |
75 | - $root = array_filter(Yaml::parse(self::$recipeSource), static function (string $key) { |
|
75 | + $root = array_filter(Yaml::parse(self::$recipeSource), static function(string $key) { |
|
76 | 76 | return substr($key, 0, 1) !== '.'; |
77 | 77 | }, ARRAY_FILTER_USE_KEY); |
78 | 78 | |
@@ -127,18 +127,18 @@ discard block |
||
127 | 127 | |
128 | 128 | protected static function tasks(array $tasks) |
129 | 129 | { |
130 | - $buildTask = function ($name, $steps) { |
|
131 | - $body = function () { |
|
130 | + $buildTask = function($name, $steps) { |
|
131 | + $body = function() { |
|
132 | 132 | }; |
133 | 133 | $task = task($name, $body); |
134 | 134 | |
135 | 135 | foreach ($steps as $step) { |
136 | - $buildStep = function ($step) use (&$body, $task) { |
|
136 | + $buildStep = function($step) use (&$body, $task) { |
|
137 | 137 | extract($step); |
138 | 138 | |
139 | 139 | if (isset($cd)) { |
140 | 140 | $prev = $body; |
141 | - $body = function () use ($cd, $prev) { |
|
141 | + $body = function() use ($cd, $prev) { |
|
142 | 142 | $prev(); |
143 | 143 | cd($cd); |
144 | 144 | }; |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | if (isset($run)) { |
148 | 148 | $has = 'run'; |
149 | 149 | $prev = $body; |
150 | - $body = function () use ($run, $prev) { |
|
150 | + $body = function() use ($run, $prev) { |
|
151 | 151 | $prev(); |
152 | 152 | try { |
153 | 153 | run($run); |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | } |
166 | 166 | $has = 'run_locally'; |
167 | 167 | $prev = $body; |
168 | - $body = function () use ($run_locally, $prev) { |
|
168 | + $body = function() use ($run_locally, $prev) { |
|
169 | 169 | $prev(); |
170 | 170 | try { |
171 | 171 | runLocally($run_locally); |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | } |
184 | 184 | $has = 'upload'; |
185 | 185 | $prev = $body; |
186 | - $body = function () use ($upload, $prev) { |
|
186 | + $body = function() use ($upload, $prev) { |
|
187 | 187 | $prev(); |
188 | 188 | upload($upload['src'], $upload['dest']); |
189 | 189 | }; |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | } |
196 | 196 | $has = 'download'; |
197 | 197 | $prev = $body; |
198 | - $body = function () use ($download, $prev) { |
|
198 | + $body = function() use ($download, $prev) { |
|
199 | 199 | $prev(); |
200 | 200 | download($download['src'], $download['dest']); |
201 | 201 | }; |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | $labels = $host->get('labels', []); |
51 | 51 | $labels['alias'] = $host->getAlias(); |
52 | 52 | $labels['true'] = 'true'; |
53 | - $isTrue = function ($value) { |
|
53 | + $isTrue = function($value) { |
|
54 | 54 | return $value; |
55 | 55 | }; |
56 | 56 | |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | private static function compare(string $op, $a, ?string $b): bool |
73 | 73 | { |
74 | 74 | $matchFunction = function($a, ?string $b) { |
75 | - foreach ((array)$a as $item) { |
|
75 | + foreach ((array) $a as $item) { |
|
76 | 76 | if ($item === $b) { |
77 | 77 | return true; |
78 | 78 | } |
@@ -167,7 +167,7 @@ |
||
167 | 167 | * @throws FileException If the SHA1 checksum differs. |
168 | 168 | * @throws UnexpectedValueException If the Phar is corrupt. |
169 | 169 | */ |
170 | - public function getFile():? string |
|
170 | + public function getFile(): ? string |
|
171 | 171 | { |
172 | 172 | if (null === $this->file) { |
173 | 173 | unlink($this->file = tempnam(sys_get_temp_dir(), 'upd')); |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | * @param boolean $major Lock to major version? |
38 | 38 | * @param boolean $pre Allow pre-releases? |
39 | 39 | */ |
40 | - public function findRecent(Version $version, bool $major = false, bool $pre = false):? Update |
|
40 | + public function findRecent(Version $version, bool $major = false, bool $pre = false): ? Update |
|
41 | 41 | { |
42 | 42 | /** @var Update|null */ |
43 | 43 | $current = null; |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | |
119 | 119 | usort( |
120 | 120 | $updates, |
121 | - function (Update $a, Update $b) { |
|
121 | + function(Update $a, Update $b) { |
|
122 | 122 | return Comparator::isGreaterThan( |
123 | 123 | $a->getVersion(), |
124 | 124 | $b->getVersion() |
@@ -40,7 +40,7 @@ |
||
40 | 40 | */ |
41 | 41 | public static function isNumber(int $number): bool |
42 | 42 | { |
43 | - return (true == preg_match('/^(0|[1-9]\d*)$/', (string)$number)); |
|
43 | + return (true == preg_match('/^(0|[1-9]\d*)$/', (string) $number)); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | /** |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | if ($this->output->isDebug()) { |
69 | 69 | $sshString = $ssh[0]; |
70 | 70 | for ($i = 1; $i < count($ssh); $i++) { |
71 | - $sshString .= ' ' . escapeshellarg((string)$ssh[$i]); |
|
71 | + $sshString .= ' ' . escapeshellarg((string) $ssh[$i]); |
|
72 | 72 | } |
73 | 73 | $this->output->writeln("[$host] $sshString"); |
74 | 74 | } |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | ->setTimeout((null === $config['timeout']) ? null : (float) $config['timeout']) |
86 | 86 | ->setIdleTimeout((null === $config['idle_timeout']) ? null : (float) $config['idle_timeout']); |
87 | 87 | |
88 | - $callback = function ($type, $buffer) use ($config, $host) { |
|
88 | + $callback = function($type, $buffer) use ($config, $host) { |
|
89 | 89 | $this->logger->printBuffer($host, $type, $buffer); |
90 | 90 | $this->pop->callback($host, boolval($config['real_time_output']))($type, $buffer); |
91 | 91 | }; |
@@ -122,6 +122,6 @@ discard block |
||
122 | 122 | private function parseExitStatus(Process $process): int |
123 | 123 | { |
124 | 124 | preg_match('/\[exit_code:(\d*)]/', $process->getOutput(), $match); |
125 | - return (int)($match[1] ?? -1); |
|
125 | + return (int) ($match[1] ?? -1); |
|
126 | 126 | } |
127 | 127 | } |
@@ -263,7 +263,7 @@ |
||
263 | 263 | |
264 | 264 | $factory = $this->values[$id]; |
265 | 265 | |
266 | - $extended = function ($c) use ($callable, $factory) { |
|
266 | + $extended = function($c) use ($callable, $factory) { |
|
267 | 267 | return $callable($factory($c), $c); |
268 | 268 | }; |
269 | 269 |
@@ -38,7 +38,7 @@ |
||
38 | 38 | */ |
39 | 39 | public function callback(Host $host, bool $forceOutput): callable |
40 | 40 | { |
41 | - return function ($type, $buffer) use ($forceOutput, $host) { |
|
41 | + return function($type, $buffer) use ($forceOutput, $host) { |
|
42 | 42 | if ($this->output->isVerbose() || $forceOutput) { |
43 | 43 | $this->printBuffer($type, $host, $buffer); |
44 | 44 | } |
@@ -52,7 +52,7 @@ |
||
52 | 52 | $this->pop->command($host, 'run', $command); |
53 | 53 | |
54 | 54 | $terminalOutput = $this->pop->callback($host, $config['real_time_output']); |
55 | - $callback = function ($type, $buffer) use ($host, $terminalOutput) { |
|
55 | + $callback = function($type, $buffer) use ($host, $terminalOutput) { |
|
56 | 56 | $this->logger->printBuffer($host, $type, $buffer); |
57 | 57 | $terminalOutput($type, $buffer); |
58 | 58 | }; |