Skip to content

Commit

Permalink
normalize EOL also in prepared queries (#375)
Browse files Browse the repository at this point in the history
* normalize EOL also in prepared queries

* record

Co-authored-by: Markus Staab <[email protected]>
  • Loading branch information
staabm and clxmstaab authored May 23, 2022
1 parent 2011d67 commit 5da7473
Show file tree
Hide file tree
Showing 24 changed files with 26 additions and 33 deletions.
11 changes: 2 additions & 9 deletions .phpstan-dba-mysqli.cache

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .phpstan-dba-pdo.cache

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/QueryReflection/QueryReflection.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,15 @@ public function resolvePreparedQueryStrings(Expr $queryExpr, Type $parameterType
foreach (TypeUtils::getConstantStrings($type) as $constantString) {
$queryString = $constantString->getValue();
$queryString = $this->replaceParameters($queryString, $parameters);
yield $queryString;
yield $this->normalizeQueryString($queryString);
}

return;
}

$queryString = $this->resolvePreparedQueryString($queryExpr, $parameterTypes, $scope);
if (null !== $queryString) {
yield $queryString;
yield $this->normalizeQueryString($queryString);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/QueryReflection/ReflectionCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

final class ReflectionCache
{
public const SCHEMA_VERSION = 'v7-normalized-eol';
public const SCHEMA_VERSION = 'v7-normalized-eol-prepared';

/**
* @var string
Expand Down
2 changes: 1 addition & 1 deletion tests/default/config/.phpstan-dba-mysqli.cache

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tests/default/config/.phpstan-dba-pdo.cache

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tests/default/config/.phpunit-phpstan-dba-mysqli.cache

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tests/default/config/.phpunit-phpstan-dba-pdo.cache

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tests/defaultFetchAssoc/config/.phpstan-dba-mysqli.cache

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tests/defaultFetchAssoc/config/.phpstan-dba-pdo.cache

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tests/defaultFetchNumeric/config/.phpstan-dba-mysqli.cache

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tests/defaultFetchNumeric/config/.phpstan-dba-pdo.cache

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tests/rules/config/.phpstan-dba-mysqli.cache

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tests/rules/config/.phpstan-dba-pdo.cache

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tests/rules/config/.phpunit-phpstan-dba-mysqli.cache

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tests/rules/config/.phpunit-phpstan-dba-pdo.cache

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tests/stringify/config/.phpstan-dba-mysqli.cache

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tests/stringify/config/.phpstan-dba-pdo.cache

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tests/stringify/config/.phpunit-phpstan-dba-mysqli.cache

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tests/stringify/config/.phpunit-phpstan-dba-pdo.cache

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5da7473

Please sign in to comment.