Browse code

feature #3107 Upgrade minimal version of php (jderusse)

This PR was merged into the 1.x branch.

Discussion
----------

Upgrade minimal version of php

Following this comment https://github.com/twigphp/Twig/pull/3103#issuecomment-519282356
Bump the minimal required version of PHP to 5.5

Commits
-------

074e46ae Upgrade minimal version of php

Fabien Potencier authored on 07/08/2019 22:43:19
Showing 5 changed files
... ...
@@ -27,9 +27,6 @@ script: ./vendor/bin/simple-phpunit
27 27
 jobs:
28 28
     fast_finish: true
29 29
     include:
30
-        - php: 5.4
31
-        - php: 5.4
32
-          env: TWIG_EXT=yes
33 30
         - php: 5.5
34 31
         - php: 5.5
35 32
           env: TWIG_EXT=yes
... ...
@@ -2,6 +2,7 @@
2 2
 
3 3
  * fixed the "empty" test on Traversable instances
4 4
  * fixed cache when opcache is installed but disabled
5
+ * upgrade minimal php version to 5.5
5 6
 
6 7
 * 1.42.2 (2019-06-18)
7 8
 
... ...
@@ -24,7 +24,7 @@
24 24
         }
25 25
     ],
26 26
     "require": {
27
-        "php": ">=5.4.0",
27
+        "php": ">=5.5.0",
28 28
         "symfony/polyfill-ctype": "^1.8"
29 29
     },
30 30
     "require-dev": {
... ...
@@ -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 5.4.0** to run.
29
+Twig needs at least **PHP 5.5.0** to run.
30 30
 
31 31
 Installation
32 32
 ------------
... ...
@@ -41,21 +41,6 @@ class OptimizerTest extends \PHPUnit\Framework\TestCase
41 41
         $this->assertTrue($node->getAttribute('output'));
42 42
     }
43 43
 
44
-    public function testRenderVariableBlockOptimizer()
45
-    {
46
-        if (\PHP_VERSION_ID >= 50400) {
47
-            $this->markTestSkipped('not needed on PHP >= 5.4');
48
-        }
49
-
50
-        $env = new Environment($this->getMockBuilder('\Twig\Loader\LoaderInterface')->getMock(), ['cache' => false, 'autoescape' => false]);
51
-        $stream = $env->parse($env->tokenize(new Source('{{ block(name|lower) }}', 'index')));
52
-
53
-        $node = $stream->getNode('body')->getNode(0)->getNode(1);
54
-
55
-        $this->assertInstanceOf('\Twig\Node\Expression\BlockReferenceExpression', $node);
56
-        $this->assertTrue($node->getAttribute('output'));
57
-    }
58
-
59 44
     /**
60 45
      * @dataProvider getTestsForForOptimizer
61 46
      */