Skip to content

Commit

Permalink
Prepare CI for stable DBAL 4
Browse files Browse the repository at this point in the history
  • Loading branch information
derrabus committed Oct 15, 2023
1 parent 4444065 commit dc4faa2
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 36 deletions.
17 changes: 8 additions & 9 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,18 @@ jobs:
- "8.3"
dbal-version:
- "default"
- "3.7"
extension:
- "sqlite3"
- "pdo_sqlite"
deps:
- "highest"
include:
- php-version: "8.2"
dbal-version: "3@dev"
extension: "pdo_sqlite"
- php-version: "8.1"
dbal-version: "4@dev"
extension: "pdo_sqlite"
- php-version: "8.2"
dbal-version: "default"
dbal-version: "4@dev"
extension: "sqlite3"
- php-version: "8.1"
dbal-version: "default"
Expand Down Expand Up @@ -110,7 +109,7 @@ jobs:
- "8.3"
dbal-version:
- "default"
- "3@dev"
- "3.7"
postgres-version:
- "15"
extension:
Expand Down Expand Up @@ -183,7 +182,7 @@ jobs:
- "8.3"
dbal-version:
- "default"
- "3@dev"
- "3.7"
- "4@dev"
mariadb-version:
- "10.9"
Expand Down Expand Up @@ -249,19 +248,19 @@ jobs:
- "8.3"
dbal-version:
- "default"
- "3@dev"
- "3.7"
mysql-version:
- "5.7"
- "8.0"
extension:
- "mysqli"
- "pdo_mysql"
include:
- php-version: "8.1"
- php-version: "8.2"
dbal-version: "4@dev"
mysql-version: "8.0"
extension: "mysqli"
- php-version: "8.1"
- php-version: "8.2"
dbal-version: "4@dev"
mysql-version: "8.0"
extension: "pdo_mysql"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ jobs:
include:
- dbal-version: default
config: phpstan.neon
- dbal-version: 4@dev
config: phpstan-dbal4.neon
- dbal-version: 3.7
config: phpstan-dbal3.neon

steps:
- name: "Checkout code"
Expand Down Expand Up @@ -65,7 +65,7 @@ jobs:
matrix:
dbal-version:
- default
- 4@dev
- 3.7

steps:
- name: "Checkout code"
Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"symfony/cache": "^5.4 || ^6.2",
"vimeo/psalm": "5.15.0"
},
"minimum-stability": "RC",
"suggest": {
"ext-dom": "Provides support for XSD validation for XML mapping files",
"symfony/cache": "Provides cache support for Setup Tool with doctrine/cache 2.0"
Expand Down
34 changes: 34 additions & 0 deletions phpstan-dbal3.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
includes:
- phpstan-baseline.neon
- phpstan-params.neon

parameters:
ignoreErrors:
# Symfony cache supports passing a key prefix to the clear method.
- '/^Method Psr\\Cache\\CacheItemPoolInterface\:\:clear\(\) invoked with 1 parameter, 0 required\.$/'

# We can be certain that those values are not matched.
-
message: '~^Match expression does not handle remaining values:~'
path: lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php

# DBAL 4 compatibility
-
message: '~^Method Doctrine\\ORM\\Query\\AST\\Functions\\TrimFunction::getTrimMode\(\) never returns .* so it can be removed from the return type\.$~'
path: lib/Doctrine/ORM/Query/AST/Functions/TrimFunction.php
-
message: '~^Method Doctrine\\ORM\\Persisters\\Entity\\BasicEntityPersister\:\:getArrayBindingType\(\) never returns .* so it can be removed from the return type\.$~'
path: lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php

-
message: '~^Unreachable statement \- code above always terminates\.$~'
path: lib/Doctrine/ORM/Mapping/AssociationMapping.php

# To be removed in 4.0
-
message: '#Negated boolean expression is always false\.#'
paths:
- lib/Doctrine/ORM/Mapping/Driver/AttributeDriver.php
- lib/Doctrine/ORM/Mapping/Driver/SimplifiedXmlDriver.php
- lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php
- lib/Doctrine/ORM/ORMSetup.php
24 changes: 0 additions & 24 deletions phpstan-dbal4.neon

This file was deleted.

20 changes: 20 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,26 @@ parameters:
message: '~^Unreachable statement \- code above always terminates\.$~'
path: lib/Doctrine/ORM/Mapping/AssociationMapping.php

# Compatibility with DBAL 3
# See https://github.com/doctrine/dbal/pull/3480
-
message: '~^Result of method Doctrine\\DBAL\\Connection::commit\(\) \(void\) is used\.$~'
path: lib/Doctrine/ORM/UnitOfWork.php
-
message: '~^Strict comparison using === between void and false will always evaluate to false\.$~'
path: lib/Doctrine/ORM/UnitOfWork.php
-
message: '~^Variable \$e on left side of \?\? always exists and is not nullable\.$~'
path: lib/Doctrine/ORM/UnitOfWork.php

-
message: '~^Parameter #1 \$command of method Symfony\\Component\\Console\\Application::add\(\) expects Symfony\\Component\\Console\\Command\\Command, Doctrine\\DBAL\\Tools\\Console\\Command\\ReservedWordsCommand given\.$~'
path: lib/Doctrine/ORM/Tools/Console/ConsoleRunner.php

-
message: '~Strict comparison using \=\=\= between callable\(\)\: mixed and null will always evaluate to false\.~'
path: lib/Doctrine/ORM/Tools/SchemaTool.php

# To be removed in 4.0
-
message: '#Negated boolean expression is always false\.#'
Expand Down

0 comments on commit dc4faa2

Please sign in to comment.