Skip to content

Commit 64234eb

Browse files
committed
adjust to sf6
1 parent b50b8d0 commit 64234eb

File tree

14 files changed

+66
-59
lines changed

14 files changed

+66
-59
lines changed

.github/workflows/test-application.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
name: 'PHP ${{ matrix.php-version }}, Symfony ${{ matrix.symfony-version }} ${{ matrix.dependencies}}'
1515
runs-on: ubuntu-20.04
1616
env:
17-
SYMFONY_PHPUNIT_VERSION: 8
17+
SYMFONY_PHPUNIT_VERSION: 9
1818
SYMFONY_DEPRECATIONS_HELPER: "/.*each.*/"
1919
SYMFONY_REQUIRE: ${{ matrix.symfony-version }}
2020

composer.json

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@
2020
},
2121
"require-dev": {
2222
"ext-dom": "*",
23-
"jackalope/jackalope-doctrine-dbal": "^1.3 || ^2.0",
23+
"jackalope/jackalope-doctrine-dbal": "^1.12 || ^2.0",
2424
"mockery/mockery": "^1.4.1",
25-
"symfony-cmf/routing-bundle": "dev-sf7 as 3.1.0",
26-
"symfony-cmf/testing": "^4.0.0",
27-
"doctrine/dbal": "^3.8.1 || ^4.0",
25+
"symfony-cmf/routing-bundle": "3.1.0",
26+
"symfony-cmf/testing": "5.0.2",
27+
"doctrine/dbal": "^3.8.4 || ^4.0",
2828
"doctrine/doctrine-bundle": "^2.0",
2929
"doctrine/phpcr-bundle": "^3.0",
3030
"doctrine/phpcr-odm": "^1.4 || ^2.0 ",
@@ -44,8 +44,7 @@
4444
"suggest": {
4545
"symfony/twig-bundle": "To get access to the CMF twig extension",
4646
"symfony/security-bundle": "To be able to use the publish workflow system",
47-
"symfony-cmf/routing": "To be able to use the CMF twig extension functions cmf_prev_linkable/cmf_next_linkable",
48-
"symfony-cmf/routing-bundle": "To be able to enable the publish_workflow_listener",
47+
"symfony-cmf/routing-bundle": "For the wtig extension functions cmf_prev_linkable/cmf_next_linkable and the publish_workflow_listener",
4948
"symfony-cmf/sonata-admin-integration-bundle": "To provide an admin interface for the PHPCR ODM documents."
5049
},
5150
"autoload": {

src/PublishWorkflow/PublishWorkflowChecker.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,6 @@ public function __construct(
6262
{
6363
}
6464

65-
/**
66-
* {@inheritdoc}
67-
*/
6865
public function isGranted(mixed $attribute, mixed $subject = null): bool
6966
{
7067
if (self::VIEW_ATTRIBUTE === $attribute

src/Resources/config/publish-workflow.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@
66

77
<services>
88

9+
<service id="cmf_core.publish_workflow.access_decision_manager.strategy" class="Symfony\Component\Security\Core\Authorization\Strategy\UnanimousStrategy"/>
910
<service id="cmf_core.publish_workflow.access_decision_manager" class="Symfony\Component\Security\Core\Authorization\AccessDecisionManager">
1011
<argument type="collection"/>
11-
<argument>unanimous</argument>
12+
<argument type="service" id="cmf_core.publish_workflow.access_decision_manager.strategy"/>
1213
<argument>true</argument>
1314
</service>
1415

tests/Fixtures/App/DataFixture/LoadRouteData.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
*/
2323
class LoadRouteData implements FixtureInterface
2424
{
25-
public function load(ObjectManager $manager)
25+
public function load(ObjectManager $manager): void
2626
{
2727
$root = $manager->find(null, '/');
2828

tests/Fixtures/App/Document/Content.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,26 @@
1111

1212
namespace Symfony\Cmf\Bundle\CoreBundle\Tests\Fixtures\App\Document;
1313

14-
use Doctrine\ODM\PHPCR\Mapping\Annotations as PHPCRODM;
14+
use Doctrine\Common\Collections\Collection;
15+
use Doctrine\ODM\PHPCR\Mapping\Attributes as PHPCRODM;
16+
use Symfony\Cmf\Bundle\RoutingBundle\Doctrine\Phpcr\Route;
1517
use Symfony\Cmf\Component\Routing\RouteReferrersReadInterface;
1618

17-
/**
18-
* @PHPCRODM\Document(referenceable=true)
19-
*/
19+
#[PHPCRODM\Document(referenceable: true)]
2020
class Content implements RouteReferrersReadInterface
2121
{
22-
/** @PHPCRODM\Id */
23-
public $id;
22+
#[PHPCRODM\Id]
23+
public string $id;
2424

25-
/** @PHPCRODM\Referrers(referringDocument="Symfony\Cmf\Bundle\RoutingBundle\Doctrine\Phpcr\Route", referencedBy="content") */
26-
public $routes;
25+
#[PHPCRODM\Referrers(referencedBy: 'content', referringDocument: Route::class)]
26+
public array|Collection $routes;
2727

28-
public function getId()
28+
public function getId(): string
2929
{
3030
return $this->id;
3131
}
3232

33-
public function getRoutes()
33+
public function getRoutes(): iterable
3434
{
3535
return $this->routes;
3636
}

tests/Fixtures/App/Document/RouteAware.php

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,21 @@
1111

1212
namespace Symfony\Cmf\Bundle\CoreBundle\Tests\Fixtures\App\Document;
1313

14-
use Doctrine\ODM\PHPCR\Mapping\Annotations as PHPCRODM;
14+
use Doctrine\ODM\PHPCR\Mapping\Attributes as PHPCRODM;
1515
use Symfony\Cmf\Component\Routing\RouteReferrersReadInterface;
1616

17-
/**
18-
* @PHPCRODM\Document()
19-
*/
17+
#[PHPCRODM\Document]
2018
class RouteAware implements RouteReferrersReadInterface
2119
{
22-
/** @PHPCRODM\Id */
23-
public $id;
20+
#[PHPCRODM\Id]
21+
public string $id;
2422

25-
public function getId()
23+
public function getId(): string
2624
{
2725
return $this->id;
2826
}
2927

30-
public function getRoutes()
28+
public function getRoutes(): iterable
3129
{
3230
return [1, 2];
3331
}

tests/Fixtures/App/Kernel.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@
1616

1717
class Kernel extends TestKernel
1818
{
19-
public function configure()
19+
public function configure(): void
2020
{
2121
$this->requireBundleSets(['default', 'phpcr_odm']);
2222

2323
$this->registerConfiguredBundles();
2424
}
2525

26-
public function registerContainerConfiguration(LoaderInterface $loader)
26+
public function registerContainerConfiguration(LoaderInterface $loader): void
2727
{
2828
$loader->load(__DIR__.'/config/config.php');
2929
}

tests/Fixtures/App/config/config.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
$loader->import(__DIR__.'/cmf_core.yml');
1616
$loader->import(__DIR__.'/cmf_routing.yml');
1717
$loader->import(__DIR__.'/config.yml');
18+
$loader->import(__DIR__.'/services.yaml');
1819

1920
$container->loadFromExtension('framework', [
2021
'csrf_protection' => false,

tests/Fixtures/App/config/config.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
11
# for cmf routing bundle
22
framework:
3-
property_access: ~
4-
annotations: ~
3+
property_access: ~
4+
http_method_override: false
5+
handle_all_throwables: true
6+
php_errors:
7+
log: true
8+
session:
9+
handler_id: null
10+
cookie_secure: auto
11+
cookie_samesite: lax
12+
validation:
13+
email_validation_mode: html5

0 commit comments

Comments
 (0)