Skip to content

Commit 43c80e8

Browse files
committed
Minor code cleanup and phpstan revisions
Signed-off-by: Simon Mundy <simon.mundy@peptolab.com>
1 parent e137e2d commit 43c80e8

5 files changed

Lines changed: 15 additions & 44 deletions

File tree

phpstan-baseline.neon

Lines changed: 13 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -222,63 +222,39 @@ parameters:
222222
count: 1
223223
path: test/integration/AdapterPlatformTest.php
224224

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-
231225
-
232226
message: '#^Parameter \#1 \$container of callable PhpDb\\Mysql\\Container\\DriverInterfaceFactory expects Laminas\\ServiceManager\\ServiceManager, Psr\\Container\\ContainerInterface given\.$#'
233227
identifier: argument.type
234-
count: 1
228+
count: 2
235229
path: test/integration/Container/DriverInterfaceFactoryTest.php
236230

237-
-
238-
message: '#^Callable PhpDb\\Mysql\\Container\\MetadataInterfaceFactory invoked with 1 parameter, 2\-3 required\.$#'
239-
identifier: arguments.count
240-
count: 1
241-
path: test/integration/Container/MetadataInterfaceFactoryTest.php
242-
243-
-
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-
255231
-
256232
message: '#^Parameter \#1 \$container of callable PhpDb\\Mysql\\Container\\PdoDriverInterfaceFactory expects Laminas\\ServiceManager\\ServiceManager, Psr\\Container\\ContainerInterface given\.$#'
257233
identifier: argument.type
258234
count: 1
259235
path: test/integration/Container/PdoDriverInterfaceFactoryTest.php
260236

261237
-
262-
message: '#^Callable PhpDb\\Mysql\\Container\\PdoStatementFactory invoked with 1 parameter, 2\-3 required\.$#'
263-
identifier: arguments.count
238+
message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertIsInt\(\) with int will always evaluate to true\.$#'
239+
identifier: staticMethod.alreadyNarrowedType
264240
count: 1
265-
path: test/integration/Container/PdoStatementFactoryTest.php
241+
path: test/integration/Pdo/ConnectionTest.php
266242

267243
-
268-
message: '#^Callable PhpDb\\Mysql\\Container\\PlatformInterfaceFactory invoked with 1 parameter, 2\-3 required\.$#'
269-
identifier: arguments.count
244+
message: '#^Unreachable statement \- code above always terminates\.$#'
245+
identifier: deadCode.unreachable
270246
count: 1
271-
path: test/integration/Container/PlatformInterfaceFactoryTest.php
247+
path: test/integration/Pdo/QueryTest.php
272248

273249
-
274-
message: '#^Callable PhpDb\\Mysql\\Container\\StatementInterfaceFactory invoked with 1 parameter, 2\-3 required\.$#'
275-
identifier: arguments.count
250+
message: '#^Unreachable statement \- code above always terminates\.$#'
251+
identifier: deadCode.unreachable
276252
count: 1
277-
path: test/integration/Container/StatementInterfaceFactoryTest.php
253+
path: test/integration/Pdo/TableGatewayTest.php
278254

279255
-
280-
message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertIsInt\(\) with int will always evaluate to true\.$#'
281-
identifier: staticMethod.alreadyNarrowedType
256+
message: '#^Unreachable statement \- code above always terminates\.$#'
257+
identifier: deadCode.unreachable
282258
count: 1
283-
path: test/integration/Pdo/ConnectionTest.php
259+
path: test/integration/TableGatewayTest.php
284260

test/integration/Container/ConnectionInterfaceFactoryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function testInvokeThrowsExceptionWithoutConnectionConfig(): void
3838
{
3939
$this->expectException(InvalidConnectionParametersException::class);
4040

41-
$factory = new ConnectionInterfaceFactory();
41+
$factory = new ConnectionInterfaceFactory();
4242
$factory(
4343
$this->container,
4444
Connection::class

test/integration/Container/DriverInterfaceFactoryTest.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,8 @@
66

77
use PhpDb\Adapter\AdapterInterface;
88
use PhpDb\Adapter\Driver\DriverInterface;
9-
use PhpDb\Adapter\Exception\InvalidConnectionParametersException;
109
use PhpDb\Exception\ContainerException;
1110
use PhpDb\Mysql\Connection;
12-
use PhpDb\Mysql\Container\ConnectionInterfaceFactory;
1311
use PhpDb\Mysql\Container\DriverInterfaceFactory;
1412
use PhpDb\Mysql\Driver;
1513
use PHPUnit\Framework\Attributes;
@@ -40,7 +38,7 @@ public function testInvokeThrowsExceptionWithoutConnectionConfig(): void
4038
{
4139
$this->expectException(ContainerException::class);
4240

43-
$factory = new DriverInterfaceFactory();
41+
$factory = new DriverInterfaceFactory();
4442
$factory(
4543
$this->container,
4644
Connection::class

test/integration/Container/PdoDriverInterfaceFactoryTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
namespace PhpDbIntegrationTest\Mysql\Container;
66

77
use PhpDb\Adapter\AdapterInterface;
8-
use PhpDb\Adapter\Driver\DriverInterface;
98
use PhpDb\Adapter\Driver\PdoDriverInterface;
109
use PhpDb\Mysql\Container\PdoDriverInterfaceFactory;
1110
use PhpDb\Mysql\Pdo\Driver;

test/integration/Container/PlatformInterfaceFactoryTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,8 @@
55
namespace PhpDbIntegrationTest\Mysql\Container;
66

77
use PhpDb\Adapter\AdapterInterface;
8-
use PhpDb\Adapter\Driver\DriverInterface;
98
use PhpDb\Adapter\Platform\PlatformInterface;
109
use PhpDb\Mysql\AdapterPlatform;
11-
use PhpDb\Mysql\Container\DriverInterfaceFactory;
1210
use PhpDb\Mysql\Container\PlatformInterfaceFactory;
1311
use PhpDb\Mysql\Pdo\Driver as PdoDriver;
1412
use PHPUnit\Framework\Attributes\CoversClass;

0 commit comments

Comments
 (0)