GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Passed
Push — master ( 4b7e13...66a168 )
by Anton
09:24
created
src/Deployer.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -86,19 +86,19 @@  discard block
 block discarded – undo
86 86
             new InputOption('file', 'f', InputOption::VALUE_REQUIRED, 'Recipe file path'),
87 87
         );
88 88
 
89
-        $this['console'] = function () use ($console) {
89
+        $this['console'] = function() use ($console) {
90 90
             return $console;
91 91
         };
92
-        $this['input'] = function () {
92
+        $this['input'] = function() {
93 93
             throw new \RuntimeException('Uninitialized "input" in Deployer container.');
94 94
         };
95
-        $this['output'] = function () {
95
+        $this['output'] = function() {
96 96
             throw new \RuntimeException('Uninitialized "output" in Deployer container.');
97 97
         };
98
-        $this['inputDefinition'] = function () {
98
+        $this['inputDefinition'] = function() {
99 99
             return new InputDefinition();
100 100
         };
101
-        $this['questionHelper'] = function () {
101
+        $this['questionHelper'] = function() {
102 102
             return $this->getHelper('question');
103 103
         };
104 104
 
@@ -106,12 +106,12 @@  discard block
 block discarded – undo
106 106
          *           Config           *
107 107
          ******************************/
108 108
 
109
-        $this['config'] = function () {
109
+        $this['config'] = function() {
110 110
             return new Configuration();
111 111
         };
112 112
         // -l  act as if it had been invoked as a login shell (i.e. source ~/.profile file)
113 113
         // -s  commands are read from the standard input (no arguments should remain after this option)
114
-        $this->config['shell'] = function () {
114
+        $this->config['shell'] = function() {
115 115
             if (currentHost() instanceof Localhost) {
116 116
                 return 'bash -s'; // Non-login shell for localhost.
117 117
             }
@@ -124,37 +124,37 @@  discard block
 block discarded – undo
124 124
          *            Core            *
125 125
          ******************************/
126 126
 
127
-        $this['pop'] = function ($c) {
127
+        $this['pop'] = function($c) {
128 128
             return new Printer($c['output']);
129 129
         };
130
-        $this['sshClient'] = function ($c) {
130
+        $this['sshClient'] = function($c) {
131 131
             return new SshClient($c['output'], $c['pop'], $c['logger']);
132 132
         };
133
-        $this['rsync'] = function ($c) {
133
+        $this['rsync'] = function($c) {
134 134
             return new Rsync($c['pop'], $c['output']);
135 135
         };
136
-        $this['processRunner'] = function ($c) {
136
+        $this['processRunner'] = function($c) {
137 137
             return new ProcessRunner($c['pop'], $c['logger']);
138 138
         };
139
-        $this['tasks'] = function () {
139
+        $this['tasks'] = function() {
140 140
             return new TaskCollection();
141 141
         };
142
-        $this['hosts'] = function () {
142
+        $this['hosts'] = function() {
143 143
             return new HostCollection();
144 144
         };
145
-        $this['scriptManager'] = function ($c) {
145
+        $this['scriptManager'] = function($c) {
146 146
             return new ScriptManager($c['tasks']);
147 147
         };
148
-        $this['selector'] = function ($c) {
148
+        $this['selector'] = function($c) {
149 149
             return new Selector($c['hosts']);
150 150
         };
151
-        $this['fail'] = function () {
151
+        $this['fail'] = function() {
152 152
             return new Collection();
153 153
         };
154
-        $this['messenger'] = function ($c) {
154
+        $this['messenger'] = function($c) {
155 155
             return new Messenger($c['input'], $c['output'], $c['logger']);
156 156
         };
157
-        $this['master'] = function ($c) {
157
+        $this['master'] = function($c) {
158 158
             return new Master(
159 159
                 $c['hosts'],
160 160
                 $c['input'],
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
                 $c['messenger'],
163 163
             );
164 164
         };
165
-        $this['importer'] = function () {
165
+        $this['importer'] = function() {
166 166
             return new Importer();
167 167
         };
168 168
 
@@ -170,12 +170,12 @@  discard block
 block discarded – undo
170 170
          *           Logger           *
171 171
          ******************************/
172 172
 
173
-        $this['log_handler'] = function () {
173
+        $this['log_handler'] = function() {
174 174
             return !empty($this['log'])
175 175
                 ? new FileHandler($this['log'])
176 176
                 : new NullHandler();
177 177
         };
178
-        $this['logger'] = function () {
178
+        $this['logger'] = function() {
179 179
             return new Logger($this['log_handler']);
180 180
         };
181 181
 
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
         $output->writeln([
306 306
             "<fg=white;bg=red> {$class} </> <comment>in {$file} on line {$exception->getLine()}:</>",
307 307
             "",
308
-            implode("\n", array_map(function ($line) {
308
+            implode("\n", array_map(function($line) {
309 309
                 return "  " . $line;
310 310
             }, explode("\n", $exception->getMessage()))),
311 311
             "",
Please login to merge, or discard this patch.
tests/src/Ssh/IOArgumentsTest.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -20,8 +20,8 @@  discard block
 block discarded – undo
20 20
             new InputOption('plan', null, InputOption::VALUE_NONE, 'Show execution plan'),
21 21
             new InputOption('start-from', null, InputOption::VALUE_REQUIRED, 'Start execution from this task'),
22 22
             new InputOption('log', null, InputOption::VALUE_REQUIRED, 'Write log to a file'),
23
-            new InputOption('profile', null, InputOption::VALUE_REQUIRED, 'Write profile to a file', ),
24
-            new InputOption('ansi', null, InputOption::VALUE_OPTIONAL, 'Force ANSI output', ),
23
+            new InputOption('profile', null, InputOption::VALUE_REQUIRED, 'Write profile to a file',),
24
+            new InputOption('ansi', null, InputOption::VALUE_OPTIONAL, 'Force ANSI output',),
25 25
         ]);
26 26
 
27 27
         $args = IOArguments::collect(
@@ -29,6 +29,6 @@  discard block
 block discarded – undo
29 29
             new ConsoleOutput(OutputInterface::VERBOSITY_DEBUG, false),
30 30
         );
31 31
 
32
-        self::assertEquals(['--option','env=prod', '--limit', '1', '-vvv'], $args);
32
+        self::assertEquals(['--option', 'env=prod', '--limit', '1', '-vvv'], $args);
33 33
     }
34 34
 }
Please login to merge, or discard this patch.
src/ProcessRunner/Printer.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@
 block discarded – undo
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
             }
Please login to merge, or discard this patch.
src/Configuration.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -115,7 +115,7 @@
 block discarded – undo
115 115
     {
116 116
         if (is_string($value)) {
117 117
             $normalizedValue = normalize_line_endings($value);
118
-            return preg_replace_callback('/\{\{\s*([\w\.\/-]+)\s*\}\}/', function (array $matches) {
118
+            return preg_replace_callback('/\{\{\s*([\w\.\/-]+)\s*\}\}/', function(array $matches) {
119 119
                 return $this->get($matches[1]);
120 120
             }, $normalizedValue);
121 121
         }
Please login to merge, or discard this patch.
src/Support/helpers.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
 function array_flatten(array $array): array
14 14
 {
15 15
     $flatten = [];
16
-    array_walk_recursive($array, function ($value) use (&$flatten) {
16
+    array_walk_recursive($array, function($value) use (&$flatten) {
17 17
         $flatten[] = $value;
18 18
     });
19 19
     return $flatten;
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 function env_stringify(array $array): string
58 58
 {
59 59
     return implode(' ', array_map(
60
-        function ($key, $value) {
60
+        function($key, $value) {
61 61
             return sprintf("%s=%s", $key, escapeshellarg((string) $value));
62 62
         },
63 63
         array_keys($array),
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
     }
133 133
 
134 134
     if (getenv('COLORTERM') === 'truecolor') {
135
-        $hsv = function ($h, $s, $v) {
135
+        $hsv = function($h, $s, $v) {
136 136
             $r = $g = $b = $i = $f = $p = $q = $t = 0;
137 137
             $i = floor($h * 6);
138 138
             $f = $h * 6 - $i;
Please login to merge, or discard this patch.
recipe/provision/databases.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@  discard block
 block discarded – undo
2 2
 
3 3
 namespace Deployer;
4 4
 
5
-set('db_type', function () {
5
+set('db_type', function() {
6 6
     $supportedDbTypes = [
7 7
         'none',
8 8
         'mysql',
@@ -12,20 +12,20 @@  discard block
 block discarded – undo
12 12
     return askChoice(' What DB to install? ', $supportedDbTypes, 0);
13 13
 });
14 14
 
15
-set('db_name', function () {
15
+set('db_name', function() {
16 16
     return ask(' DB name: ', 'prod');
17 17
 });
18 18
 
19
-set('db_user', function () {
19
+set('db_user', function() {
20 20
     return ask(' DB user: ', 'deployer');
21 21
 });
22 22
 
23
-set('db_password', function () {
23
+set('db_password', function() {
24 24
     return askHiddenResponse(' DB password: ');
25 25
 });
26 26
 
27 27
 desc('Provision databases');
28
-task('provision:databases', function () {
28
+task('provision:databases', function() {
29 29
     set('remote_user', get('provision_user'));
30 30
 
31 31
     $dbType = get('db_type');
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
     ->limit(1);
38 38
 
39 39
 desc('Provision MySQL');
40
-task('provision:mysql', function () {
40
+task('provision:mysql', function() {
41 41
     run('apt-get install -y mysql-server', env: ['DEBIAN_FRONTEND' => 'noninteractive'], timeout: 900);
42 42
     run("mysql --user=\"root\" -e \"CREATE USER IF NOT EXISTS '{{db_user}}'@'0.0.0.0' IDENTIFIED BY '%secret%';\"", secret: get('db_password'));
43 43
     run("mysql --user=\"root\" -e \"CREATE USER IF NOT EXISTS '{{db_user}}'@'%' IDENTIFIED BY '%secret%';\"", secret: get('db_password'));
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 });
49 49
 
50 50
 desc('Provision MariaDB');
51
-task('provision:mariadb', function () {
51
+task('provision:mariadb', function() {
52 52
     run('apt-get install -y mariadb-server', env: ['DEBIAN_FRONTEND' => 'noninteractive'], timeout: 900);
53 53
     run("mysql --user=\"root\" -e \"CREATE USER IF NOT EXISTS '{{db_user}}'@'0.0.0.0' IDENTIFIED BY '%secret%';\"", secret: get('db_password'));
54 54
     run("mysql --user=\"root\" -e \"CREATE USER IF NOT EXISTS '{{db_user}}'@'%' IDENTIFIED BY '%secret%';\"", secret: get('db_password'));
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 });
60 60
 
61 61
 desc('Provision PostgreSQL');
62
-task('provision:postgresql', function () {
62
+task('provision:postgresql', function() {
63 63
     run('apt-get install -y postgresql postgresql-contrib', env: ['DEBIAN_FRONTEND' => 'noninteractive'], timeout: 900);
64 64
     run("sudo -u postgres psql <<< $'CREATE DATABASE {{db_name}};'");
65 65
     run("sudo -u postgres psql <<< $'CREATE USER {{db_user}} WITH ENCRYPTED PASSWORD \'%secret%\';'", secret: get('db_password'));
Please login to merge, or discard this patch.
recipe/provision/website.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -4,16 +4,16 @@  discard block
 block discarded – undo
4 4
 
5 5
 namespace Deployer;
6 6
 
7
-set('domain', function () {
7
+set('domain', function() {
8 8
     return ask(' Domain: ', get('hostname'));
9 9
 });
10 10
 
11
-set('public_path', function () {
11
+set('public_path', function() {
12 12
     return ask(' Public path: ', 'public');
13 13
 });
14 14
 
15 15
 desc('Configures a server');
16
-task('provision:server', function () {
16
+task('provision:server', function() {
17 17
     set('remote_user', get('provision_user'));
18 18
     run('usermod -a -G www-data caddy');
19 19
     run("mkdir -p /var/deployer");
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 })->oncePerNode();
23 23
 
24 24
 desc('Provision website');
25
-task('provision:website', function () {
25
+task('provision:website', function() {
26 26
     $restoreBecome = become('deployer');
27 27
 
28 28
     run("[ -d {{deploy_path}} ] || mkdir -p {{deploy_path}}");
@@ -66,11 +66,11 @@  discard block
 block discarded – undo
66 66
 })->limit(1);
67 67
 
68 68
 desc('Shows access logs');
69
-task('logs:access', function () {
69
+task('logs:access', function() {
70 70
     run('tail -f {{deploy_path}}/log/access.log');
71 71
 })->verbose();
72 72
 
73 73
 desc('Shows caddy syslog');
74
-task('logs:caddy', function () {
74
+task('logs:caddy', function() {
75 75
     run('sudo journalctl -u caddy -f');
76 76
 })->verbose();
Please login to merge, or discard this patch.
tests/legacy/recipe/env.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -8,14 +8,14 @@
 block discarded – undo
8 8
     'VAR' => 'global',
9 9
 ]);
10 10
 
11
-task('test', function () {
11
+task('test', function() {
12 12
     info('global=' . run('echo $VAR'));
13 13
     info('local=' . run('echo $VAR', env: ['VAR' => 'local']));
14 14
     info('dotenv=' . run('echo $KEY'));
15 15
     info('dotenv=' . run('echo $KEY', env: ['KEY' => 'local']));
16 16
 });
17 17
 
18
-before('test', function () {
18
+before('test', function() {
19 19
     run('mkdir -p {{deploy_path}}');
20 20
     run('echo KEY="\'Hello, world!\'" > {{deploy_path}}/.env');
21 21
     set('dotenv', '{{deploy_path}}/.env');
Please login to merge, or discard this patch.
src/functions.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
  * });
51 51
  * ```
52 52
  */
53
-function host(string ...$hostname): Host|ObjectProxy
53
+function host(string ...$hostname): Host | ObjectProxy
54 54
 {
55 55
     $deployer = Deployer::get();
56 56
     if (count($hostname) === 1 && $deployer->hosts->has($hostname[0])) {
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
         $deployer->hosts->set($aliases[0], $host);
71 71
         return $host;
72 72
     } else {
73
-        $hosts = array_map(function ($hostname) use ($deployer): Host {
73
+        $hosts = array_map(function($hostname) use ($deployer): Host {
74 74
             $host = new Host($hostname);
75 75
             $deployer->hosts->set($hostname, $host);
76 76
             return $host;
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
  * localhost('ci'); // Alias and hostname will be "ci".
88 88
  * ```
89 89
  */
90
-function localhost(string ...$hostnames): Localhost|ObjectProxy
90
+function localhost(string ...$hostnames): Localhost | ObjectProxy
91 91
 {
92 92
     $deployer = Deployer::get();
93 93
     $hostnames = Range::expand($hostnames);
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
         $deployer->hosts->set($host->getAlias(), $host);
98 98
         return $host;
99 99
     } else {
100
-        $hosts = array_map(function ($hostname) use ($deployer): Localhost {
100
+        $hosts = array_map(function($hostname) use ($deployer): Localhost {
101 101
             $host = new Localhost($hostname);
102 102
             $deployer->hosts->set($host->getAlias(), $host);
103 103
             return $host;
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
  * @param callable|array|null $body Callable task, array of other tasks names or nothing to get a defined tasks
184 184
  * @return Task
185 185
  */
186
-function task(string $name, callable|array|null $body = null): Task
186
+function task(string $name, callable | array | null $body = null): Task
187 187
 {
188 188
     $deployer = Deployer::get();
189 189
 
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
  *
236 236
  * @return ?Task
237 237
  */
238
-function before(string $task, string|callable $do): ?Task
238
+function before(string $task, string | callable $do): ?Task
239 239
 {
240 240
     if (is_closure($do)) {
241 241
         $newTask = task("before:$task", $do);
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
  *
256 256
  * @return ?Task
257 257
  */
258
-function after(string $task, string|callable $do): ?Task
258
+function after(string $task, string | callable $do): ?Task
259 259
 {
260 260
     if (is_closure($do)) {
261 261
         $newTask = task("after:$task", $do);
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
  *
277 277
  * @return ?Task
278 278
  */
279
-function fail(string $task, string|callable $do): ?Task
279
+function fail(string $task, string | callable $do): ?Task
280 280
 {
281 281
     if (is_callable($do)) {
282 282
         $newTask = task("fail:$task", $do);
@@ -337,7 +337,7 @@  discard block
 block discarded – undo
337 337
 {
338 338
     $currentBecome = get('become');
339 339
     set('become', $user);
340
-    return function () use ($currentBecome) {
340
+    return function() use ($currentBecome) {
341 341
         set('become', $currentBecome);
342 342
     };
343 343
 }
@@ -400,14 +400,14 @@  discard block
 block discarded – undo
400 400
     ?int    $idleTimeout = null,
401 401
 ): string {
402 402
     $runParams = new RunParams(
403
-        shell: currentHost()->getShell(),
404
-        cwd: $cwd ?? has('working_path') ? get('working_path') : null,
405
-        env: array_merge_alternate(get('env', []), $env ?? []),
406
-        nothrow: $nothrow,
407
-        timeout: $timeout ?? get('default_timeout', 300),
408
-        idleTimeout: $idleTimeout,
409
-        forceOutput: $forceOutput,
410
-        secrets: empty($secret) ? null : ['secret' => $secret],
403
+        shell : currentHost()->getShell(),
404
+        cwd : $cwd ?? has('working_path') ? get('working_path') : null,
405
+        env : array_merge_alternate(get('env', []), $env ?? []),
406
+        nothrow : $nothrow,
407
+        timeout : $timeout ?? get('default_timeout', 300),
408
+        idleTimeout : $idleTimeout,
409
+        forceOutput : $forceOutput,
410
+        secrets : empty($secret) ? null : ['secret' => $secret],
411 411
     );
412 412
 
413 413
     $dotenv = get('dotenv', false);
@@ -415,7 +415,7 @@  discard block
 block discarded – undo
415 415
         $runParams->dotenv = $dotenv;
416 416
     }
417 417
 
418
-    $run = function (string $command, ?RunParams $params = null) use ($runParams): string {
418
+    $run = function(string $command, ?RunParams $params = null) use ($runParams) : string {
419 419
         $params = $params ?? $runParams;
420 420
         $host = currentHost();
421 421
         $command = parse($command);
@@ -490,14 +490,14 @@  discard block
 block discarded – undo
490 490
     ?string $shell = null,
491 491
 ): string {
492 492
     $runParams = new RunParams(
493
-        shell: $shell ?? 'bash -s',
494
-        cwd: $cwd,
495
-        env: $env,
496
-        nothrow: $nothrow,
497
-        timeout: $timeout,
498
-        idleTimeout: $idleTimeout,
499
-        forceOutput: $forceOutput,
500
-        secrets: empty($secret) ? null : ['secret' => $secret],
493
+        shell : $shell ?? 'bash -s',
494
+        cwd : $cwd,
495
+        env : $env,
496
+        nothrow : $nothrow,
497
+        timeout : $timeout,
498
+        idleTimeout : $idleTimeout,
499
+        forceOutput : $forceOutput,
500
+        secrets : empty($secret) ? null : ['secret' => $secret],
501 501
     );
502 502
 
503 503
     $process = Deployer::get()->processRunner;
Please login to merge, or discard this patch.