Skip to content

Commit

Permalink
feature #3157 Twig 2 is compatible with PHP 7.0 (nicolas-grekas)
Browse files Browse the repository at this point in the history
This PR was merged into the 2.x branch.

Discussion
----------

Twig 2 is compatible with PHP 7.0

7.1 was needed for #3102, but this is not the case anymore since #3113

Commits
-------

b845ed9 Twig 2 is compatible with PHP 7.0
  • Loading branch information
fabpot committed Oct 1, 2019
2 parents f8c5f86 + b845ed9 commit 4625774
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 16 deletions.
26 changes: 16 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,34 @@ cache:
- extra/*/vendor
- $HOME/.composer/cache/files

env:
global:
- SYMFONY_PHPUNIT_REMOVE_RETURN_TYPEHINT=1
- SYMFONY_PHPUNIT_DISABLE_RESULT_CACHE=1

before_install:
- phpenv config-rm xdebug.ini || return 0

install:
- travis_retry composer install
- (cd extra/cssinliner-extra && travis_retry composer install)
- (cd extra/html-extra && travis_retry composer install)
- (cd extra/inky-extra && travis_retry composer install)
- (cd extra/intl-extra && travis_retry composer install)
- (cd extra/markdown-extra && travis_retry composer install)
- ([[ $TRAVIS_PHP_VERSION = 7.0 ]] || cd extra/cssinliner-extra && travis_retry composer install)
- ([[ $TRAVIS_PHP_VERSION = 7.0 ]] || cd extra/html-extra && travis_retry composer install)
- ([[ $TRAVIS_PHP_VERSION = 7.0 ]] || cd extra/inky-extra && travis_retry composer install)
- ([[ $TRAVIS_PHP_VERSION = 7.0 ]] || cd extra/intl-extra && travis_retry composer install)
- ([[ $TRAVIS_PHP_VERSION = 7.0 ]] || cd extra/markdown-extra && travis_retry composer install)

script:
- ./vendor/bin/simple-phpunit
- (cd extra/cssinliner-extra && ./vendor/bin/simple-phpunit)
- (cd extra/html-extra && ./vendor/bin/simple-phpunit)
- (cd extra/inky-extra && ./vendor/bin/simple-phpunit)
- (cd extra/intl-extra && ./vendor/bin/simple-phpunit)
- (cd extra/markdown-extra && ./vendor/bin/simple-phpunit)
- ([[ $TRAVIS_PHP_VERSION = 7.0 ]] || cd extra/cssinliner-extra && ./vendor/bin/simple-phpunit)
- ([[ $TRAVIS_PHP_VERSION = 7.0 ]] || cd extra/html-extra && ./vendor/bin/simple-phpunit)
- ([[ $TRAVIS_PHP_VERSION = 7.0 ]] || cd extra/inky-extra && ./vendor/bin/simple-phpunit)
- ([[ $TRAVIS_PHP_VERSION = 7.0 ]] || cd extra/intl-extra && ./vendor/bin/simple-phpunit)
- ([[ $TRAVIS_PHP_VERSION = 7.0 ]] || cd extra/markdown-extra && ./vendor/bin/simple-phpunit)

jobs:
fast_finish: true
include:
- php: 7.0
- php: 7.1
- php: 7.2
- php: 7.3
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
}
],
"require": {
"php": "^7.1.3",
"php": "^7.0",
"symfony/polyfill-mbstring": "^1.3",
"symfony/polyfill-ctype": "^1.8"
},
Expand Down
2 changes: 1 addition & 1 deletion doc/intro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Slim, Yii, Laravel, and Codeigniter — just to name a few.
Prerequisites
-------------

Twig needs at least **PHP 7.1.3** to run.
Twig needs at least **PHP 7.0.0** to run.

Installation
------------
Expand Down
4 changes: 2 additions & 2 deletions tests/Cache/FilesystemTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ class FilesystemTest extends TestCase
private $directory;
private $cache;

protected function setUp(): void
protected function setUp()
{
$nonce = hash('sha256', uniqid(mt_rand(), true));
$this->classname = '__Twig_Tests_Cache_FilesystemTest_Template_'.$nonce;
$this->directory = sys_get_temp_dir().'/twig-test';
$this->cache = new FilesystemCache($this->directory);
}

protected function tearDown(): void
protected function tearDown()
{
if (file_exists($this->directory)) {
FilesystemHelper::removeDir($this->directory);
Expand Down
2 changes: 1 addition & 1 deletion tests/Extension/SandboxTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class SandboxTest extends TestCase
protected static $params;
protected static $templates;

protected function setUp(): void
protected function setUp()
{
self::$params = [
'name' => 'Fabien',
Expand Down
2 changes: 1 addition & 1 deletion tests/TokenStreamTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class TokenStreamTest extends TestCase
{
protected static $tokens;

protected function setUp(): void
protected function setUp()
{
self::$tokens = [
new Token(Token::TEXT_TYPE, 1, 1),
Expand Down

0 comments on commit 4625774

Please sign in to comment.