Skip to content

Commit 0f2d257

Browse files
committed
Merge branch '3.5.x' into 4.0.x
* 3.5.x: PHPStan 1.9.1 Bump dev tools Remove unwanted suffix Fix typo Run tests with MariaDB 10.9 Revert "Clean up MySQL version detection logic" Update project metadata
2 parents 0c4f7ea + 0fbb1f2 commit 0f2d257

File tree

11 files changed

+32
-62
lines changed

11 files changed

+32
-62
lines changed

.doctrine-project.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@
1414
{
1515
"name": "3.5",
1616
"branchName": "3.5.x",
17-
"slug": "3.5",
18-
"upcoming": true
17+
"slug": "current",
18+
"current": true,
19+
"aliases": ["stable"]
1920
},
2021
{
2122
"name": "3.4",
2223
"branchName": "3.4.x",
23-
"slug": "current",
24-
"current": true,
25-
"aliases": ["stable"]
24+
"slug": "3.4",
25+
"maintained": false
2626
},
2727
{
2828
"name": "3.3",

.github/workflows/continuous-integration.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,15 +271,16 @@ jobs:
271271
- "10.2"
272272
- "10.5"
273273
- "10.7"
274+
- "10.9"
274275
extension:
275276
- "mysqli"
276277
- "pdo_mysql"
277278
include:
278279
- php-version: "8.2"
279-
mariadb-version: "10.7"
280+
mariadb-version: "10.9"
280281
extension: "mysqli"
281282
- php-version: "8.2"
282-
mariadb-version: "10.7"
283+
mariadb-version: "10.9"
283284
extension: "pdo_mysql"
284285

285286
services:

README.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# Doctrine DBAL
22

3-
| [4.0-dev][4.0] | [3.4][3.4] |
3+
| [4.0-dev][4.0] | [3.5][3.5] |
44
|:-----------------------------------------------:|:---------------------------------------------------:|
5-
| [![GitHub Actions][GA 4.0 image]][GA 4.0] | [![GitHub Actions][GA 3.4 image]][GA 3.4] |
6-
| [![AppVeyor][AppVeyor 4.0 image]][AppVeyor 4.0] | [![AppVeyor][AppVeyor 3.4 image]][AppVeyor 3.4] |
7-
| [![Code Coverage][Coverage image]][CodeCov 4.0] | [![Code Coverage][Coverage 3.4 image]][CodeCov 3.4] |
8-
| N/A | [![Code Coverage][TypeCov 3.4 image]][TypeCov 3.4] |
5+
| [![GitHub Actions][GA 4.0 image]][GA 4.0] | [![GitHub Actions][GA 3.5 image]][GA 3.5] |
6+
| [![AppVeyor][AppVeyor 4.0 image]][AppVeyor 4.0] | [![AppVeyor][AppVeyor 3.5 image]][AppVeyor 3.5] |
7+
| [![Code Coverage][Coverage image]][CodeCov 4.0] | [![Code Coverage][Coverage 3.5 image]][CodeCov 3.5] |
8+
| N/A | [![Code Coverage][TypeCov 3.5 image]][TypeCov 3.5] |
99

1010
Powerful ***D***ata***B***ase ***A***bstraction ***L***ayer with many features for database schema introspection and schema management.
1111

@@ -23,12 +23,12 @@ Powerful ***D***ata***B***ase ***A***bstraction ***L***ayer with many features f
2323
[GA 4.0]: https://github.com/doctrine/dbal/actions?query=workflow%3A%22Continuous+Integration%22+branch%3A4.0.x
2424
[GA 4.0 image]: https://github.com/doctrine/dbal/workflows/Continuous%20Integration/badge.svg
2525

26-
[Coverage 3.4 image]: https://codecov.io/gh/doctrine/dbal/branch/3.4.x/graph/badge.svg
27-
[3.4]: https://github.com/doctrine/dbal/tree/3.4.x
28-
[CodeCov 3.4]: https://codecov.io/gh/doctrine/dbal/branch/3.4.x
29-
[AppVeyor 3.4]: https://ci.appveyor.com/project/doctrine/dbal/branch/3.4.x
30-
[AppVeyor 3.4 image]: https://ci.appveyor.com/api/projects/status/i88kitq8qpbm0vie/branch/3.4.x?svg=true
31-
[GA 3.4]: https://github.com/doctrine/dbal/actions?query=workflow%3A%22Continuous+Integration%22+branch%3A3.4.x
32-
[GA 3.4 image]: https://github.com/doctrine/dbal/workflows/Continuous%20Integration/badge.svg?branch=3.4.x
33-
[TypeCov 3.4]: https://shepherd.dev/github/doctrine/dbal
34-
[TypeCov 3.4 image]: https://shepherd.dev/github/doctrine/dbal/coverage.svg
26+
[Coverage 3.5 image]: https://codecov.io/gh/doctrine/dbal/branch/3.5.x/graph/badge.svg
27+
[3.5]: https://github.com/doctrine/dbal/tree/3.5.x
28+
[CodeCov 3.5]: https://codecov.io/gh/doctrine/dbal/branch/3.5.x
29+
[AppVeyor 3.5]: https://ci.appveyor.com/project/doctrine/dbal/branch/3.5.x
30+
[AppVeyor 3.5 image]: https://ci.appveyor.com/api/projects/status/i88kitq8qpbm0vie/branch/3.5.x?svg=true
31+
[GA 3.5]: https://github.com/doctrine/dbal/actions?query=workflow%3A%22Continuous+Integration%22+branch%3A3.5.x
32+
[GA 3.5 image]: https://github.com/doctrine/dbal/workflows/Continuous%20Integration/badge.svg?branch=3.5.x
33+
[TypeCov 3.5]: https://shepherd.dev/github/doctrine/dbal
34+
[TypeCov 3.5 image]: https://shepherd.dev/github/doctrine/dbal/coverage.svg

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@
4040
"require-dev": {
4141
"doctrine/coding-standard": "10.0.0",
4242
"jetbrains/phpstorm-stubs": "2022.2",
43-
"phpstan/phpstan": "1.8.10",
43+
"phpstan/phpstan": "1.9.1",
4444
"phpstan/phpstan-phpunit": "1.1.1",
4545
"phpstan/phpstan-strict-rules": "^1.4",
46-
"phpunit/phpunit": "9.5.25",
47-
"psalm/plugin-phpunit": "0.17.0",
46+
"phpunit/phpunit": "9.5.26",
47+
"psalm/plugin-phpunit": "0.18.0",
4848
"squizlabs/php_codesniffer": "3.7.1",
4949
"symfony/cache": "^5.4|^6.0",
5050
"symfony/console": "^4.4.30|^5.4|^6.0",

phpstan.neon.dist

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,6 @@ parameters:
88
checkMissingIterableValueType: false
99
checkGenericClassInNonGenericObjectType: false
1010
ignoreErrors:
11-
# Requires a release of https://github.com/JetBrains/phpstorm-stubs/pull/1158
12-
-
13-
message: '~^Strict comparison using === between string and null will always evaluate to false\.$~'
14-
path: %currentWorkingDirectory%/src/Driver/IBMDB2/Connection.php
15-
1611
# https://github.com/phpstan/phpstan-strict-rules/issues/103
1712
-
1813
message: '~^Construct empty\(\) is not allowed. Use more strict comparison\.~'
@@ -46,11 +41,6 @@ parameters:
4641
paths:
4742
- src/Driver/OCI8/Result.php
4843

49-
-
50-
message: '~Method Doctrine\\DBAL\\DriverManager::createDriver\(\) should return Doctrine\\DBAL\\Driver but returns object\.~'
51-
paths:
52-
- src/DriverManager.php
53-
5444
# https://github.com/phpstan/phpstan/issues/4679
5545
-
5646
message: '~^Cannot call method writeTemporary\(\) on OCILob\|null\.$~'
@@ -62,11 +52,6 @@ parameters:
6252
paths:
6353
- src/Driver/Mysqli/Result.php
6454

65-
# The schema manager isn't initialized if the test is skipped
66-
-
67-
message: '~Strict comparison using === between Doctrine\\DBAL\\Schema\\AbstractSchemaManager and null will always evaluate to false\.~'
68-
path: tests/Functional/Schema/SchemaManagerFunctionalTestCase.php
69-
7055
# Removing the (int) cast will make Psalm unhappy.
7156
-
7257
message: '~^Casting to int something that''s already int\.$~'
@@ -77,9 +62,6 @@ parameters:
7762
- src/Driver/Mysqli/Exception/StatementError.php
7863

7964
# We're testing with invalid input.
80-
-
81-
message: '~^Parameter #2 \$lockMode of method Doctrine\\DBAL\\Platforms\\AbstractPlatform\:\:appendLockHint\(\) expects 0\|1\|2\|4, 128 given\.$~'
82-
path: tests/Platforms/AbstractPlatformTestCase.php
8365
-
8466
message: '~^Unable to resolve the template type T in call to method static method Doctrine\\DBAL\\DriverManager::getConnection\(\)~'
8567
path: tests/DriverManagerTest.php
@@ -99,19 +81,6 @@ parameters:
9981
paths:
10082
- tests/DriverManagerTest.php
10183

102-
# It is not clear how to address these errors (it should be an intersection type)
103-
-
104-
message: '~array{url: ''sqlite::memory:'', wrapperClass: class-string<Doctrine\\DBAL\\Connection>\|class-string<PHPUnit\\Framework\\MockObject\\MockObject>} given\.$~'
105-
path: tests/DriverManagerTest.php
106-
-
107-
message: '~class-string<Doctrine\\DBAL\\Connection>&class-string<PHPUnit\\Framework\\MockObject\\MockObject> given\.$~'
108-
path: tests/DriverManagerTest.php
109-
110-
# It is not clear how to address this error (one of the types is a sub-type of the other)
111-
-
112-
message: '~^Call to static method PHPUnit\\Framework\\Assert::assertSame\(\) .* will always evaluate to false\.$~'
113-
path: tests/ConnectionTest.php
114-
11584
# There is no way to make this assertion in the code,
11685
# and the API doesn't support parametrization of returned column types.
11786
-

src/Connection.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@ class Connection implements ServerVersionProvider
114114
* @param Driver $driver The driver to use.
115115
* @param Configuration|null $config The configuration, optional.
116116
* @psalm-param Params $params
117-
* @phpstan-param array<string,mixed> $params
118117
*/
119118
public function __construct(
120119
array $params,

src/Connections/PrimaryReadReplicaConnection.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ class PrimaryReadReplicaConnection extends Connection
9494
*
9595
* @param array<string, mixed> $params
9696
* @psalm-param Params $params
97-
* @phpstan-param array<string,mixed> $params
9897
*/
9998
public function __construct(array $params, Driver $driver, ?Configuration $config = null)
10099
{

src/Driver/SQLite3/Driver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public function connect(array $params): Connection
1919
if (isset($params['path'])) {
2020
if ($isMemory) {
2121
throw new Exception(
22-
'Invalid connection settings: specifying both parameters "path" and "memory" ambiguous.',
22+
'Invalid connection settings: specifying both parameters "path" and "memory" is ambiguous.',
2323
);
2424
}
2525

src/DriverManager.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
use function array_keys;
2020
use function array_merge;
21+
use function assert;
2122
use function class_implements;
2223
use function in_array;
2324
use function is_string;
@@ -68,6 +69,7 @@
6869
* serverVersion?: string,
6970
* sharding?: array<string,mixed>,
7071
* slaves?: array<OverrideParams>,
72+
* url?: string,
7173
* user?: string,
7274
* wrapperClass?: class-string<Connection>,
7375
* unix_socket?: string,
@@ -208,7 +210,6 @@ public static function getAvailableDrivers(): array
208210
/**
209211
* @param array<string,mixed> $params
210212
* @psalm-param Params $params
211-
* @phpstan-param array<string,mixed> $params
212213
*/
213214
private static function createDriver(array $params): Driver
214215
{
@@ -252,12 +253,10 @@ private static function normalizeDatabaseUrlPath(string $urlPath): string
252253
*
253254
* @param mixed[] $params The list of parameters.
254255
* @psalm-param Params $params
255-
* @phpstan-param array<string,mixed> $params
256256
*
257257
* @return mixed[] A modified list of parameters with info from a database
258258
* URL extracted into indidivual parameter parts.
259259
* @psalm-return Params
260-
* @phpstan-return array<string,mixed>
261260
*/
262261
private static function parseDatabaseUrl(array $params): array
263262
{
@@ -267,6 +266,8 @@ private static function parseDatabaseUrl(array $params): array
267266

268267
// Patch the URL without a host to make it valid before parsing
269268
$url = preg_replace('#^pdo-sqlite:///#', 'pdo-sqlite://localhost/', $params['url']);
269+
assert($url !== null);
270+
270271
$url = parse_url($url);
271272

272273
if ($url === false) {

tests/Cache/QueryCacheProfileTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ public function testConnectionParamsShouldBeHashed(): void
110110
self::assertArrayHasKey('connectionParams', $params);
111111

112112
foreach ($this->connectionParams as $param) {
113+
self::assertIsString($params['connectionParams']);
113114
self::assertStringNotContainsString($param, $params['connectionParams']);
114115
}
115116
}

tests/Functional/Driver/SQLite3/DriverTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public function testAmbiguousParams(): void
6464
$this->expectException(DriverException::class);
6565
$this->expectExceptionMessage(
6666
'An exception occurred in the driver: '
67-
. 'Invalid connection settings: specifying both parameters "path" and "memory" ambiguous.',
67+
. 'Invalid connection settings: specifying both parameters "path" and "memory" is ambiguous.',
6868
);
6969

7070
$connection = new Connection(

0 commit comments

Comments
 (0)