Skip to content

Commit d31407b

Browse files
committed
Fixup for DBAL4 changes & Phpstan
1 parent 654e31e commit d31407b

26 files changed

+425
-517
lines changed

.github/workflows/ci.yml

+37-27
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
coverage: none
2626

2727
- name: 'Require Doctrine MongoDB dependencies'
28-
run: composer require --no-update --ignore-platform-reqs --dev --no-interaction --ansi "doctrine/mongodb-odm:^2.4" "doctrine/mongodb-odm-bundle:^4.5.1"
28+
run: composer require --no-update --ignore-platform-reqs --dev --no-interaction --ansi "doctrine/mongodb-odm:^2.6" "doctrine/mongodb-odm-bundle:^5.0.0"
2929

3030
- name: 'Install dependencies'
3131
id: deps
@@ -72,12 +72,7 @@ jobs:
7272
mongodb: true
7373

7474
# Previous Symfony versions
75-
#
7675

77-
# Previous PHP versions
78-
#
79-
80-
# Most recent versions
8176
- name: 'Test Symfony 5.4 [Linux, PHP 8.1]'
8277
os: 'ubuntu-latest'
8378
php: '8.1'
@@ -86,43 +81,58 @@ jobs:
8681
mongodb: true
8782
mysql: true
8883

89-
- name: 'Test Symfony 5.4 [Windows, PHP 8.1]'
90-
os: 'windows-latest'
91-
php: '8.1'
92-
symfony: '5.4.*@dev'
84+
- name: 'Test Symfony 6.4 [Linux, PHP 8.3]'
85+
os: 'ubuntu-latest'
86+
php: '8.3'
87+
symfony: '6.4.*@dev'
88+
allow-unstable: true
9389
mongodb: true
9490
mysql: true
95-
allow-unstable: true
9691

97-
- name: 'Test Symfony 6.3 [Linux, PHP 8.1]'
92+
- name: 'Test Symfony 7.0 [Linux, PHP 8.3]'
9893
os: 'ubuntu-latest'
99-
php: '8.1'
100-
symfony: '6.3.*@dev'
101-
mongodb: true
102-
mysql: true
94+
php: '8.3'
95+
symfony: '7.0.*@dev'
10396
allow-unstable: true
97+
mysql: true
98+
mongodb: true
99+
mongodbnew: true
100+
101+
# Previous PHP versions
104102

105-
- name: 'Test Symfony 6.4 [Linux, PHP 8.1]'
103+
- name: 'Test Symfony 7.1 [Linux, PHP 8.2]'
106104
os: 'ubuntu-latest'
107-
php: '8.1'
108-
symfony: '6.4.*@dev'
105+
php: '8.2'
106+
symfony: '7.0.*@dev'
109107
allow-unstable: true
110108
mysql: true
111109
mongodb: true
110+
mongodbnew: true
112111

113-
- name: 'Test Symfony 7.0 [Linux, PHP 8.2]'
112+
# Most recent versions
113+
114+
- name: 'Test Symfony 7.1 [Linux, PHP 8.3]'
114115
os: 'ubuntu-latest'
115-
php: '8.2'
116+
php: '8.3'
116117
symfony: '7.0.*@dev'
117118
allow-unstable: true
118119
mysql: true
119120
mongodb: true
120121
mongodbnew: true
121122

123+
- name: 'Test Symfony 7.1 [Windows, PHP 8.3]'
124+
os: 'windows-latest'
125+
php: '8.3'
126+
symfony: '7.1.*@dev'
127+
mongodb: true
128+
mongodbnew: true
129+
mysql: true
130+
allow-unstable: true
131+
122132
# Bleeding edge (unreleased dev versions where failures are allowed)
123-
- name: 'Test next Symfony 7.1 [Linux, PHP 8.2] (allowed failure)'
133+
- name: 'Test next Symfony 7.2 [Linux, PHP 8.3] (allowed failure)'
124134
os: 'ubuntu-latest'
125-
php: '8.2'
135+
php: '8.3'
126136
symfony: '7.1.*@dev'
127137
composer-flags: '--ignore-platform-req php'
128138
allow-unstable: true
@@ -131,10 +141,10 @@ jobs:
131141
mongodb: true
132142
mongodbnew: true
133143

134-
- name: 'Test next Symfony 7.1 [Linux, PHP 8.3] (allowed failure)'
144+
- name: 'Test next Symfony 7.2 [Linux, PHP 8.4] (allowed failure)'
135145
os: 'ubuntu-latest'
136-
php: '8.3'
137-
symfony: '7.1.*@dev'
146+
php: '8.4'
147+
symfony: '7.2.*@dev'
138148
composer-flags: '--ignore-platform-req php'
139149
allow-unstable: true
140150
allow-failure: true
@@ -202,7 +212,7 @@ jobs:
202212
if: ${{ matrix.mongodb && !matrix.mongodbnew }}
203213

204214
- name: 'Require Doctrine MongoDB dependencies for new symfony'
205-
run: composer require --no-update ${{ matrix.composer-flags }} --dev --no-interaction --ansi "doctrine/mongodb-odm:^2.6" "doctrine/mongodb-odm-bundle:5.0.x-dev"
215+
run: composer require --no-update ${{ matrix.composer-flags }} --dev --no-interaction --ansi "doctrine/mongodb-odm:^2.6" "doctrine/mongodb-odm-bundle:^5.0.0"
206216
if: ${{ matrix.mongodb && matrix.mongodbnew }}
207217

208218
- name: 'Install dependencies'

.make/try.mk

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#######
2+
# Try #
3+
#######
4+
5+
# Execute first command (try), unconditionnaly run second command (finally), and
6+
# exit with first command return code.
7+
#
8+
# @param $1 First command
9+
# @param $2 Second command
10+
#
11+
# Examples:
12+
#
13+
# Example #1: Run tests and remove artefacts
14+
#
15+
# $(call try_finally, phpunit, rm -Rf artefacts)
16+
17+
define try_finally
18+
( \
19+
$(strip $(1)) \
20+
) ; RC=$${?} \
21+
; $(strip $(2)) \
22+
&& exit $${RC}
23+
endef

.php-version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
8.1
1+
8.2

Makefile

+15-12
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
include .make/help.mk
22
include .make/text.mk
3+
include .make/try.mk
34

45
PHP_CS_FIXER_VERSION=v3.13.0
56

@@ -14,7 +15,7 @@ setup:
1415
## Install - Install deps
1516
install: setup
1617
install:
17-
rm -f symfony composer.lock
18+
rm -f composer.lock
1819
symfony composer config minimum-stability --unset
1920
symfony composer update --prefer-dist --ignore-platform-req=ext-mongodb
2021

@@ -32,13 +33,6 @@ install.54:
3233
symfony composer config minimum-stability dev
3334
symfony composer update --ignore-platform-req=ext-mongodb
3435

35-
## Install - Install Symfony 6.3 deps
36-
install.63: setup
37-
install.63: export SYMFONY_REQUIRE = 6.3.*@dev
38-
install.63:
39-
symfony composer config minimum-stability dev
40-
symfony composer update --ignore-platform-req=ext-mongodb
41-
4236
## Install - Install Symfony 6.4 deps
4337
install.64: setup
4438
install.64: export SYMFONY_REQUIRE = 6.4.*@dev
@@ -61,8 +55,16 @@ install.71:
6155
symfony composer update --ignore-platform-req=ext-mongodb
6256

6357
## Install - Add Doctrine ODM deps
64-
deps.odm.add:
65-
symfony composer require --no-update --no-interaction --dev "doctrine/mongodb-odm:^2.3" "doctrine/mongodb-odm-bundle:^4.4.1"
58+
deps.odm.add: deps.odm.add+sf64
59+
60+
## Install - Add Doctrine ODM deps for Symfony 6.4+
61+
deps.odm.add+sf64:
62+
symfony composer require --no-update --no-interaction --dev "doctrine/mongodb-odm:^2.6" "doctrine/mongodb-odm-bundle:^5.0"
63+
@$(call log_warning, Run again appropriate install target to update dependencies. Be careful not to commit compose.json changes.)
64+
65+
## Install - Add Doctrine ODM deps for Symfony 5.4+
66+
deps.odm.add+sf54:
67+
symfony composer require --no-update --no-interaction --dev "doctrine/mongodb-odm:^2.4" "doctrine/mongodb-odm-bundle:^4.5.1"
6668
@$(call log_warning, Run again appropriate install target to update dependencies. Be careful not to commit compose.json changes.)
6769

6870
## Install - Remove back Doctrine ODM deps
@@ -108,10 +110,12 @@ lint.update:
108110
make php-cs-fixer.phar
109111

110112
lint.php-cs-fixer.fix: php-cs-fixer.phar
113+
lint.php-cs-fixer.fix: export PHP_CS_FIXER_IGNORE_ENV = 1
111114
lint.php-cs-fixer.fix:
112115
symfony php ./php-cs-fixer.phar fix --no-interaction
113116

114117
lint.php-cs-fixer: php-cs-fixer.phar
118+
lint.php-cs-fixer: export PHP_CS_FIXER_IGNORE_ENV = 1
115119
lint.php-cs-fixer:
116120
symfony php ./php-cs-fixer.phar fix --no-interaction --dry-run --diff -vvv
117121

@@ -121,5 +125,4 @@ php-cs-fixer.phar:
121125

122126
lint.phpstan:
123127
@make deps.odm.add install >> /dev/null 2>&1
124-
./vendor/bin/phpstan
125-
@make deps.odm.rm install >> /dev/null 2>&1
128+
$(call try_finally, ./vendor/bin/phpstan, make deps.odm.rm install >> /dev/null 2>&1)

composer.json

+15-16
Original file line numberDiff line numberDiff line change
@@ -41,22 +41,22 @@
4141
"require-dev": {
4242
"ext-pdo_sqlite": "*",
4343
"composer/semver": "^3.2",
44-
"doctrine/dbal": "^3.2|^4.0",
45-
"doctrine/doctrine-bundle": "^2.5",
46-
"doctrine/orm": "^2.10|^3.0",
44+
"doctrine/dbal": "^3.8|^4.0",
45+
"doctrine/doctrine-bundle": "^2.11",
46+
"doctrine/orm": "^2.20|^3.0",
4747
"phpstan/phpstan": "^1.10",
4848
"phpstan/phpstan-symfony": "^1.2",
49-
"symfony/browser-kit": "^5.4|^6.3|^7.0",
50-
"symfony/config": "^5.4|^6.3|^7.0",
51-
"symfony/dependency-injection": "^5.4.2|^6.3|^7.0",
52-
"symfony/filesystem": "^5.4|^6.3|^7.0",
53-
"symfony/form": "^5.4|^6.3|^7.0",
54-
"symfony/framework-bundle": "^5.4|^6.3|^7.0",
55-
"symfony/http-kernel": "^5.4.2|^6.3|^7.0",
56-
"symfony/phpunit-bridge": "^5.4|^6.3|^7.0",
57-
"symfony/translation": "^5.4|^6.3|^7.0",
58-
"symfony/var-dumper": "^5.4|^6.3|^7.0",
59-
"symfony/yaml": "^5.4|^6.3|^7.0"
49+
"symfony/browser-kit": "^5.4.40|^6.4|^7.0",
50+
"symfony/config": "^5.4.40|^6.4|^7.0",
51+
"symfony/dependency-injection": "^5.4.40|^6.4|^7.0",
52+
"symfony/filesystem": "^5.4.40|^6.4|^7.0",
53+
"symfony/form": "^5.4.40|^6.4|^7.0",
54+
"symfony/framework-bundle": "^5.4.40|^6.4|^7.0",
55+
"symfony/http-kernel": "^5.4.40|^6.4|^7.0",
56+
"symfony/phpunit-bridge": "^5.4.40|^6.4|^7.0",
57+
"symfony/translation": "^5.4.40|^6.4|^7.0",
58+
"symfony/var-dumper": "^5.4.40|^6.4|^7.0",
59+
"symfony/yaml": "^5.4.40|^6.4|^7.0"
6060
},
6161
"extra": {
6262
"branch-alias": {
@@ -68,6 +68,5 @@
6868
"*": "dist"
6969
},
7070
"sort-packages": true
71-
},
72-
"minimum-stability": "dev"
71+
}
7372
}

docker-compose.yml

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
version: '3.3'
2-
31
services:
42
db:
53
image: mysql:8.0

phpstan.neon.dist phpstan.dist.neon

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,7 @@ parameters:
77
paths:
88
- src
99

10-
checkMissingIterableValueType: false
1110
treatPhpDocTypesAsCertain: false
11+
12+
ignoreErrors:
13+
- identifier: missingType.iterableValue

phpunit.xml.dist

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<env name="DOCTRINE_DBAL_URL" value="sqlite:///%kernel.cache_dir%/db.sqlite" />
1717
<!--<env name="DOCTRINE_DBAL_URL" value="pdo-mysql://root@localhost:3306/doctrine_tests" />-->
1818
<env name="SYMFONY_DEPRECATIONS_HELPER" value="max[direct]=0&amp;max[self]=0&amp;max[total]=9999&amp;verbose=1&amp;baselineFile=./tests/allowed-deprecations.json&amp;generateBaseline=0"/>
19-
<env name="SYMFONY_PHPUNIT_REQUIRE" value="phpspec/prophecy-phpunit"/>
19+
<env name="SYMFONY_PHPUNIT_REQUIRE" value=""/>
2020
<env name="SYMFONY_PHPUNIT_VERSION" value="9.5"/>
2121
</php>
2222
<testsuites>

src/Bridge/Doctrine/DBAL/Types/AbstractEnumSQLDeclarationType.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ abstract class AbstractEnumSQLDeclarationType extends AbstractEnumType
2525
/**
2626
* {@inheritdoc}
2727
*/
28-
public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform): string
28+
public function getSQLDeclaration(array $column, AbstractPlatform $platform): string
2929
{
3030
if (class_exists(AbstractMySQLPlatform::class)) {
3131
if (!$platform instanceof AbstractMySQLPlatform) {

0 commit comments

Comments
 (0)