Skip to content

Commit d997f63

Browse files
committed
allow installation with symfony 6
1 parent 43c99e0 commit d997f63

File tree

7 files changed

+60
-62
lines changed

7 files changed

+60
-62
lines changed

.github/workflows/test-application.yaml

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,16 @@ jobs:
2222
fail-fast: false
2323
matrix:
2424
include:
25-
- php-version: '7.4'
25+
- php-version: '8.1'
2626
dependencies: 'lowest'
27-
- php-version: '7.4'
28-
symfony-version: 4.4.*
29-
test-installation: true
30-
- php-version: '7.4'
31-
symfony-version: 5.0.*
32-
test-installation: true
33-
- php-version: '8.0'
34-
symfony-version: 5.1.*
35-
test-installation: true
27+
- php-version: '8.1'
28+
- php-version: '8.2'
29+
- php-version: '8.3'
30+
symfony-version: 6.4.*
3631

3732
steps:
3833
- name: Checkout project
39-
uses: actions/checkout@v2
34+
uses: actions/checkout@v4
4035

4136
- name: Install and configure PHP
4237
uses: shivammathur/setup-php@v2
@@ -45,17 +40,15 @@ jobs:
4540
tools: 'composer:v2'
4641

4742
- name: Install Symfony Flex
48-
run: composer global require --no-progress --no-scripts --no-plugins symfony/flex
43+
run: |
44+
composer global require --no-progress --no-scripts --no-plugins symfony/flex
45+
composer global config --no-plugins allow-plugins.symfony/flex true
4946
5047
- name: Install dependencies with Composer
51-
uses: ramsey/composer-install@v1
48+
uses: ramsey/composer-install@v2
5249
with:
5350
dependency-versions: ${{ matrix.dependencies }}
5451
composer-options: --prefer-dist
5552

5653
- name: Execute test cases
5754
run: make test
58-
59-
- name: Test installation
60-
if: ${{ matrix.test-installation == true }}
61-
run: make test

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Changelog
44
3.0.0 (unreleased)
55
-----
66

7+
* Support Symfony 6
78
* Adjust to doctrine and twig BC breaks. If you extended classes or customized services, check for old `Twig_*` classes or `Doctrine\Common\Persistence` namespace.
89
* Drop support for old Symfony versions
910
* Drop support for old PHP versions
@@ -41,7 +42,7 @@ Released 2.0.0
4142
2.0.0-RC1
4243
---------
4344

44-
* **2017-01-17**: [BC BREAK] Removed DoctrineOrmMappingsPass - all active Doctrine versions contain the mapping pass. Use `Doctrine\Bundle\DoctrineBundle\DependencyInjection\Compiler\DoctrineOrmMappingsPass` instead.
45+
* **2017-01-17**: [BC BREAK] Removed DoctrineOrmMappingsPass - all active Doctrine versions contain the mapping pass. Use `Doctrine\Bundle\DoctrineBundle\DependencyInjection\Compiler\DoctrineOrmMappingsPass` instead.
4546
* **2017-01-13**: [BC BREAK] Removed the `Slugifier` classes and the
4647
dependency on `symfony-cmf/slugifier-api`.
4748
* **2016-12-03**: [BC BREAK] Moved sonata admin related classes and

composer.json

Lines changed: 25 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -14,39 +14,37 @@
1414
}
1515
],
1616
"require": {
17-
"php": "^7.4 || ^8.0",
18-
"symfony/framework-bundle": "^4.4 || ^5.0",
19-
"symfony/security-core": "^4.4 || ^5.0"
17+
"php": "^8.1",
18+
"symfony/framework-bundle": "^6.4",
19+
"symfony/security-core": "^6.4"
2020
},
2121
"require-dev": {
22-
"jackalope/jackalope-doctrine-dbal": "^1.3",
23-
"symfony/security-bundle": "^4.4 || ^5.0",
24-
"symfony/phpunit-bridge": "^4.4.34 || ^5.0",
22+
"jackalope/jackalope-doctrine-dbal": "^1.3 || ^2.0",
2523
"mockery/mockery": "^1.4.1",
26-
"symfony-cmf/routing-bundle": "^2.1.0",
24+
"symfony-cmf/routing-bundle": "dev-sf7 as 3.1.0",
2725
"symfony-cmf/testing": "^4.0.0",
28-
"doctrine/dbal": "^2.5",
26+
"doctrine/dbal": "^3.8.1 || ^4.0",
2927
"doctrine/doctrine-bundle": "^2.0",
30-
"doctrine/phpcr-odm": "^1.4|^2.0 ",
31-
"doctrine/phpcr-bundle": "^2.3.0",
32-
"symfony/browser-kit": "^4.4 || ^5.0",
33-
"symfony/form": "^4.4 || ^5.0",
34-
"symfony/monolog-bridge": "^4.4 || ^5.0",
28+
"doctrine/phpcr-bundle": "^3.0",
29+
"doctrine/phpcr-odm": "^1.4 || ^2.0 ",
30+
"symfony/browser-kit": "^6.4",
31+
"symfony/form": "^6.4",
32+
"symfony/monolog-bridge": "^6.4",
3533
"symfony/monolog-bundle": "^3.0",
36-
"symfony/templating": "^4.4 || ^5.0",
37-
"symfony/translation": "^4.4 || ^5.0",
38-
"symfony/twig-bundle": "^4.4 || ^5.0",
39-
"symfony/validator": "^4.4 || ^5.0",
40-
"symfony/yaml": "^4.4 || ^5.0",
41-
"symfony/asset": "^4.4 || ^5.0"
34+
"symfony/phpunit-bridge": "^7.0.3",
35+
"symfony/security-bundle": "^6.4",
36+
"symfony/templating": "^6.4",
37+
"symfony/translation": "^6.4",
38+
"symfony/twig-bundle": "^6.4",
39+
"symfony/validator": "^6.4",
40+
"symfony/yaml": "^6.4",
41+
"symfony/asset": "^6.4"
4242
},
4343
"suggest": {
44-
"symfony/twig-bundle": "To get access to the CMF twig extension (^4.4 || ^5.0)",
45-
"doctrine/phpcr-bundle": "To be able to use the CMF twig extension (^1.0)",
46-
"doctrine/phpcr-odm": "To be able to use the CMF twig extension (^1.0)",
47-
"symfony/security-bundle": "To be able to use the publish workflow system (^4.4 || ^5.0)",
48-
"symfony-cmf/routing": "To be able to use the CMF twig extension functions cmf_prev_linkable/cmf_next_linkable (^2.1)",
49-
"symfony-cmf/routing-bundle": "To be able to enable the publish_workflow_listener (^2.1)",
44+
"symfony/twig-bundle": "To get access to the CMF twig extension",
45+
"symfony/security-bundle": "To be able to use the publish workflow system",
46+
"symfony-cmf/routing": "To be able to use the CMF twig extension functions cmf_prev_linkable/cmf_next_linkable",
47+
"symfony-cmf/routing-bundle": "To be able to enable the publish_workflow_listener",
5048
"symfony-cmf/sonata-admin-integration-bundle": "To provide an admin interface for the PHPCR ODM documents."
5149
},
5250
"autoload": {
@@ -63,5 +61,6 @@
6361
"branch-alias": {
6462
"dev-master": "3.x-dev"
6563
}
66-
}
64+
},
65+
"minimum-stability": "dev"
6766
}

src/Doctrine/Phpcr/NonTranslatableMetadataListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function getSubscribedEvents()
3939
*/
4040
public function loadClassMetadata(LoadClassMetadataEventArgs $eventArgs)
4141
{
42-
/** @var $meta ClassMetadata */
42+
/** @var ClassMetadata $meta */
4343
$meta = $eventArgs->getClassMetadata();
4444

4545
if (!$meta->translator) {

src/Doctrine/Phpcr/TranslatableMetadataListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public function getSubscribedEvents()
5151
*/
5252
public function loadClassMetadata(LoadClassMetadataEventArgs $eventArgs)
5353
{
54-
/** @var $meta ClassMetadata */
54+
/** @var ClassMetadata $meta */
5555
$meta = $eventArgs->getClassMetadata();
5656

5757
if ($meta->getReflectionClass()->implementsInterface(TranslatableInterface::class)) {

src/Templating/Helper/Cmf.php

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ private function getDocument($document, ?bool $ignoreRole = false, ?string $clas
175175
try {
176176
$document = $this->getDm()->find(null, $document);
177177
} catch (MissingTranslationException $e) {
178-
return;
178+
return null;
179179
}
180180
}
181181

@@ -188,7 +188,7 @@ private function getDocument($document, ?bool $ignoreRole = false, ?string $clas
188188
|| (true === $ignoreRole && !$this->publishWorkflowChecker->isGranted(PublishWorkflowChecker::VIEW_ANONYMOUS_ATTRIBUTE, $document))
189189
|| (null !== $class && !($document instanceof $class))
190190
) {
191-
return;
191+
return null;
192192
}
193193

194194
return $document;
@@ -234,7 +234,7 @@ public function findMany(array $paths = [], $limit = false, $offset = false, ?bo
234234
* If you need the bypass role, you will have a firewall configured and can
235235
* simply use {{ is_granted('VIEW', document) }}
236236
*
237-
* @param object $document
237+
* @param ?object $document
238238
*/
239239
public function isPublished($document): bool
240240
{
@@ -426,12 +426,12 @@ public function isLinkable($document): bool
426426
*/
427427
private function getChildrenPaths(string $path, array &$children, ?int $depth)
428428
{
429-
if (null !== $depth && $depth < 1) {
430-
return;
429+
if (null !== $depth) {
430+
if ($depth-- < 1) {
431+
return;
432+
}
431433
}
432434

433-
--$depth;
434-
435435
$node = $this->getDm()->getPhpcrSession()->getNode($path);
436436
$names = (array) $node->getNodeNames();
437437
foreach ($names as $name) {
@@ -485,7 +485,7 @@ private function checkChildren(array $childNames, string $path, ?bool $ignoreRol
485485
}
486486
}
487487

488-
return;
488+
return null;
489489
}
490490

491491
/**
@@ -515,7 +515,7 @@ private function traversePrevDepth(?int $depth, int $anchorDepth, array $childNa
515515
}
516516
}
517517

518-
return;
518+
return null;
519519
}
520520

521521
/**
@@ -536,7 +536,7 @@ private function searchDepthPrev($path, $anchor, ?int $depth = null, ?bool $igno
536536
}
537537

538538
if (null === $path || '/' === $path) {
539-
return;
539+
return null;
540540
}
541541

542542
$node = $this->getDm()->getPhpcrSession()->getNode($path);
@@ -550,7 +550,7 @@ private function searchDepthPrev($path, $anchor, ?int $depth = null, ?bool $igno
550550
}
551551

552552
if ($path === $anchor) {
553-
return;
553+
return null;
554554
}
555555

556556
$parent = $node->getParent();
@@ -592,7 +592,7 @@ private function searchDepthPrev($path, $anchor, ?int $depth = null, ?bool $igno
592592
}
593593
}
594594

595-
return;
595+
return null;
596596
}
597597

598598
/**
@@ -613,7 +613,7 @@ private function searchDepthNext($path, $anchor, ?int $depth = null, ?bool $igno
613613
}
614614

615615
if (null === $path || '/' === $path) {
616-
return;
616+
return null;
617617
}
618618

619619
$node = $this->getDm()->getPhpcrSession()->getNode($path);
@@ -653,7 +653,7 @@ private function searchDepthNext($path, $anchor, ?int $depth = null, ?bool $igno
653653
while ('/' !== $parentPath) {
654654
$parent = $parent->getParent();
655655
if (false === strpos($parent->getPath(), $anchor)) {
656-
return;
656+
return null;
657657
}
658658

659659
$childNames = $parent->getNodeNames()->getArrayCopy();
@@ -666,7 +666,7 @@ private function searchDepthNext($path, $anchor, ?int $depth = null, ?bool $igno
666666
}
667667
}
668668

669-
return;
669+
return null;
670670
}
671671

672672
/**
@@ -686,7 +686,7 @@ private function search($path, ?bool $reverse = false, ?bool $ignoreRole = false
686686
}
687687

688688
if (null === $path || '/' === $path) {
689-
return;
689+
return null;
690690
}
691691

692692
$node = $this->getDm()->getPhpcrSession()->getNode($path);
@@ -770,6 +770,8 @@ public function getPrevLinkable($current, $anchor = null, ?int $depth = null, ?b
770770

771771
$current = $candidate;
772772
}
773+
774+
return null;
773775
}
774776

775777
/**
@@ -800,5 +802,7 @@ public function getNextLinkable($current, $anchor = null, ?int $depth = null, ?b
800802

801803
$current = $candidate;
802804
}
805+
806+
return null;
803807
}
804808
}

tests/Functional/Form/CheckboxUrlLabelFormTypeTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,5 +101,6 @@ protected function assertMatchesXpath($html, $expression, $count = 1)
101101
substr($dom->saveHTML(), 6, -8)
102102
));
103103
}
104+
$this->addToAssertionCount(1);
104105
}
105106
}

0 commit comments

Comments
 (0)