Skip to content

Commit

Permalink
Merge branch 'doctrine:4.0.x' into fix-6146
Browse files Browse the repository at this point in the history
  • Loading branch information
fisharebest authored Jun 4, 2024
2 parents 9c87c57 + cbd0e9a commit 360b326
Show file tree
Hide file tree
Showing 28 changed files with 244 additions and 118 deletions.
9 changes: 9 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
labels:
- "CI"
target-branch: "3.8.x"
2 changes: 1 addition & 1 deletion .github/workflows/coding-standards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ on:
jobs:
coding-standards:
name: "Coding Standards"
uses: "doctrine/.github/.github/workflows/coding-standards.yml@4.0.0"
uses: "doctrine/.github/.github/workflows/coding-standards.yml@5.0.1"
34 changes: 23 additions & 11 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
ini-values: "zend.assertions=1"

- name: "Install dependencies with Composer"
uses: "ramsey/composer-install@v2"
uses: "ramsey/composer-install@v3"
with:
composer-options: "--ignore-platform-req=php+"
dependency-versions: "${{ matrix.dependencies }}"
Expand Down Expand Up @@ -136,7 +136,7 @@ jobs:
ini-values: "zend.assertions=1"

- name: "Install dependencies with Composer"
uses: "ramsey/composer-install@v2"
uses: "ramsey/composer-install@v3"
with:
composer-options: "--ignore-platform-req=php+"

Expand Down Expand Up @@ -193,7 +193,7 @@ jobs:
ini-values: "zend.assertions=1"

- name: "Install dependencies with Composer"
uses: "ramsey/composer-install@v2"
uses: "ramsey/composer-install@v3"
with:
composer-options: "--ignore-platform-req=php+"

Expand Down Expand Up @@ -257,7 +257,7 @@ jobs:
ini-values: "zend.assertions=1"

- name: "Install dependencies with Composer"
uses: "ramsey/composer-install@v2"
uses: "ramsey/composer-install@v3"
with:
composer-options: "--ignore-platform-req=php+"

Expand Down Expand Up @@ -328,7 +328,7 @@ jobs:
extensions: "${{ matrix.extension }}"

- name: "Install dependencies with Composer"
uses: "ramsey/composer-install@v2"
uses: "ramsey/composer-install@v3"
with:
composer-options: "--ignore-platform-req=php+"

Expand All @@ -353,7 +353,6 @@ jobs:
mysql-version:
- "5.7"
- "8.0"
- "8.3"
extension:
- "mysqli"
- "pdo_mysql"
Expand All @@ -370,6 +369,16 @@ jobs:
- php-version: "8.3"
mysql-version: "8.0"
extension: "pdo_mysql"
- php-version: "8.1"
mysql-version: "8.4"
extension: "mysqli"
custom-entrypoint: >-
--entrypoint sh mysql:8.4 -c "exec docker-entrypoint.sh mysqld --mysql-native-password=ON"
- php-version: "8.1"
mysql-version: "8.4"
extension: "pdo_mysql"
custom-entrypoint: >-
--entrypoint sh mysql:8.4 -c "exec docker-entrypoint.sh mysqld --mysql-native-password=ON"
services:
mysql:
Expand Down Expand Up @@ -399,7 +408,7 @@ jobs:
extensions: "${{ matrix.extension }}"

- name: "Install dependencies with Composer"
uses: "ramsey/composer-install@v2"
uses: "ramsey/composer-install@v3"
with:
composer-options: "--ignore-platform-req=php+"

Expand Down Expand Up @@ -470,7 +479,7 @@ jobs:
extensions: "${{ matrix.extension }}-5.10.0beta1"

- name: "Install dependencies with Composer"
uses: "ramsey/composer-install@v2"
uses: "ramsey/composer-install@v3"
with:
composer-options: "--ignore-platform-req=php+"

Expand Down Expand Up @@ -541,7 +550,7 @@ jobs:
IBM_DB2_CONFIGURE_OPTS: "--with-IBM_DB2=/tmp/clidriver"

- name: "Install dependencies with Composer"
uses: "ramsey/composer-install@v2"
uses: "ramsey/composer-install@v3"
with:
composer-options: "--ignore-platform-req=php+"

Expand Down Expand Up @@ -576,7 +585,7 @@ jobs:
run: "composer config minimum-stability dev"

- name: "Install development dependencies with Composer"
uses: "ramsey/composer-install@v2"
uses: "ramsey/composer-install@v3"
with:
composer-options: "--prefer-dist"

Expand Down Expand Up @@ -612,6 +621,9 @@ jobs:
working-directory: reports

- name: "Upload to Codecov"
uses: "codecov/codecov-action@v3"
uses: "codecov/codecov-action@v4"
with:
directory: reports
fail_ci_if_error: true
env:
CODECOV_TOKEN: "${{ secrets.CODECOV_TOKEN }}"
2 changes: 1 addition & 1 deletion .github/workflows/lock-closed-issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
lock:
runs-on: ubuntu-latest
steps:
- uses: dessant/lock-threads@v3
- uses: dessant/lock-threads@v5
with:
github-token: '${{ github.token }}'
issue-inactive-days: 30
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
tools: "cs2pr"

- name: "Install dependencies with Composer"
uses: "ramsey/composer-install@v2"
uses: "ramsey/composer-install@v3"

- name: "Run a static analysis with phpstan/phpstan"
run: "vendor/bin/phpstan --error-format=checkstyle | cs2pr"
Expand All @@ -74,7 +74,7 @@ jobs:
tools: cs2pr

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

- name: Run static analysis with Vimeo Psalm
run: vendor/bin/psalm --shepherd
Expand Down
14 changes: 7 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,16 @@
"doctrine/coding-standard": "12.0.0",
"fig/log-test": "^1",
"jetbrains/phpstorm-stubs": "2023.2",
"phpstan/phpstan": "1.10.58",
"phpstan/phpstan-phpunit": "1.3.15",
"phpstan/phpstan-strict-rules": "^1.5",
"phpunit/phpunit": "10.5.9",
"psalm/plugin-phpunit": "0.18.4",
"phpstan/phpstan": "1.11.1",
"phpstan/phpstan-phpunit": "1.4.0",
"phpstan/phpstan-strict-rules": "^1.6",
"phpunit/phpunit": "10.5.20",
"psalm/plugin-phpunit": "0.19.0",
"slevomat/coding-standard": "8.13.1",
"squizlabs/php_codesniffer": "3.9.0",
"squizlabs/php_codesniffer": "3.9.2",
"symfony/cache": "^6.3.8|^7.0",
"symfony/console": "^5.4|^6.3|^7.0",
"vimeo/psalm": "5.21.1"
"vimeo/psalm": "5.24.0"
},
"suggest": {
"symfony/console": "For helpful console commands such as SQL execution and import of files."
Expand Down
28 changes: 19 additions & 9 deletions docs/en/reference/known-vendor-issues.rst
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,20 @@ MySQL
DateTimeTz
~~~~~~~~~~

MySQL does not support saving timezones or offsets. The DateTimeTz
type therefore behaves like the DateTime type.
Prior to version 8.0.19, MySQL does not support saving timezones or offsets. The DateTimeTz type therefore
behaves like the DateTime type on previous versions.
Starting from version `8.0.19 and later <https://dev.mysql.com/doc/refman/8.0/en/date-and-time-literals.html#date-and-time-string-numeric-literals>`_,
timezone offsets are supported. MySQL converts the time zone offset to UTC for storage, and back from UTC to the current
(SYSTEM, SESSION, etc) time zone for retrieval.

MariaDB
-------

DateTimeTz
~~~~~~~~~~

MariaDB does not support saving timezone offsets. The DateTimeTz type therefore behaves like the DateTime
type.

Sqlite
------
Expand All @@ -86,7 +98,7 @@ breaks the SERIALIZABLE transaction isolation property that SQLite supposedly
has.

DateTime
~~~~~~~~~~
~~~~~~~~

Unlike most database management systems, Sqlite does not convert supplied
datetime strings to an internal storage format before storage. Instead, Sqlite
Expand All @@ -104,8 +116,8 @@ when trying to convert database values to ``\DateTime`` objects using
DateTimeTz
~~~~~~~~~~

Sqlite does not support saving timezones or offsets. The DateTimeTz
type therefore behaves like the DateTime type.
Sqlite supports saving timezone offsets, but this feature is not yet implemented in DBAL.
The DateTimeTz type therefore behaves like the DateTime type.

Reverse engineering primary key order
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand All @@ -121,10 +133,8 @@ IBM DB2
DateTimeTz
~~~~~~~~~~

DB2 does not save the actual Timezone Name but UTC-Offsets. The
difference is subtle but can be potentially very nasty. Derick
Rethans explains it very well
`in a blog post of his <http://derickrethans.nl/storing-date-time-in-database.html>`_.
DB2 does not support saving timezone offsets. The DateTimeTz type therefore behaves like the DateTime
type.

Oracle
------
Expand Down
9 changes: 5 additions & 4 deletions docs/en/reference/platforms.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,15 @@ can be found as follows:
MySQL
^^^^^

- ``MySQLPlatform`` for version 5.7 (5.7.9 GA) and above.
- ``MySQL80Platform`` for version 8.0 (8.0 GA) and above.
- ``MySQLPlatform`` for version 5.7.9 and above.
- ``MySQL80Platform`` for version 8.0 and above.

MariaDB
^^^^^

- ``MariaDBPlatform`` for version 10.4 (10.4.3 GA) and above.
- ``MariaDB1052Platform`` for version 10.5 (10.5.2 GA) and above.
- ``MariaDBPlatform`` for version 10.4.3 and above.
- ``MariaDb1052Platform`` for version 10.5.2 and above.
- ``MariaDb1060Platform`` for version 10.6 and above.

Oracle
^^^^^^
Expand Down
9 changes: 9 additions & 0 deletions docs/en/reference/types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,15 @@ information, you should consider using this type.
Values retrieved from the database are always converted to PHP's ``\DateTime`` object
or ``null`` if no data is present.

.. note::

This type is not supported by all the vendor platforms or by all of their versions. Depending on
these variants, the databases that support this type may return the persisted date and time in a
different timezone than the one used during the ``INSERT`` or the ``UPDATE`` operation. This means
that if you persist a value like `1986-22-03 19:45:30-03:00`, you could have `1986-22-03 22:45:30-00:00`
as the result of a ``SELECT`` operation for that record. In these cases, the timezone offset present
in the result is usually UTC or the one configured as default in the database server.

.. warning::

Passing instances of ``DateTimeImmutable`` to this type is deprecated since 3.7. Use
Expand Down
6 changes: 3 additions & 3 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
parameters:
level: 8
phpVersion: 80200
phpVersion: 80300
paths:
- src
- static-analysis
- tests
treatPhpDocTypesAsCertain: false
reportUnmatchedIgnoredErrors: false
checkMissingIterableValueType: false
checkGenericClassInNonGenericObjectType: false
ignoreErrors:
- identifier: missingType.generics

# https://github.com/phpstan/phpstan-strict-rules/issues/103
-
message: '~^Construct empty\(\) is not allowed. Use more strict comparison\.~'
Expand Down
1 change: 0 additions & 1 deletion src/Driver/OCI8/Middleware/InitializeSession.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ public function connect(
'ALTER SESSION SET'
. " NLS_DATE_FORMAT = 'YYYY-MM-DD HH24:MI:SS'"
. " NLS_TIME_FORMAT = 'HH24:MI:SS'"
. " NLS_DATE_FORMAT = 'YYYY-MM-DD HH24:MI:SS'"
. " NLS_TIMESTAMP_FORMAT = 'YYYY-MM-DD HH24:MI:SS'"
. " NLS_TIMESTAMP_TZ_FORMAT = 'YYYY-MM-DD HH24:MI:SS TZH:TZM'"
. " NLS_NUMERIC_CHARACTERS = '.,'",
Expand Down
4 changes: 1 addition & 3 deletions src/Platforms/MariaDB1052Platform.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@
use Doctrine\DBAL\Schema\TableDiff;

/**
* Provides the behavior, features and SQL dialect of the MariaDB 10.5 (10.5.2 GA) database platform.
*
* Note: Should not be used with versions prior to 10.5.2.
* Provides the behavior, features and SQL dialect of the MariaDB 10.5 database platform.
*/
class MariaDB1052Platform extends MariaDBPlatform
{
Expand Down
2 changes: 1 addition & 1 deletion src/Platforms/MariaDB1060Platform.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use Doctrine\DBAL\SQL\Builder\SelectSQLBuilder;

/**
* Provides the behavior, features and SQL dialect of the MariaDB 10.6 (10.6.0 GA) database platform.
* Provides the behavior, features and SQL dialect of the MariaDB 10.6 database platform.
*/
class MariaDB1060Platform extends MariaDB1052Platform
{
Expand Down
2 changes: 1 addition & 1 deletion src/Platforms/MySQL80Platform.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use Doctrine\DBAL\SQL\Builder\SelectSQLBuilder;

/**
* Provides the behavior, features and SQL dialect of the MySQL 8.0 (8.0 GA) database platform.
* Provides the behavior, features and SQL dialect of the MySQL 8.0 database platform.
*/
class MySQL80Platform extends MySQLPlatform
{
Expand Down
Loading

0 comments on commit 360b326

Please sign in to comment.