Skip to content

Commit

Permalink
bug #3004 Fix support for PHP 7.4 (fabpot)
Browse files Browse the repository at this point in the history
This PR was squashed before being merged into the 1.x branch (closes #3004).

Discussion
----------

Fix support for PHP 7.4

Commits
-------

f958bd1 fixed deprecation under PHP 7.4
1fb0f97 fixed PHP 7.4 support
7be8e94 added PHP 7.4 in Travis config
  • Loading branch information
fabpot committed May 14, 2019
2 parents 2e1e952 + f958bd1 commit 611a29c
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Expand Up @@ -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 change: 1 addition & 0 deletions CHANGELOG
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/Lexer.php
Expand Up @@ -262,7 +262,7 @@ protected function lexData()
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");
Expand Down
2 changes: 1 addition & 1 deletion src/Node/Node.php
Expand Up @@ -40,7 +40,7 @@ public function __construct(array $nodes = [], array $attributes = [], $lineno =
{
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;
Expand Down

0 comments on commit 611a29c

Please sign in to comment.