Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
->setRules([
'@Symfony' => true,
'@Symfony:risky' => true,
'strict_param' => true,
'array_syntax' => ['syntax' => 'short'],
'fopen_flags' => false,
'ordered_imports' => true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down
4 changes: 1 addition & 3 deletions src/PdoReflection/PdoStatementReflection.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
2 changes: 1 addition & 1 deletion src/QueryReflection/ChainedReflector.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/QueryReflection/PlaceholderValidation.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down