Skip to content

Commit f2546e6

Browse files
committed
Drop support for DBAL 3
1 parent fdd84a2 commit f2546e6

Some content is hidden

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

48 files changed

+109
-636
lines changed

.github/workflows/continuous-integration.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ jobs:
3838
- "8.3"
3939
dbal-version:
4040
- "default"
41-
- "3.7"
4241
extension:
4342
- "sqlite3"
4443
- "pdo_sqlite"
@@ -109,7 +108,6 @@ jobs:
109108
- "8.3"
110109
dbal-version:
111110
- "default"
112-
- "3.7"
113111
postgres-version:
114112
- "15"
115113
extension:
@@ -121,8 +119,8 @@ jobs:
121119
postgres-version: "14"
122120
extension: pdo_pgsql
123121
- php-version: "8.2"
124-
dbal-version: "3.7"
125-
postgres-version: "9.6"
122+
dbal-version: "default"
123+
postgres-version: "10"
126124
extension: pdo_pgsql
127125

128126
services:
@@ -182,7 +180,6 @@ jobs:
182180
- "8.3"
183181
dbal-version:
184182
- "default"
185-
- "3.7"
186183
- "4@dev"
187184
mariadb-version:
188185
- "10.9"
@@ -248,7 +245,6 @@ jobs:
248245
- "8.3"
249246
dbal-version:
250247
- "default"
251-
- "3.7"
252248
mysql-version:
253249
- "5.7"
254250
- "8.0"

.github/workflows/static-analysis.yml

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,6 @@ jobs:
2727
name: Static Analysis with PHPStan
2828
runs-on: ubuntu-22.04
2929

30-
strategy:
31-
matrix:
32-
include:
33-
- dbal-version: default
34-
config: phpstan.neon
35-
- dbal-version: 3.8.2
36-
config: phpstan-dbal3.neon
37-
3830
steps:
3931
- name: "Checkout code"
4032
uses: "actions/checkout@v4"
@@ -46,27 +38,16 @@ jobs:
4638
php-version: "8.3"
4739
tools: cs2pr
4840

49-
- name: Require specific DBAL version
50-
run: "composer require doctrine/dbal ^${{ matrix.dbal-version }} --no-update"
51-
if: "${{ matrix.dbal-version != 'default' }}"
52-
53-
5441
- name: Install dependencies with Composer
5542
uses: ramsey/composer-install@v2
5643

5744
- name: Run static analysis with phpstan/phpstan
58-
run: "vendor/bin/phpstan analyse -c ${{ matrix.config }} --error-format=checkstyle | cs2pr"
45+
run: "vendor/bin/phpstan analyse --error-format=checkstyle | cs2pr"
5946

6047
static-analysis-psalm:
6148
name: Static Analysis with Psalm
6249
runs-on: ubuntu-22.04
6350

64-
strategy:
65-
matrix:
66-
dbal-version:
67-
- default
68-
- 3.8.2
69-
7051
steps:
7152
- name: "Checkout code"
7253
uses: "actions/checkout@v4"
@@ -76,11 +57,6 @@ jobs:
7657
with:
7758
coverage: none
7859
php-version: "8.3"
79-
tools: cs2pr
80-
81-
- name: Require specific DBAL version
82-
run: "composer require doctrine/dbal ^${{ matrix.dbal-version }} --no-update"
83-
if: "${{ matrix.dbal-version != 'default' }}"
8460

8561
- name: Install dependencies with Composer
8662
uses: ramsey/composer-install@v2

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"composer-runtime-api": "^2",
2525
"ext-ctype": "*",
2626
"doctrine/collections": "^2.2",
27-
"doctrine/dbal": "^3.8.2 || ^4",
27+
"doctrine/dbal": "^4",
2828
"doctrine/deprecations": "^0.5.3 || ^1",
2929
"doctrine/event-manager": "^1.2 || ^2",
3030
"doctrine/inflector": "^1.4 || ^2.0",

phpstan-dbal3.neon

Lines changed: 0 additions & 33 deletions
This file was deleted.

phpstan.neon

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -12,39 +12,11 @@ parameters:
1212
message: '~^Match expression does not handle remaining values:~'
1313
path: src/Persisters/Entity/BasicEntityPersister.php
1414

15-
# DBAL 4 compatibility
16-
-
17-
message: '~^Method Doctrine\\ORM\\Query\\AST\\Functions\\TrimFunction::getTrimMode\(\) never returns .* so it can be removed from the return type\.$~'
18-
path: src/Query/AST/Functions/TrimFunction.php
19-
-
20-
message: '~^Method Doctrine\\ORM\\Persisters\\Entity\\BasicEntityPersister\:\:getArrayBindingType\(\) never returns .* so it can be removed from the return type\.$~'
21-
path: src/Persisters/Entity/BasicEntityPersister.php
22-
15+
# To be removed in 4.0
2316
-
2417
message: '~^Unreachable statement \- code above always terminates\.$~'
2518
path: src/Mapping/AssociationMapping.php
2619

27-
# Compatibility with DBAL 3
28-
# See https://github.com/doctrine/dbal/pull/3480
29-
-
30-
message: '~^Result of method Doctrine\\DBAL\\Connection::commit\(\) \(void\) is used\.$~'
31-
path: src/UnitOfWork.php
32-
-
33-
message: '~^Strict comparison using === between null and false will always evaluate to false\.$~'
34-
path: src/UnitOfWork.php
35-
-
36-
message: '~^Variable \$e on left side of \?\? always exists and is not nullable\.$~'
37-
path: src/UnitOfWork.php
38-
39-
-
40-
message: '~^Parameter #1 \$command of method Symfony\\Component\\Console\\Application::add\(\) expects Symfony\\Component\\Console\\Command\\Command, Doctrine\\DBAL\\Tools\\Console\\Command\\ReservedWordsCommand given\.$~'
41-
path: src/Tools/Console/ConsoleRunner.php
42-
43-
-
44-
message: '~Strict comparison using \=\=\= between callable\(\)\: mixed and null will always evaluate to false\.~'
45-
path: src/Tools/SchemaTool.php
46-
47-
# To be removed in 4.0
4820
-
4921
message: '#Negated boolean expression is always false\.#'
5022
paths:

psalm-baseline.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -861,9 +861,6 @@
861861
</UninitializedProperty>
862862
</file>
863863
<file src="src/Query/Exec/MultiTableUpdateExecutor.php">
864-
<InvalidArgument>
865-
<code><![CDATA[$paramTypes]]></code>
866-
</InvalidArgument>
867864
<InvalidReturnStatement>
868865
<code><![CDATA[$numUpdated]]></code>
869866
</InvalidReturnStatement>

psalm.xml

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424
<issueHandlers>
2525
<DeprecatedClass>
2626
<errorLevel type="suppress">
27-
<!-- We wire the command as long as DBAL ships it -->
28-
<referencedClass name="Doctrine\DBAL\Tools\Console\Command\ReservedWordsCommand" />
2927
<!-- Remove on 3.0.x -->
3028
<referencedClass name="Doctrine\ORM\Event\LifecycleEventArgs"/>
3129
<referencedClass name="Doctrine\ORM\Exception\UnknownEntityNamespace"/>
@@ -45,22 +43,11 @@
4543
<referencedClass name="Doctrine\ORM\Tools\Console\EntityManagerProvider\HelperSetManagerProvider"/>
4644
</errorLevel>
4745
</DeprecatedClass>
48-
<DeprecatedMethod>
49-
<errorLevel type="suppress">
50-
<!-- Remove on 3.0.x -->
51-
<!-- Compatibility with DBAL 3 -->
52-
<referencedMethod name="Doctrine\DBAL\Connection::getEventManager"/>
53-
<file name="src/Query/TreeWalkerChain.php"/>
54-
</errorLevel>
55-
</DeprecatedMethod>
5646
<DocblockTypeContradiction>
5747
<errorLevel type="suppress">
5848
<!-- We're catching invalid input here. -->
5949
<file name="src/Internal/Hydration/AbstractHydrator.php"/>
6050

61-
<!-- DBAL 3.2 forward compatibility -->
62-
<file name="src/Tools/Pagination/CountOutputWalker.php"/>
63-
<file name="src/Tools/Pagination/LimitSubqueryOutputWalker.php"/>
6451
<!-- https://github.com/vimeo/psalm/issues/8520 -->
6552
<file name="src/PersistentCollection.php"/>
6653
<!-- Remove on 4.0.x -->
@@ -183,43 +170,13 @@
183170

184171
<!-- Persistence 2 compatibility -->
185172
<referencedFunction name="Doctrine\Persistence\ObjectManager::clear"/>
186-
187-
<!-- See https://github.com/doctrine/orm/issues/8850 -->
188-
<referencedFunction name="Doctrine\DBAL\Connection::lastInsertId"/>
189-
190-
<!-- FIXME -->
191-
<referencedFunction name="Doctrine\DBAL\DriverManager::getConnection"/>
192173
</errorLevel>
193174
</TooManyArguments>
194-
<TypeDoesNotContainNull>
195-
<errorLevel type="suppress">
196-
<!-- DBAL 3 compatibility -->
197-
<file name="src/Tools/SchemaTool.php"/>
198-
</errorLevel>
199-
</TypeDoesNotContainNull>
200175
<TypeDoesNotContainType>
201176
<errorLevel type="suppress">
202-
<file name="src/Internal/SQLResultCasing.php"/>
203177
<file name="src/Mapping/ClassMetadataFactory.php"/>
204-
<!-- DBAL 3 compatibility -->
205-
<file name="src/UnitOfWork.php"/>
206-
<file name="src/Utility/LockSqlHelper.php"/>
207178
</errorLevel>
208179
</TypeDoesNotContainType>
209-
<UndefinedClass>
210-
<errorLevel type="suppress">
211-
<!-- Compatibility with DBAL 3 -->
212-
<referencedClass name="Doctrine\DBAL\Platforms\SQLitePlatform"/>
213-
</errorLevel>
214-
</UndefinedClass>
215-
<UndefinedMethod>
216-
<errorLevel type="suppress">
217-
<!-- Compatibility with DBAL 3 -->
218-
<referencedMethod name="Doctrine\DBAL\Connection::getEventManager"/>
219-
<!-- FIXME -->
220-
<referencedMethod name="Doctrine\DBAL\Schema\SchemaDiff::toSaveSql"/>
221-
</errorLevel>
222-
</UndefinedMethod>
223180
<UndefinedPropertyFetch>
224181
<errorLevel type="suppress">
225182
<!-- https://github.com/vimeo/psalm/issues/7878 -->

src/AbstractQuery.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -321,16 +321,16 @@ public function setParameters(ArrayCollection|array $parameters): static
321321
/**
322322
* Sets a query parameter.
323323
*
324-
* @param string|int $key The parameter position or name.
325-
* @param mixed $value The parameter value.
326-
* @param ParameterType|ArrayParameterType|string|int|null $type The parameter type. If specified, the given value
327-
* will be run through the type conversion of this
328-
* type. This is usually not needed for strings and
329-
* numeric types.
324+
* @param string|int $key The parameter position or name.
325+
* @param mixed $value The parameter value.
326+
* @param ParameterType|ArrayParameterType|string|null $type The parameter type. If specified, the given value
327+
* will be run through the type conversion of this
328+
* type. This is usually not needed for strings and
329+
* numeric types.
330330
*
331331
* @return $this
332332
*/
333-
public function setParameter(string|int $key, mixed $value, ParameterType|ArrayParameterType|string|int|null $type = null): static
333+
public function setParameter(string|int $key, mixed $value, ParameterType|ArrayParameterType|string|null $type = null): static
334334
{
335335
$existingParameter = $this->getParameter($key);
336336

src/Cache/Persister/Entity/AbstractEntityPersister.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public function getInserts(): array
9090
public function getSelectSQL(
9191
array|Criteria $criteria,
9292
AssociationMapping|null $assoc = null,
93-
LockMode|int|null $lockMode = null,
93+
LockMode|null $lockMode = null,
9494
int|null $limit = null,
9595
int|null $offset = null,
9696
array|null $orderBy = null,
@@ -290,7 +290,7 @@ public function load(
290290
object|null $entity = null,
291291
AssociationMapping|null $assoc = null,
292292
array $hints = [],
293-
LockMode|int|null $lockMode = null,
293+
LockMode|null $lockMode = null,
294294
int|null $limit = null,
295295
array|null $orderBy = null,
296296
): object|null {
@@ -533,15 +533,15 @@ public function loadOneToOneEntity(AssociationMapping $assoc, object $sourceEnti
533533
/**
534534
* {@inheritDoc}
535535
*/
536-
public function lock(array $criteria, LockMode|int $lockMode): void
536+
public function lock(array $criteria, LockMode $lockMode): void
537537
{
538538
$this->persister->lock($criteria, $lockMode);
539539
}
540540

541541
/**
542542
* {@inheritDoc}
543543
*/
544-
public function refresh(array $id, object $entity, LockMode|int|null $lockMode = null): void
544+
public function refresh(array $id, object $entity, LockMode|null $lockMode = null): void
545545
{
546546
$this->persister->refresh($id, $entity, $lockMode);
547547
}

src/Decorator/EntityManagerDecorator.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,17 +107,17 @@ public function close(): void
107107
$this->wrapped->close();
108108
}
109109

110-
public function lock(object $entity, LockMode|int $lockMode, DateTimeInterface|int|null $lockVersion = null): void
110+
public function lock(object $entity, LockMode $lockMode, DateTimeInterface|int|null $lockVersion = null): void
111111
{
112112
$this->wrapped->lock($entity, $lockMode, $lockVersion);
113113
}
114114

115-
public function find(string $className, mixed $id, LockMode|int|null $lockMode = null, int|null $lockVersion = null): object|null
115+
public function find(string $className, mixed $id, LockMode|null $lockMode = null, int|null $lockVersion = null): object|null
116116
{
117117
return $this->wrapped->find($className, $id, $lockMode, $lockVersion);
118118
}
119119

120-
public function refresh(object $object, LockMode|int|null $lockMode = null): void
120+
public function refresh(object $object, LockMode|null $lockMode = null): void
121121
{
122122
$this->wrapped->refresh($object, $lockMode);
123123
}

0 commit comments

Comments
 (0)