diff --git a/packages/PHPStanStaticTypeMapper/TypeMapper/UnionTypeMapper.php b/packages/PHPStanStaticTypeMapper/TypeMapper/UnionTypeMapper.php index 5b4c94716e7..da5915b3fcc 100644 --- a/packages/PHPStanStaticTypeMapper/TypeMapper/UnionTypeMapper.php +++ b/packages/PHPStanStaticTypeMapper/TypeMapper/UnionTypeMapper.php @@ -126,7 +126,7 @@ public function mapToPhpParserNode(Type $type, string $typeKind): ?Node return $this->mapNullabledType($nullabledType, $typeKind); } - /** + /** * @param TypeKind::* $typeKind */ private function mapNullabledType(Type $nullabledType, string $typeKind): ?Node diff --git a/rules-tests/Php81/Rector/FuncCall/NullToStrictStringFuncCallArgRector/Fixture/case_insensitive_function_name.php.inc b/rules-tests/Php81/Rector/FuncCall/NullToStrictStringFuncCallArgRector/Fixture/case_insensitive_function_name.php.inc new file mode 100644 index 00000000000..a3cec9e97c7 --- /dev/null +++ b/rules-tests/Php81/Rector/FuncCall/NullToStrictStringFuncCallArgRector/Fixture/case_insensitive_function_name.php.inc @@ -0,0 +1,27 @@ + +----- + diff --git a/rules/Php81/Rector/FuncCall/NullToStrictStringFuncCallArgRector.php b/rules/Php81/Rector/FuncCall/NullToStrictStringFuncCallArgRector.php index d9131cdcc5a..6b79fa09644 100644 --- a/rules/Php81/Rector/FuncCall/NullToStrictStringFuncCallArgRector.php +++ b/rules/Php81/Rector/FuncCall/NullToStrictStringFuncCallArgRector.php @@ -484,7 +484,7 @@ private function resolveOriginalPositions(FuncCall $funcCall): array $funcCall, $scope ); - $functionName = $this->nodeNameResolver->getName($funcCall); + $functionName = $functionReflection->getName(); $argNames = self::ARG_POSITION_NAME_NULL_TO_STRICT_STRING[$functionName]; $positions = []; diff --git a/rules/TypeDeclaration/TypeAnalyzer/AlwaysStrictScalarExprAnalyzer.php b/rules/TypeDeclaration/TypeAnalyzer/AlwaysStrictScalarExprAnalyzer.php index 466b652a19f..83ded2e3588 100644 --- a/rules/TypeDeclaration/TypeAnalyzer/AlwaysStrictScalarExprAnalyzer.php +++ b/rules/TypeDeclaration/TypeAnalyzer/AlwaysStrictScalarExprAnalyzer.php @@ -56,7 +56,7 @@ public function matchStrictScalarExpr(Expr $expr): ?Type if ($expr instanceof FuncCall) { $returnType = $this->resolveFuncCallType($expr); - if ($returnType === null) { + if (! $returnType instanceof Type) { return null; } @@ -84,11 +84,7 @@ private function isScalarType(Type $type): bool return true; } - if ($type instanceof BooleanType) { - return true; - } - - return false; + return $type instanceof BooleanType; } private function resolveTypeFromScalar(Scalar $scalar): Type|null