@@ -334,7 +334,7 @@ |
||
334 | 334 | } |
335 | 335 | } |
336 | 336 | // fixme: add 'user repos'! |
337 | - return array_map(function ($org) { |
|
337 | + return array_map(function($org) { |
|
338 | 338 | return $org['login']; |
339 | 339 | }, $this->orgs); |
340 | 340 | } |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | 'versions' => implode(',', $issue->getVersions()), |
262 | 262 | 'updated' => $issue->getUpdated(), |
263 | 263 | ]); |
264 | - return (bool)$ok; |
|
264 | + return (bool) $ok; |
|
265 | 265 | } |
266 | 266 | |
267 | 267 | /** |
@@ -393,7 +393,7 @@ discard block |
||
393 | 393 | if (!$util->isValidTimeStamp($rev)) { |
394 | 394 | throw new InvalidArgumentException("Second parameter must be a valid timestamp!"); |
395 | 395 | } |
396 | - if ((int)$rev === 0) { |
|
396 | + if ((int) $rev === 0) { |
|
397 | 397 | $rev = filemtime(wikiFN($page)); |
398 | 398 | $changelog = new PageChangelog($page); |
399 | 399 | $rev_info = $changelog->getRevisionInfo($rev); |
@@ -401,7 +401,7 @@ discard block |
||
401 | 401 | $this->savePageRev($page, $rev, $rev_info['sum'], $user); |
402 | 402 | } |
403 | 403 | /** @noinspection TypeUnsafeComparisonInspection this is done to ensure $issue_id is a natural number */ |
404 | - if (!is_numeric($issue_id) || (int)$issue_id != $issue_id) { |
|
404 | + if (!is_numeric($issue_id) || (int) $issue_id != $issue_id) { |
|
405 | 405 | throw new InvalidArgumentException("IssueId must be an integer!"); |
406 | 406 | } |
407 | 407 | $ok = $this->saveEntity('pagerev_issues', [ |
@@ -414,7 +414,7 @@ discard block |
||
414 | 414 | 'type' => $type, |
415 | 415 | ]); |
416 | 416 | |
417 | - return (bool)$ok; |
|
417 | + return (bool) $ok; |
|
418 | 418 | } |
419 | 419 | |
420 | 420 | /** |
@@ -443,7 +443,7 @@ discard block |
||
443 | 443 | 'summary' => $summary, |
444 | 444 | 'user' => $user, |
445 | 445 | ]); |
446 | - return (bool)$ok; |
|
446 | + return (bool) $ok; |
|
447 | 447 | } |
448 | 448 | |
449 | 449 | /** |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | public function sendResponse($code, $msg) |
87 | 87 | { |
88 | 88 | header('Content-Type: application/json'); |
89 | - if ((int)$code === 204) { |
|
89 | + if ((int) $code === 204) { |
|
90 | 90 | http_status(200); |
91 | 91 | } else { |
92 | 92 | http_status($code); |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | */ |
108 | 108 | public function isValidTimeStamp($timestamp) |
109 | 109 | { |
110 | - return ((string)(int)$timestamp === (string)$timestamp); |
|
110 | + return ((string) (int) $timestamp === (string) $timestamp); |
|
111 | 111 | } |
112 | 112 | |
113 | 113 | } |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | { |
203 | 203 | $groups = $this->makeSingleGitLabGetRequest('/groups'); |
204 | 204 | |
205 | - return array_map(function ($group) { |
|
205 | + return array_map(function($group) { |
|
206 | 206 | return $group['full_path']; |
207 | 207 | }, $groups); |
208 | 208 | |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | try { |
226 | 226 | $repoHooks = $this->makeSingleGitLabGetRequest("/projects/$organisation%2F{$project['path']}/hooks?per_page=100"); |
227 | 227 | } catch (HTTPRequestException $e) { |
228 | - $repo->error = (int)$e->getCode(); |
|
228 | + $repo->error = (int) $e->getCode(); |
|
229 | 229 | } |
230 | 230 | |
231 | 231 | $repoHooks = array_filter($repoHooks, [$this, 'isOurIssueHook']); |
@@ -381,7 +381,7 @@ discard block |
||
381 | 381 | $versions = array_map('trim', explode(',', $versions)); |
382 | 382 | } |
383 | 383 | if (!empty($versions[0]['name'])) { |
384 | - $versions = array_map(function ($version) { |
|
384 | + $versions = array_map(function($version) { |
|
385 | 385 | return $version['name']; |
386 | 386 | }, $versions); |
387 | 387 | } |
@@ -409,7 +409,7 @@ discard block |
||
409 | 409 | if (!$util->isValidTimeStamp($updated)) { |
410 | 410 | $updated = strtotime($updated); |
411 | 411 | } |
412 | - $this->updated = (int)$updated; |
|
412 | + $this->updated = (int) $updated; |
|
413 | 413 | return $this; |
414 | 414 | } |
415 | 415 | |
@@ -690,7 +690,7 @@ discard block |
||
690 | 690 | private function calculateColor($color) |
691 | 691 | { |
692 | 692 | /** @noinspection PrintfScanfArgumentsInspection */ |
693 | - list($r, $g, $b) = array_map(function ($color8bit) { |
|
693 | + list($r, $g, $b) = array_map(function($color8bit) { |
|
694 | 694 | $c = $color8bit / 255; |
695 | 695 | if ($c <= 0.03928) { |
696 | 696 | $cl = $c / 12.92; |
@@ -146,7 +146,7 @@ |
||
146 | 146 | global $INPUT; |
147 | 147 | $reconfigureURL = $INPUT->server->str('REQUEST_URI') . '&reconfigureService=' . $serviceID; |
148 | 148 | $reconfigureLink = "<a href=\"$reconfigureURL\">{$this->getLang('label: reconfigure service')}</a>"; |
149 | - $authorizedUserLabel = sprintf($this->getLang('label: authorized with user'),$service->getUserString()); |
|
149 | + $authorizedUserLabel = sprintf($this->getLang('label: authorized with user'), $service->getUserString()); |
|
150 | 150 | $form = new \dokuwiki\Form\Form(['data-service' => $serviceID]); |
151 | 151 | $form->addFieldsetOpen($this->getLang('legend:user')); |
152 | 152 | $form->addTagOpen('p'); |
@@ -142,7 +142,7 @@ |
||
142 | 142 | $html = '<div class="org_repos">'; |
143 | 143 | $html .= '<p>Below are the repositories of the organisation to which the authorized user has access to. Click on the icon to create/delete the webhook.</p>'; |
144 | 144 | $html .= '<div><ul>'; |
145 | - usort($repos, function ($repo1, $repo2) { |
|
145 | + usort($repos, function($repo1, $repo2) { |
|
146 | 146 | return $repo1->displayName < $repo2->displayName ? -1 : 1; |
147 | 147 | }); |
148 | 148 | $importSVG = inlineSVG(__DIR__ . '/../images/import.svg'); |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | * Simple test to make sure the plugin.info.txt is in correct format |
12 | 12 | */ |
13 | 13 | public function test_plugininfo() { |
14 | - $file = __DIR__.'/../plugin.info.txt'; |
|
14 | + $file = __DIR__ . '/../plugin.info.txt'; |
|
15 | 15 | $this->assertFileExists($file); |
16 | 16 | |
17 | 17 | $info = confToHash($file); |
@@ -36,23 +36,23 @@ discard block |
||
36 | 36 | * conf/metadata.php. |
37 | 37 | */ |
38 | 38 | public function test_plugin_conf() { |
39 | - $conf_file = __DIR__.'/../conf/default.php'; |
|
40 | - if (file_exists($conf_file)){ |
|
39 | + $conf_file = __DIR__ . '/../conf/default.php'; |
|
40 | + if (file_exists($conf_file)) { |
|
41 | 41 | include($conf_file); |
42 | 42 | } |
43 | - $meta_file = __DIR__.'/../conf/metadata.php'; |
|
43 | + $meta_file = __DIR__ . '/../conf/metadata.php'; |
|
44 | 44 | if (file_exists($meta_file)) { |
45 | 45 | include($meta_file); |
46 | 46 | } |
47 | 47 | |
48 | - $this->assertEquals(gettype($conf), gettype($meta),'Both ' . DOKU_PLUGIN . 'issuelinks/conf/default.php and ' . DOKU_PLUGIN . 'issuelinks/conf/metadata.php have to exist and contain the same keys.'); |
|
48 | + $this->assertEquals(gettype($conf), gettype($meta), 'Both ' . DOKU_PLUGIN . 'issuelinks/conf/default.php and ' . DOKU_PLUGIN . 'issuelinks/conf/metadata.php have to exist and contain the same keys.'); |
|
49 | 49 | |
50 | 50 | if (gettype($conf) != 'NULL' && gettype($meta) != 'NULL') { |
51 | - foreach($conf as $key => $value) { |
|
51 | + foreach ($conf as $key => $value) { |
|
52 | 52 | $this->assertArrayHasKey($key, $meta, 'Key $meta[\'' . $key . '\'] missing in ' . DOKU_PLUGIN . 'issuelinks/conf/metadata.php'); |
53 | 53 | } |
54 | 54 | |
55 | - foreach($meta as $key => $value) { |
|
55 | + foreach ($meta as $key => $value) { |
|
56 | 56 | $this->assertArrayHasKey($key, $conf, 'Key $conf[\'' . $key . '\'] missing in ' . DOKU_PLUGIN . 'issuelinks/conf/default.php'); |
57 | 57 | } |
58 | 58 | } |