Skip to content

Commit 4358d36

Browse files
authored
Merge pull request #276 from symfony-cmf/upgrade-versions
Upgrade versions
2 parents 2abdf6a + 4811612 commit 4358d36

File tree

22 files changed

+130
-122
lines changed

22 files changed

+130
-122
lines changed
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Test application
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- 'master'
8+
- '[0-9]+.x'
9+
- '[0-9]+.[0-9]+'
10+
- '[0-9]+.[0-9]+.x'
11+
12+
jobs:
13+
test:
14+
name: 'PHP ${{ matrix.php-version }}, Symfony ${{ matrix.symfony-version }} ${{ matrix.dependencies}}'
15+
runs-on: ubuntu-20.04
16+
env:
17+
SYMFONY_PHPUNIT_VERSION: 8
18+
SYMFONY_DEPRECATIONS_HELPER: "/.*each.*/"
19+
SYMFONY_REQUIRE: ${{ matrix.symfony-version }}
20+
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
include:
25+
- php-version: '7.4'
26+
dependencies: 'lowest'
27+
- php-version: '7.4'
28+
symfony-version: 4.4.*
29+
test-installation: true
30+
31+
steps:
32+
- name: Checkout project
33+
uses: actions/checkout@v2
34+
35+
- name: Install and configure PHP
36+
uses: shivammathur/setup-php@v2
37+
with:
38+
php-version: ${{ matrix.php-version }}
39+
tools: 'composer:v2'
40+
41+
- name: Install Symfony Flex
42+
run: composer global require --no-progress --no-scripts --no-plugins symfony/flex
43+
44+
- name: Install dependencies with Composer
45+
uses: ramsey/composer-install@v1
46+
with:
47+
dependency-versions: ${{ matrix.dependencies }}
48+
composer-options: --prefer-dist
49+
50+
- name: Execute test cases
51+
run: make test
52+
53+
- name: Test installation
54+
if: ${{ matrix.test-installation == true }}
55+
run: make test

.travis.yml

Lines changed: 0 additions & 62 deletions
This file was deleted.

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: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,30 +14,37 @@
1414
}
1515
],
1616
"require": {
17-
"php": "^7.1",
18-
"symfony/framework-bundle": "^2.8 || ^3.3 || ^4.0",
19-
"symfony/security-core": "^2.8 || ^3.3 || ^4.0"
17+
"php": "^7.4",
18+
"symfony/framework-bundle": "^4.4",
19+
"symfony/security-core": "^4.4"
2020
},
2121
"require-dev": {
22-
"symfony/security-bundle": "^2.8 || ^3.3 || ^4.0",
23-
"symfony/phpunit-bridge": "^4.2.2",
22+
"jackalope/jackalope-doctrine-dbal": "^1.3",
23+
"symfony/security-bundle": "^4.4",
24+
"symfony/phpunit-bridge": "^4.4.34",
2425
"mockery/mockery": "^0.9.4",
2526
"symfony-cmf/routing-bundle": "^2.1.0",
26-
"symfony-cmf/testing": "^2.1.11",
27-
"doctrine/dbal": "2.5.*",
27+
"symfony-cmf/testing": "^4.0.0",
28+
"doctrine/dbal": "^2.5",
29+
"doctrine/doctrine-bundle": "^2.0",
2830
"doctrine/phpcr-odm": "^1.4|^2.0 ",
29-
"symfony/browser-kit": "^2.8 || ^3.3 || ^4.0",
30-
"symfony/templating": "^2.8 || ^3.3 || ^4.0",
31-
"symfony/form": "^2.8 || ^3.3 || ^4.0",
32-
"symfony/translation": "^2.8 || ^3.3 || ^4.0",
33-
"symfony/validator": "^2.8 || ^3.3 || ^4.0",
34-
"symfony/asset": "^2.8 || ^3.3 || ^4.0"
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"
3542
},
3643
"suggest": {
37-
"symfony/twig-bundle": "To get access to the CMF twig extension (^2.8 || ^3.3 || ^4.0)",
44+
"symfony/twig-bundle": "To get access to the CMF twig extension (^3.3 || ^4.4)",
3845
"doctrine/phpcr-bundle": "To be able to use the CMF twig extension (^1.0)",
3946
"doctrine/phpcr-odm": "To be able to use the CMF twig extension (^1.0)",
40-
"symfony/security-bundle": "To be able to use the publish workflow system (^2.8 || ^3.3 || ^4.0)",
47+
"symfony/security-bundle": "To be able to use the publish workflow system (^3.3 || ^4.4)",
4148
"symfony-cmf/routing": "To be able to use the CMF twig extension functions cmf_prev_linkable/cmf_next_linkable (^2.1)",
4249
"symfony-cmf/routing-bundle": "To be able to enable the publish_workflow_listener (^2.1)",
4350
"symfony-cmf/sonata-admin-integration-bundle": "To provide an admin interface for the PHPCR ODM documents."
@@ -54,7 +61,7 @@
5461
},
5562
"extra": {
5663
"branch-alias": {
57-
"dev-master": "2.2-dev"
64+
"dev-master": "3.x-dev"
5865
}
5966
}
6067
}

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

0 commit comments

Comments
 (0)