Skip to content

Commit 858c1fc

Browse files
committed
⬆️ allow Symfony 8
1 parent 1f160d2 commit 858c1fc

6 files changed

Lines changed: 60 additions & 68 deletions

File tree

.github/workflows/build.yaml

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
name: build
22

3-
on: [push, pull_request]
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request: ~
48

59
env:
610
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -63,6 +67,7 @@ jobs:
6367
symfony: ['*']
6468
with_imagine: [false]
6569
with_oneupbundle: [true]
70+
with_gaufrette: [true]
6671
max_deprecations: [0]
6772
include:
6873
- extra:
@@ -91,11 +96,19 @@ jobs:
9196
with_oneupbundle: false
9297
max_deprecations: 0
9398
- php: '8.4'
94-
symfony: '7.4.*@dev'
99+
symfony: '7.4.*'
95100
dependencies: highest
96101
with_imagine: false
97102
with_oneupbundle: false
98103
max_deprecations: 6
104+
- php: '8.5'
105+
symfony: '8.0.*'
106+
dependencies: highest
107+
with_imagine: false
108+
with_oneupbundle: false
109+
with_gaufrette: false
110+
max_deprecations: 6
111+
99112
name: PHP ${{ matrix.php }} with Symfony ${{ matrix.symfony }} tests with ${{ matrix.dependencies }} dependencies
100113
steps:
101114
- name: Checkout
@@ -110,21 +123,23 @@ jobs:
110123
with:
111124
php-version: ${{ matrix.php }}
112125
extensions: mongodb-stable, pdo_sqlite
113-
- run: composer require --no-update doctrine/annotations:^1.14
126+
- run: composer require --no-update --dev doctrine/annotations:"^1.14 || ^2.0"
114127
- run: |
115128
composer global config --no-plugins allow-plugins.symfony/flex true
116-
composer global require --no-interaction --no-progress symfony/flex:^2.8
129+
composer global require --no-interaction --no-progress symfony/flex:"^2.10"
117130
composer config extra.symfony.require ${{ matrix.symfony }}
118131
if: matrix.symfony != '*'
119132
- name: use possible dev deps
120133
if: contains(matrix.symfony, '@dev')
121134
run: |
122135
composer config minimum-stability dev
123136
composer config prefer-stable true
124-
- run: composer require --no-update liip/imagine-bundle:"^2.0"
137+
- run: composer require --no-update --dev liip/imagine-bundle:"^2.0"
125138
if: matrix.with_imagine
126-
- run: composer require --no-update oneup/flysystem-bundle:"^4.0.1"
139+
- run: composer require --no-update --dev oneup/flysystem-bundle:"^4.0.1"
127140
if: matrix.with_oneupbundle
141+
- run: composer remove --no-update --dev knplabs/knp-gaufrette-bundle
142+
if: ${{ !matrix.with_gaufrette}}
128143
- name: Update project dependencies
129144
uses: ramsey/composer-install@v2
130145
with:

composer.json

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -19,44 +19,44 @@
1919
"ext-simplexml": "*",
2020
"doctrine/persistence": "^3.0 || ^4.0",
2121
"jms/metadata": "^2.4",
22-
"symfony/config": "^5.4 || ^6.0 || ^7.0",
23-
"symfony/console": "^5.4 || ^6.0 || ^7.0",
24-
"symfony/dependency-injection": "^5.4 || ^6.0 || ^7.0",
22+
"symfony/config": "^5.4 || ^6.0 || ^7.0 || ^8.0",
23+
"symfony/console": "^5.4 || ^6.0 || ^7.0 || ^8.0",
24+
"symfony/dependency-injection": "^5.4 || ^6.0 || ^7.0 || ^8.0",
2525
"symfony/event-dispatcher-contracts": "^3.1",
26-
"symfony/http-foundation": "^5.4 || ^6.0 || ^7.0",
27-
"symfony/http-kernel": "^5.4 || ^6.0 || ^7.0",
28-
"symfony/mime": "^5.4 || ^6.0 || ^7.0",
29-
"symfony/property-access": "^5.4 || ^6.0 || ^7.0",
30-
"symfony/string": "^5.4 || ^6.0 || ^7.0"
26+
"symfony/http-foundation": "^5.4 || ^6.0 || ^7.0 || ^8.0",
27+
"symfony/http-kernel": "^5.4 || ^6.0 || ^7.0 || ^8.0",
28+
"symfony/mime": "^5.4 || ^6.0 || ^7.0 || ^8.0",
29+
"symfony/property-access": "^5.4 || ^6.0 || ^7.0 || ^8.0",
30+
"symfony/string": "^5.4 || ^6.0 || ^7.0 || ^8.0"
3131
},
3232
"require-dev": {
3333
"ext-sqlite3": "*",
3434
"dg/bypass-finals": "^1.9",
3535
"doctrine/common": "^3.0",
36-
"doctrine/doctrine-bundle": "^2.7",
36+
"doctrine/doctrine-bundle": "^2.7 || ^3.0",
3737
"doctrine/mongodb-odm": "^2.4",
3838
"doctrine/orm": "^2.13 || ^3.0",
3939
"knplabs/knp-gaufrette-bundle": "dev-master",
4040
"league/flysystem-bundle": "^2.4 || ^3.0",
4141
"league/flysystem-memory": "^2.0 || ^3.0",
42-
"matthiasnoback/symfony-dependency-injection-test": "^5.1",
42+
"matthiasnoback/symfony-dependency-injection-test": "^5.1 || ^6.0",
4343
"mikey179/vfsstream": "^1.6.11",
44-
"phpunit/phpunit": "^10.5 || ^11.5 || ^12.0",
45-
"symfony/asset": "^5.4 || ^6.0 || ^7.0",
46-
"symfony/browser-kit": "^5.4 || ^6.0 || ^7.0",
47-
"symfony/css-selector": "^5.4 || ^6.0 || ^7.0",
48-
"symfony/doctrine-bridge": "^5.4 || ^6.0 || ^7.0",
49-
"symfony/dom-crawler": "^5.4 || ^6.0 || ^7.0",
50-
"symfony/form": "^5.4 || ^6.0 || ^7.0",
51-
"symfony/framework-bundle": "^5.4 || ^6.0 || ^7.0",
52-
"symfony/phpunit-bridge": "^7.2",
53-
"symfony/security-csrf": "^5.4 || ^6.0 || ^7.0",
54-
"symfony/translation": "^5.4 || ^6.0 || ^7.0",
55-
"symfony/twig-bridge": "^5.4 || ^6.0 || ^7.0",
56-
"symfony/twig-bundle": "^5.4 || ^6.0 || ^7.0",
57-
"symfony/validator": "^5.4.22 || ^6.0 || ^7.0",
58-
"symfony/var-dumper": "^5.4 || ^6.0 || ^7.0",
59-
"symfony/yaml": "^5.4 || ^6.0 || ^7.0"
44+
"phpunit/phpunit": "^10.5 || ^11.5 || ^12.2",
45+
"symfony/asset": "^5.4 || ^6.0 || ^7.0 || ^8.0",
46+
"symfony/browser-kit": "^5.4 || ^6.0 || ^7.0 || ^8.0",
47+
"symfony/css-selector": "^5.4 || ^6.0 || ^7.0 || ^8.0",
48+
"symfony/doctrine-bridge": "^5.4 || ^6.0 || ^7.0 || ^8.0",
49+
"symfony/dom-crawler": "^5.4 || ^6.0 || ^7.0 || ^8.0",
50+
"symfony/form": "^5.4 || ^6.0 || ^7.0 || ^8.0",
51+
"symfony/framework-bundle": "^5.4 || ^6.0 || ^7.0 || ^8.0",
52+
"symfony/phpunit-bridge": "^7.3",
53+
"symfony/security-csrf": "^5.4 || ^6.0 || ^7.0 || ^8.0",
54+
"symfony/translation": "^5.4 || ^6.0 || ^7.0 || ^8.0",
55+
"symfony/twig-bridge": "^5.4 || ^6.0 || ^7.0 || ^8.0",
56+
"symfony/twig-bundle": "^5.4 || ^6.0 || ^7.0 || ^8.0",
57+
"symfony/validator": "^5.4.22 || ^6.0 || ^7.0 || ^8.0",
58+
"symfony/var-dumper": "^5.4 || ^6.0 || ^7.0 || ^8.0",
59+
"symfony/yaml": "^5.4 || ^6.0 || ^7.0 || ^8.0"
6060
},
6161
"suggest": {
6262
"doctrine/doctrine-bundle": "For integration with Doctrine",

phpstan-baseline.neon

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -6,36 +6,6 @@ parameters:
66
count: 1
77
path: src/Adapter/PHPCR/PHPCRAdapter.php
88

9-
-
10-
message: '#^Call to an undefined method Symfony\\Component\\Config\\Definition\\Builder\\NodeDefinition\:\:children\(\)\.$#'
11-
identifier: method.notFound
12-
count: 1
13-
path: src/DependencyInjection/Configuration.php
14-
15-
-
16-
message: '#^Call to an undefined method Symfony\\Component\\Config\\Definition\\Builder\\NodeParentInterface\:\:scalarNode\(\)\.$#'
17-
identifier: method.notFound
18-
count: 2
19-
path: src/DependencyInjection/Configuration.php
20-
21-
-
22-
message: '#^Parameter \#1 \$node of method Vich\\UploaderBundle\\DependencyInjection\\Configuration\:\:addGeneralSection\(\) expects Symfony\\Component\\Config\\Definition\\Builder\\ArrayNodeDefinition, Symfony\\Component\\Config\\Definition\\Builder\\NodeDefinition given\.$#'
23-
identifier: argument.type
24-
count: 1
25-
path: src/DependencyInjection/Configuration.php
26-
27-
-
28-
message: '#^Parameter \#1 \$node of method Vich\\UploaderBundle\\DependencyInjection\\Configuration\:\:addMappingsSection\(\) expects Symfony\\Component\\Config\\Definition\\Builder\\ArrayNodeDefinition, Symfony\\Component\\Config\\Definition\\Builder\\NodeDefinition given\.$#'
29-
identifier: argument.type
30-
count: 1
31-
path: src/DependencyInjection/Configuration.php
32-
33-
-
34-
message: '#^Parameter \#1 \$node of method Vich\\UploaderBundle\\DependencyInjection\\Configuration\:\:addMetadataSection\(\) expects Symfony\\Component\\Config\\Definition\\Builder\\ArrayNodeDefinition, Symfony\\Component\\Config\\Definition\\Builder\\NodeDefinition given\.$#'
35-
identifier: argument.type
36-
count: 1
37-
path: src/DependencyInjection/Configuration.php
38-
399
-
4010
message: '#^Method Vich\\UploaderBundle\\Storage\\FileSystemStorage\:\:doUpload\(\) never returns null so it can be removed from the return type\.$#'
4111
identifier: return.unusedType

tests/Fixtures/App/app/config/config.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ doctrine:
2929
path: "%kernel.cache_dir%/database.db3"
3030

3131
orm:
32-
auto_generate_proxy_classes: "%kernel.debug%"
3332
auto_mapping: true
3433

3534
services:

tests/Naming/SlugNamerTest.php

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use Doctrine\ORM\EntityRepository;
66
use PHPUnit\Framework\Attributes\DataProvider;
7+
use PHPUnit\Framework\MockObject\MockBuilder;
78
use Vich\UploaderBundle\Naming\SlugNamer;
89
use Vich\UploaderBundle\Tests\TestCase;
910

@@ -44,11 +45,15 @@ public function testNameReturnsAnUniqueName(string $originalName, ?string $guess
4445
->willReturn($file)
4546
;
4647

47-
$repo = $this->getMockBuilder(EntityRepository::class)
48-
->disableOriginalConstructor()
49-
->addMethods(['findOneBySlug'])
50-
->getMock()
51-
;
48+
// @phpstan-ignore-next-line function.impossibleType
49+
if (\method_exists(MockBuilder::class, 'addMethods')) {
50+
$repo = $this->getMockBuilder(EntityRepository::class)
51+
->disableOriginalConstructor()
52+
->addMethods(['findOneBySlug']) // @phpstan-ignore-line method.notFound
53+
->getMock();
54+
} else {
55+
$repo = $this->createMock(EntityRepository::class);
56+
}
5257
$repo
5358
->method('findOneBySlug')
5459
->willReturnMap([['lala.jpeg', null], ['lala.mp3', new \stdClass()]])

tests/Storage/GaufretteStorageTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ protected function getStorage(): StorageInterface
2626

2727
protected function setUp(): void
2828
{
29+
if (!\class_exists(FilesystemMap::class)) {
30+
self::markTestSkipped('GaufretteBundle is not installed.');
31+
}
2932
$this->filesystemMap = $this->createMock(FilesystemMap::class);
3033

3134
parent::setUp();

0 commit comments

Comments
 (0)