Skip to content

Commit

Permalink
Merge pull request #4752 from samsonasik/apply-rector-move-variable
Browse files Browse the repository at this point in the history
[Rector] Apply Rector: MoveVariableDeclarationNearReferenceRector
  • Loading branch information
samsonasik authored May 30, 2021
2 parents 2c3f989 + ab11e7a commit b0552ba
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
"fakerphp/faker": "^1.9",
"mikey179/vfsstream": "^1.6",
"nexusphp/tachycardia": "^1.0",
"phpstan/phpstan": "0.12.86",
"phpstan/phpstan": "0.12.88",
"phpunit/phpunit": "^9.1",
"predis/predis": "^1.1",
"rector/rector": "0.11.2",
"rector/rector": "0.11.7",
"squizlabs/php_codesniffer": "^3.3",
"symplify/package-builder": "^9.3"
},
Expand Down
2 changes: 2 additions & 0 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use Rector\CodeQuality\Rector\If_\SimplifyIfReturnBoolRector;
use Rector\CodeQuality\Rector\Return_\SimplifyUselessVariableRector;
use Rector\CodeQuality\Rector\Ternary\UnnecessaryTernaryExpressionRector;
use Rector\CodeQualityStrict\Rector\Variable\MoveVariableDeclarationNearReferenceRector;
use Rector\CodingStyle\Rector\FuncCall\CountArrayToEmptyArrayComparisonRector;
use Rector\Core\Configuration\Option;
use Rector\Core\ValueObject\PhpVersion;
Expand Down Expand Up @@ -90,4 +91,5 @@
$services->set(RemoveErrorSuppressInTryCatchStmtsRector::class);
$services->set(TernaryToNullCoalescingRector::class);
$services->set(ListToArrayDestructRector::class);
$services->set(MoveVariableDeclarationNearReferenceRector::class);
};
3 changes: 1 addition & 2 deletions system/Pager/Pager.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,11 @@ public function makeLinks(int $page, ?int $perPage, int $total, string $template
*/
protected function displayLinks(string $group, string $template): string
{
$pager = new PagerRenderer($this->getDetails($group));

if (! array_key_exists($template, $this->config->templates))
{
throw PagerException::forInvalidTemplate($template);
}
$pager = new PagerRenderer($this->getDetails($group));

return $this->view->setVar('pager', $pager)
->render($this->config->templates[$template]);
Expand Down

0 comments on commit b0552ba

Please sign in to comment.