8000 Manually merge 2.10.x into 2.11.x by greg0ire · Pull Request #4273 · doctrine/dbal · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Manually merge 2.10.x into 2.11.x #4273

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Sep 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/coding-standards.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: "Coding Standards"

on: ["pull_request", "push"]

jobs:
coding-standards:
name: "Coding Standards"
runs-on: "ubuntu-20.04"

strategy:
matrix:
php-version:
- "7.4"

steps:
- name: "Checkout"
uses: "actions/checkout@v2"

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
php-version: "${{ matrix.php-version }}"
tools: "cs2pr"

- name: "Cache dependencies installed with Composer"
uses: "actions/cache@v2"
with:
path: "~/.composer/cache"
key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}"
restore-keys: "php-${{ matrix.php-version }}-composer-locked-"

- name: "Install dependencies with Composer"
run: "composer install --no-interaction --no-progress --no-suggest"

# https://github.com/doctrine/.github/issues/3
- name: "Run PHP_CodeSniffer"
run: "vendor/bin/phpcs -q --no-colors --report=checkstyle | cs2pr"
33 changes: 0 additions & 33 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,39 +69,6 @@ jobs:
- name: "Run a static analysis with vimeo/psalm"
run: "vendor/bin/psalm --show-info=false --stats --output-format=github --threads=4"

coding-standards:
name: "Coding Standards"
runs-on: "ubuntu-latest"

strategy:
matrix:
php-version:
- "7.4"

steps:
- name: "Checkout"
uses: "actions/checkout@v2"

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
php-version: "${{ matrix.php-version }}"
tools: "cs2pr"

- name: "Cache dependencies installed with composer"
uses: "actions/cache@v1"
with:
path: "~/.composer/cache"
key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}"
restore-keys: "php-${{ matrix.php-version }}-composer-locked-"

- name: "Install dependencies with composer"
run: "composer install --no-interaction --no-progress --no-suggest"

- name: "Run squizlabs/php_codesniffer"
run: "vendor/bin/phpcs -q --no-colors --report=checkstyle | cs2pr"

phpunit-oci8:
name: "PHPUnit on OCI8"
runs-on: "ubuntu-latest"
Expand Down
12 changes: 9 additions & 3 deletions lib/Doctrine/DBAL/Driver/AbstractPostgreSQLDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ abstract class AbstractPostgreSQLDriver implements Driver, ExceptionConverterDri
*/
public function convertException($message, DeprecatedDriverException $exception)
{
switch ($exception->getSQLState()) {
$sqlState = $exception->getSQLState();

switch ($sqlState) {
case '40001':
case '40P01':
return new DeadlockException($message, $exception);
Expand Down Expand Up @@ -82,9 +84,13 @@ public function convertException($message, DeprecatedDriverException $exception)
case '42P07':
return new TableExistsException($message, $exception);

case '08006':
return new Exception\ConnectionException($message, $exception);

case '7':
// In some case (mainly connection errors) the PDO exception does not provide a SQLSTATE via its code.
// The exception code is always set to 7 here.
// Prior to fixing https://bugs.php.net/bug.php?id=64705 (PHP 7.3.22 and PHP 7.4.10),
// in some cases (mainly connection errors) the PDO exception wouldn't provide a SQLSTATE via its code.
// The exception code would be always set to 7 here.
// We have to match against the SQLSTATE in the error message in these cases.
if (strpos($exception->getMessage(), 'SQLSTATE[08006]') !== false) {
return new ConnectionException($message, $exception);
Expand Down
5 changes: 0 additions & 5 deletions lib/Doctrine/DBAL/Driver/AbstractSQLiteDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use Doctrine\DBAL\Driver\DriverException as DeprecatedDriverException;
use Doctrine\DBAL\Exception\ConnectionException;
use Doctrine\DBAL\Exception\DriverException;
use Doctrine\DBAL\Exception\ForeignKeyConstraintViolationException;
use Doctrine\DBAL\Exception\InvalidFieldNameException;
use Doctrine\DBAL\Exception\LockWaitTimeoutException;
use Doctrine\DBAL\Exception\NonUniqueFieldNameException;
Expand Down Expand Up @@ -84,10 +83,6 @@ public function convertException($message, DeprecatedDriverException $exception)
return new ConnectionException($message, $exception);
}

if (strpos($exception->getMessage(), 'FOREIGN KEY constraint failed') !== false) {
return new ForeignKeyConstraintViolationException($message, $exception);
}

return new DriverException($message, $exception);
}

Expand Down
131 changes: 0 additions & 131 deletions lib/Doctrine/DBAL/Internal/DependencyOrderCalculator.php

This file was deleted.

12 changes: 0 additions & 12 deletions lib/Doctrine/DBAL/Internal/DependencyOrderEdge.php

This file was deleted.

18 changes: 0 additions & 18 deletions lib/Doctrine/DBAL/Internal/DependencyOrderNode.php

This file was deleted.

10 changes: 0 additions & 10 deletions lib/Doctrine/DBAL/Platforms/AbstractPlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -3219,16 +3219,6 @@ public function supportsForeignKeyConstraints()
return true;
}

/**
* Whether foreign key constraints can be dropped.
*
* If false, then getDropForeignKeySQL() throws exception.
*/
public function supportsCreateDropForeignKeyConstraints(): bool
{
return true;
}

/**
* Whether this platform supports onUpdate in foreign key constraints.
*
Expand Down
15 changes: 2 additions & 13 deletions lib/Doctrine/DBAL/Platforms/SqlitePlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -791,11 +791,6 @@ public function canEmulateSchemas()
* {@inheritDoc}
*/
public function supportsForeignKeyConstraints()
{
return true;
}

public function supportsCreateDropForeignKeyConstraints(): bool
{
return false;
}
Expand All @@ -813,21 +808,15 @@ public function getCreatePrimaryKeySQL(Index $index, $table)
*/
public function getCreateForeignKeySQL(ForeignKeyConstraint $foreignKey, $table)
{
throw new Exception(
'Sqlite platform does not support alter foreign key, '
. 'the table must be fully recreated using getAlterTableSQL.'
);
throw new Exception('Sqlite platform does not support alter foreign key.');
}

/**
* {@inheritdoc}
*/
public function getDropForeignKeySQL($foreignKey, $table)
{
throw new Exception(
'Sqlite platform does not support alter foreign key, '
. 'the table must be fully recreated using getAlterTableSQL.'
);
throw new Exception('Sqlite platform does not support alter foreign key.');
}

/**
Expand Down
Loading
0