Skip to content

Commit 6242e77

Browse files
Allow Symfony 4.0 (#407)
* DevKit updates add version changes into composer.json DevKit updates DevKit updates DevKit updates DevKit updates DevKit updates DevKit updates DevKit updates DevKit updates DevKit updates DevKit updates DevKit updates DevKit updates DevKit updates increase config-test version also use validator use new validator class try to use a switch use the right interface to work with do not user phpunit < 5.7 style fixes due to style CI revert changes on deprecation helper DevKit updates simplify bc hack * move composer update to before section * revert
1 parent 64b2842 commit 6242e77

File tree

4 files changed

+38
-27
lines changed

4 files changed

+38
-27
lines changed

.travis.yml

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ cache:
2626
- $HOME/.composer/cache/files
2727

2828
env:
29-
matrix: SYMFONY_VERSION=^3.4@dev
29+
matrix: SYMFONY_VERSION=4.0.*
3030
global:
3131
- SYMFONY_DEPRECATIONS_HELPER=0
3232
- SYMFONY_PHPUNIT_DIR=.phpunit SYMFONY_PHPUNIT_REMOVE="symfony/yaml"
@@ -37,31 +37,25 @@ env:
3737
matrix:
3838
include:
3939
- php: 7.1
40-
env: DEPS=dev SYMFONY_VERSION=^4.0@dev
40+
env: STABILITY=dev SYMFONY_VERSION=4.0.*
4141
- php: 7.1
42-
env: DEPS=dev SYMFONY_VERSION=^3.4@dev
42+
env: STABILITY=dev COMPOSER_FLAGS="--prefer-lowest" SYMFONY_VERSION=2.8.* SYMFONY_DEPRECATIONS_HELPER=weak
4343
- php: 7.1
44-
env: COMPOSER_FLAGS="--prefer-lowest" SYMFONY_VERSION=2.8.* SYMFONY_DEPRECATIONS_HELPER=weak
44+
env: STABILITY=dev SYMFONY_VERSION=3.3.*
4545
- php: 7.1
46-
env: SYMFONY_VERSION=3.3.*
46+
env: STABILITY=dev SYMFONY_VERSION=3.4.*
4747
- env: TEST_INSTALLATION=true
48-
4948
fast_finish: true
5049
allow_failures:
51-
- php: 7.1
52-
env: DEPS=dev SYMFONY_VERSION=^4.0@dev
5350
- env: TEST_INSTALLATION=true
5451

55-
5652
before_install:
57-
- if [[ "$TRAVIS_PHP_VERSION" != "hhvm" ]]; then echo "memory_limit = -1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini; fi
5853
- phpenv config-rm xdebug.ini || true
5954
- composer self-update
60-
- if [ "$DEPS" = "dev" ]; then perl -pi -e 's/^}$/,"minimum-stability":"dev"}/' composer.json; fi
55+
- if ! [ -z "$STABILITY" ]; then composer config minimum-stability ${STABILITY}; composer config prefer-stable true; fi;
6156
- if [ "$SYMFONY_VERSION" != "" ]; then composer require symfony/symfony:${SYMFONY_VERSION} --no-update; fi
6257
- export BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo $TRAVIS_BRANCH; else echo $TRAVIS_PULL_REQUEST_BRANCH; fi)
63-
64-
install: travis_wait composer update --prefer-dist $COMPOSER_FLAGS
58+
- travis_wait composer update --prefer-dist $COMPOSER_FLAGS
6559

6660
script:
6761
- if [ "${TEST_INSTALLATION}" == true ]; then make test_installation; else make test; fi

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ controller for redirection routes.
2424
## Requirements
2525

2626
* PHP 7.1
27-
* Symfony 2.8 / 3.3 / ^3.4@dev
27+
* Symfony 2.8 / 3.3 / 3.4 / 4.0
2828
* See also the `require` section of [composer.json](composer.json)
2929

3030
## Documentation
@@ -45,7 +45,7 @@ For general support and questions, please use [StackOverflow](http://stackoverfl
4545
## Contributing
4646

4747
Pull requests are welcome. Please see our
48-
[CONTRIBUTING](https://github.com/symfony-cmf/symfony-cmf/blob/master/CONTRIBUTING.md)
48+
[CONTRIBUTING](https://github.com/symfony-cmf/blob/master/CONTRIBUTING.md)
4949
guide.
5050

5151
Unit and/or functional tests exist for this package. See the

composer.json

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
"name": "symfony-cmf/routing-bundle",
33
"type": "symfony-bundle",
44
"description": "Symfony RoutingBundle",
5-
"keywords": ["routing", "database"],
5+
"keywords": [
6+
"routing",
7+
"database"
8+
],
69
"homepage": "http://cmf.symfony.com",
710
"license": "MIT",
811
"authors": [
@@ -14,25 +17,27 @@
1417
"require": {
1518
"php": "^7.1",
1619
"symfony-cmf/routing": "^2.0",
17-
"symfony/framework-bundle": "^2.8|^3.3",
18-
"symfony/twig-bundle": "^2.8|^3.3"
20+
"symfony/framework-bundle": "^2.8 || ^3.3 || ^4.0",
21+
"symfony/twig-bundle": "^2.8 || ^3.3 || ^4.0"
1922
},
2023
"require-dev": {
2124
"doctrine/phpcr-odm": "^1.4|^2.0",
22-
"symfony/phpunit-bridge": "^3.2",
23-
"matthiasnoback/symfony-dependency-injection-test": "~0.6",
24-
"matthiasnoback/symfony-config-test": "^1.3.1",
25+
"symfony/phpunit-bridge": "^3.3 || ^4.0",
26+
"matthiasnoback/symfony-dependency-injection-test": "^1.0",
27+
"matthiasnoback/symfony-config-test": "^2.2",
2528
"doctrine/orm": "^2.5",
2629
"symfony-cmf/testing": "^2.1@dev",
27-
"doctrine/data-fixtures": "^1.0.0"
30+
"doctrine/data-fixtures": "^1.0.0",
31+
"symfony/validator": "^2.8 || ^3.3 || ^4.0"
2832
},
2933
"suggest": {
3034
"doctrine/phpcr-odm": "To enable support for the PHPCR ODM documents (^1.4)",
3135
"doctrine/phpcr-bundle": "To enable support for the PHPCR ODM documents",
3236
"doctrine/orm": "To enable support for the ORM entities (^2.5)"
3337
},
3438
"conflict": {
35-
"doctrine/phpcr-odm": "<1.4"
39+
"doctrine/phpcr-odm": "<1.4",
40+
"phpunit/phpunit": "<5.7"
3641
},
3742
"autoload": {
3843
"psr-4": {
@@ -48,7 +53,5 @@
4853
"branch-alias": {
4954
"dev-master": "2.1-dev"
5055
}
51-
},
52-
"minimum-stability":"dev",
53-
"prefer-stable": true
56+
}
5457
}

tests/Unit/Validator/Constraints/RouteDefaultsValidatorTest.php

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,23 @@
1212
namespace Symfony\Cmf\Bundle\RoutingBundle\Tests\Unit\Validator\Constraints;
1313

1414
use Symfony\Cmf\Bundle\RoutingBundle\Validator\Constraints\RouteDefaults;
15+
use Symfony\Component\Validator\Test\ConstraintValidatorTestCase;
1516
use Symfony\Component\Validator\Tests\Constraints\AbstractConstraintValidatorTest;
1617

17-
abstract class RouteDefaultsValidatorTest extends AbstractConstraintValidatorTest
18+
/*
19+
* @Todo: Remove this when we drop Symfony 2.x support
20+
*/
21+
if (!class_exists(ConstraintValidatorTestCase::class)) {
22+
abstract class HackBaseClass extends AbstractConstraintValidatorTest
23+
{
24+
}
25+
} else {
26+
abstract class HackBaseClass extends ConstraintValidatorTestCase
27+
{
28+
}
29+
}
30+
31+
abstract class RouteDefaultsValidatorTest extends HackBaseClass
1832
{
1933
protected $controllerResolver;
2034
protected $engine;

0 commit comments

Comments
 (0)