Skip to content

Commit 03f289c

Browse files
committed
generate baseline
1 parent 0e4ba8a commit 03f289c

File tree

3 files changed

+45
-25
lines changed

3 files changed

+45
-25
lines changed

phpstan-baseline.neon

+43-23
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,100 @@
11
parameters:
22
ignoreErrors:
33
-
4-
message: "#^Unresolvable Query\\: Cannot resolve query with variable type\\: non\\-empty\\-string\\.$#"
4+
message: '#^Unresolvable Query\: Cannot resolve query with variable type\: non\-empty\-string\.$#'
5+
identifier: dba.unresolvableQuery
56
count: 2
67
path: src/Analyzer/QueryPlanAnalyzerMysql.php
78

89
-
9-
message: """
10-
#^Call to deprecated method resolveQueryString\\(\\) of class staabm\\\\PHPStanDba\\\\QueryReflection\\\\QueryReflection\\:
11-
use resolveQueryStrings\\(\\) instead$#
12-
"""
10+
message: '''
11+
#^Call to deprecated method resolveQueryString\(\) of class staabm\\PHPStanDba\\QueryReflection\\QueryReflection\:
12+
use resolveQueryStrings\(\) instead$#
13+
'''
14+
identifier: method.deprecated
1315
count: 1
1416
path: src/Extensions/DeployerRunMysqlQueryDynamicReturnTypeExtension.php
1517

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

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

2630
-
27-
message: """
28-
#^Call to deprecated method resolvePreparedQueryString\\(\\) of class staabm\\\\PHPStanDba\\\\QueryReflection\\\\QueryReflection\\:
29-
use resolvePreparedQueryStrings\\(\\) instead$#
30-
"""
31+
message: '''
32+
#^Call to deprecated method resolvePreparedQueryString\(\) of class staabm\\PHPStanDba\\QueryReflection\\QueryReflection\:
33+
use resolvePreparedQueryStrings\(\) instead$#
34+
'''
35+
identifier: method.deprecated
3136
count: 1
3237
path: src/QueryReflection/QueryReflection.php
3338

3439
-
35-
message: "#^Casting to \\*NEVER\\* something that's already \\*NEVER\\*\\.$#"
40+
message: '#^Casting to \*NEVER\* something that''s already \*NEVER\*\.$#'
41+
identifier: cast.useless
3642
count: 1
3743
path: src/QueryReflection/QueryReflection.php
3844

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

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

4957
-
50-
message: "#^Doing instanceof PHPStan\\\\Type\\\\IntersectionType is error\\-prone and deprecated\\.$#"
58+
message: '#^Doing instanceof PHPStan\\Type\\IntersectionType is error\-prone and deprecated\.$#'
59+
identifier: phpstanApi.instanceofType
5160
count: 1
5261
path: src/QueryReflection/QuerySimulation.php
5362

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

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

6475
-
65-
message: """
66-
#^Call to deprecated method resolveQueryString\\(\\) of class staabm\\\\PHPStanDba\\\\QueryReflection\\\\QueryReflection\\:
67-
use resolveQueryStrings\\(\\) instead$#
68-
"""
76+
message: '''
77+
#^Call to deprecated method resolveQueryString\(\) of class staabm\\PHPStanDba\\QueryReflection\\QueryReflection\:
78+
use resolveQueryStrings\(\) instead$#
79+
'''
80+
identifier: method.deprecated
6981
count: 1
7082
path: src/Rules/SyntaxErrorInDibiPreparedStatementMethodRule.php
7183

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

7790
-
78-
message: "#^Only booleans are allowed in an if condition, int given\\.$#"
91+
message: '#^Parameter \#3 \$joinCondition of class staabm\\PHPStanDba\\SchemaReflection\\Join constructor expects SqlFtw\\Sql\\Expression\\RootNode, mixed given\.$#'
92+
identifier: argument.type
93+
count: 1
94+
path: src/SqlAst/ParserInference.php
95+
96+
-
97+
message: '#^Only booleans are allowed in an if condition, int given\.$#'
98+
identifier: if.condNotBoolean
7999
count: 1
80100
path: src/TypeMapping/MysqliTypeMapper.php

src/QueryReflection/PdoPgSqlQueryReflector.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function __construct(PDO $pdo)
3030
/**
3131
* @return PDOException|array<PDOColumnMeta>|null
3232
*/
33-
protected function simulateQuery(string $queryString)
33+
protected function simulateQuery(string $queryString) // @phpstan-ignore method.childReturnType
3434
{
3535
if (\array_key_exists($queryString, $this->cache)) {
3636
return $this->cache[$queryString];

tests/rules/QueryPlanAnalyzerRuleTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
class QueryPlanAnalyzerRuleTest extends RuleTestCase
1818
{
1919
/**
20-
* @var bool|0|positive-int
20+
* @var bool
2121
*/
2222
private $numberOfAllowedUnindexedReads;
2323

0 commit comments

Comments
 (0)