Skip to content

Commit 1ab7f52

Browse files
phpstan-botclaude
andcommitted
Remove redundant containsNull check before removeNull
TypeCombinator::removeNull() already handles the case where the type does not contain null, making the containsNull guard unnecessary. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent ddb4fe8 commit 1ab7f52

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/Type/Php/DateTimeModifyReturnTypeExtension.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,7 @@ public function getTypeFromMethodCall(MethodReflection $methodReflection, Method
7777

7878
return null;
7979
} elseif ($hasDateTime) {
80-
$callerType = $scope->getType($methodCall->var);
81-
if (TypeCombinator::containsNull($callerType)) {
82-
$callerType = TypeCombinator::removeNull($callerType);
83-
}
84-
return $callerType;
80+
return TypeCombinator::removeNull($scope->getType($methodCall->var));
8581
}
8682

8783
if ($this->phpVersion->hasDateTimeExceptions()) {

0 commit comments

Comments
 (0)