Skip to content

Commit

Permalink
rector
Browse files Browse the repository at this point in the history
  • Loading branch information
vjik committed Feb 18, 2024
1 parent 98121e5 commit 7625b24
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"rector/rector": "^1.0.0",
"roave/infection-static-analysis-plugin": "^1.16",
"spatie/phpunit-watcher": "^1.23",
"vimeo/psalm": "^4.30|^5.8",
"vimeo/psalm": "^5.22",
"yiisoft/active-record": "3.0.x-dev",
"yiisoft/assets": "^4.0",
"yiisoft/csrf": "^2.0",
Expand Down
13 changes: 12 additions & 1 deletion rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

use Rector\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector;
use Rector\Config\RectorConfig;
use Rector\Php73\Rector\FuncCall\JsonThrowOnErrorRector;
use Rector\Php74\Rector\Closure\ClosureToArrowFunctionRector;
use Rector\Php81\Rector\Property\ReadOnlyPropertyRector;
use Rector\Php81\Rector\FuncCall\NullToStrictStringFuncCallArgRector;
use Rector\Set\ValueObject\LevelSetList;

return static function (RectorConfig $rectorConfig): void {
Expand All @@ -17,6 +21,13 @@

// define sets of rules
$rectorConfig->sets([
LevelSetList::UP_TO_PHP_80,
LevelSetList::UP_TO_PHP_81,
]);

$rectorConfig->skip([
ClosureToArrowFunctionRector::class,
JsonThrowOnErrorRector::class,
ReadOnlyPropertyRector::class,
NullToStrictStringFuncCallArgRector::class,
]);
};
2 changes: 1 addition & 1 deletion src/Inspector/Controller/GitController.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function log(): ResponseInterface
$result = [
'currentBranch' => $branch->getName(),
'sha' => $branch->getCommitHash(),
'commits' => array_map([$this, 'serializeCommit'], $git->getLog(limit: 20)->getCommits()),
'commits' => array_map($this->serializeCommit(...), $git->getLog(limit: 20)->getCommits()),

Check warning on line 61 in src/Inspector/Controller/GitController.php

View check run for this annotation

Codecov / codecov/patch

src/Inspector/Controller/GitController.php#L61

Added line #L61 was not covered by tests
];
$response = VarDumper::create($result)->asPrimitives(255);
return $this->responseFactory->createResponse($response);
Expand Down

0 comments on commit 7625b24

Please sign in to comment.