Skip to content

Commit

Permalink
[CodeQuality] Register SimplifyUselessLastVariableAssignRector to cod…
Browse files Browse the repository at this point in the history
…e-quality config set (#2993)

* [CodeQuality] Register SimplifyUselessLastVariableAssignRector to code-quality config set

* [ci-review] Rector Rectify

Co-authored-by: GitHub Action <action@github.com>
  • Loading branch information
samsonasik and actions-user committed Oct 16, 2022
1 parent 7b1b356 commit 34040f3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 2 additions & 0 deletions config/set/code-quality.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
use Rector\CodeQuality\Rector\FuncCall\StrvalToTypeCastRector;
use Rector\CodeQuality\Rector\FuncCall\UnwrapSprintfOneArgumentRector;
use Rector\CodeQuality\Rector\FunctionLike\RemoveAlwaysTrueConditionSetInConstructorRector;
use Rector\CodeQuality\Rector\FunctionLike\SimplifyUselessLastVariableAssignRector;
use Rector\CodeQuality\Rector\FunctionLike\SimplifyUselessVariableRector;
use Rector\CodeQuality\Rector\Identical\BooleanNotIdenticalToNotIdenticalRector;
use Rector\CodeQuality\Rector\Identical\FlipTypeControlToUseExclusiveTypeRector;
Expand Down Expand Up @@ -190,5 +191,6 @@
TernaryFalseExpressionToIfRector::class,
InlineConstructorDefaultToPropertyRector::class,
SimplifyIfExactValueReturnValueRector::class,
SimplifyUselessLastVariableAssignRector::class,
]);
};
3 changes: 1 addition & 2 deletions rules/TypeDeclaration/Helper/PhpDocNullableTypeHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,11 @@ private function hasClosureType(Type $phpDocType): bool

private function hasNullType(Type $phpDocType): bool
{
$isPhpDocTypeContainingNullType = false;
if ($phpDocType instanceof UnionType) {
return TypeCombinator::containsNull($phpDocType);
}

return $isPhpDocTypeContainingNullType;
return false;
}

/**
Expand Down

0 comments on commit 34040f3

Please sign in to comment.