Skip to content

Commit

Permalink
Merge branch '3.2.x' into 4.0.x
Browse files Browse the repository at this point in the history
  • Loading branch information
morozov committed Jul 15, 2021
2 parents c242a4f + 812213b commit 3713f6a
Show file tree
Hide file tree
Showing 24 changed files with 246 additions and 161 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/coding-standards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
strategy:
matrix:
php-version:
- "7.4"
- "8.0"

steps:
- name: "Checkout"
Expand Down
13 changes: 1 addition & 12 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ jobs:
- "7.3"
- "7.4"
- "8.0"
- "8.1"
dependencies:
- "highest"
include:
Expand Down Expand Up @@ -69,7 +68,6 @@ jobs:
php-version:
- "7.4"
- "8.0"
- "8.1"

services:
oracle:
Expand Down Expand Up @@ -113,7 +111,6 @@ jobs:
php-version:
- "7.4"
- "8.0"
- "8.1"

services:
oracle:
Expand Down Expand Up @@ -162,8 +159,6 @@ jobs:
include:
- php-version: "8.0"
postgres-version: "13"
- php-version: "8.1"
postgres-version: "13"

services:
postgres:
Expand Down Expand Up @@ -225,12 +220,6 @@ jobs:
- php-version: "8.0"
mariadb-version: "10.5"
extension: "pdo_mysql"
- php-version: "8.1"
mariadb-version: "10.5"
extension: "mysqli"
- php-version: "8.1"
mariadb-version: "10.5"
extension: "pdo_mysql"

services:
mariadb:
Expand Down Expand Up @@ -390,7 +379,7 @@ jobs:

services:
mssql:
image: "microsoft/mssql-server-linux:2017-latest"
image: "mcr.microsoft.com/mssql/server:2017-latest"
env:
ACCEPT_EULA: "Y"
SA_PASSWORD: "Doctrine2018"
Expand Down
20 changes: 0 additions & 20 deletions .github/workflows/release-on-milestone-closed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,3 @@ jobs:
"SIGNING_SECRET_KEY": ${{ secrets.SIGNING_SECRET_KEY }}
"GIT_AUTHOR_NAME": ${{ secrets.GIT_AUTHOR_NAME }}
"GIT_AUTHOR_EMAIL": ${{ secrets.GIT_AUTHOR_EMAIL }}

- name: "Create Merge-Up Pull Request"
uses: "laminas/[email protected]"
with:
command-name: "laminas:automatic-releases:create-merge-up-pull-request"
env:
"GITHUB_TOKEN": ${{ secrets.GITHUB_TOKEN }}
"SIGNING_SECRET_KEY": ${{ secrets.SIGNING_SECRET_KEY }}
"GIT_AUTHOR_NAME": ${{ secrets.GIT_AUTHOR_NAME }}
"GIT_AUTHOR_EMAIL": ${{ secrets.GIT_AUTHOR_EMAIL }}

- name: "Create and/or Switch to new Release Branch"
uses: "laminas/automatic-releases@v1"
with:
command-name: "laminas:automatic-releases:switch-default-branch-to-next-minor"
env:
"GITHUB_TOKEN": ${{ secrets.ORGANIZATION_ADMIN_TOKEN }}
"SIGNING_SECRET_KEY": ${{ secrets.SIGNING_SECRET_KEY }}
"GIT_AUTHOR_NAME": ${{ secrets.GIT_AUTHOR_NAME }}
"GIT_AUTHOR_EMAIL": ${{ secrets.GIT_AUTHOR_EMAIL }}
24 changes: 14 additions & 10 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,24 @@ jobs:
strategy:
matrix:
php-version:
- "7.4"
- "8.0"

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

- name: Psalm
uses: docker://vimeo/psalm-github-actions:4.6.4
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
composer_require_dev: true
args: --shepherd
coverage: none
php-version: ${{ matrix.php-version }}
tools: cs2pr

- name: Psalm type inference tests
uses: docker://vimeo/psalm-github-actions:4.6.4
with:
composer_require_dev: true
args: --config=psalm-strict.xml
- name: Install dependencies with Composer
uses: ramsey/composer-install@v1

- name: Run static analysis with Vimeo Psalm
run: vendor/bin/psalm --shepherd

- name: Run type inference tests with Vimeo Psalm
run: vendor/bin/psalm --config=psalm-strict.xml --shepherd
11 changes: 11 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,17 @@ The following methods have been removed.

# Upgrade to 3.2

## Deprecated static calls to `Comparator::compareSchemas($fromSchema, $toSchema)`

The usage of `Comparator::compareSchemas($fromSchema, $toSchema)` statically is
deprecated in order to provide a more consistent API.

## Deprecated `Comparator::compare($fromSchema, $toSchema)`

The usage of `Comparator::compare($fromSchema, $toSchema)` is deprecated and
replaced by `Comparator::compareSchemas($fromSchema, $toSchema)` in order to
clarify the purpose of the method.

## Deprecated `Connection::lastInsertId($name)`

The usage of `Connection::lastInsertId()` with a sequence name is deprecated as unsafe in scenarios with multiple
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
},
"require-dev": {
"doctrine/coding-standard": "9.0.0",
"jetbrains/phpstorm-stubs": "2020.2",
"jetbrains/phpstorm-stubs": "2021.1",
"phpstan/phpstan": "0.12.81",
"phpstan/phpstan-phpunit": "0.12.18",
"phpstan/phpstan-strict-rules": "0.12.2",
Expand All @@ -48,7 +48,7 @@
"squizlabs/php_codesniffer": "3.6.0",
"symfony/cache": "^5.2|^6.0",
"symfony/console": "^2.0.5|^3.0|^4.0|^5.0|^6.0",
"vimeo/psalm": "4.6.4"
"vimeo/psalm": "4.8.1"
},
"suggest": {
"symfony/console": "For helpful console commands such as SQL execution and import of files."
Expand Down
9 changes: 2 additions & 7 deletions phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
<!-- Show progress of the run and show sniff names -->
<arg value="ps"/>

<config name="php_version" value="70300"/>

<file>bin</file>
<file>src</file>
<file>tests</file>
Expand All @@ -36,13 +38,6 @@
<exclude-pattern>*/lib/Doctrine/DBAL/Driver/PDOStatementImplementations.php</exclude-pattern>
</rule>

<!-- Disable the rules that will require PHP 7.4 -->
<rule ref="SlevomatCodingStandard.TypeHints.PropertyTypeHint">
<properties>
<property name="enableNativeTypeHint" value="false"/>
</properties>
</rule>

<rule ref="PSR2.Classes.PropertyDeclaration.Underscore">
<exclude-pattern>*/src/Configuration.php</exclude-pattern>
<exclude-pattern>*/src/Connection.php</exclude-pattern>
Expand Down
10 changes: 10 additions & 0 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ parameters:

# weird class name, represented in stubs as OCI_(Lob|Collection)
- '~unknown class OCI-(Lob|Collection)~'
- '~^Call to method writeTemporary\(\) on an unknown class OCILob\.~'

# Requires a release of https://github.com/JetBrains/phpstorm-stubs/pull/553
-
Expand Down Expand Up @@ -123,6 +124,15 @@ parameters:
message: '~^Instanceof between Doctrine\\DBAL\\Platforms\\Keywords\\KeywordList and Doctrine\\DBAL\\Platforms\\Keywords\\KeywordList will always evaluate to true\.~'
paths:
- %currentWorkingDirectory%/src/Platforms/AbstractPlatform.php

# See https://github.com/doctrine/dbal/pull/4707
# TODO: remove in 4.0.0
-
message: '~^Dynamic call to static method Doctrine\\DBAL\\Schema\\Comparator::compareSchemas\(\)\.$~'
paths:
- %currentWorkingDirectory%/src/Schema/AbstractSchemaManager.php
- %currentWorkingDirectory%/src/Schema/Comparator.php
- %currentWorkingDirectory%/src/Schema/Schema.php
includes:
- vendor/phpstan/phpstan-phpunit/extension.neon
- vendor/phpstan/phpstan-phpunit/rules.neon
Expand Down
37 changes: 24 additions & 13 deletions psalm.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,13 @@
-->
<referencedMethod name="Doctrine\DBAL\Query\QueryBuilder::execute"/>
<referencedMethod name="Doctrine\DBAL\Statement::execute"/>
<!--
See https://github.com/doctrine/dbal/pull/4707
TODO: remove in 4.0.0
-->
<file name="src/Schema/Comparator.php" />
<file name="tests/Functional/Platform/NewPrimaryKeyWithNewAutoIncrementColumnTest.php" />
<file name="tests/Schema/ComparatorTest.php" />
</errorLevel>
</DeprecatedMethod>
<DocblockTypeContradiction>
Expand All @@ -85,6 +92,8 @@
See https://github.com/vimeo/psalm/issues/5325
-->
<file name="tests/Driver/OCI8/ExecutionModeTest.php"/>
<!-- See https://github.com/vimeo/psalm/issues/5472 -->
<file name="src/Portability/Converter.php"/>
</errorLevel>
</DocblockTypeContradiction>
<FalsableReturnStatement>
Expand Down Expand Up @@ -117,6 +126,12 @@
<file name="src/Driver/OCI8/Connection.php"/>
</errorLevel>
</ImplementedReturnTypeMismatch>
<InvalidDocblock>
<errorLevel type="suppress">
<!-- See https://github.com/vimeo/psalm/issues/5472 -->
<file name="src/Portability/Converter.php"/>
</errorLevel>
</InvalidDocblock>
<InvalidPropertyAssignmentValue>
<errorLevel type="suppress">
<!-- Fixing this issue requires an API change -->
Expand Down Expand Up @@ -174,24 +189,11 @@
</RedundantCondition>
<RedundantConditionGivenDocblockType>
<errorLevel type="suppress">
<!--
Requires a release of https://github.com/JetBrains/phpstorm-stubs/pull/1055
-->
<file name="src/Driver/Mysqli/Result.php"/>
<!--
Requires a release of https://github.com/JetBrains/phpstorm-stubs/pull/1053
-->
<file name="src/Driver/PDO/Result.php"/>
<!--
Fixing these issues requires support of union types at the language level
or breaking API changes.
-->
<file name="src/Platforms/MySQLPlatform.php"/>
<!--
Requires a release of
https://github.com/JetBrains/phpstorm-stubs/commit/43ce0bb13e927b9eb69cc06c16ab22f548c4735b
-->
<file name="src/Driver/Mysqli/Connection.php"/>
</errorLevel>
</RedundantConditionGivenDocblockType>
<TypeDoesNotContainType>
Expand All @@ -215,6 +217,12 @@
<file name="src/Tools/Dumper.php"/>
</errorLevel>
</UndefinedClass>
<UndefinedDocblockClass>
<errorLevel type="suppress">
<!-- See https://github.com/vimeo/psalm/issues/5472 -->
<referencedClass name="Doctrine\DBAL\Portability\T"/>
</errorLevel>
</UndefinedDocblockClass>
<UnsafeInstantiation>
<errorLevel type="suppress">
<!-- See https://github.com/doctrine/dbal/issues/4511 -->
Expand All @@ -231,6 +239,9 @@
<errorLevel type="suppress">
<!-- See https://github.com/vimeo/psalm/issues/4295 -->
<file name="src/Exception/DriverException.php"/>

<!-- See https://bugs.php.net/bug.php?id=77591 -->
<referencedFunction name="db2_autocommit"/>
</errorLevel>
</InvalidScalarArgument>
<InvalidReturnStatement>
Expand Down
4 changes: 2 additions & 2 deletions src/Driver/OCI8/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ public function query(string $sql): ResultInterface
return $this->prepare($sql)->execute();
}

public function quote(string $input): string
public function quote(string $value): string
{
return "'" . addcslashes(str_replace("'", "''", $input), "\000\n\r\\\032") . "'";
return "'" . addcslashes(str_replace("'", "''", $value), "\000\n\r\\\032") . "'";
}

public function exec(string $sql): int
Expand Down
4 changes: 2 additions & 2 deletions src/Driver/SQLSrv/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ public function query(string $sql): ResultInterface
return $this->prepare($sql)->execute();
}

public function quote(string $input): string
public function quote(string $value): string
{
return "'" . str_replace("'", "''", $input) . "'";
return "'" . str_replace("'", "''", $value) . "'";
}

public function exec(string $sql): int
Expand Down
10 changes: 5 additions & 5 deletions src/Platforms/AbstractPlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -1189,11 +1189,11 @@ public function getWriteLockSQL(): string
/**
* Returns the SQL snippet to drop an existing database.
*
* @param string $database The name of the database that should be dropped.
* @param string $name The name of the database that should be dropped.
*/
public function getDropDatabaseSQL(string $database): string
public function getDropDatabaseSQL(string $name): string
{
return 'DROP DATABASE ' . $database;
return 'DROP DATABASE ' . $name;
}

/**
Expand Down Expand Up @@ -2620,11 +2620,11 @@ public function getSequenceNextValSQL(string $sequence): string
/**
* Returns the SQL to create a new database.
*
* @param string $database The name of the database that should be created.
* @param string $name The name of the database that should be created.
*
* @throws Exception If not supported on this platform.
*/
public function getCreateDatabaseSQL(string $database): string
public function getCreateDatabaseSQL(string $name): string
{
throw NotSupported::new(__METHOD__);
}
Expand Down
8 changes: 4 additions & 4 deletions src/Platforms/DB2Platform.php
Original file line number Diff line number Diff line change
Expand Up @@ -328,14 +328,14 @@ public function getDropViewSQL(string $name): string
return 'DROP VIEW ' . $name;
}

public function getCreateDatabaseSQL(string $database): string
public function getCreateDatabaseSQL(string $name): string
{
return 'CREATE DATABASE ' . $database;
return 'CREATE DATABASE ' . $name;
}

public function getDropDatabaseSQL(string $database): string
public function getDropDatabaseSQL(string $name): string
{
return 'DROP DATABASE ' . $database;
return 'DROP DATABASE ' . $name;
}

public function supportsCreateDropDatabase(): bool
Expand Down
8 changes: 4 additions & 4 deletions src/Platforms/MySQLPlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -300,14 +300,14 @@ public function getListTableMetadataSQL(string $table, ?string $database = null)
);
}

public function getCreateDatabaseSQL(string $database): string
public function getCreateDatabaseSQL(string $name): string
{
return 'CREATE DATABASE ' . $database;
return 'CREATE DATABASE ' . $name;
}

public function getDropDatabaseSQL(string $database): string
public function getDropDatabaseSQL(string $name): string
{
return 'DROP DATABASE ' . $database;
return 'DROP DATABASE ' . $name;
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/Platforms/OraclePlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -703,9 +703,9 @@ public function getForeignKeyReferentialActionSQL(string $action): string
}
}

public function getDropDatabaseSQL(string $database): string
public function getDropDatabaseSQL(string $name): string
{
return 'DROP USER ' . $database . ' CASCADE';
return 'DROP USER ' . $name . ' CASCADE';
}

/**
Expand Down
Loading

0 comments on commit 3713f6a

Please sign in to comment.