Skip to content

Commit 37622f0

Browse files
Add support for Symfony 7 (#1776)
1 parent 8eaec5e commit 37622f0

File tree

64 files changed

+228
-178
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+228
-178
lines changed

.github/workflows/test.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@ jobs:
5858
allowed-to-fail: false
5959
symfony-require: 6.4.*
6060
variant: symfony/symfony:"6.4.*"
61+
- php-version: '8.3'
62+
dependencies: highest
63+
allowed-to-fail: false
64+
symfony-require: 7.0.*
65+
variant: symfony/symfony:"7.0.*"
6166

6267
steps:
6368
- name: Checkout

composer.json

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -33,47 +33,47 @@
3333
"sonata-project/seo-bundle": "^3.4",
3434
"sonata-project/twig-extensions": "^1.3 || ^2.0",
3535
"symfony-cmf/routing-bundle": "^2.1 || ^3.0",
36-
"symfony/config": "^5.4 || ^6.2",
37-
"symfony/console": "^5.4 || ^6.2",
38-
"symfony/dependency-injection": "^5.4 || ^6.2",
39-
"symfony/form": "^5.4 || ^6.2",
40-
"symfony/framework-bundle": "^5.4 || ^6.2",
41-
"symfony/http-foundation": "^5.4 || ^6.2",
42-
"symfony/http-kernel": "^5.4 || ^6.2",
43-
"symfony/intl": "^5.4 || ^6.2",
44-
"symfony/options-resolver": "^5.4 || ^6.2",
45-
"symfony/process": "^5.4 || ^6.2",
46-
"symfony/property-access": "^5.4 || ^6.2",
47-
"symfony/property-info": "^5.4 || ^6.2",
48-
"symfony/routing": "^5.4 || ^6.2",
49-
"symfony/runtime": "^5.4 || ^6.2",
50-
"symfony/security-core": "^5.4 || ^6.2",
51-
"symfony/security-http": "^5.4 || ^6.2",
52-
"symfony/serializer": "^5.4.24 || ^6.2.11",
53-
"symfony/validator": "^5.4 || ^6.2",
36+
"symfony/config": "^5.4 || ^6.2 || ^7.0",
37+
"symfony/console": "^5.4 || ^6.2 || ^7.0",
38+
"symfony/dependency-injection": "^5.4 || ^6.2 || ^7.0",
39+
"symfony/form": "^5.4 || ^6.2 || ^7.0",
40+
"symfony/framework-bundle": "^5.4 || ^6.2 || ^7.0",
41+
"symfony/http-foundation": "^5.4 || ^6.2 || ^7.0",
42+
"symfony/http-kernel": "^5.4 || ^6.2 || ^7.0",
43+
"symfony/intl": "^5.4 || ^6.2 || ^7.0",
44+
"symfony/options-resolver": "^5.4 || ^6.2 || ^7.0",
45+
"symfony/process": "^5.4 || ^6.2 || ^7.0",
46+
"symfony/property-access": "^5.4 || ^6.2 || ^7.0",
47+
"symfony/property-info": "^5.4 || ^6.2 || ^7.0",
48+
"symfony/routing": "^5.4 || ^6.2 || ^7.0",
49+
"symfony/runtime": "^5.4 || ^6.2 || ^7.0",
50+
"symfony/security-core": "^5.4 || ^6.2 || ^7.0",
51+
"symfony/security-http": "^5.4 || ^6.2 || ^7.0",
52+
"symfony/serializer": "^5.4.24 || ^6.2.11 || ^7.0",
53+
"symfony/validator": "^5.4 || ^6.2 || ^7.0",
5454
"twig/string-extra": "^3.0",
5555
"twig/twig": "^3.0"
5656
},
5757
"require-dev": {
58-
"dama/doctrine-test-bundle": "^7.0",
58+
"dama/doctrine-test-bundle": "^8.0",
5959
"friendsofphp/php-cs-fixer": "^3.4",
6060
"masterminds/html5": "^2.7",
61-
"matthiasnoback/symfony-dependency-injection-test": "^4.1.1",
61+
"matthiasnoback/symfony-dependency-injection-test": "^4.1.1 || ^5.0",
6262
"phpstan/extension-installer": "^1.0",
6363
"phpstan/phpstan": "^1.0",
6464
"phpstan/phpstan-phpunit": "^1.0",
6565
"phpstan/phpstan-strict-rules": "^1.3",
6666
"phpstan/phpstan-symfony": "^1.0",
6767
"phpunit/phpunit": "^9.5",
68-
"psalm/plugin-phpunit": "^0.18",
68+
"psalm/plugin-phpunit": "^0.19",
6969
"psalm/plugin-symfony": "^5.0",
7070
"rector/rector": "^1.1",
71-
"symfony/browser-kit": "^5.4 || ^6.2",
72-
"symfony/css-selector": "^5.4 || ^6.2",
73-
"symfony/filesystem": "^5.4 || ^6.2",
71+
"symfony/browser-kit": "^5.4 || ^6.2 || ^7.0",
72+
"symfony/css-selector": "^5.4 || ^6.2 || ^7.0",
73+
"symfony/filesystem": "^5.4 || ^6.2 || ^7.0",
7474
"symfony/panther": "^2.0.1",
75-
"symfony/phpunit-bridge": "^6.2",
76-
"symfony/yaml": "^5.4 || ^6.2",
75+
"symfony/phpunit-bridge": "^7.0",
76+
"symfony/yaml": "^5.4 || ^6.2 || ^7.0",
7777
"vimeo/psalm": "^5.0"
7878
},
7979
"conflict": {

src/Admin/BlockAdmin.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ final class BlockAdmin extends BaseBlockAdmin
4747
*/
4848
public function __construct(
4949
BlockServiceManagerInterface $blockManager,
50-
private array $blocks = []
50+
private array $blocks = [],
5151
) {
5252
parent::__construct($blockManager);
5353
}
@@ -206,7 +206,7 @@ private function configureBlockFields(FormMapper $form, BlockInterface $block):
206206
$service = $this->blockManager->get($block);
207207

208208
if (!$service instanceof EditableBlockService) {
209-
throw new \RuntimeException(sprintf(
209+
throw new \RuntimeException(\sprintf(
210210
'The block "%s" must implement %s',
211211
$blockType,
212212
EditableBlockService::class

src/Admin/PageAdmin.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ final class PageAdmin extends AbstractAdmin
4848

4949
public function __construct(
5050
private PageManagerInterface $pageManager,
51-
private SiteManagerInterface $siteManager
51+
private SiteManagerInterface $siteManager,
5252
) {
5353
parent::__construct();
5454
}
@@ -119,7 +119,7 @@ protected function alterNewInstance(object $object): void
119119
protected function configurePersistentParameters(): array
120120
{
121121
$parameters = [];
122-
$key = sprintf('%s.current_site', $this->getCode());
122+
$key = \sprintf('%s.current_site', $this->getCode());
123123

124124
if (!$this->hasRequest()) {
125125
return $parameters;
@@ -192,7 +192,7 @@ protected function configureDatagridFilters(DatagridMapper $filter): void
192192
$builder = $queryBuilder->getQueryBuilder();
193193

194194
if (\in_array($data->getValue(), ['hybrid', 'cms'], true)) {
195-
$builder->andWhere(sprintf('%s.routeName %s :routeName', $alias, 'cms' === $data->getValue() ? '=' : '!='));
195+
$builder->andWhere(\sprintf('%s.routeName %s :routeName', $alias, 'cms' === $data->getValue() ? '=' : '!='));
196196
$builder->setParameter('routeName', PageInterface::PAGE_ROUTE_CMS_NAME);
197197

198198
return true;

src/Admin/SharedBlockAdmin.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ final class SharedBlockAdmin extends BaseBlockAdmin
3030

3131
protected function generateBaseRoutePattern(bool $isChildAdmin = false): string
3232
{
33-
return sprintf('%s/%s', parent::generateBaseRoutePattern($isChildAdmin), 'shared');
33+
return \sprintf('%s/%s', parent::generateBaseRoutePattern($isChildAdmin), 'shared');
3434
}
3535

3636
protected function generateBaseRouteName(bool $isChildAdmin = false): string
3737
{
38-
return sprintf('%s_%s', parent::generateBaseRouteName($isChildAdmin), 'shared');
38+
return \sprintf('%s_%s', parent::generateBaseRouteName($isChildAdmin), 'shared');
3939
}
4040

4141
/**
@@ -101,7 +101,7 @@ private function configureBlockFields(FormMapper $form, BlockInterface $block):
101101
$service = $this->blockManager->get($block);
102102

103103
if (!$service instanceof EditableBlockService) {
104-
throw new \RuntimeException(sprintf(
104+
throw new \RuntimeException(\sprintf(
105105
'The block "%s" is not a valid %s',
106106
$blockType,
107107
EditableBlockService::class

src/Admin/SnapshotAdmin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ final class SnapshotAdmin extends AbstractAdmin
4040
public function __construct(
4141
private TransformerInterface $transformer,
4242
private PageManagerInterface $pageManager,
43-
private SnapshotManagerInterface $snapshotManager
43+
private SnapshotManagerInterface $snapshotManager,
4444
) {
4545
parent::__construct();
4646
}

src/Block/BreadcrumbBlockService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ final class BreadcrumbBlockService extends BaseBreadcrumbMenuBlockService implem
3535
public function __construct(
3636
Environment $twig,
3737
FactoryInterface $factory,
38-
private CmsManagerSelectorInterface $cmsSelector
38+
private CmsManagerSelectorInterface $cmsSelector,
3939
) {
4040
parent::__construct($twig, $factory);
4141
}

src/Block/ChildrenPagesBlockService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public function __construct(
5252
Environment $twig,
5353
private SiteSelectorInterface $siteSelector,
5454
private CmsManagerSelectorInterface $cmsManagerSelector,
55-
private AdminInterface $pageAdmin
55+
private AdminInterface $pageAdmin,
5656
) {
5757
parent::__construct($twig);
5858
}

src/Block/PageListBlockService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ final class PageListBlockService extends AbstractBlockService implements Editabl
3434
{
3535
public function __construct(
3636
Environment $twig,
37-
private PageManagerInterface $pageManager
37+
private PageManagerInterface $pageManager,
3838
) {
3939
parent::__construct($twig);
4040
}

src/Block/SharedBlockBlockService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ final class SharedBlockBlockService extends AbstractBlockService implements Edit
4646
public function __construct(
4747
Environment $twig,
4848
private ManagerInterface $blockManager,
49-
private AdminInterface $sharedBlockAdmin
49+
private AdminInterface $sharedBlockAdmin,
5050
) {
5151
parent::__construct($twig);
5252
}

0 commit comments

Comments
 (0)