Skip to content

Commit 4811612

Browse files
committed
further restrict versions and adjust to twig 2
1 parent 6413c66 commit 4811612

File tree

13 files changed

+59
-49
lines changed

13 files changed

+59
-49
lines changed

.github/workflows/test-application.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,6 @@ jobs:
2424
include:
2525
- php-version: '7.4'
2626
dependencies: 'lowest'
27-
- php-version: '7.4'
28-
symfony-version: 3.3.*
29-
- php-version: '7.4'
30-
symfony-version: 3.4.*
3127
- php-version: '7.4'
3228
symfony-version: 4.4.*
3329
test-installation: true

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
Changelog
22
=========
33

4+
3.0.0 (unreleased)
5+
-----
6+
7+
* Adjust to doctrine and twig BC breaks. If you extended classes or customized services, check for old `Twig_*` classes or `Doctrine\Common\Persistence` namespace.
8+
* Drop support for old Symfony versions
9+
* Drop support for old PHP versions
10+
411
2.1.1
512
-----
613

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@ a twig extension and php templating helper to walk PHPCR-ODM trees and support f
2323

2424
## Requirements
2525

26-
* PHP 7.1 / 7.2
27-
* Symfony 2.8 / 3.3 / 3.4 / 4.0
28-
* See also the `require` section of [composer.json](composer.json)
26+
* See the `require` section of [composer.json](composer.json)
2927

3028
## Documentation
3129

composer.json

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,30 @@
1515
],
1616
"require": {
1717
"php": "^7.4",
18-
"symfony/framework-bundle": "^3.3 || ^4.4",
19-
"symfony/security-core": "^3.3 || ^4.4"
18+
"symfony/framework-bundle": "^4.4",
19+
"symfony/security-core": "^4.4"
2020
},
2121
"require-dev": {
2222
"jackalope/jackalope-doctrine-dbal": "^1.3",
23-
"symfony/security-bundle": "^3.3 || ^4.4",
24-
"symfony/phpunit-bridge": "^4.2.2",
23+
"symfony/security-bundle": "^4.4",
24+
"symfony/phpunit-bridge": "^4.4.34",
2525
"mockery/mockery": "^0.9.4",
2626
"symfony-cmf/routing-bundle": "^2.1.0",
2727
"symfony-cmf/testing": "^4.0.0",
28-
"doctrine/dbal": "2.5.*",
28+
"doctrine/dbal": "^2.5",
29+
"doctrine/doctrine-bundle": "^2.0",
2930
"doctrine/phpcr-odm": "^1.4|^2.0 ",
30-
"symfony/browser-kit": "^3.3 || ^4.4",
31-
"symfony/templating": "^3.3 || ^4.4",
32-
"symfony/form": "^3.3 || ^4.4",
33-
"symfony/translation": "^3.3 || ^4.4",
34-
"symfony/validator": "^3.3 || ^4.4",
35-
"symfony/asset": "^3.3 || ^4.4"
31+
"doctrine/phpcr-bundle": "^2.3.0",
32+
"symfony/browser-kit": "^4.4",
33+
"symfony/form": "^4.4",
34+
"symfony/monolog-bridge": "^4.4",
35+
"symfony/monolog-bundle": "^3.0",
36+
"symfony/templating": "^4.4",
37+
"symfony/translation": "^4.4",
38+
"symfony/twig-bundle": "^4.4",
39+
"symfony/validator": "^4.4",
40+
"symfony/yaml": "^4.4",
41+
"symfony/asset": "^4.4"
3642
},
3743
"suggest": {
3844
"symfony/twig-bundle": "To get access to the CMF twig extension (^3.3 || ^4.4)",
@@ -55,7 +61,7 @@
5561
},
5662
"extra": {
5763
"branch-alias": {
58-
"dev-master": "2.2-dev"
64+
"dev-master": "3.x-dev"
5965
}
6066
}
6167
}

src/Doctrine/Phpcr/NonTranslatableMetadataListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
namespace Symfony\Cmf\Bundle\CoreBundle\Doctrine\Phpcr;
1313

1414
use Doctrine\Common\EventSubscriber;
15-
use Doctrine\Common\Persistence\Event\LoadClassMetadataEventArgs;
15+
use Doctrine\Persistence\Event\LoadClassMetadataEventArgs;
1616
use Doctrine\ODM\PHPCR\Mapping\ClassMetadata;
1717

1818
/**

src/Doctrine/Phpcr/TranslatableMetadataListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
namespace Symfony\Cmf\Bundle\CoreBundle\Doctrine\Phpcr;
1313

1414
use Doctrine\Common\EventSubscriber;
15-
use Doctrine\Common\Persistence\Event\LoadClassMetadataEventArgs;
15+
use Doctrine\Persistence\Event\LoadClassMetadataEventArgs;
1616
use Doctrine\ODM\PHPCR\Mapping\ClassMetadata;
1717
use Symfony\Cmf\Bundle\CoreBundle\Translatable\TranslatableInterface;
1818

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{% block cmf_core_checkbox_url_label_row %}
2-
{% spaceless %}
2+
{% apply spaceless %}
33
{{ form_errors(form) }}
44
<label class="checkbox">
55
<input type="checkbox" {{ block('widget_attributes') }}{% if value is defined %} value="{{ value }}"{% endif %}{% if checked %} checked="checked"{% endif %} />
66
{{ label | trans(paths, translation_domain) | raw }}
77
</label>
8-
{% endspaceless %}
8+
{% endapply %}
99
{% endblock %}

src/Templating/Helper/Cmf.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
namespace Symfony\Cmf\Bundle\CoreBundle\Templating\Helper;
1313

14-
use Doctrine\Common\Persistence\ManagerRegistry;
14+
use Doctrine\Persistence\ManagerRegistry;
1515
use Doctrine\ODM\PHPCR\DocumentManager;
1616
use Doctrine\ODM\PHPCR\Translation\MissingTranslationException;
1717
use PHPCR\Util\PathHelper;
@@ -20,7 +20,6 @@
2020
use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException;
2121
use Symfony\Component\Routing\Route;
2222
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
23-
use Symfony\Component\Templating\Helper\Helper;
2423

2524
/**
2625
* Layout helper for the CMF.

src/Twig/Extension/CmfExtension.php

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@
1313

1414
use Symfony\Cmf\Bundle\CoreBundle\Templating\Helper\Cmf;
1515
use Symfony\Cmf\Component\Routing\RouteReferrersReadInterface;
16+
use Twig\Extension\AbstractExtension;
17+
use Twig\TwigFunction;
1618

17-
class CmfExtension extends \Twig_Extension
19+
class CmfExtension extends AbstractExtension
1820
{
1921
protected $helper;
2022

@@ -31,27 +33,27 @@ public function __construct(Cmf $helper)
3133
public function getFunctions()
3234
{
3335
$functions = [
34-
new \Twig_SimpleFunction('cmf_is_published', [$this, 'isPublished']),
35-
new \Twig_SimpleFunction('cmf_child', [$this, 'getChild']),
36-
new \Twig_SimpleFunction('cmf_children', [$this, 'getChildren']),
37-
new \Twig_SimpleFunction('cmf_prev', [$this, 'getPrev']),
38-
new \Twig_SimpleFunction('cmf_next', [$this, 'getNext']),
39-
new \Twig_SimpleFunction('cmf_find', [$this, 'find']),
40-
new \Twig_SimpleFunction('cmf_find_translation', [$this, 'findTranslation']),
41-
new \Twig_SimpleFunction('cmf_find_many', [$this, 'findMany']),
42-
new \Twig_SimpleFunction('cmf_descendants', [$this, 'getDescendants']),
43-
new \Twig_SimpleFunction('cmf_nodename', [$this, 'getNodeName']),
44-
new \Twig_SimpleFunction('cmf_parent_path', [$this, 'getParentPath']),
45-
new \Twig_SimpleFunction('cmf_path', [$this, 'getPath']),
46-
new \Twig_SimpleFunction('cmf_document_locales', [$this, 'getLocalesFor']),
36+
new TwigFunction('cmf_is_published', [$this, 'isPublished']),
37+
new TwigFunction('cmf_child', [$this, 'getChild']),
38+
new TwigFunction('cmf_children', [$this, 'getChildren']),
39+
new TwigFunction('cmf_prev', [$this, 'getPrev']),
40+
new TwigFunction('cmf_next', [$this, 'getNext']),
41+
new TwigFunction('cmf_find', [$this, 'find']),
42+
new TwigFunction('cmf_find_translation', [$this, 'findTranslation']),
43+
new TwigFunction('cmf_find_many', [$this, 'findMany']),
44+
new TwigFunction('cmf_descendants', [$this, 'getDescendants']),
45+
new TwigFunction('cmf_nodename', [$this, 'getNodeName']),
46+
new TwigFunction('cmf_parent_path', [$this, 'getParentPath']),
47+
new TwigFunction('cmf_path', [$this, 'getPath']),
48+
new TwigFunction('cmf_document_locales', [$this, 'getLocalesFor']),
4749
];
4850

4951
if (interface_exists(RouteReferrersReadInterface::class)) {
5052
$functions = array_merge($functions, [
51-
new \Twig_SimpleFunction('cmf_is_linkable', [$this, 'isLinkable']),
52-
new \Twig_SimpleFunction('cmf_prev_linkable', [$this, 'getPrevLinkable']),
53-
new \Twig_SimpleFunction('cmf_next_linkable', [$this, 'getNextLinkable']),
54-
new \Twig_SimpleFunction('cmf_linkable_children', [$this, 'getLinkableChildren']),
53+
new TwigFunction('cmf_is_linkable', [$this, 'isLinkable']),
54+
new TwigFunction('cmf_prev_linkable', [$this, 'getPrevLinkable']),
55+
new TwigFunction('cmf_next_linkable', [$this, 'getNextLinkable']),
56+
new TwigFunction('cmf_linkable_children', [$this, 'getLinkableChildren']),
5557
]);
5658
}
5759

tests/Fixtures/App/DataFixture/LoadHierarchyRouteData.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
namespace Symfony\Cmf\Bundle\CoreBundle\Tests\Fixtures\App\DataFixture;
1313

1414
use Doctrine\Common\DataFixtures\FixtureInterface;
15-
use Doctrine\Common\Persistence\ObjectManager;
15+
use Doctrine\Persistence\ObjectManager;
1616
use Symfony\Cmf\Bundle\CoreBundle\Tests\Fixtures\App\Document\RouteAware;
1717

1818
/**

0 commit comments

Comments
 (0)