@@ -376,7 +376,7 @@ discard block |
||
| 376 | 376 | 'active' => $active, |
| 377 | 377 | 'name' => $name, |
| 378 | 378 | 'url' => $url, |
| 379 | - 'selected' => $this->isCurrentItem([ $linkIdent, (string)$url ]), |
|
| 379 | + 'selected' => $this->isCurrentItem([$linkIdent, (string)$url]), |
|
| 380 | 380 | 'required_acl_permissions' => $permissions |
| 381 | 381 | ]; |
| 382 | 382 | } else { |
@@ -481,7 +481,7 @@ discard block |
||
| 481 | 481 | */ |
| 482 | 482 | public function displayAsPanel() |
| 483 | 483 | { |
| 484 | - return in_array($this->displayType(), [ 'panel', 'collapsible' ]); |
|
| 484 | + return in_array($this->displayType(), ['panel', 'collapsible']); |
|
| 485 | 485 | } |
| 486 | 486 | |
| 487 | 487 | /** |
@@ -587,10 +587,10 @@ discard block |
||
| 587 | 587 | $this->addGroup($groupIdent, $group); |
| 588 | 588 | } |
| 589 | 589 | |
| 590 | - uasort($this->groups, [ $this, 'sortGroupsByPriority' ]); |
|
| 590 | + uasort($this->groups, [$this, 'sortGroupsByPriority']); |
|
| 591 | 591 | |
| 592 | 592 | // Remove items that are not active. |
| 593 | - $this->groups = array_filter($this->groups, function($item) { |
|
| 593 | + $this->groups = array_filter($this->groups, function ($item) { |
|
| 594 | 594 | return ($item->active()); |
| 595 | 595 | }); |
| 596 | 596 | |
@@ -902,7 +902,7 @@ discard block |
||
| 902 | 902 | 'cssClasses' => 'js-toggle-filemanager', |
| 903 | 903 | 'priority' => 90 |
| 904 | 904 | ]; |
| 905 | - $this->defaultSidemenuActions = [ $library ]; |
|
| 905 | + $this->defaultSidemenuActions = [$library]; |
|
| 906 | 906 | } |
| 907 | 907 | |
| 908 | 908 | return $this->defaultSidemenuActions; |
@@ -422,7 +422,7 @@ discard block |
||
| 422 | 422 | } |
| 423 | 423 | } |
| 424 | 424 | |
| 425 | - usort($sidebarActions, [ $this, 'sortActionsByPriority' ]); |
|
| 425 | + usort($sidebarActions, [$this, 'sortActionsByPriority']); |
|
| 426 | 426 | |
| 427 | 427 | while (($first = reset($sidebarActions)) && $first['isSeparator']) { |
| 428 | 428 | array_shift($sidebarActions); |
@@ -485,7 +485,7 @@ discard block |
||
| 485 | 485 | $obj = $this->form()->obj(); |
| 486 | 486 | $this->isObjDeletable = !!$obj->id(); |
| 487 | 487 | |
| 488 | - $method = [ $obj, 'isDeletable' ]; |
|
| 488 | + $method = [$obj, 'isDeletable']; |
|
| 489 | 489 | if (is_callable($method)) { |
| 490 | 490 | $this->isObjDeletable = call_user_func($method); |
| 491 | 491 | } |
@@ -514,7 +514,7 @@ discard block |
||
| 514 | 514 | $this->isObjResettable = true; |
| 515 | 515 | |
| 516 | 516 | $obj = $this->form()->obj(); |
| 517 | - $method = [ $obj, 'isResettable' ]; |
|
| 517 | + $method = [$obj, 'isResettable']; |
|
| 518 | 518 | if (is_callable($method)) { |
| 519 | 519 | $this->isObjResettable = call_user_func($method); |
| 520 | 520 | } |
@@ -542,7 +542,7 @@ discard block |
||
| 542 | 542 | $this->isObjSavable = true; |
| 543 | 543 | |
| 544 | 544 | $obj = $this->form()->obj(); |
| 545 | - $method = [ $obj, 'isSavable' ]; |
|
| 545 | + $method = [$obj, 'isSavable']; |
|
| 546 | 546 | if (is_callable($method)) { |
| 547 | 547 | $this->isObjSavable = call_user_func($method); |
| 548 | 548 | } |
@@ -570,7 +570,7 @@ discard block |
||
| 570 | 570 | $obj = $this->form()->obj(); |
| 571 | 571 | $this->isObjViewable = !!$obj->id(); |
| 572 | 572 | |
| 573 | - $method = [ $obj, 'isViewable' ]; |
|
| 573 | + $method = [$obj, 'isViewable']; |
|
| 574 | 574 | if (is_callable($method)) { |
| 575 | 575 | $this->isObjViewable = call_user_func($method); |
| 576 | 576 | } |
@@ -736,7 +736,7 @@ discard block |
||
| 736 | 736 | $locales = $this->translator()->locales(); |
| 737 | 737 | $languages = []; |
| 738 | 738 | |
| 739 | - uasort($locales, [ $this, 'sortLanguagesByPriority' ]); |
|
| 739 | + uasort($locales, [$this, 'sortLanguagesByPriority']); |
|
| 740 | 740 | |
| 741 | 741 | foreach ($locales as $locale => $localeStruct) { |
| 742 | 742 | /** |
@@ -792,9 +792,9 @@ discard block |
||
| 792 | 792 | protected function resolveConditionalLogic($condition) |
| 793 | 793 | { |
| 794 | 794 | $renderer = $this->getActionRenderer(); |
| 795 | - if ($renderer && is_callable([ $renderer, $condition ])) { |
|
| 795 | + if ($renderer && is_callable([$renderer, $condition])) { |
|
| 796 | 796 | return !!$renderer->{$condition}(); |
| 797 | - } elseif (is_callable([ $this, $condition ])) { |
|
| 797 | + } elseif (is_callable([$this, $condition])) { |
|
| 798 | 798 | return !!$this->{$condition}(); |
| 799 | 799 | } elseif (is_callable($condition)) { |
| 800 | 800 | return !!$condition(); |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | private function retrieveLinks($url, $level) |
| 197 | 197 | { |
| 198 | 198 | $crawler = $this->goutteClient->request('GET', $url); |
| 199 | - $crawler->filter('a')->each(function($item) use ($level) { |
|
| 199 | + $crawler->filter('a')->each(function ($item) use ($level) { |
|
| 200 | 200 | $href = $item->attr('href'); |
| 201 | 201 | $parsedHref = parse_url($href); |
| 202 | 202 | if (isset($parsedHref['host']) && ($parsedHref['host'] !== $this->parsedStartUrl['host'])) { |
@@ -234,7 +234,7 @@ discard block |
||
| 234 | 234 | $this->climate()->out('Deleting '.$dir); |
| 235 | 235 | return; |
| 236 | 236 | |
| 237 | - $files = array_diff(scandir($dir), ['.','..']); |
|
| 237 | + $files = array_diff(scandir($dir), ['.', '..']); |
|
| 238 | 238 | foreach ($files as $file) { |
| 239 | 239 | $f = $dir.'/'.$file; |
| 240 | 240 | if (is_dir($f)) { |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | 'on_stats' => function (TransferStats $stats) { |
| 141 | 141 | if ($stats->hasResponse()) { |
| 142 | 142 | $code = $stats->getResponse()->getStatusCode(); |
| 143 | - $transferTime = (1000*$stats->getTransferTime()); |
|
| 143 | + $transferTime = (1000 * $stats->getTransferTime()); |
|
| 144 | 144 | $effectiveUrl = (string)$stats->getEffectiveUri(); |
| 145 | 145 | if ($this->verbose() && $code > 200 && $code < 400) { |
| 146 | 146 | $this->climate()->orange(sprintf( |
@@ -185,7 +185,7 @@ discard block |
||
| 185 | 185 | { |
| 186 | 186 | |
| 187 | 187 | $crawler = $this->goutteClient->request('GET', $url); |
| 188 | - $crawler->filter('a')->each(function($item) use ($level) { |
|
| 188 | + $crawler->filter('a')->each(function ($item) use ($level) { |
|
| 189 | 189 | $href = $item->attr('href'); |
| 190 | 190 | if (in_array($href, $this->processedUrls)) { |
| 191 | 191 | return; |
@@ -68,7 +68,7 @@ |
||
| 68 | 68 | public function run(RequestInterface $request, ResponseInterface $response) |
| 69 | 69 | { |
| 70 | 70 | $translator = $this->translator(); |
| 71 | - $ip = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : null; |
|
| 71 | + $ip = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : null; |
|
| 72 | 72 | |
| 73 | 73 | $username = $request->getParam('username'); |
| 74 | 74 | if (!$username) { |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | $parts = parse_url($val); |
| 123 | - if (empty($parts['scheme']) && !in_array($val[0], [ '/', '#', '?' ])) { |
|
| 123 | + if (empty($parts['scheme']) && !in_array($val[0], ['/', '#', '?'])) { |
|
| 124 | 124 | $path = isset($parts['path']) ? ltrim($parts['path'], '/') : ''; |
| 125 | 125 | $query = isset($parts['query']) ? $parts['query'] : ''; |
| 126 | 126 | $hash = isset($parts['fragment']) ? $parts['fragment'] : ''; |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | } |
| 144 | 144 | |
| 145 | 145 | $parts = parse_url($val); |
| 146 | - if (empty($parts['scheme']) && !in_array($val[0], [ '/', '#', '?' ])) { |
|
| 146 | + if (empty($parts['scheme']) && !in_array($val[0], ['/', '#', '?'])) { |
|
| 147 | 147 | $path = isset($parts['path']) ? ltrim($parts['path'], '/') : ''; |
| 148 | 148 | $query = isset($parts['query']) ? $parts['query'] : ''; |
| 149 | 149 | $hash = isset($parts['fragment']) ? $parts['fragment'] : ''; |
@@ -331,7 +331,7 @@ discard block |
||
| 331 | 331 | */ |
| 332 | 332 | protected function defaultDataSources() |
| 333 | 333 | { |
| 334 | - return [ static::DATA_SOURCE_REQUEST, static::DATA_SOURCE_OBJECT ]; |
|
| 334 | + return [static::DATA_SOURCE_REQUEST, static::DATA_SOURCE_OBJECT]; |
|
| 335 | 335 | } |
| 336 | 336 | |
| 337 | 337 | /** |
@@ -361,7 +361,7 @@ discard block |
||
| 361 | 361 | if (is_string($toResolve)) { |
| 362 | 362 | $obj = $this->obj(); |
| 363 | 363 | |
| 364 | - $resolved = [ $obj, $toResolve ]; |
|
| 364 | + $resolved = [$obj, $toResolve]; |
|
| 365 | 365 | |
| 366 | 366 | // check for slim callable as "class:method" |
| 367 | 367 | $callablePattern = '!^([^\:]+)\:([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)$!'; |
@@ -370,7 +370,7 @@ discard block |
||
| 370 | 370 | $method = $matches[2]; |
| 371 | 371 | |
| 372 | 372 | if ($class === 'parent') { |
| 373 | - $resolved = [ $obj, $class.'::'.$method ]; |
|
| 373 | + $resolved = [$obj, $class.'::'.$method]; |
|
| 374 | 374 | } |
| 375 | 375 | } |
| 376 | 376 | |
@@ -388,7 +388,7 @@ discard block |
||
| 388 | 388 | protected function acceptedRequestData() |
| 389 | 389 | { |
| 390 | 390 | return array_merge( |
| 391 | - [ 'obj_type', 'obj_id', 'template' ], |
|
| 391 | + ['obj_type', 'obj_id', 'template'], |
|
| 392 | 392 | parent::acceptedRequestData() |
| 393 | 393 | ); |
| 394 | 394 | } |
@@ -331,7 +331,7 @@ discard block |
||
| 331 | 331 | */ |
| 332 | 332 | protected function defaultDataSources() |
| 333 | 333 | { |
| 334 | - return [ static::DATA_SOURCE_REQUEST, static::DATA_SOURCE_OBJECT ]; |
|
| 334 | + return [static::DATA_SOURCE_REQUEST, static::DATA_SOURCE_OBJECT]; |
|
| 335 | 335 | } |
| 336 | 336 | |
| 337 | 337 | /** |
@@ -361,7 +361,7 @@ discard block |
||
| 361 | 361 | if (is_string($toResolve)) { |
| 362 | 362 | $obj = $this->obj(); |
| 363 | 363 | |
| 364 | - $resolved = [ $obj, $toResolve ]; |
|
| 364 | + $resolved = [$obj, $toResolve]; |
|
| 365 | 365 | |
| 366 | 366 | // check for slim callable as "class:method" |
| 367 | 367 | $callablePattern = '!^([^\:]+)\:([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)$!'; |
@@ -370,7 +370,7 @@ discard block |
||
| 370 | 370 | $method = $matches[2]; |
| 371 | 371 | |
| 372 | 372 | if ($class === 'parent') { |
| 373 | - $resolved = [ $obj, $class.'::'.$method ]; |
|
| 373 | + $resolved = [$obj, $class.'::'.$method]; |
|
| 374 | 374 | } |
| 375 | 375 | } |
| 376 | 376 | |
@@ -388,7 +388,7 @@ discard block |
||
| 388 | 388 | protected function acceptedRequestData() |
| 389 | 389 | { |
| 390 | 390 | return array_merge( |
| 391 | - [ 'obj_type', 'obj_id', 'template' ], |
|
| 391 | + ['obj_type', 'obj_id', 'template'], |
|
| 392 | 392 | parent::acceptedRequestData() |
| 393 | 393 | ); |
| 394 | 394 | } |
@@ -174,7 +174,7 @@ |
||
| 174 | 174 | */ |
| 175 | 175 | protected function isFeedbackDismissable($level) |
| 176 | 176 | { |
| 177 | - return in_array($level, [ 'log', 'debug', 'info', 'notice' ]); |
|
| 177 | + return in_array($level, ['log', 'debug', 'info', 'notice']); |
|
| 178 | 178 | } |
| 179 | 179 | |
| 180 | 180 | /** |