Skip to content

Commit 603071a

Browse files
committed
adjust to sf6
1 parent b50b8d0 commit 603071a

File tree

12 files changed

+49
-52
lines changed

12 files changed

+49
-52
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: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"jackalope/jackalope-doctrine-dbal": "^1.3 || ^2.0",
2424
"mockery/mockery": "^1.4.1",
2525
"symfony-cmf/routing-bundle": "dev-sf7 as 3.1.0",
26-
"symfony-cmf/testing": "^4.0.0",
26+
"symfony-cmf/testing": "dev-sf7 as 5.0.0",
2727
"doctrine/dbal": "^3.8.1 || ^4.0",
2828
"doctrine/doctrine-bundle": "^2.0",
2929
"doctrine/phpcr-bundle": "^3.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/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/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: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
# for cmf routing bundle
22
framework:
33
property_access: ~
4-
annotations: ~
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
services:
2+
form_factory_public:
3+
public: true
4+
alias: form.factory

tests/Functional/Form/CheckboxUrlLabelFormTypeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function setUp(): void
2626

2727
public function testFormTwigTemplate(): void
2828
{
29-
$view = self::getContainer()->get('test.service_container')->get('form.factory')->createNamedBuilder('name')
29+
$view = self::getContainer()->get('form_factory_public')->createNamedBuilder('name')
3030
->add('terms', CheckboxUrlLabelFormType::class, [
3131
'label' => '%a% and %b% and %c%',
3232
'routes' => [

0 commit comments

Comments
 (0)