Skip to content

Commit

Permalink
refactor: clean up rector config and re-run rector
Browse files Browse the repository at this point in the history
  • Loading branch information
samsonasik committed Dec 14, 2024
1 parent d983f20 commit 439dcfa
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
2 changes: 0 additions & 2 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
use Rector\Php55\Rector\String_\StringClassNameToClassConstantRector;
use Rector\Php70\Rector\FuncCall\RandomFunctionRector;
use Rector\Php80\Rector\Class_\ClassPropertyAssignToConstructorPromotionRector;
use Rector\Php80\Rector\FunctionLike\MixedTypeRector;
use Rector\Php81\Rector\FuncCall\NullToStrictStringFuncCallArgRector;
use Rector\PHPUnit\CodeQuality\Rector\Class_\YieldDataProviderRector;
use Rector\PHPUnit\Set\PHPUnitSetList;
Expand Down Expand Up @@ -151,7 +150,6 @@
__DIR__ . '/system/Security/Security.php',
__DIR__ . '/system/Session/Session.php',
],
MixedTypeRector::class,

ReturnNeverTypeRector::class => [
__DIR__ . '/system/Cache/Handlers/BaseHandler.php',
Expand Down
2 changes: 1 addition & 1 deletion system/Session/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ public function start()
if (! isset($_SESSION['__ci_last_regenerate'])) {
$_SESSION['__ci_last_regenerate'] = Time::now()->getTimestamp();
} elseif ($_SESSION['__ci_last_regenerate'] < (Time::now()->getTimestamp() - $regenerateTime)) {
$this->regenerate((bool) $this->config->regenerateDestroy);
$this->regenerate($this->config->regenerateDestroy);
}
}
// Another work-around ... PHP doesn't seem to send the session cookie
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
namespace Utils\Rector;

use PhpParser\Node;
use PhpParser\Node\Expr;
use PhpParser\Node\Expr\ErrorSuppress;
use PhpParser\Node\Stmt\Class_;
use PhpParser\Node\Stmt\Function_;
Expand Down Expand Up @@ -60,7 +61,7 @@ public function refactor(Node $node): ?Node

$this->traverseNodesWithCallable(
$node->stmts,
static function (Node $subNode) use (&$hasChanged) {
static function (Node $subNode) use (&$hasChanged): int|Expr|null {
if ($subNode instanceof Class_ || $subNode instanceof Function_) {
return NodeTraverser::DONT_TRAVERSE_CURRENT_AND_CHILDREN;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ private function updateDocblock(string $variableName, string $camelCaseName, ?Fu
}

$docComment = $functionLike->getDocComment();
if ($docComment === null) {
if (! $docComment instanceof Doc) {
return;
}

Expand Down

0 comments on commit 439dcfa

Please sign in to comment.