Browse code

Twig 2 is compatible with PHP 7.0

Nicolas Grekas authored on 20/09/2019 12:51:44
Showing 6 changed files
... ...
@@ -6,28 +6,34 @@ cache:
6 6
         - extra/*/vendor
7 7
         - $HOME/.composer/cache/files
8 8
 
9
+env:
10
+    global:
11
+        - SYMFONY_PHPUNIT_REMOVE_RETURN_TYPEHINT=1
12
+        - SYMFONY_PHPUNIT_DISABLE_RESULT_CACHE=1
13
+
9 14
 before_install:
10 15
     - phpenv config-rm xdebug.ini || return 0
11 16
 
12 17
 install:
13 18
     - travis_retry composer install
14
-    - (cd extra/cssinliner-extra && travis_retry composer install)
15
-    - (cd extra/html-extra && travis_retry composer install)
16
-    - (cd extra/inky-extra && travis_retry composer install)
17
-    - (cd extra/intl-extra && travis_retry composer install)
18
-    - (cd extra/markdown-extra && travis_retry composer install)
19
+    - ([[ $TRAVIS_PHP_VERSION = 7.0 ]] || cd extra/cssinliner-extra && travis_retry composer install)
20
+    - ([[ $TRAVIS_PHP_VERSION = 7.0 ]] || cd extra/html-extra && travis_retry composer install)
21
+    - ([[ $TRAVIS_PHP_VERSION = 7.0 ]] || cd extra/inky-extra && travis_retry composer install)
22
+    - ([[ $TRAVIS_PHP_VERSION = 7.0 ]] || cd extra/intl-extra && travis_retry composer install)
23
+    - ([[ $TRAVIS_PHP_VERSION = 7.0 ]] || cd extra/markdown-extra && travis_retry composer install)
19 24
 
20 25
 script:
21 26
     - ./vendor/bin/simple-phpunit
22
-    - (cd extra/cssinliner-extra && ./vendor/bin/simple-phpunit)
23
-    - (cd extra/html-extra && ./vendor/bin/simple-phpunit)
24
-    - (cd extra/inky-extra && ./vendor/bin/simple-phpunit)
25
-    - (cd extra/intl-extra && ./vendor/bin/simple-phpunit)
26
-    - (cd extra/markdown-extra && ./vendor/bin/simple-phpunit)
27
+    - ([[ $TRAVIS_PHP_VERSION = 7.0 ]] || cd extra/cssinliner-extra && ./vendor/bin/simple-phpunit)
28
+    - ([[ $TRAVIS_PHP_VERSION = 7.0 ]] || cd extra/html-extra && ./vendor/bin/simple-phpunit)
29
+    - ([[ $TRAVIS_PHP_VERSION = 7.0 ]] || cd extra/inky-extra && ./vendor/bin/simple-phpunit)
30
+    - ([[ $TRAVIS_PHP_VERSION = 7.0 ]] || cd extra/intl-extra && ./vendor/bin/simple-phpunit)
31
+    - ([[ $TRAVIS_PHP_VERSION = 7.0 ]] || cd extra/markdown-extra && ./vendor/bin/simple-phpunit)
27 32
 
28 33
 jobs:
29 34
     fast_finish: true
30 35
     include:
36
+        - php: 7.0
31 37
         - php: 7.1
32 38
         - php: 7.2
33 39
         - php: 7.3
... ...
@@ -24,7 +24,7 @@
24 24
         }
25 25
     ],
26 26
     "require": {
27
-        "php": "^7.1.3",
27
+        "php": "^7.0",
28 28
         "symfony/polyfill-mbstring": "^1.3",
29 29
         "symfony/polyfill-ctype": "^1.8"
30 30
     },
... ...
@@ -26,7 +26,7 @@ Slim, Yii, Laravel, and Codeigniter — just to name a few.
26 26
 Prerequisites
27 27
 -------------
28 28
 
29
-Twig needs at least **PHP 7.1.3** to run.
29
+Twig needs at least **PHP 7.0.0** to run.
30 30
 
31 31
 Installation
32 32
 ------------
... ...
@@ -21,7 +21,7 @@ class FilesystemTest extends TestCase
21 21
     private $directory;
22 22
     private $cache;
23 23
 
24
-    protected function setUp(): void
24
+    protected function setUp()
25 25
     {
26 26
         $nonce = hash('sha256', uniqid(mt_rand(), true));
27 27
         $this->classname = '__Twig_Tests_Cache_FilesystemTest_Template_'.$nonce;
... ...
@@ -29,7 +29,7 @@ class FilesystemTest extends TestCase
29 29
         $this->cache = new FilesystemCache($this->directory);
30 30
     }
31 31
 
32
-    protected function tearDown(): void
32
+    protected function tearDown()
33 33
     {
34 34
         if (file_exists($this->directory)) {
35 35
             FilesystemHelper::removeDir($this->directory);
... ...
@@ -28,7 +28,7 @@ class SandboxTest extends TestCase
28 28
     protected static $params;
29 29
     protected static $templates;
30 30
 
31
-    protected function setUp(): void
31
+    protected function setUp()
32 32
     {
33 33
         self::$params = [
34 34
             'name' => 'Fabien',
... ...
@@ -20,7 +20,7 @@ class TokenStreamTest extends TestCase
20 20
 {
21 21
     protected static $tokens;
22 22
 
23
-    protected function setUp(): void
23
+    protected function setUp()
24 24
     {
25 25
         self::$tokens = [
26 26
             new Token(Token::TEXT_TYPE, 1, 1),