diff --git a/.travis.yml b/.travis.yml index 10a5c8b25..a8b5713ae 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,24 +18,26 @@ before_install: install: - travis_retry composer install - - ./vendor/bin/simple-phpunit 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 = "nightly" ]] || cd extra/string-extra && travis_retry composer install) + - export PHPUNIT=$(readlink -f ./vendor/bin/simple-phpunit) + - $PHPUNIT install + - (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) + - ([[ $TRAVIS_PHP_VERSION = nightly ]] && (cd extra/markdown-extra && composer config platform.php 7.4.99) || true) + - (cd extra/markdown-extra && travis_retry composer install) + - (cd extra/string-extra && travis_retry composer install) script: - - ./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 = "nightly" ]] || cd extra/string-extra && ./vendor/bin/simple-phpunit) + - $PHPUNIT + - (cd extra/cssinliner-extra && $PHPUNIT) + - (cd extra/html-extra && $PHPUNIT) + - (cd extra/inky-extra && $PHPUNIT) + - (cd extra/intl-extra && $PHPUNIT) + - (cd extra/markdown-extra && $PHPUNIT) + - (cd extra/string-extra && $PHPUNIT) -matrix: +jobs: fast_finish: true include: - php: 7.2 diff --git a/composer.json b/composer.json index a0e2f84a0..a17e50140 100644 --- a/composer.json +++ b/composer.json @@ -6,7 +6,6 @@ "homepage": "https://twig.symfony.com", "license": "BSD-3-Clause", "minimum-stability": "dev", - "prefer-stable": true, "authors": [ { "name": "Fabien Potencier", diff --git a/drupal_test.sh b/drupal_test.sh index 75d5f0260..e15bd6673 100755 --- a/drupal_test.sh +++ b/drupal_test.sh @@ -6,11 +6,12 @@ set -e REPO=`pwd` cd /tmp rm -rf drupal-twig-test -composer create-project --no-interaction drupal-composer/drupal-project:8.x-dev drupal-twig-test +composer create-project --no-install --no-interaction drupal-composer/drupal-project:8.x-dev drupal-twig-test cd drupal-twig-test +composer require --no-update webflo/drupal-core-require-dev "egulias/email-validator:^2.0" +composer update (cd vendor/twig && rm -rf twig && ln -sf $REPO twig) echo '$config["system.logging"]["error_level"] = "verbose";' >> web/sites/default/settings.php -composer require drupal/core:8.7.x-dev webflo/drupal-core-require-dev:8.7.x-dev "egulias/email-validator:^2.0" php ./web/core/scripts/drupal install --no-interaction demo_umami > output perl -p -i -e 's/^([A-Za-z]+)\: (.+)$/export DRUPAL_\1=\2/' output source output diff --git a/extra/cssinliner-extra/composer.json b/extra/cssinliner-extra/composer.json index 1afeaf9cd..c1696a3f2 100644 --- a/extra/cssinliner-extra/composer.json +++ b/extra/cssinliner-extra/composer.json @@ -6,7 +6,6 @@ "homepage": "https://twig.symfony.com", "license": "MIT", "minimum-stability": "dev", - "prefer-stable": true, "authors": [ { "name": "Fabien Potencier", diff --git a/extra/html-extra/composer.json b/extra/html-extra/composer.json index fb3037388..c301966f7 100644 --- a/extra/html-extra/composer.json +++ b/extra/html-extra/composer.json @@ -6,7 +6,6 @@ "homepage": "https://twig.symfony.com", "license": "MIT", "minimum-stability": "dev", - "prefer-stable": true, "authors": [ { "name": "Fabien Potencier", diff --git a/extra/inky-extra/composer.json b/extra/inky-extra/composer.json index 817cac369..137670e3a 100644 --- a/extra/inky-extra/composer.json +++ b/extra/inky-extra/composer.json @@ -6,7 +6,6 @@ "homepage": "https://twig.symfony.com", "license": "MIT", "minimum-stability": "dev", - "prefer-stable": true, "authors": [ { "name": "Fabien Potencier", diff --git a/extra/intl-extra/composer.json b/extra/intl-extra/composer.json index 65de3fa5c..a6fdc223e 100644 --- a/extra/intl-extra/composer.json +++ b/extra/intl-extra/composer.json @@ -6,7 +6,6 @@ "homepage": "https://twig.symfony.com", "license": "MIT", "minimum-stability": "dev", - "prefer-stable": true, "authors": [ { "name": "Fabien Potencier", diff --git a/extra/intl-extra/src/IntlExtension.php b/extra/intl-extra/src/IntlExtension.php index 3bb23bac7..34f33c80e 100644 --- a/extra/intl-extra/src/IntlExtension.php +++ b/extra/intl-extra/src/IntlExtension.php @@ -307,7 +307,7 @@ final class IntlExtension extends AbstractExtension return $this->formatDateTime($env, $date, 'none', $timeFormat, $pattern, $timezone, $calendar, $locale); } - private function createDateFormatter(?string $locale, ?string $dateFormat, ?string $timeFormat, string $pattern = '', \DateTimeZone $timezone, string $calendar): \IntlDateFormatter + private function createDateFormatter(?string $locale, ?string $dateFormat, ?string $timeFormat, string $pattern, \DateTimeZone $timezone, string $calendar): \IntlDateFormatter { if (null !== $dateFormat && !isset(self::DATE_FORMATS[$dateFormat])) { throw new RuntimeError(sprintf('The date format "%s" does not exist, known formats are: "%s".', $dateFormat, implode('", "', array_keys(self::DATE_FORMATS)))); diff --git a/extra/markdown-extra/composer.json b/extra/markdown-extra/composer.json index bbbc03196..0afec0638 100644 --- a/extra/markdown-extra/composer.json +++ b/extra/markdown-extra/composer.json @@ -6,7 +6,6 @@ "homepage": "https://twig.symfony.com", "license": "MIT", "minimum-stability": "dev", - "prefer-stable": true, "authors": [ { "name": "Fabien Potencier", diff --git a/extra/string-extra/composer.json b/extra/string-extra/composer.json index 5bc9fcc99..ad9027e2b 100644 --- a/extra/string-extra/composer.json +++ b/extra/string-extra/composer.json @@ -6,7 +6,6 @@ "homepage": "https://twig.symfony.com", "license": "MIT", "minimum-stability": "dev", - "prefer-stable": true, "authors": [ { "name": "Fabien Potencier", diff --git a/extra/twig-extra-bundle/composer.json b/extra/twig-extra-bundle/composer.json index 4275d7bb1..83e436ba6 100644 --- a/extra/twig-extra-bundle/composer.json +++ b/extra/twig-extra-bundle/composer.json @@ -6,7 +6,6 @@ "homepage": "https://twig.symfony.com", "license": "MIT", "minimum-stability": "dev", - "prefer-stable": true, "authors": [ { "name": "Fabien Potencier", diff --git a/src/Node/Expression/GetAttrExpression.php b/src/Node/Expression/GetAttrExpression.php index 6527af1c7..e6a75ce94 100644 --- a/src/Node/Expression/GetAttrExpression.php +++ b/src/Node/Expression/GetAttrExpression.php @@ -18,7 +18,7 @@ use Twig\Template; class GetAttrExpression extends AbstractExpression { - public function __construct(AbstractExpression $node, AbstractExpression $attribute, AbstractExpression $arguments = null, string $type, int $lineno) + public function __construct(AbstractExpression $node, AbstractExpression $attribute, ?AbstractExpression $arguments, string $type, int $lineno) { $nodes = ['node' => $node, 'attribute' => $attribute]; if (null !== $arguments) { diff --git a/src/Node/Expression/Test/DefinedTest.php b/src/Node/Expression/Test/DefinedTest.php index 8ccfc8e65..3953bbbe2 100644 --- a/src/Node/Expression/Test/DefinedTest.php +++ b/src/Node/Expression/Test/DefinedTest.php @@ -35,7 +35,7 @@ use Twig\Node\Node; */ class DefinedTest extends TestExpression { - public function __construct(Node $node, string $name, Node $arguments = null, int $lineno) + public function __construct(Node $node, string $name, ?Node $arguments, int $lineno) { if ($node instanceof NameExpression) { $node->setAttribute('is_defined_test', true); diff --git a/src/Node/Expression/TestExpression.php b/src/Node/Expression/TestExpression.php index e0c90c374..e518bd8f1 100644 --- a/src/Node/Expression/TestExpression.php +++ b/src/Node/Expression/TestExpression.php @@ -16,7 +16,7 @@ use Twig\Node\Node; class TestExpression extends CallExpression { - public function __construct(Node $node, string $name, Node $arguments = null, int $lineno) + public function __construct(Node $node, string $name, ?Node $arguments, int $lineno) { $nodes = ['node' => $node]; if (null !== $arguments) { diff --git a/src/Node/ModuleNode.php b/src/Node/ModuleNode.php index 93eef125f..e972b6ba5 100644 --- a/src/Node/ModuleNode.php +++ b/src/Node/ModuleNode.php @@ -28,7 +28,7 @@ use Twig\Source; */ final class ModuleNode extends Node { - public function __construct(Node $body, AbstractExpression $parent = null, Node $blocks, Node $macros, Node $traits, $embeddedTemplates, Source $source) + public function __construct(Node $body, ?AbstractExpression $parent, Node $blocks, Node $macros, Node $traits, $embeddedTemplates, Source $source) { $nodes = [ 'body' => $body, diff --git a/tests/Node/Expression/CallTest.php b/tests/Node/Expression/CallTest.php index 4bfbbe424..99839b87a 100644 --- a/tests/Node/Expression/CallTest.php +++ b/tests/Node/Expression/CallTest.php @@ -135,7 +135,7 @@ class CallTest extends TestCase class Node_Expression_Call extends CallExpression { - public function getArguments($callable = null, $arguments) + public function getArguments($callable, $arguments) { return parent::getArguments($callable, $arguments); }