Minor fixes

This commit is contained in:
Nicolas Grekas
2020-05-21 10:13:35 +02:00
parent f59c2596ad
commit 5dc364469b
11 changed files with 18 additions and 15 deletions
+4 -3
View File
@@ -9,7 +9,6 @@ cache:
env:
global:
- SYMFONY_PHPUNIT_REMOVE_RETURN_TYPEHINT=1
- SYMFONY_PHPUNIT_DISABLE_RESULT_CACHE=1
before_install:
@@ -18,9 +17,11 @@ before_install:
install:
- travis_retry composer install
- ./vendor/bin/simple-phpunit install
- export PHPUNIT=$(readlink -f ./vendor/bin/simple-phpunit)
- $PHPUNIT install
script: ./vendor/bin/simple-phpunit
script:
- $PHPUNIT
jobs:
fast_finish: true
+3 -1
View File
@@ -6,8 +6,10 @@ 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
php ./web/core/scripts/drupal install --no-interaction demo_umami > output
+1 -1
View File
@@ -17,7 +17,7 @@ use Twig\Template;
class GetAttrExpression extends AbstractExpression
{
public function __construct(AbstractExpression $node, AbstractExpression $attribute, AbstractExpression $arguments = null, $type, $lineno)
public function __construct(AbstractExpression $node, AbstractExpression $attribute, ?AbstractExpression $arguments, string $type, int $lineno)
{
$nodes = ['node' => $node, 'attribute' => $attribute];
if (null !== $arguments) {
+1 -1
View File
@@ -33,7 +33,7 @@ use Twig\Node\Expression\TestExpression;
*/
class DefinedTest extends TestExpression
{
public function __construct(\Twig_NodeInterface $node, $name, \Twig_NodeInterface $arguments = null, $lineno)
public function __construct(\Twig_NodeInterface $node, $name, ?\Twig_NodeInterface $arguments, $lineno)
{
if ($node instanceof NameExpression) {
$node->setAttribute('is_defined_test', true);
+1 -1
View File
@@ -16,7 +16,7 @@ use Twig\TwigTest;
class TestExpression extends CallExpression
{
public function __construct(\Twig_NodeInterface $node, $name, \Twig_NodeInterface $arguments = null, $lineno)
public function __construct(\Twig_NodeInterface $node, $name, ?\Twig_NodeInterface $arguments, $lineno)
{
$nodes = ['node' => $node];
if (null !== $arguments) {
+1 -1
View File
@@ -28,7 +28,7 @@ use Twig\Source;
*/
class ModuleNode extends Node
{
public function __construct(\Twig_NodeInterface $body, AbstractExpression $parent = null, \Twig_NodeInterface $blocks, \Twig_NodeInterface $macros, \Twig_NodeInterface $traits, $embeddedTemplates, $name, $source = '')
public function __construct(\Twig_NodeInterface $body, ?AbstractExpression $parent, \Twig_NodeInterface $blocks, \Twig_NodeInterface $macros, \Twig_NodeInterface $traits, $embeddedTemplates, $name, $source = '')
{
if (!$name instanceof Source) {
@trigger_error(sprintf('Passing a string as the $name argument of %s() is deprecated since version 1.27. Pass a \Twig\Source instance instead.', __METHOD__), E_USER_DEPRECATED);
+2 -2
View File
@@ -20,7 +20,7 @@ class FilesystemTest extends \PHPUnit\Framework\TestCase
private $directory;
private $cache;
protected function setUp()
protected function setUp(): void
{
$nonce = hash('sha256', uniqid(mt_rand(), true));
$this->classname = '__Twig_Tests_Cache_FilesystemTest_Template_'.$nonce;
@@ -28,7 +28,7 @@ class FilesystemTest extends \PHPUnit\Framework\TestCase
$this->cache = new FilesystemCache($this->directory);
}
protected function tearDown()
protected function tearDown(): void
{
if (file_exists($this->directory)) {
FilesystemHelper::removeDir($this->directory);
+1 -1
View File
@@ -22,7 +22,7 @@ class SandboxTest extends \PHPUnit\Framework\TestCase
protected static $params;
protected static $templates;
protected function setUp()
protected function setUp(): void
{
self::$params = [
'name' => 'Fabien',
+2 -2
View File
@@ -19,7 +19,7 @@ class FileCachingTest extends \PHPUnit\Framework\TestCase
private $env;
private $tmpDir;
protected function setUp()
protected function setUp(): void
{
$this->tmpDir = sys_get_temp_dir().'/TwigTests';
if (!file_exists($this->tmpDir)) {
@@ -33,7 +33,7 @@ class FileCachingTest extends \PHPUnit\Framework\TestCase
$this->env = new Environment(new ArrayLoader(['index' => 'index', 'index2' => 'index2']), ['cache' => $this->tmpDir]);
}
protected function tearDown()
protected function tearDown(): void
{
FilesystemHelper::removeDir($this->tmpDir);
}
+1 -1
View File
@@ -18,7 +18,7 @@ class TokenStreamTest extends \PHPUnit\Framework\TestCase
{
protected static $tokens;
protected function setUp()
protected function setUp(): void
{
self::$tokens = [
new Token(Token::TEXT_TYPE, 1, 1),
+1 -1
View File
@@ -151,7 +151,7 @@ class Twig_Test_EscapingTest extends \PHPUnit\Framework\TestCase
protected $env;
protected function setUp()
protected function setUp(): void
{
$this->env = new \Twig\Environment($this->createMock('\Twig\Loader\LoaderInterface'));
}