bug #3004 Fix support for PHP 7.4 (fabpot)

This PR was squashed before being merged into the 1.x branch (closes #3004).

Discussion
----------

Fix support for PHP 7.4

Commits
-------

f958bd1e fixed deprecation under PHP 7.4
1fb0f970 fixed PHP 7.4 support
7be8e944 added PHP 7.4 in Travis config
This commit is contained in:
Fabien Potencier
2019-05-14 08:45:39 +02:00
4 changed files with 4 additions and 2 deletions
+1
View File
@@ -38,6 +38,7 @@ jobs:
- php: 7.1
- php: 7.2
- php: 7.3
- php: 7.4snapshot
- stage: integration tests
php: 7.3
script: ./drupal_test.sh
+1
View File
@@ -1,5 +1,6 @@
* 1.41.0 (2019-XX-XX)
* fixed support for PHP 7.4
* added "filter", "map", and "reduce" filters (and support for arrow functions)
* fixed partial output leak when a PHP fatal error occurs
* optimized context access on PHP 7.4
+1 -1
View File
@@ -262,7 +262,7 @@ class Lexer implements \Twig_LexerInterface
if ($this->options['whitespace_trim'] === $this->positions[2][$this->position][0]) {
// whitespace_trim detected ({%-, {{- or {#-)
$text = rtrim($text);
} else {
} elseif ($this->options['whitespace_line_trim'] === $this->positions[2][$this->position][0]) {
// whitespace_line_trim detected ({%~, {{~ or {#~)
// don't trim \r and \n
$text = rtrim($text, " \t\0\x0B");
+1 -1
View File
@@ -40,7 +40,7 @@ class Node implements \Twig_NodeInterface
{
foreach ($nodes as $name => $node) {
if (!$node instanceof \Twig_NodeInterface) {
@trigger_error(sprintf('Using "%s" for the value of node "%s" of "%s" is deprecated since version 1.25 and will be removed in 2.0.', \is_object($node) ? \get_class($node) : null === $node ? 'null' : \gettype($node), $name, \get_class($this)), E_USER_DEPRECATED);
@trigger_error(sprintf('Using "%s" for the value of node "%s" of "%s" is deprecated since version 1.25 and will be removed in 2.0.', \is_object($node) ? \get_class($node) : (null === $node ? 'null' : \gettype($node)), $name, \get_class($this)), E_USER_DEPRECATED);
}
}
$this->nodes = $nodes;