diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 5488326bb..435192915 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -16,6 +16,7 @@ ->setRules([ '@Symfony' => true, '@Symfony:risky' => true, + 'strict_param' => true, 'array_syntax' => ['syntax' => 'short'], 'fopen_flags' => false, 'ordered_imports' => true, diff --git a/src/Extensions/PdoStatementFetchDynamicReturnTypeExtension.php b/src/Extensions/PdoStatementFetchDynamicReturnTypeExtension.php index bcaebb790..43d450741 100644 --- a/src/Extensions/PdoStatementFetchDynamicReturnTypeExtension.php +++ b/src/Extensions/PdoStatementFetchDynamicReturnTypeExtension.php @@ -74,7 +74,7 @@ private function inferType(MethodReflection $methodReflection, MethodCall $metho } $fetchType = $fetchModeType->getValue(); - if (!\in_array($fetchType, [PDO::FETCH_ASSOC, PDO::FETCH_NUM, PDO::FETCH_BOTH])) { + if (!\in_array($fetchType, [PDO::FETCH_ASSOC, PDO::FETCH_NUM, PDO::FETCH_BOTH], true)) { return null; } } diff --git a/src/PdoReflection/PdoStatementReflection.php b/src/PdoReflection/PdoStatementReflection.php index 6e0988e99..2ac7003ea 100644 --- a/src/PdoReflection/PdoStatementReflection.php +++ b/src/PdoReflection/PdoStatementReflection.php @@ -34,9 +34,7 @@ public function findPrepareQueryStringExpression(MethodReflection $methodReflect } /** - * // the following param doesnt work, see phpstan bug https://github.com/phpstan/phpstan/issues/6577. - * - * @xx-param PDO::FETCH* $fetchType + * @param PDO::FETCH* $fetchType * * @return Type|null */ diff --git a/src/QueryReflection/ChainedReflector.php b/src/QueryReflection/ChainedReflector.php index ab4f89478..afa7e41ff 100644 --- a/src/QueryReflection/ChainedReflector.php +++ b/src/QueryReflection/ChainedReflector.php @@ -31,7 +31,7 @@ public function validateQueryString(string $queryString): ?Error // on "not found" error, we try the next reflector. if ($reflectorError) { - if (!\in_array($reflectorError->getCode(), [MysqliQueryReflector::MYSQL_UNKNOWN_TABLE])) { + if (!\in_array($reflectorError->getCode(), [MysqliQueryReflector::MYSQL_UNKNOWN_TABLE], true)) { return $reflectorError; } if (true === $nooneKnows) { diff --git a/src/QueryReflection/PlaceholderValidation.php b/src/QueryReflection/PlaceholderValidation.php index 20aa887fa..44617166e 100644 --- a/src/QueryReflection/PlaceholderValidation.php +++ b/src/QueryReflection/PlaceholderValidation.php @@ -111,7 +111,7 @@ private function validateNamedPlaceholders(string $queryString, array $parameter if ($parameter->isOptional) { continue; } - if (!\in_array($placeholderKey, $namedPlaceholders)) { + if (!\in_array($placeholderKey, $namedPlaceholders, true)) { yield sprintf('Value %s is given, but the query does not contain this placeholder.', $placeholderKey); } }