Skip to content

Commit c36a698

Browse files
Add support for Symfony 7 (#35)
1 parent d089185 commit c36a698

File tree

4 files changed

+38
-18
lines changed

4 files changed

+38
-18
lines changed

.github/workflows/test-application.yaml

+20-7
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,16 @@ jobs:
4141
env:
4242
SYMFONY_DEPRECATIONS_HELPER: weak
4343

44+
- php-version: '8.2'
45+
dependency-versions: 'highest'
46+
env:
47+
SYMFONY_DEPRECATIONS_HELPER: weak
48+
49+
- php-version: '8.3'
50+
dependency-versions: 'highest'
51+
env:
52+
SYMFONY_DEPRECATIONS_HELPER: weak
53+
4454
services:
4555
mysql:
4656
image: mysql:5.7
@@ -52,17 +62,21 @@ jobs:
5262

5363
steps:
5464
- name: Checkout project
55-
uses: actions/checkout@v2
65+
uses: actions/checkout@v4
5666

5767
- name: Install and configure PHP
5868
uses: shivammathur/setup-php@v2
5969
with:
6070
php-version: ${{ matrix.php-version }}
61-
extensions: 'imagick'
6271
tools: 'composer:v2'
6372

73+
- name: Remove Lint Tools
74+
# These tools are not required to run tests, so we are removing them to improve dependency resolving and
75+
# testing lowest versions.
76+
run: composer remove "*php-cs-fixer*" "*phpstan*" "*rector*" --dev --no-update
77+
6478
- name: Install composer dependencies
65-
uses: ramsey/composer-install@v1
79+
uses: ramsey/composer-install@v2
6680
with:
6781
dependency-versions: ${{matrix.dependency-versions}}
6882

@@ -80,17 +94,16 @@ jobs:
8094

8195
steps:
8296
- name: Checkout project
83-
uses: actions/checkout@v2
97+
uses: actions/checkout@v4
8498

8599
- name: Install and configure PHP
86100
uses: shivammathur/setup-php@v2
87101
with:
88-
php-version: 8.1
89-
extensions: 'imagick'
102+
php-version: 8.3
90103
tools: 'composer:v2'
91104

92105
- name: Install composer dependencies
93-
uses: ramsey/composer-install@v1
106+
uses: ramsey/composer-install@v2
94107
with:
95108
dependency-versions: ${{matrix.dependency-versions}}
96109

Tests/Application/bin/console.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
if (\class_exists(Debug::class)) {
3434
Debug::enable();
3535
} else {
36-
\Symfony\Component\Debug\Debug::enable();
36+
Symfony\Component\Debug\Debug::enable();
3737
}
3838
}
3939

Tests/Unit/EventListener/SetThemeEventListenerTest.php

+3
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
use PHPUnit\Framework\TestCase;
1717
use Prophecy\Argument;
18+
use Prophecy\PhpUnit\ProphecyTrait;
1819
use Prophecy\Prophecy\ObjectProphecy;
1920
use Sulu\Bundle\PreviewBundle\Preview\Events\PreRenderEvent;
2021
use Sulu\Bundle\ThemeBundle\EventListener\SetThemeEventListener;
@@ -29,6 +30,8 @@
2930

3031
class SetThemeEventListenerTest extends TestCase
3132
{
33+
use ProphecyTrait;
34+
3235
/**
3336
* @var ThemeRepositoryInterface|ObjectProphecy
3437
*/

composer.json

+14-10
Original file line numberDiff line numberDiff line change
@@ -16,24 +16,25 @@
1616
"require": {
1717
"php": "^7.3 || ^8.0",
1818
"sulu/sulu": "^2.4 || ^2.5@dev",
19-
"symfony/config": "^4.4 || ^5.4 || ^6.0",
20-
"symfony/dependency-injection": "^4.4 || ^5.4 || ^6.0",
21-
"symfony/http-kernel": "^5.4 || ^6.0",
22-
"sylius/theme-bundle": "^2.1"
19+
"symfony/config": "^4.4 || ^5.4 || ^6.0 || ^7.0",
20+
"symfony/dependency-injection": "^4.4 || ^5.4 || ^6.0 || ^7.0",
21+
"symfony/http-kernel": "^5.4 || ^6.0 || ^7.0",
22+
"sylius/theme-bundle": "^2.1 || ^2.4@dev"
2323
},
2424
"require-dev": {
25-
"friendsofphp/php-cs-fixer": "^3.1",
26-
"jackalope/jackalope-doctrine-dbal": "^1.3.4",
25+
"jackalope/jackalope-doctrine-dbal": "^1.3.4 || ^2.0",
2726
"jangregor/phpstan-prophecy": "^1.0",
27+
"php-cs-fixer/shim": "^3.1",
2828
"phpspec/prophecy": "^1.15",
29+
"phpspec/prophecy-phpunit": "^2.0",
2930
"phpstan/phpstan": "^1.4",
3031
"phpstan/phpstan-doctrine": "^1.2",
3132
"phpstan/phpstan-phpunit": "^1.0",
3233
"phpstan/phpstan-symfony": "^1.1",
33-
"phpunit/phpunit": "^8.5.9",
34-
"symfony/dotenv": "^5.4 || ^6.0",
34+
"phpunit/phpunit": "^8.5.9 || ^9.5",
35+
"symfony/dotenv": "^5.4 || ^6.0 || ^7.0",
3536
"symfony/monolog-bundle": "^3.1",
36-
"symfony/phpunit-bridge": "^5.2",
37+
"symfony/phpunit-bridge": "^5.2 || ^6.0 || ^7.0",
3738
"thecodingmachine/phpstan-strict-rules": "^1.0"
3839
},
3940
"conflict": {
@@ -87,6 +88,9 @@
8788
]
8889
},
8990
"config": {
90-
"sort-packages": true
91+
"sort-packages": true,
92+
"allow-plugins": {
93+
"php-http/discovery": true
94+
}
9195
}
9296
}

0 commit comments

Comments
 (0)