Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions config/sets/twig/twig30.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

declare(strict_types=1);

use PHPStan\Type\ArrayType;
use PHPStan\Type\MixedType;
use Rector\Config\RectorConfig;
use Rector\TypeDeclaration\Rector\ClassMethod\AddReturnTypeDeclarationRector;
use Rector\TypeDeclaration\ValueObject\AddReturnTypeDeclaration;

return static function (RectorConfig $rectorConfig): void {

$rectorConfig->ruleWithConfiguration(AddReturnTypeDeclarationRector::class, [
new AddReturnTypeDeclaration('Twig\Extension\ExtensionInterface', 'getFilters', new ArrayType(new MixedType(), new MixedType())),
new AddReturnTypeDeclaration('Twig\Extension\ExtensionInterface', 'getTests', new ArrayType(new MixedType(), new MixedType())),
new AddReturnTypeDeclaration('Twig\Extension\ExtensionInterface', 'getFunctions', new ArrayType(new MixedType(), new MixedType())),
]);
};

6 changes: 6 additions & 0 deletions src/Set/SetProvider/TwigSetProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ public function provide(): array
'2.4',
__DIR__ . '/../../../config/sets/twig/twig24.php'
),
new ComposerTriggeredSet(
SetGroup::TWIG,
'twig/twig',
'3.0',
__DIR__ . '/../../../config/sets/twig/twig30.php'
),
];
}
}
2 changes: 2 additions & 0 deletions src/Set/TwigSetList.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,7 @@ final class TwigSetList

public const string TWIG_24 = __DIR__ . '/../../config/sets/twig/twig24.php';

public const string TWIG_30 = __DIR__ . '/../../config/sets/twig/twig30.php';

public const string TWIG_UNDERSCORE_TO_NAMESPACE = __DIR__ . '/../../config/sets/twig/twig-underscore-to-namespace.php';
}
Loading