Skip to content

Commit a047645

Browse files
committed
Merge branch '3.10.x' into 4.3.x
* 3.10.x: Improve DBAL migration docs for object, array and json_array type removals. Consistently reference IBM Db2 as Db2 replace SplObjectStorage::attach() with SplObjectStorage::offsetSet() do not call setAccessible() on PHP >= 8.1 Bump doctrine/coding-standard to v14
2 parents e906a37 + a245491 commit a047645

20 files changed

+89
-35
lines changed

.github/workflows/coding-standards.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@ on:
2525
jobs:
2626
coding-standards:
2727
name: "Coding Standards"
28-
uses: "doctrine/.github/.github/workflows/coding-standards.yml@7.3.0"
28+
uses: "doctrine/.github/.github/workflows/coding-standards.yml@8.0.0"
2929
with:
3030
composer-options: "--ignore-platform-req=php+"

.github/workflows/continuous-integration.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,8 @@ jobs:
236236
php-version: "8.2"
237237
extension: "pdo_sqlsrv"
238238

239-
phpunit-ibm-db2:
240-
name: "PHPUnit with IBM DB2"
239+
phpunit-db2:
240+
name: "PHPUnit with Db2"
241241
needs: "phpunit-smoke-check"
242242
uses: ./.github/workflows/phpunit-db2.yml
243243
with:
@@ -293,7 +293,7 @@ jobs:
293293
- "phpunit-mariadb"
294294
- "phpunit-mysql"
295295
- "phpunit-mssql"
296-
- "phpunit-ibm-db2"
296+
- "phpunit-db2"
297297

298298
steps:
299299
- name: "Checkout"

.github/workflows/documentation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ on:
1717
jobs:
1818
documentation:
1919
name: "Documentation"
20-
uses: "doctrine/.github/.github/workflows/documentation.yml@7.3.0"
20+
uses: "doctrine/.github/.github/workflows/documentation.yml@8.0.0"

.github/workflows/phpunit-db2.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
- name: Checkout
3333
uses: actions/checkout@v4
3434

35-
- name: Install IBM DB2 CLI driver
35+
- name: Install Db2 CLI driver
3636
working-directory: /tmp
3737
run: |
3838
wget https://github.com/ibmdb/db2drivers/raw/refs/heads/main/clidriver/v11.5.9/linuxx64_odbc_cli.tar.gz

.github/workflows/static-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ on:
2525
jobs:
2626
static-analysis-phpstan:
2727
name: "Static Analysis"
28-
uses: "doctrine/.github/.github/workflows/phpstan.yml@7.3.0"
28+
uses: "doctrine/.github/.github/workflows/phpstan.yml@8.0.0"

UPGRADE.md

Lines changed: 61 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1916,6 +1916,22 @@ The following classes and constants have been deprecated:
19161916

19171917
Use JSON for storing unstructured data.
19181918

1919+
You can keep the old type behavior by copying (and adapting) the old type
1920+
classes
1921+
([Array](https://github.com/doctrine/dbal/blob/2.13.9/lib/Doctrine/DBAL/Types/ArrayType.php)
1922+
and
1923+
[Object](https://github.com/doctrine/dbal/blob/2.13.9/lib/Doctrine/DBAL/Types/ObjectType.php))
1924+
into your own code- base and re-register them in the TypeRegistry:
1925+
1926+
```php
1927+
use Doctrine\DBAL\Types\TypeFactory;
1928+
use MyApp\Doctrine\Types\ArrayType;
1929+
use MyApp\Doctrine\Types\ObjectType;
1930+
1931+
TypeRegistry::register('array', new ArrayType());
1932+
TypeRegistry::register('object', new ObjectType());
1933+
```
1934+
19191935
## Deprecated `Driver::getSchemaManager()`.
19201936

19211937
The `Driver::getSchemaManager()` method has been deprecated. Use `AbstractPlatform::createSchemaManager()` instead.
@@ -2122,9 +2138,9 @@ following methods are deprecated:
21222138
The protected property `AbstractPlatform::$doctrineTypeComments` is deprecated
21232139
as well.
21242140

2125-
## Deprecated support for IBM DB2 10.5 and older
2141+
## Deprecated support for Db2 10.5 and older
21262142

2127-
IBM DB2 10.5 and older won't be supported in DBAL 4. Consider upgrading to IBM DB2 11.1 or later.
2143+
Db2 10.5 and older won't be supported in DBAL 4. Consider upgrading to Db2 11.1 or later.
21282144

21292145
## Deprecated support for Oracle 12c (12.2.0.1) and older
21302146

@@ -2672,9 +2688,49 @@ Please generate UUIDs on the application side (e.g. using [ramsey/uuid](https://
26722688

26732689
The `Doctrine\DBAL\Driver::getName()` has been removed.
26742690

2691+
## BC Break: `json_array` type removed
2692+
2693+
Removed `json_array` type and all associated hacks.
2694+
2695+
It is recommened to migrate to the `json` type while still being on the ORM 2
2696+
branch. You then need to migrate the database (using migrations or SchemaTool)
2697+
to update both the type and especially remove the `(Dc2Type:json_array)` column
2698+
comment, before you ugprade to DBAL 3.
2699+
2700+
If you cannot migrate the database or rely on this type, especially its
2701+
behavior with regard to NULL and empty values, you can copy (adapt) the
2702+
[JsonArrayType
2703+
class](https://github.com/doctrine/dbal/blob/2.13.9/lib/Doctrine/DBAL/Types/JsonArrayType.php)
2704+
into your own codebase and re-regsiter under the name:
2705+
2706+
```php
2707+
use Doctrine\DBAL\Types\TypeFactory;
2708+
use MyApp\Doctrine\Types\JsonArrayType;
2709+
2710+
TypeRegistry::register('json_array', new JsonArrayType());
2711+
```
2712+
2713+
Or if you want to opt into the newer type instead, with its slightly changed null behavior, you can
2714+
register that with:
2715+
2716+
```php
2717+
use Doctrine\DBAL\Types\TypeFactory;
2718+
use Doctrine\DBAL\Types\JsonType;
2719+
2720+
TypeRegistry::register('json_array', new JsonType());
2721+
```
2722+
2723+
In Symfony you can register this type with:
2724+
2725+
```yml
2726+
doctrine:
2727+
dbal:
2728+
types:
2729+
json_array: "Doctrine\\DBAL\\Types\\JsonType"
2730+
```
2731+
26752732
## BC BREAK Removed previously deprecated features
26762733
2677-
* Removed `json_array` type and all associated hacks.
26782734
* Removed `Connection::TRANSACTION_*` constants.
26792735
* Removed `AbstractPlatform::DATE_INTERVAL_UNIT_*` and `AbstractPlatform::TRIM_*` constants.
26802736
* Removed `AbstractPlatform::getSQLResultCasing()`, `::prefersSequences()` and `::supportsForeignKeyOnUpdate()` methods.
@@ -2790,9 +2846,9 @@ All implementations of the `VersionAwarePlatformDriver` interface have to implem
27902846
The `Doctrine\DBAL\Platforms\MsSQLKeywords` class has been removed.
27912847
Please use `Doctrine\DBAL\Platforms\SQLServerPlatform` instead.
27922848

2793-
## BC BREAK: Removed PDO DB2 driver
2849+
## BC BREAK: Removed PDO Db2 driver
27942850

2795-
This PDO-based IBM DB2 driver (built on top of `pdo_ibm` extension) has already been unsupported as of 2.5, it has been now removed.
2851+
This PDO-based Db2 driver (built on top of `pdo_ibm` extension) has already been unsupported as of 2.5, it has been now removed.
27962852

27972853
The following class has been removed:
27982854

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@
3737
"psr/log": "^1|^2|^3"
3838
},
3939
"require-dev": {
40-
"doctrine/coding-standard": "13.0.1",
40+
"doctrine/coding-standard": "14.0.0",
4141
"fig/log-test": "^1",
4242
"jetbrains/phpstorm-stubs": "2023.2",
4343
"phpstan/phpstan": "2.1.22",
4444
"phpstan/phpstan-phpunit": "2.0.6",
4545
"phpstan/phpstan-strict-rules": "^2",
4646
"phpunit/phpunit": "11.5.23",
47-
"slevomat/coding-standard": "8.16.2",
48-
"squizlabs/php_codesniffer": "3.13.1",
47+
"slevomat/coding-standard": "8.24.0",
48+
"squizlabs/php_codesniffer": "4.0.0",
4949
"symfony/cache": "^6.3.8|^7.0",
5050
"symfony/console": "^5.4|^6.3|^7.0"
5151
},

docs/en/reference/configuration.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ interfaces to use. It can be configured in one of two ways:
172172
- ``pdo_sqlsrv``: A Microsoft SQL Server driver that uses pdo_sqlsrv PDO
173173
- ``sqlsrv``: A Microsoft SQL Server driver that uses the sqlsrv PHP extension.
174174
- ``oci8``: An Oracle driver that uses the oci8 PHP extension.
175-
- ``ibm_db2``: An IBM DB2 driver that uses the ibm_db2 PHP extension.
175+
- ``ibm_db2``: A Db2 driver that uses the ibm_db2 PHP extension.
176176

177177
- ``driverClass``: Specifies a custom driver implementation if no
178178
'driver' is specified. This allows the use of custom drivers that

docs/en/reference/introduction.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ the oci8 extension under the hood.
1313

1414
The following database vendors are currently supported:
1515

16-
- DB2 (IBM)
16+
- Db2 (IBM)
1717
- MariaDB
1818
- MySQL (Oracle)
1919
- Oracle

docs/en/reference/known-vendor-issues.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,13 +127,13 @@ columns in the table is not the same as the order in the primary key. Tables
127127
created with Doctrine use the order of the columns as defined in the primary
128128
key.
129129

130-
IBM DB2
131-
-------
130+
Db2
131+
---
132132

133133
DateTimeTz
134134
~~~~~~~~~~
135135

136-
DB2 does not support saving timezone offsets. The DateTimeTz type therefore behaves like the DateTime
136+
Db2 does not support saving timezone offsets. The DateTimeTz type therefore behaves like the DateTime
137137
type.
138138

139139
Oracle

0 commit comments

Comments
 (0)