Skip to content

Commit

Permalink
generate baseline
Browse files Browse the repository at this point in the history
  • Loading branch information
staabm committed Nov 15, 2024
1 parent ce0cddc commit 02ab31a
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 25 deletions.
66 changes: 43 additions & 23 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
@@ -1,80 +1,100 @@
parameters:
ignoreErrors:
-
message: "#^Unresolvable Query\\: Cannot resolve query with variable type\\: non\\-empty\\-string\\.$#"
message: '#^Unresolvable Query\: Cannot resolve query with variable type\: non\-empty\-string\.$#'
identifier: dba.unresolvableQuery
count: 2
path: src/Analyzer/QueryPlanAnalyzerMysql.php

-
message: """
#^Call to deprecated method resolveQueryString\\(\\) of class staabm\\\\PHPStanDba\\\\QueryReflection\\\\QueryReflection\\:
use resolveQueryStrings\\(\\) instead$#
"""
message: '''
#^Call to deprecated method resolveQueryString\(\) of class staabm\\PHPStanDba\\QueryReflection\\QueryReflection\:
use resolveQueryStrings\(\) instead$#
'''
identifier: method.deprecated
count: 1
path: src/Extensions/DeployerRunMysqlQueryDynamicReturnTypeExtension.php

-
message: "#^Doing instanceof PHPStan\\\\Type\\\\Constant\\\\ConstantArrayType is error\\-prone and deprecated\\. Use Type\\:\\:getConstantArrays\\(\\) instead\\.$#"
message: '#^Doing instanceof PHPStan\\Type\\Constant\\ConstantArrayType is error\-prone and deprecated\. Use Type\:\:getConstantArrays\(\) instead\.$#'
identifier: phpstanApi.instanceofType
count: 2
path: src/Extensions/DibiConnectionFetchDynamicReturnTypeExtension.php

-
message: "#^Strict comparison using \\=\\=\\= between 'dibi' and 'dibi' will always evaluate to true\\.$#"
message: '#^Strict comparison using \=\=\= between ''dibi'' and ''dibi'' will always evaluate to true\.$#'
identifier: identical.alwaysTrue
count: 1
path: src/QueryReflection/DbaApi.php

-
message: """
#^Call to deprecated method resolvePreparedQueryString\\(\\) of class staabm\\\\PHPStanDba\\\\QueryReflection\\\\QueryReflection\\:
use resolvePreparedQueryStrings\\(\\) instead$#
"""
message: '''
#^Call to deprecated method resolvePreparedQueryString\(\) of class staabm\\PHPStanDba\\QueryReflection\\QueryReflection\:
use resolvePreparedQueryStrings\(\) instead$#
'''
identifier: method.deprecated
count: 1
path: src/QueryReflection/QueryReflection.php

-
message: "#^Casting to \\*NEVER\\* something that's already \\*NEVER\\*\\.$#"
message: '#^Casting to \*NEVER\* something that''s already \*NEVER\*\.$#'
identifier: cast.useless
count: 1
path: src/QueryReflection/QueryReflection.php

-
message: "#^Strict comparison using \\=\\=\\= between null and null will always evaluate to true\\.$#"
message: '#^Strict comparison using \=\=\= between null and null will always evaluate to true\.$#'
identifier: identical.alwaysTrue
count: 1
path: src/QueryReflection/QueryReflection.php

-
message: "#^Doing instanceof PHPStan\\\\Type\\\\ConstantScalarType is error\\-prone and deprecated\\. Use Type\\:\\:isConstantScalarValue\\(\\) or Type\\:\\:getConstantScalarTypes\\(\\) or Type\\:\\:getConstantScalarValues\\(\\) instead\\.$#"
message: '#^Doing instanceof PHPStan\\Type\\ConstantScalarType is error\-prone and deprecated\. Use Type\:\:isConstantScalarValue\(\) or Type\:\:getConstantScalarTypes\(\) or Type\:\:getConstantScalarValues\(\) instead\.$#'
identifier: phpstanApi.instanceofType
count: 1
path: src/QueryReflection/QuerySimulation.php

-
message: "#^Doing instanceof PHPStan\\\\Type\\\\IntersectionType is error\\-prone and deprecated\\.$#"
message: '#^Doing instanceof PHPStan\\Type\\IntersectionType is error\-prone and deprecated\.$#'
identifier: phpstanApi.instanceofType
count: 1
path: src/QueryReflection/QuerySimulation.php

-
message: "#^Doing instanceof PHPStan\\\\Type\\\\ObjectType is error\\-prone and deprecated\\. Use Type\\:\\:isObject\\(\\) or Type\\:\\:getObjectClassNames\\(\\) instead\\.$#"
message: '#^Doing instanceof PHPStan\\Type\\ObjectType is error\-prone and deprecated\. Use Type\:\:isObject\(\) or Type\:\:getObjectClassNames\(\) instead\.$#'
identifier: phpstanApi.instanceofType
count: 2
path: src/QueryReflection/QuerySimulation.php

-
message: "#^Doing instanceof PHPStan\\\\Type\\\\Constant\\\\ConstantStringType is error\\-prone and deprecated\\. Use Type\\:\\:getConstantStrings\\(\\) instead\\.$#"
message: '#^Doing instanceof PHPStan\\Type\\Constant\\ConstantStringType is error\-prone and deprecated\. Use Type\:\:getConstantStrings\(\) instead\.$#'
identifier: phpstanApi.instanceofType
count: 1
path: src/Rules/PdoStatementExecuteMethodRule.php

-
message: """
#^Call to deprecated method resolveQueryString\\(\\) of class staabm\\\\PHPStanDba\\\\QueryReflection\\\\QueryReflection\\:
use resolveQueryStrings\\(\\) instead$#
"""
message: '''
#^Call to deprecated method resolveQueryString\(\) of class staabm\\PHPStanDba\\QueryReflection\\QueryReflection\:
use resolveQueryStrings\(\) instead$#
'''
identifier: method.deprecated
count: 1
path: src/Rules/SyntaxErrorInDibiPreparedStatementMethodRule.php

-
message: "#^Doing instanceof PHPStan\\\\Type\\\\Constant\\\\ConstantArrayType is error\\-prone and deprecated\\. Use Type\\:\\:getConstantArrays\\(\\) instead\\.$#"
message: '#^Doing instanceof PHPStan\\Type\\Constant\\ConstantArrayType is error\-prone and deprecated\. Use Type\:\:getConstantArrays\(\) instead\.$#'
identifier: phpstanApi.instanceofType
count: 1
path: src/Rules/SyntaxErrorInDibiPreparedStatementMethodRule.php

-
message: "#^Only booleans are allowed in an if condition, int given\\.$#"
message: '#^Parameter \#3 \$joinCondition of class staabm\\PHPStanDba\\SchemaReflection\\Join constructor expects SqlFtw\\Sql\\Expression\\RootNode, mixed given\.$#'
identifier: argument.type
count: 1
path: src/SqlAst/ParserInference.php

-
message: '#^Only booleans are allowed in an if condition, int given\.$#'
identifier: if.condNotBoolean
count: 1
path: src/TypeMapping/MysqliTypeMapper.php
2 changes: 1 addition & 1 deletion src/QueryReflection/PdoPgSqlQueryReflector.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function __construct(PDO $pdo)
/**
* @return PDOException|array<PDOColumnMeta>|null
*/
protected function simulateQuery(string $queryString)
protected function simulateQuery(string $queryString) // @phpstan-ignore method.childReturnType
{
if (\array_key_exists($queryString, $this->cache)) {
return $this->cache[$queryString];
Expand Down
2 changes: 1 addition & 1 deletion tests/rules/QueryPlanAnalyzerRuleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
class QueryPlanAnalyzerRuleTest extends RuleTestCase
{
/**
* @var bool|0|positive-int
* @var bool
*/
private $numberOfAllowedUnindexedReads;

Expand Down

0 comments on commit 02ab31a

Please sign in to comment.