Skip to content

Commit 59ac5ea

Browse files
authored
Merge pull request php-db#22 from tyrsson/update-unit-test
Update-unit-test
2 parents 76edd34 + de09914 commit 59ac5ea

40 files changed

+1710
-1079
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
},
3232
"require": {
3333
"php": "~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0",
34-
"php-db/phpdb": "^0.2.0",
34+
"php-db/phpdb": "^0.3.0",
3535
"webmozart/assert": "^1.11"
3636
},
3737
"require-dev": {

composer.lock

Lines changed: 8 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

phpcs.xml.dist

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,6 @@
1818

1919
<!-- Include all rules from Laminas Coding Standard -->
2020
<rule ref="LaminasCodingStandard">
21-
<!--
22-
declare(strict_types=1) is too risky for a security-only component,
23-
and should only be reconsidered once this package receives new feature work.
24-
-->
25-
<exclude name="SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing"/>
21+
2622
</rule>
2723
</ruleset>

phpstan-baseline.neon

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
parameters:
2+
ignoreErrors:
3+
-
4+
message: '#^Variable \$aliasTo on left side of \?\?\= is never defined\.$#'
5+
identifier: nullCoalesce.variable
6+
count: 1
7+
path: src/Container/DriverInterfaceFactoryFactory.php
8+
9+
-
10+
message: '#^Cannot call static method createFromConfig\(\) on callable\.$#'
11+
identifier: staticMethod.nonObject
12+
count: 1
13+
path: src/Container/PdoDriverFactory.php
14+
15+
-
16+
message: '#^Parameter \#1 \$name \(string\) of method PhpDb\\Adapter\\Sqlite\\Driver\\Pdo\\Connection\:\:getLastGeneratedValue\(\) should be compatible with parameter \$name \(null\) of method PhpDb\\Adapter\\Driver\\ConnectionInterface\:\:getLastGeneratedValue\(\)$#'
17+
identifier: method.childParameterType
18+
count: 2
19+
path: src/Driver/Pdo/Connection.php
20+
21+
-
22+
message: '#^Parameter \#2 \$parameters of class PhpDb\\Adapter\\Exception\\InvalidConnectionParametersException constructor expects int, array given\.$#'
23+
identifier: argument.type
24+
count: 1
25+
path: src/Driver/Pdo/Connection.php
26+
27+
-
28+
message: '#^Parameter \#1 \$resource \(PDOStatement\) of method PhpDb\\Adapter\\Sqlite\\Driver\\Pdo\\Pdo\:\:createResult\(\) should be compatible with parameter \$resource \(resource\) of method PhpDb\\Adapter\\Driver\\DriverInterface\:\:createResult\(\)$#'
29+
identifier: method.childParameterType
30+
count: 3
31+
path: src/Driver/Pdo/Pdo.php
32+
33+
-
34+
message: '#^Parameter \#3 \$rowCount of method PhpDb\\Adapter\\Driver\\Pdo\\Result\:\:initialize\(\) expects int\|null, Closure\|null given\.$#'
35+
identifier: argument.type
36+
count: 1
37+
path: src/Driver/Pdo/Pdo.php
38+
39+
-
40+
message: '#^Variable \$schemas might not be defined\.$#'
41+
identifier: variable.undefined
42+
count: 1
43+
path: src/Metadata/Source/SqliteMetadata.php
44+
45+
-
46+
message: '#^Method PhpDb\\Adapter\\Sqlite\\Sql\\Platform\\Ddl\\AlterTableDecorator\:\:processAddColumns\(\) should return array\<string\> but returns array\<int, array\<string\>\>\.$#'
47+
identifier: return.type
48+
count: 1
49+
path: src/Sql/Platform/Ddl/AlterTableDecorator.php
50+
51+
-
52+
message: '#^Method PhpDb\\Adapter\\Sqlite\\Sql\\Platform\\Ddl\\AlterTableDecorator\:\:processChangeColumns\(\) should return array\<string\> but returns array\<int, list\<array\<int, string\>\>\>\.$#'
53+
identifier: return.type
54+
count: 1
55+
path: src/Sql/Platform/Ddl/AlterTableDecorator.php
56+
57+
-
58+
message: '#^Offset ''paramPrefix'' does not exist on string\.$#'
59+
identifier: offsetAccess.notFound
60+
count: 2
61+
path: src/Sql/Platform/SelectDecorator.php
62+
63+
-
64+
message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertIsArray\(\) with array will always evaluate to true\.$#'
65+
identifier: staticMethod.alreadyNarrowedType
66+
count: 3
67+
path: test/unit/ConfigProviderTest.php
68+
69+
-
70+
message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertIsCallable\(\) with callable\(\)\: mixed will always evaluate to true\.$#'
71+
identifier: staticMethod.alreadyNarrowedType
72+
count: 1
73+
path: test/unit/Container/ConnectionInterfaceFactoryFactoryTest.php
74+
75+
-
76+
message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertIsCallable\(\) with callable\(\)\: mixed will always evaluate to true\.$#'
77+
identifier: staticMethod.alreadyNarrowedType
78+
count: 1
79+
path: test/unit/Container/DriverInterfaceFactoryFactoryTest.php
80+
81+
-
82+
message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertIsCallable\(\) with callable\(\)\: mixed will always evaluate to true\.$#'
83+
identifier: staticMethod.alreadyNarrowedType
84+
count: 1
85+
path: test/unit/Container/PlatformInterfaceFactoryFactoryTest.php
86+
87+
-
88+
message: '#^PHPDoc tag @var with type PhpDb\\Adapter\\Driver\\PdoDriverAwareInterface&PhpDb\\Adapter\\Driver\\StatementInterface is not subtype of native type PHPUnit\\Framework\\MockObject\\MockObject\.$#'
89+
identifier: varTag.nativeType
90+
count: 1
91+
path: test/unit/Driver/Pdo/PdoTest.php
92+
93+
-
94+
message: '#^Parameter \#1 \$callback of function set_error_handler expects \(callable\(int, string, string, int\)\: bool\)\|null, Closure\(int, string\)\: void given\.$#'
95+
identifier: argument.type
96+
count: 1
97+
path: test/unit/Platform/SqliteTest.php
98+
99+
-
100+
message: '#^Parameter \#1 \$callback of function set_error_handler expects \(callable\(int, string, string, int\)\: bool\)\|null, Closure\(mixed, mixed\)\: void given\.$#'
101+
identifier: argument.type
102+
count: 1
103+
path: test/unit/Platform/SqliteTest.php

src/Driver/Pdo/Connection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class Connection extends AbstractPdoConnection
2727
* {@inheritDoc}
2828
*/
2929
#[Override]
30-
public function getCurrentSchema(): string|bool
30+
public function getCurrentSchema(): string|false
3131
{
3232
if (! $this->isConnected()) {
3333
$this->connect();

src/Sql/Platform/Ddl/AlterTableDecorator.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace PhpDb\Adapter\Sqlite\Sql\Platform\Ddl;
46

57
use PhpDb\Adapter\Platform\PlatformInterface;

src/Sql/Platform/Ddl/CreateTableDecorator.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace PhpDb\Adapter\Sqlite\Sql\Platform\Ddl;
46

57
use PhpDb\Adapter\Platform\PlatformInterface;

src/Sql/Platform/SelectDecorator.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace PhpDb\Adapter\Sqlite\Sql\Platform;
46

57
use PhpDb\Adapter\Driver\DriverInterface;

src/Sql/Platform/Sqlite.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace PhpDb\Adapter\Sqlite\Sql\Platform;
46

57
use PhpDb\Sql\Ddl\AlterTable;

test/integration/Container/TestAsset/SetupTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
use PhpDb\Adapter\Driver\DriverInterface;
1212
use PhpDb\Adapter\Sqlite\ConfigProvider;
1313
use PhpDb\Adapter\Sqlite\Driver\Pdo\Pdo;
14+
use PhpDb\ConfigProvider as LaminasDbConfigProvider;
1415
use PhpDb\Container\AdapterManager;
15-
use PhpDb\Container\ConfigProvider as LaminasDbConfigProvider;
1616
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
1717
use Psr\Container\ContainerInterface;
1818

0 commit comments

Comments
 (0)