Skip to content

Commit 3a8121e

Browse files
committed
Allow symfony 4
1 parent 38513f4 commit 3a8121e

File tree

3 files changed

+35
-15
lines changed

3 files changed

+35
-15
lines changed

.travis.yml

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,40 @@ language: php
22

33
sudo: false
44

5+
env:
6+
global:
7+
- SYMFONY_VERSION=""
8+
59
php:
6-
- 5.3
710
- 5.4
811
- 5.5
912
- 5.6
1013
- 7.0
14+
- 7.1
1115
- hhvm
1216

1317
matrix:
14-
allow_failures:
15-
- php: hhvm
16-
fast_finish: true
17-
include:
18-
- php: 5.3
19-
env: dependencies=lowest
18+
allow_failures:
19+
- php: hhvm
20+
fast_finish: true
21+
include:
22+
- php: 5.3
23+
env: SYMFONY_VERSION="2.1.*"
24+
dist: precise
25+
- php: 5.5
26+
env: SYMFONY_VERSION="3.0.*"
27+
- php: 7.1
28+
env: SYMFONY_VERSION="4.0.*"
2029

2130
cache:
22-
directories:
23-
- $HOME/.composer/cache/files
31+
directories:
32+
- $HOME/.composer/cache/files
33+
34+
before_install:
35+
- phpenv config-rm xdebug.ini
36+
- echo "memory_limit=2G" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
37+
- if [ "$SYMFONY_VERSION" != "" ]; then composer require --dev --no-update symfony/symfony:$SYMFONY_VERSION; fi
2438

25-
install:
26-
- if [ "$dependencies" = "lowest" ]; then composer update --prefer-lowest --no-interaction; else composer install --no-interaction; fi;
39+
install: composer update --prefer-lowest --no-interaction
2740

2841
script: ./vendor/bin/phpunit --coverage-text

Tests/AbstractTestCase.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
use Misd\LinkifyBundle\MisdLinkifyBundle;
1515
use PHPUnit_Framework_TestCase;
16+
use Symfony\Component\DependencyInjection\Compiler\ResolveChildDefinitionsPass;
1617
use Symfony\Component\DependencyInjection\Compiler\ResolveDefinitionTemplatesPass;
1718
use Symfony\Component\DependencyInjection\Compiler\ResolveParameterPlaceHoldersPass;
1819
use Symfony\Component\DependencyInjection\ContainerBuilder;
@@ -44,7 +45,12 @@ protected function getContainer(array $config = array(), KernelInterface $kernel
4445
$bundle->build($container);
4546

4647
$container->getCompilerPassConfig()->setOptimizationPasses(
47-
array(new ResolveParameterPlaceHoldersPass(), new ResolveDefinitionTemplatesPass())
48+
array(
49+
new ResolveParameterPlaceHoldersPass(),
50+
class_exists('Symfony\Component\DependencyInjection\Compiler\ResolveDefinitionTemplatesPass')
51+
? new ResolveDefinitionTemplatesPass()
52+
: new ResolveChildDefinitionsPass()
53+
)
4854
);
4955
$container->getCompilerPassConfig()->setRemovingPasses(array());
5056
$container->compile();

composer.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,13 @@
1616
},
1717
"require": {
1818
"php": "^5.3.3 || ^7.0",
19-
"symfony/framework-bundle": "^2.1 || ^3.0",
19+
"symfony/framework-bundle": "^2.1 || ^3.0 || ^4.0",
2020
"misd/linkify": "^1.0"
2121
},
2222
"require-dev": {
23-
"phpunit/phpunit": "^4.0 || ^5.0",
24-
"symfony/twig-bundle": "^2.1 || ^3.0"
23+
"phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0",
24+
"sebastian/version": ">=1.0.3",
25+
"symfony/twig-bundle": "^2.1 || ^3.0 || ^4.0"
2526
},
2627
"conflict": {
2728
"phpunit/phpunit-mock-objects": "<2.2",

0 commit comments

Comments
 (0)