fixed code for older versions of PHP

This commit is contained in:
Fabien Potencier
2017-05-11 14:51:50 -07:00
parent d884330572
commit 75f2231a45
5 changed files with 8 additions and 8 deletions
+3 -3
View File
@@ -8,7 +8,6 @@ cache:
- $HOME/.composer/cache/files
php:
- 5.2
- 5.3
- 5.4
- 5.5
@@ -25,13 +24,14 @@ before_install:
- if [[ ! $TRAVIS_PHP_VERSION = hhvm* ]]; then phpenv config-rm xdebug.ini || echo "xdebug not available"; fi
install:
# Composer is not available on PHP 5.2
- if [ ${TRAVIS_PHP_VERSION:0:3} != "5.2" ]; then travis_retry composer install; fi
- travis_retry composer install
before_script:
- if [ "$TWIG_EXT" == "yes" ]; then sh -c "cd ext/twig && phpize && ./configure --enable-twig && make && make install"; fi
- if [ "$TWIG_EXT" == "yes" ]; then echo "extension=twig.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"`; fi
script: ./vendor/bin/simple-phpunit
matrix:
fast_finish: true
exclude:
+1 -1
View File
@@ -1,6 +1,6 @@
* 1.34.0 (2017-XX-XX)
* n/a
* dropped PHP 5.2 support
* 1.33.2 (2017-04-20)
+1 -1
View File
@@ -27,7 +27,7 @@
"forum": "https://groups.google.com/forum/#!forum/twig-users"
},
"require": {
"php": ">=5.2.7"
"php": ">=5.3.3"
},
"require-dev": {
"symfony/phpunit-bridge": "~3.3@dev",
+2 -1
View File
@@ -28,7 +28,8 @@ Slim, Yii, Laravel, Codeigniter and Kohana — just to name a few.
Prerequisites
-------------
Twig needs at least **PHP 5.2.7** to run.
Twig needs at least **PHP 5.2.7** to run. As of 1.34, the minimum requirement
was bumped to **PHP 5.3.3**.
Installation
------------
+1 -2
View File
@@ -10,7 +10,6 @@
*/
use PHPUnit\Framework\TestCase;
use PHPUnit\Framework\Constraint\Exception as ExceptionConstraint;
/**
* Integration test helper.
@@ -199,7 +198,7 @@ abstract class Twig_Test_IntegrationTestCase extends TestCase
if (false !== $exception) {
list($class) = explode(':', $exception);
$constraintClass = class_exists(ExceptionConstraint::class) ? ExceptionConstraint::class : \PHPUnit_Framework_Constraint_Exception::class;
$constraintClass = class_exists('PHPUnit\Framework\Constraint\Exception') ? 'PHPUnit\Framework\Constraint\Exception' : 'PHPUnit_Framework_Constraint_Exception';
$this->assertThat(null, new $constraintClass($class));
}