Skip to content

Commit 76c4c33

Browse files
morozovgreg0ire
authored andcommitted
Merge branch '2.10.x' into 2.11.x
2 parents f97ee94 + 03bc93b commit 76c4c33

20 files changed

+79
-439
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: "Coding Standards"
2+
3+
on: ["pull_request", "push"]
4+
5+
jobs:
6+
coding-standards:
7+
name: "Coding Standards"
8+
runs-on: "ubuntu-20.04"
9+
10+
strategy:
11+
matrix:
12+
php-version:
13+
- "7.4"
14+
15+
steps:
16+
- name: "Checkout"
17+
uses: "actions/checkout@v2"
18+
19+
- name: "Install PHP"
20+
uses: "shivammathur/setup-php@v2"
21+
with:
22+
coverage: "none"
23+
php-version: "${{ matrix.php-version }}"
24+
tools: "cs2pr"
25+
26+
- name: "Cache dependencies installed with Composer"
27+
uses: "actions/cache@v2"
28+
with:
29+
path: "~/.composer/cache"
30+
key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}"
31+
restore-keys: "php-${{ matrix.php-version }}-composer-locked-"
32+
33+
- name: "Install dependencies with Composer"
34+
run: "composer install --no-interaction --no-progress --no-suggest"
35+
36+
# https://github.com/doctrine/.github/issues/3
37+
- name: "Run PHP_CodeSniffer"
38+
run: "vendor/bin/phpcs -q --no-colors --report=checkstyle | cs2pr"

.github/workflows/continuous-integration.yml

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -69,39 +69,6 @@ jobs:
6969
- name: "Run a static analysis with vimeo/psalm"
7070
run: "vendor/bin/psalm --show-info=false --stats --output-format=github --threads=4"
7171

72-
coding-standards:
73-
name: "Coding Standards"
74-
runs-on: "ubuntu-latest"
75-
76-
strategy:
77-
matrix:
78-
php-version:
79-
- "7.4"
80-
81-
steps:
82-
- name: "Checkout"
83-
uses: "actions/checkout@v2"
84-
85-
- name: "Install PHP"
86-
uses: "shivammathur/setup-php@v2"
87-
with:
88-
coverage: "none"
89-
php-version: "${{ matrix.php-version }}"
90-
tools: "cs2pr"
91-
92-
- name: "Cache dependencies installed with composer"
93-
uses: "actions/cache@v1"
94-
with:
95-
path: "~/.composer/cache"
96-
key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}"
97-
restore-keys: "php-${{ matrix.php-version }}-composer-locked-"
98-
99-
- name: "Install dependencies with composer"
100-
run: "composer install --no-interaction --no-progress --no-suggest"
101-
102-
- name: "Run squizlabs/php_codesniffer"
103-
run: "vendor/bin/phpcs -q --no-colors --report=checkstyle | cs2pr"
104-
10572
phpunit-oci8:
10673
name: "PHPUnit on OCI8"
10774
runs-on: "ubuntu-latest"

lib/Doctrine/DBAL/Driver/AbstractPostgreSQLDriver.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ abstract class AbstractPostgreSQLDriver implements Driver, ExceptionConverterDri
4444
*/
4545
public function convertException($message, DeprecatedDriverException $exception)
4646
{
47-
switch ($exception->getSQLState()) {
47+
$sqlState = $exception->getSQLState();
48+
49+
switch ($sqlState) {
4850
case '40001':
4951
case '40P01':
5052
return new DeadlockException($message, $exception);
@@ -82,9 +84,13 @@ public function convertException($message, DeprecatedDriverException $exception)
8284
case '42P07':
8385
return new TableExistsException($message, $exception);
8486

87+
case '08006':
88+
return new Exception\ConnectionException($message, $exception);
89+
8590
case '7':
86-
// In some case (mainly connection errors) the PDO exception does not provide a SQLSTATE via its code.
87-
// The exception code is always set to 7 here.
91+
// Prior to fixing https://bugs.php.net/bug.php?id=64705 (PHP 7.3.22 and PHP 7.4.10),
92+
// in some cases (mainly connection errors) the PDO exception wouldn't provide a SQLSTATE via its code.
93+
// The exception code would be always set to 7 here.
8894
// We have to match against the SQLSTATE in the error message in these cases.
8995
if (strpos($exception->getMessage(), 'SQLSTATE[08006]') !== false) {
9096
return new ConnectionException($message, $exception);

lib/Doctrine/DBAL/Driver/AbstractSQLiteDriver.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
use Doctrine\DBAL\Driver\DriverException as DeprecatedDriverException;
88
use Doctrine\DBAL\Exception\ConnectionException;
99
use Doctrine\DBAL\Exception\DriverException;
10-
use Doctrine\DBAL\Exception\ForeignKeyConstraintViolationException;
1110
use Doctrine\DBAL\Exception\InvalidFieldNameException;
1211
use Doctrine\DBAL\Exception\LockWaitTimeoutException;
1312
use Doctrine\DBAL\Exception\NonUniqueFieldNameException;
@@ -84,10 +83,6 @@ public function convertException($message, DeprecatedDriverException $exception)
8483
return new ConnectionException($message, $exception);
8584
}
8685

87-
if (strpos($exception->getMessage(), 'FOREIGN KEY constraint failed') !== false) {
88-
return new ForeignKeyConstraintViolationException($message, $exception);
89-
}
90-
9186
return new DriverException($message, $exception);
9287
}
9388

lib/Doctrine/DBAL/Internal/DependencyOrderCalculator.php

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

lib/Doctrine/DBAL/Internal/DependencyOrderEdge.php

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

lib/Doctrine/DBAL/Internal/DependencyOrderNode.php

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

lib/Doctrine/DBAL/Platforms/AbstractPlatform.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3219,16 +3219,6 @@ public function supportsForeignKeyConstraints()
32193219
return true;
32203220
}
32213221

3222-
/**
3223-
* Whether foreign key constraints can be dropped.
3224-
*
3225-
* If false, then getDropForeignKeySQL() throws exception.
3226-
*/
3227-
public function supportsCreateDropForeignKeyConstraints(): bool
3228-
{
3229-
return true;
3230-
}
3231-
32323222
/**
32333223
* Whether this platform supports onUpdate in foreign key constraints.
32343224
*

lib/Doctrine/DBAL/Platforms/SqlitePlatform.php

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -791,11 +791,6 @@ public function canEmulateSchemas()
791791
* {@inheritDoc}
792792
*/
793793
public function supportsForeignKeyConstraints()
794-
{
795-
return true;
796-
}
797-
798-
public function supportsCreateDropForeignKeyConstraints(): bool
799794
{
800795
return false;
801796
}
@@ -813,21 +808,15 @@ public function getCreatePrimaryKeySQL(Index $index, $table)
813808
*/
814809
public function getCreateForeignKeySQL(ForeignKeyConstraint $foreignKey, $table)
815810
{
816-
throw new Exception(
817-
'Sqlite platform does not support alter foreign key, '
818-
. 'the table must be fully recreated using getAlterTableSQL.'
819-
);
811+
throw new Exception('Sqlite platform does not support alter foreign key.');
820812
}
821813

822814
/**
823815
* {@inheritdoc}
824816
*/
825817
public function getDropForeignKeySQL($foreignKey, $table)
826818
{
827-
throw new Exception(
828-
'Sqlite platform does not support alter foreign key, '
829-
. 'the table must be fully recreated using getAlterTableSQL.'
830-
);
819+
throw new Exception('Sqlite platform does not support alter foreign key.');
831820
}
832821

833822
/**

0 commit comments

Comments
 (0)