mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-02 05:26:43 +00:00
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 -------f958bd1efixed deprecation under PHP 7.41fb0f970fixed PHP 7.4 support7be8e944added PHP 7.4 in Travis config
This commit is contained in:
@@ -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,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
@@ -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
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user