From fcaa9991b1ee4615d8e7d29487ee7af7ea9503f6 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Tue, 19 May 2020 15:18:10 +0200 Subject: [PATCH 1/6] fix constructor argument types --- src/Node/Expression/BlockReferenceExpression.php | 5 ++++- src/Node/ForNode.php | 2 +- src/Node/IfNode.php | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Node/Expression/BlockReferenceExpression.php b/src/Node/Expression/BlockReferenceExpression.php index 3a2c5cee7..7e3c3e484 100644 --- a/src/Node/Expression/BlockReferenceExpression.php +++ b/src/Node/Expression/BlockReferenceExpression.php @@ -22,7 +22,10 @@ use Twig\Node\Node; */ class BlockReferenceExpression extends AbstractExpression { - public function __construct(\Twig_NodeInterface $name, ?Node $template, $lineno, $tag = null) + /** + * @param Node|null $template + */ + public function __construct(\Twig_NodeInterface $name, $template, $lineno, $tag = null) { if (\is_bool($template)) { @trigger_error(sprintf('The %s method "$asString" argument is deprecated since version 1.28 and will be removed in 2.0.', __METHOD__), E_USER_DEPRECATED); diff --git a/src/Node/ForNode.php b/src/Node/ForNode.php index 9b141ceab..111da37ea 100644 --- a/src/Node/ForNode.php +++ b/src/Node/ForNode.php @@ -25,7 +25,7 @@ class ForNode extends Node { protected $loop; - public function __construct(AssignNameExpression $keyTarget, AssignNameExpression $valueTarget, AbstractExpression $seq, ?AbstractExpression $ifexpr, ?\Twig_NodeInterface $body, ?\Twig_NodeInterface $else, $lineno, $tag = null) + public function __construct(AssignNameExpression $keyTarget, AssignNameExpression $valueTarget, AbstractExpression $seq, ?AbstractExpression $ifexpr, \Twig_NodeInterface $body, ?\Twig_NodeInterface $else, $lineno, $tag = null) { $body = new Node([$body, $this->loop = new ForLoopNode($lineno, $tag)]); diff --git a/src/Node/IfNode.php b/src/Node/IfNode.php index 417702a6c..da2ad344a 100644 --- a/src/Node/IfNode.php +++ b/src/Node/IfNode.php @@ -21,7 +21,7 @@ use Twig\Compiler; */ class IfNode extends Node { - public function __construct(?\Twig_NodeInterface $tests, ?\Twig_NodeInterface $else, $lineno, $tag = null) + public function __construct(\Twig_NodeInterface $tests, ?\Twig_NodeInterface $else, $lineno, $tag = null) { $nodes = ['tests' => $tests]; if (null !== $else) { From 90c38edac91c533635d450379d0f6d3a5adcfd14 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Tue, 19 May 2020 15:25:58 +0200 Subject: [PATCH 2/6] Bypass tests for extra packages on PHP 8 --- .travis.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5d05b16d3..435c2170e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,21 +27,21 @@ install: ./vendor/bin/simple-phpunit install; phpenv global nightly; fi - - (cd extra/cssinliner-extra && travis_retry composer install) - - (cd extra/html-extra && travis_retry composer install) - - (cd extra/inky-extra && travis_retry composer install) - - (cd extra/intl-extra && travis_retry composer install) - - (cd extra/markdown-extra && travis_retry composer install) - - ([[ $TRAVIS_PHP_VERSION < 7.2 ]] || (cd extra/string-extra && travis_retry composer install)) + - ([[ $TRAVIS_PHP_VERSION < 8.0 ]] && cd extra/cssinliner-extra && travis_retry composer install) + - ([[ $TRAVIS_PHP_VERSION < 8.0 ]] && cd extra/html-extra && travis_retry composer install) + - ([[ $TRAVIS_PHP_VERSION < 8.0 ]] && cd extra/inky-extra && travis_retry composer install) + - ([[ $TRAVIS_PHP_VERSION < 8.0 ]] && cd extra/intl-extra && travis_retry composer install) + - ([[ $TRAVIS_PHP_VERSION < 8.0 ]] && cd extra/markdown-extra && travis_retry composer install) + - ([[ $TRAVIS_PHP_VERSION >= 7.2 && $TRAVIS_PHP_VERSION < 8.0 ]] && (cd extra/string-extra && travis_retry composer install)) script: - ./vendor/bin/simple-phpunit - - (cd extra/cssinliner-extra && ./vendor/bin/simple-phpunit) - - (cd extra/html-extra && ./vendor/bin/simple-phpunit) - - (cd extra/inky-extra && ./vendor/bin/simple-phpunit) - - (cd extra/intl-extra && ./vendor/bin/simple-phpunit) - - (cd extra/markdown-extra && ./vendor/bin/simple-phpunit) - - ([[ $TRAVIS_PHP_VERSION < 7.2 ]] || (cd extra/string-extra && ./vendor/bin/simple-phpunit)) + - ([[ $TRAVIS_PHP_VERSION < 8.0 ]] && cd extra/cssinliner-extra && ./vendor/bin/simple-phpunit) + - ([[ $TRAVIS_PHP_VERSION < 8.0 ]] && cd extra/html-extra && ./vendor/bin/simple-phpunit) + - ([[ $TRAVIS_PHP_VERSION < 8.0 ]] && cd extra/inky-extra && ./vendor/bin/simple-phpunit) + - ([[ $TRAVIS_PHP_VERSION < 8.0 ]] && cd extra/intl-extra && ./vendor/bin/simple-phpunit) + - ([[ $TRAVIS_PHP_VERSION < 8.0 ]] && cd extra/markdown-extra && ./vendor/bin/simple-phpunit) + - ([[ $TRAVIS_PHP_VERSION >= 7.2 && $TRAVIS_PHP_VERSION < 8.0 ]] && (cd extra/string-extra && ./vendor/bin/simple-phpunit)) matrix: fast_finish: true From b003d737624243fbe7b438f2a074af7b6f77d9fa Mon Sep 17 00:00:00 2001 From: Denis Brumann Date: Tue, 19 May 2020 15:40:58 +0200 Subject: [PATCH 3/6] Remove deprecated option MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See: https://docs.travis-ci.com/user/reference/overview/#deprecated-virtualization-environments > If you’re trying to use sudo: false or dist: precise keys in your travis.yml, we recommend you remove them and switch to our current Xenial Linux infrastructure. --- .travis.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index e170c1833..c4c6c0aae 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,8 +2,6 @@ language: php dist: xenial -sudo: false - cache: directories: - vendor From 43797e76d60eae7f6a342ed8cc19933b2f9eb868 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Tue, 19 May 2020 15:43:57 +0200 Subject: [PATCH 4/6] Fix Travis config --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 435c2170e..f37394e17 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,7 +32,7 @@ install: - ([[ $TRAVIS_PHP_VERSION < 8.0 ]] && cd extra/inky-extra && travis_retry composer install) - ([[ $TRAVIS_PHP_VERSION < 8.0 ]] && cd extra/intl-extra && travis_retry composer install) - ([[ $TRAVIS_PHP_VERSION < 8.0 ]] && cd extra/markdown-extra && travis_retry composer install) - - ([[ $TRAVIS_PHP_VERSION >= 7.2 && $TRAVIS_PHP_VERSION < 8.0 ]] && (cd extra/string-extra && travis_retry composer install)) + - ([[ $TRAVIS_PHP_VERSION > 7.1 && $TRAVIS_PHP_VERSION < 8.0 ]] && (cd extra/string-extra && travis_retry composer install)) script: - ./vendor/bin/simple-phpunit @@ -41,7 +41,7 @@ script: - ([[ $TRAVIS_PHP_VERSION < 8.0 ]] && cd extra/inky-extra && ./vendor/bin/simple-phpunit) - ([[ $TRAVIS_PHP_VERSION < 8.0 ]] && cd extra/intl-extra && ./vendor/bin/simple-phpunit) - ([[ $TRAVIS_PHP_VERSION < 8.0 ]] && cd extra/markdown-extra && ./vendor/bin/simple-phpunit) - - ([[ $TRAVIS_PHP_VERSION >= 7.2 && $TRAVIS_PHP_VERSION < 8.0 ]] && (cd extra/string-extra && ./vendor/bin/simple-phpunit)) + - ([[ $TRAVIS_PHP_VERSION > 7.1 && $TRAVIS_PHP_VERSION < 8.0 ]] && (cd extra/string-extra && ./vendor/bin/simple-phpunit)) matrix: fast_finish: true From e0b897ddcf20ee7447a08a0417ad325d54f13553 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Tue, 19 May 2020 15:50:52 +0200 Subject: [PATCH 5/6] Fix Travis config --- .travis.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.travis.yml b/.travis.yml index f37394e17..afe347d3f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,21 +27,21 @@ install: ./vendor/bin/simple-phpunit install; phpenv global nightly; fi - - ([[ $TRAVIS_PHP_VERSION < 8.0 ]] && cd extra/cssinliner-extra && travis_retry composer install) - - ([[ $TRAVIS_PHP_VERSION < 8.0 ]] && cd extra/html-extra && travis_retry composer install) - - ([[ $TRAVIS_PHP_VERSION < 8.0 ]] && cd extra/inky-extra && travis_retry composer install) - - ([[ $TRAVIS_PHP_VERSION < 8.0 ]] && cd extra/intl-extra && travis_retry composer install) - - ([[ $TRAVIS_PHP_VERSION < 8.0 ]] && cd extra/markdown-extra && travis_retry composer install) - - ([[ $TRAVIS_PHP_VERSION > 7.1 && $TRAVIS_PHP_VERSION < 8.0 ]] && (cd extra/string-extra && travis_retry composer install)) + - ([[ $TRAVIS_PHP_VERSION = "nightly" ]] || cd extra/cssinliner-extra && travis_retry composer install) + - ([[ $TRAVIS_PHP_VERSION = "nightly" ]] || cd extra/html-extra && travis_retry composer install) + - ([[ $TRAVIS_PHP_VERSION = "nightly" ]] || cd extra/inky-extra && travis_retry composer install) + - ([[ $TRAVIS_PHP_VERSION = "nightly" ]] || cd extra/intl-extra && travis_retry composer install) + - ([[ $TRAVIS_PHP_VERSION = "nightly" ]] || cd extra/markdown-extra && travis_retry composer install) + - ([[ $TRAVIS_PHP_VERSION = 7.1 ]] || [[ $TRAVIS_PHP_VERSION = "nightly" ]] || (cd extra/string-extra && travis_retry composer install)) script: - ./vendor/bin/simple-phpunit - - ([[ $TRAVIS_PHP_VERSION < 8.0 ]] && cd extra/cssinliner-extra && ./vendor/bin/simple-phpunit) - - ([[ $TRAVIS_PHP_VERSION < 8.0 ]] && cd extra/html-extra && ./vendor/bin/simple-phpunit) - - ([[ $TRAVIS_PHP_VERSION < 8.0 ]] && cd extra/inky-extra && ./vendor/bin/simple-phpunit) - - ([[ $TRAVIS_PHP_VERSION < 8.0 ]] && cd extra/intl-extra && ./vendor/bin/simple-phpunit) - - ([[ $TRAVIS_PHP_VERSION < 8.0 ]] && cd extra/markdown-extra && ./vendor/bin/simple-phpunit) - - ([[ $TRAVIS_PHP_VERSION > 7.1 && $TRAVIS_PHP_VERSION < 8.0 ]] && (cd extra/string-extra && ./vendor/bin/simple-phpunit)) + - ([[ $TRAVIS_PHP_VERSION = "nightly" ]] || cd extra/cssinliner-extra && ./vendor/bin/simple-phpunit) + - ([[ $TRAVIS_PHP_VERSION = "nightly" ]] || cd extra/html-extra && ./vendor/bin/simple-phpunit) + - ([[ $TRAVIS_PHP_VERSION = "nightly" ]] || cd extra/inky-extra && ./vendor/bin/simple-phpunit) + - ([[ $TRAVIS_PHP_VERSION = "nightly" ]] || cd extra/intl-extra && ./vendor/bin/simple-phpunit) + - ([[ $TRAVIS_PHP_VERSION = "nightly" ]] || cd extra/markdown-extra && ./vendor/bin/simple-phpunit) + - ([[ $TRAVIS_PHP_VERSION = 7.1 ]] || [[ $TRAVIS_PHP_VERSION = "nightly" ]] || (cd extra/string-extra && ./vendor/bin/simple-phpunit)) matrix: fast_finish: true From 663b8fa83270ae53c3c6f41de684e0282462b24c Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Tue, 19 May 2020 16:03:12 +0200 Subject: [PATCH 6/6] Fix typo --- src/Node/Expression/CallExpression.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Node/Expression/CallExpression.php b/src/Node/Expression/CallExpression.php index e182b0280..0b53f27f5 100644 --- a/src/Node/Expression/CallExpression.php +++ b/src/Node/Expression/CallExpression.php @@ -113,7 +113,7 @@ abstract class CallExpression extends AbstractExpression $compiler->raw($isArray ? ']' : ')'); } - protected function getArguments($callable = null, $arguments) + protected function getArguments($callable, $arguments) { $callType = $this->getAttribute('type'); $callName = $this->getAttribute('name');