Skip to content

Commit a34ffb5

Browse files
authored
Merge pull request #44 from tyrsson/patch-setup-trait
Fixes -
2 parents e70ce59 + 1a595ea commit a34ffb5

51 files changed

Lines changed: 454 additions & 375 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

composer.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
"scripts": {
6363
"check": [
6464
"@cs-check",
65-
"@static-analysis",
65+
"@sa",
6666
"@test",
6767
"@test-integration"
6868
],
@@ -71,8 +71,9 @@
7171
"test": "phpunit --colors=always --testsuite \"unit test\"",
7272
"test-coverage": "phpunit --colors=always --coverage-clover clover.xml",
7373
"test-integration": "phpunit --colors=always --testsuite \"integration test\"",
74-
"static-analysis": "vendor/bin/phpstan analyse --memory-limit=256M",
75-
"sa-generate-baseline": "vendor/bin/phpstan analyse --memory-limit=256M --generate-baseline",
74+
"sa": "vendor/bin/phpstan analyse --memory-limit=256M",
75+
"sa-gen-baseline": "vendor/bin/phpstan analyse --memory-limit=256M --generate-baseline",
76+
"sa-verbose": "vendor/bin/phpstan analyse --memory-limit=256M -vv",
7677
"upload-coverage": "coveralls -v"
7778
}
7879
}

phpstan-baseline.neon

Lines changed: 167 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -4,172 +4,281 @@ parameters:
44
message: '#^Method PhpDb\\Adapter\\Profiler\\ProfilerInterface\:\:profilerFinish\(\) invoked with 1 parameter, 0 required\.$#'
55
identifier: arguments.count
66
count: 1
7-
path: src/Driver/Mysqli/Connection.php
7+
path: src/Connection.php
88

99
-
10-
message: '#^Property PhpDb\\Adapter\\Mysql\\Driver\\Mysqli\\Connection\:\:\$driver \(PhpDb\\Adapter\\Mysql\\Driver\\Mysqli\\Mysqli\) does not accept PhpDb\\Adapter\\Driver\\DriverInterface\.$#'
10+
message: '#^Property PhpDb\\Mysql\\Connection\:\:\$driver \(PhpDb\\Mysql\\Driver\) does not accept PhpDb\\Adapter\\Driver\\DriverInterface\.$#'
1111
identifier: assign.propertyType
1212
count: 1
13-
path: src/Driver/Mysqli/Connection.php
13+
path: src/Connection.php
1414

1515
-
16-
message: '#^Property PhpDb\\Adapter\\Mysql\\Driver\\Mysqli\\Connection\:\:\$resource \(mysqli\) does not accept null\.$#'
16+
message: '#^Property PhpDb\\Mysql\\Connection\:\:\$resource \(mysqli\) does not accept null\.$#'
1717
identifier: assign.propertyType
1818
count: 1
19-
path: src/Driver/Mysqli/Connection.php
19+
path: src/Connection.php
2020

2121
-
2222
message: '#^Strict comparison using \!\=\= between null and null will always evaluate to false\.$#'
2323
identifier: notIdentical.alwaysFalse
2424
count: 1
25-
path: src/Driver/Mysqli/Connection.php
25+
path: src/Connection.php
2626

2727
-
2828
message: '#^Variable \$names in PHPDoc tag @var does not match assigned variable \$findParameterValue\.$#'
2929
identifier: varTag.differentVariable
3030
count: 1
31-
path: src/Driver/Mysqli/Connection.php
31+
path: src/Connection.php
3232

3333
-
34-
message: '#^Instanceof between PhpDb\\Adapter\\Mysql\\Driver\\Mysqli\\Connection and PhpDb\\Adapter\\Driver\\DriverAwareInterface will always evaluate to true\.$#'
34+
message: '#^PHPDoc tag @var for variable \$connectionInstance contains unknown class PhpDb\\Mysql\\Driver\\ConnectionInterface\.$#'
35+
identifier: class.notFound
36+
count: 1
37+
path: src/Container/DriverInterfaceFactory.php
38+
39+
-
40+
message: '#^PHPDoc tag @var for variable \$resultInstance contains unknown class PhpDb\\Mysql\\Driver\\ResultInterface\.$#'
41+
identifier: class.notFound
42+
count: 1
43+
path: src/Container/DriverInterfaceFactory.php
44+
45+
-
46+
message: '#^PHPDoc tag @var for variable \$statementInstance contains unknown class PhpDb\\Mysql\\Driver\\StatementInterface\.$#'
47+
identifier: class.notFound
48+
count: 1
49+
path: src/Container/DriverInterfaceFactory.php
50+
51+
-
52+
message: '#^Instanceof between PhpDb\\Mysql\\Connection and PhpDb\\Adapter\\Driver\\DriverAwareInterface will always evaluate to true\.$#'
3553
identifier: instanceof.alwaysTrue
3654
count: 1
37-
path: src/Driver/Mysqli/Mysqli.php
55+
path: src/Driver.php
3856

3957
-
40-
message: '#^Instanceof between PhpDb\\Adapter\\Mysql\\Driver\\Mysqli\\Connection and PhpDb\\Adapter\\Profiler\\ProfilerAwareInterface will always evaluate to true\.$#'
58+
message: '#^Instanceof between PhpDb\\Mysql\\Connection and PhpDb\\Adapter\\Profiler\\ProfilerAwareInterface will always evaluate to true\.$#'
4159
identifier: instanceof.alwaysTrue
4260
count: 1
43-
path: src/Driver/Mysqli/Mysqli.php
61+
path: src/Driver.php
4462

4563
-
46-
message: '#^Instanceof between PhpDb\\Adapter\\Mysql\\Driver\\Mysqli\\Statement and PhpDb\\Adapter\\Driver\\DriverAwareInterface will always evaluate to true\.$#'
64+
message: '#^Instanceof between PhpDb\\Mysql\\Statement and PhpDb\\Adapter\\Driver\\DriverAwareInterface will always evaluate to true\.$#'
4765
identifier: instanceof.alwaysTrue
4866
count: 1
49-
path: src/Driver/Mysqli/Mysqli.php
67+
path: src/Driver.php
5068

5169
-
52-
message: '#^Instanceof between PhpDb\\Adapter\\Mysql\\Driver\\Mysqli\\Statement and PhpDb\\Adapter\\Profiler\\ProfilerAwareInterface will always evaluate to true\.$#'
70+
message: '#^Instanceof between PhpDb\\Mysql\\Statement and PhpDb\\Adapter\\Profiler\\ProfilerAwareInterface will always evaluate to true\.$#'
5371
identifier: instanceof.alwaysTrue
5472
count: 1
55-
path: src/Driver/Mysqli/Mysqli.php
73+
path: src/Driver.php
5674

5775
-
58-
message: '#^Method PhpDb\\Adapter\\Mysql\\Driver\\Mysqli\\Mysqli\:\:getResultPrototype\(\) should return PhpDb\\Adapter\\Mysql\\Driver\\Mysqli\\Result but returns PhpDb\\Adapter\\Driver\\ResultInterface\.$#'
76+
message: '#^Method PhpDb\\Mysql\\Driver\:\:getResultPrototype\(\) should return PhpDb\\Mysql\\Result but returns PhpDb\\Adapter\\Driver\\ResultInterface\.$#'
5977
identifier: return.type
6078
count: 1
61-
path: src/Driver/Mysqli/Mysqli.php
79+
path: src/Driver.php
6280

6381
-
64-
message: '#^Parameter \#1 \$resource \(mysqli\|mysqli_stmt\|PhpDb\\Adapter\\Mysql\\Driver\\Mysqli\\mysqli_result\) of method PhpDb\\Adapter\\Mysql\\Driver\\Mysqli\\Mysqli\:\:createResult\(\) should be compatible with parameter \$resource \(resource\) of method PhpDb\\Adapter\\Driver\\DriverInterface\:\:createResult\(\)$#'
82+
message: '#^Parameter \#1 \$resource \(mysqli\|mysqli_stmt\|PhpDb\\Mysql\\mysqli_result\) of method PhpDb\\Mysql\\Driver\:\:createResult\(\) should be compatible with parameter \$resource \(resource\) of method PhpDb\\Adapter\\Driver\\DriverInterface\:\:createResult\(\)$#'
6583
identifier: method.childParameterType
6684
count: 1
67-
path: src/Driver/Mysqli/Mysqli.php
85+
path: src/Driver.php
6886

6987
-
70-
message: '#^Parameter \$resource of method PhpDb\\Adapter\\Mysql\\Driver\\Mysqli\\Mysqli\:\:createResult\(\) has invalid type PhpDb\\Adapter\\Mysql\\Driver\\Mysqli\\mysqli_result\.$#'
88+
message: '#^Parameter \$resource of method PhpDb\\Mysql\\Driver\:\:createResult\(\) has invalid type PhpDb\\Mysql\\mysqli_result\.$#'
7189
identifier: class.notFound
7290
count: 1
73-
path: src/Driver/Mysqli/Mysqli.php
91+
path: src/Driver.php
92+
93+
-
94+
message: '#^Parameter \#2 \$array of function implode expects array\<string\>, array\<int, array\<int, string\>\> given\.$#'
95+
identifier: argument.type
96+
count: 2
97+
path: src/Metadata/Source.php
98+
99+
-
100+
message: '#^Parameter \#2 \$array of function implode expects array\<string\>, array\<int, list\<string\>\> given\.$#'
101+
identifier: argument.type
102+
count: 4
103+
path: src/Metadata/Source.php
104+
105+
-
106+
message: '#^Variable \$isFK might not be defined\.$#'
107+
identifier: variable.undefined
108+
count: 1
109+
path: src/Metadata/Source.php
110+
111+
-
112+
message: '#^Variable \$name might not be defined\.$#'
113+
identifier: variable.undefined
114+
count: 2
115+
path: src/Metadata/Source.php
116+
117+
-
118+
message: '#^Call to function is_string\(\) with string will always evaluate to true\.$#'
119+
identifier: function.alreadyNarrowedType
120+
count: 1
121+
path: src/Pdo/Connection.php
122+
123+
-
124+
message: '#^Parameter \#1 \$resource \(PDOStatement\) of method PhpDb\\Mysql\\Pdo\\Driver\:\:createResult\(\) should be compatible with parameter \$resource \(resource\) of method PhpDb\\Adapter\\Driver\\DriverInterface\:\:createResult\(\)$#'
125+
identifier: method.childParameterType
126+
count: 3
127+
path: src/Pdo/Driver.php
74128

75129
-
76130
message: '#^Instanceof between mysqli_stmt and mysqli_stmt will always evaluate to true\.$#'
77131
identifier: instanceof.alwaysTrue
78132
count: 2
79-
path: src/Driver/Mysqli/Result.php
133+
path: src/Result.php
80134

81135
-
82-
message: '#^Method PhpDb\\Adapter\\Mysql\\Driver\\Mysqli\\Result\:\:initialize\(\) has PhpDb\\Adapter\\Exception\\InvalidArgumentException in PHPDoc @throws tag but it''s not thrown\.$#'
136+
message: '#^Method PhpDb\\Mysql\\Result\:\:initialize\(\) has PhpDb\\Adapter\\Exception\\InvalidArgumentException in PHPDoc @throws tag but it''s not thrown\.$#'
83137
identifier: throws.unusedType
84138
count: 1
85-
path: src/Driver/Mysqli/Result.php
139+
path: src/Result.php
86140

87141
-
88-
message: '#^Method PhpDb\\Adapter\\Mysql\\Driver\\Mysqli\\Result\:\:isBuffered\(\) never returns null so it can be removed from the return type\.$#'
142+
message: '#^Method PhpDb\\Mysql\\Result\:\:isBuffered\(\) never returns null so it can be removed from the return type\.$#'
89143
identifier: return.unusedType
90144
count: 1
91-
path: src/Driver/Mysqli/Result.php
145+
path: src/Result.php
92146

93147
-
94148
message: '#^Result of && is always false\.$#'
95149
identifier: booleanAnd.alwaysFalse
96150
count: 1
97-
path: src/Driver/Mysqli/Result.php
151+
path: src/Result.php
98152

99153
-
100154
message: '#^Instanceof between PhpDb\\Adapter\\ParameterContainer and PhpDb\\Adapter\\ParameterContainer will always evaluate to true\.$#'
101155
identifier: instanceof.alwaysTrue
102156
count: 1
103-
path: src/Driver/Mysqli/Statement.php
157+
path: src/Statement.php
104158

105159
-
106160
message: '#^Instanceof between mysqli_stmt and mysqli_stmt will always evaluate to true\.$#'
107161
identifier: instanceof.alwaysTrue
108162
count: 1
109-
path: src/Driver/Mysqli/Statement.php
163+
path: src/Statement.php
110164

111165
-
112-
message: '#^Method PhpDb\\Adapter\\Mysql\\Driver\\Mysqli\\Statement\:\:execute\(\) never returns null so it can be removed from the return type\.$#'
166+
message: '#^Method PhpDb\\Mysql\\Statement\:\:execute\(\) never returns null so it can be removed from the return type\.$#'
113167
identifier: return.unusedType
114168
count: 1
115-
path: src/Driver/Mysqli/Statement.php
169+
path: src/Statement.php
116170

117171
-
118-
message: '#^Method PhpDb\\Adapter\\Mysql\\Driver\\Mysqli\\Statement\:\:getParameterContainer\(\) never returns null so it can be removed from the return type\.$#'
172+
message: '#^Method PhpDb\\Mysql\\Statement\:\:getParameterContainer\(\) never returns null so it can be removed from the return type\.$#'
119173
identifier: return.unusedType
120174
count: 1
121-
path: src/Driver/Mysqli/Statement.php
175+
path: src/Statement.php
122176

123177
-
124-
message: '#^Method PhpDb\\Adapter\\Mysql\\Driver\\Mysqli\\Statement\:\:getSql\(\) never returns null so it can be removed from the return type\.$#'
178+
message: '#^Method PhpDb\\Mysql\\Statement\:\:getSql\(\) never returns null so it can be removed from the return type\.$#'
125179
identifier: return.unusedType
126180
count: 1
127-
path: src/Driver/Mysqli/Statement.php
181+
path: src/Statement.php
128182

129183
-
130-
message: '#^Property PhpDb\\Adapter\\Mysql\\Driver\\Mysqli\\Statement\:\:\$driver \(PhpDb\\Adapter\\Mysql\\Driver\\Mysqli\\Mysqli\) does not accept PhpDb\\Adapter\\Driver\\DriverInterface\.$#'
184+
message: '#^Property PhpDb\\Mysql\\Statement\:\:\$driver \(PhpDb\\Mysql\\Driver\) does not accept PhpDb\\Adapter\\Driver\\DriverInterface\.$#'
131185
identifier: assign.propertyType
132186
count: 1
133-
path: src/Driver/Mysqli/Statement.php
187+
path: src/Statement.php
134188

135189
-
136-
message: '#^Call to function is_string\(\) with string will always evaluate to true\.$#'
137-
identifier: function.alreadyNarrowedType
190+
message: '#^Call to an undefined method PhpDb\\Mysql\\Driver\:\:quoteValue\(\)\.$#'
191+
identifier: method.notFound
192+
count: 2
193+
path: test/integration/AdapterPlatformTest.php
194+
195+
-
196+
message: '#^Parameter \#1 \$connection of class PhpDb\\Mysql\\Driver constructor expects PhpDb\\Mysql\\Connection, PDO given\.$#'
197+
identifier: argument.type
138198
count: 1
139-
path: src/Driver/Pdo/Connection.php
199+
path: test/integration/AdapterPlatformTest.php
140200

141201
-
142-
message: '#^Parameter \#1 \$resource \(PDOStatement\) of method PhpDb\\Adapter\\Mysql\\Driver\\Pdo\\Pdo\:\:createResult\(\) should be compatible with parameter \$resource \(resource\) of method PhpDb\\Adapter\\Driver\\DriverInterface\:\:createResult\(\)$#'
143-
identifier: method.childParameterType
144-
count: 3
145-
path: src/Driver/Pdo/Pdo.php
202+
message: '#^Parameter \#1 \$connection of class PhpDb\\Mysql\\Driver constructor expects PhpDb\\Mysql\\Connection, mysqli given\.$#'
203+
identifier: argument.type
204+
count: 1
205+
path: test/integration/AdapterPlatformTest.php
146206

147207
-
148-
message: '#^Parameter \#2 \$array of function implode expects array\<string\>, array\<int, array\<int, string\>\> given\.$#'
208+
message: '#^Parameter \#2 \$statementPrototype of class PhpDb\\Mysql\\Driver constructor expects PhpDb\\Mysql\\Statement, PhpDb\\Adapter\\Driver\\Pdo\\Statement given\.$#'
149209
identifier: argument.type
150-
count: 2
151-
path: src/Metadata/Source/MysqlMetadata.php
210+
count: 1
211+
path: test/integration/AdapterPlatformTest.php
152212

153213
-
154-
message: '#^Parameter \#2 \$array of function implode expects array\<string\>, array\<int, list\<string\>\> given\.$#'
214+
message: '#^Property PhpDbIntegrationTest\\Mysql\\Platform\\AdapterPlatformTest\:\:\$adapters \(array\<string, mysqli\|PDO\>\) does not accept array\<string, mysqli\|PDO\|PhpDb\\Mysql\\Connection\>\.$#'
215+
identifier: assign.propertyType
216+
count: 1
217+
path: test/integration/AdapterPlatformTest.php
218+
219+
-
220+
message: '#^Property PhpDbIntegrationTest\\Mysql\\Platform\\AdapterPlatformTest\:\:\$adapters \(array\<string, mysqli\|PDO\>\) does not accept array\<string, mysqli\|PDO\|PhpDb\\Mysql\\Pdo\\Connection\>\.$#'
221+
identifier: assign.propertyType
222+
count: 1
223+
path: test/integration/AdapterPlatformTest.php
224+
225+
-
226+
message: '#^Callable PhpDb\\Mysql\\Container\\DriverInterfaceFactory invoked with 1 parameter, 2\-3 required\.$#'
227+
identifier: arguments.count
228+
count: 1
229+
path: test/integration/Container/DriverInterfaceFactoryTest.php
230+
231+
-
232+
message: '#^Parameter \#1 \$container of callable PhpDb\\Mysql\\Container\\DriverInterfaceFactory expects Laminas\\ServiceManager\\ServiceManager, Psr\\Container\\ContainerInterface given\.$#'
155233
identifier: argument.type
156-
count: 4
157-
path: src/Metadata/Source/MysqlMetadata.php
234+
count: 1
235+
path: test/integration/Container/DriverInterfaceFactoryTest.php
158236

159237
-
160-
message: '#^Variable \$isFK might not be defined\.$#'
161-
identifier: variable.undefined
238+
message: '#^Callable PhpDb\\Mysql\\Container\\MetadataInterfaceFactory invoked with 1 parameter, 2\-3 required\.$#'
239+
identifier: arguments.count
162240
count: 1
163-
path: src/Metadata/Source/MysqlMetadata.php
241+
path: test/integration/Container/MetadataInterfaceFactoryTest.php
164242

165243
-
166-
message: '#^Variable \$name might not be defined\.$#'
167-
identifier: variable.undefined
168-
count: 2
169-
path: src/Metadata/Source/MysqlMetadata.php
244+
message: '#^Callable PhpDb\\Mysql\\Container\\PdoConnectionInterfaceFactory invoked with 1 parameter, 2\-3 required\.$#'
245+
identifier: arguments.count
246+
count: 1
247+
path: test/integration/Container/PdoConnectionInterfaceFactoryTest.php
248+
249+
-
250+
message: '#^Callable PhpDb\\Mysql\\Container\\PdoDriverInterfaceFactory invoked with 1 parameter, 2\-3 required\.$#'
251+
identifier: arguments.count
252+
count: 1
253+
path: test/integration/Container/PdoDriverInterfaceFactoryTest.php
254+
255+
-
256+
message: '#^Parameter \#1 \$container of callable PhpDb\\Mysql\\Container\\PdoDriverInterfaceFactory expects Laminas\\ServiceManager\\ServiceManager, Psr\\Container\\ContainerInterface given\.$#'
257+
identifier: argument.type
258+
count: 1
259+
path: test/integration/Container/PdoDriverInterfaceFactoryTest.php
260+
261+
-
262+
message: '#^Callable PhpDb\\Mysql\\Container\\PdoStatementFactory invoked with 1 parameter, 2\-3 required\.$#'
263+
identifier: arguments.count
264+
count: 1
265+
path: test/integration/Container/PdoStatementFactoryTest.php
266+
267+
-
268+
message: '#^Callable PhpDb\\Mysql\\Container\\PlatformInterfaceFactory invoked with 1 parameter, 2\-3 required\.$#'
269+
identifier: arguments.count
270+
count: 1
271+
path: test/integration/Container/PlatformInterfaceFactoryTest.php
272+
273+
-
274+
message: '#^Callable PhpDb\\Mysql\\Container\\StatementInterfaceFactory invoked with 1 parameter, 2\-3 required\.$#'
275+
identifier: arguments.count
276+
count: 1
277+
path: test/integration/Container/StatementInterfaceFactoryTest.php
170278

171279
-
172280
message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertIsInt\(\) with int will always evaluate to true\.$#'
173281
identifier: staticMethod.alreadyNarrowedType
174282
count: 1
175-
path: test/integration/Driver/Pdo/ConnectionTest.php
283+
path: test/integration/Pdo/ConnectionTest.php
284+

phpunit.xml.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
failOnWarning="true">
1212

1313
<extensions>
14-
<bootstrap class="PhpDbIntegrationTest\Adapter\Mysql\Extension\ListenerExtension" />
14+
<bootstrap class="PhpDbIntegrationTest\Mysql\Extension\ListenerExtension" />
1515
</extensions>
1616
<testsuites>
1717
<testsuite name="unit test">

0 commit comments

Comments
 (0)