Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix support for PHP 7.4 #3004

Merged
merged 3 commits into from May 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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