diff --git a/.gitattributes b/.gitattributes index 18ea6a59..1c8e1637 100644 --- a/.gitattributes +++ b/.gitattributes @@ -9,6 +9,7 @@ docs export-ignore Makefile export-ignore phpunit.xml.dist export-ignore bin/console export-ignore +rector.php export-ignore phpstan.neon.dist export-ignore phpstan-baseline.neon export-ignore phpstan-console-application.php export-ignore diff --git a/.github/workflows/qa.yaml b/.github/workflows/qa.yaml index c38af99d..e7381438 100644 --- a/.github/workflows/qa.yaml +++ b/.github/workflows/qa.yaml @@ -62,3 +62,27 @@ jobs: - name: Psalm run: vendor/bin/psalm --no-progress --show-info=false --stats --output-format=github --threads=$(nproc) --shepherd --php-version=8.1 + rector: + name: Rector + + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Install PHP with extensions + uses: shivammathur/setup-php@v2 + with: + php-version: '8.1' + coverage: none + tools: composer:v2 + + - name: Install Composer dependencies (highest) + uses: ramsey/composer-install@v2 + with: + dependency-versions: highest + composer-options: --prefer-dist --prefer-stable + + - name: Rector + run: vendor/bin/rector --no-progress-bar --dry-run diff --git a/Makefile b/Makefile index d7221e85..6f553c20 100644 --- a/Makefile +++ b/Makefile @@ -119,3 +119,7 @@ phpstan: psalm: vendor/bin/psalm --php-version=8.1 .PHONY: psalm + +rector: + vendor/bin/rector +.PHONY: rector diff --git a/composer.json b/composer.json index ce185024..441e63f6 100644 --- a/composer.json +++ b/composer.json @@ -57,6 +57,7 @@ "phpunit/phpunit": "^9.5.13", "psalm/plugin-phpunit": "^0.16", "psalm/plugin-symfony": "^3.0", + "rector/rector": "^0.12", "sonata-project/doctrine-extensions": "^1.10.1", "symfony/browser-kit": "^4.4 || ^5.3 || ^6.0", "symfony/debug": "^4.4 || ^5.3 || ^6.0", diff --git a/rector.php b/rector.php new file mode 100644 index 00000000..2cc1f7f5 --- /dev/null +++ b/rector.php @@ -0,0 +1,41 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * DO NOT EDIT THIS FILE! + * + * It's auto-generated by sonata-project/dev-kit package. + */ + +use Rector\Config\RectorConfig; +use Rector\Php70\Rector\FunctionLike\ExceptionHandlerTypehintRector; +use Rector\Php71\Rector\FuncCall\CountOnNullRector; +use Rector\Set\ValueObject\LevelSetList; + +return static function (RectorConfig $rectorConfig): void { + $rectorConfig->paths([ + __DIR__.'/src', + __DIR__.'/tests', + ]); + + $rectorConfig->sets([ + LevelSetList::UP_TO_PHP_74, + ]); + + $rectorConfig->importNames(); + $rectorConfig->disableImportShortClasses(); + $rectorConfig->skip([ + CountOnNullRector::class, + ExceptionHandlerTypehintRector::class, + ]); +}; diff --git a/src/Block/BlockContext.php b/src/Block/BlockContext.php index b516ff1a..9babc280 100644 --- a/src/Block/BlockContext.php +++ b/src/Block/BlockContext.php @@ -17,15 +17,12 @@ final class BlockContext implements BlockContextInterface { - /** - * @var BlockInterface - */ - private $block; + private BlockInterface $block; /** * @var array */ - private $settings; + private array $settings; /** * @param array $settings diff --git a/src/Block/BlockContextManager.php b/src/Block/BlockContextManager.php index b313e84a..1b899431 100644 --- a/src/Block/BlockContextManager.php +++ b/src/Block/BlockContextManager.php @@ -23,33 +23,27 @@ final class BlockContextManager implements BlockContextManagerInterface { - /** - * @var BlockLoaderInterface - */ - private $blockLoader; + private BlockLoaderInterface $blockLoader; - /** - * @var BlockServiceManagerInterface - */ - private $blockService; + private BlockServiceManagerInterface $blockService; /** * @var array> */ - private $settingsByType = []; + private array $settingsByType = []; /** * @var array> * @phpstan-var array> */ - private $settingsByClass = []; + private array $settingsByClass = []; /** * NEXT_MAJOR: remove. * * @var array{by_class: array, by_type: array} */ - private $cacheBlocks = ['by_class' => [], 'by_type' => []]; + private array $cacheBlocks = ['by_class' => [], 'by_type' => []]; /** * @var LoggerInterface diff --git a/src/Block/BlockLoaderChain.php b/src/Block/BlockLoaderChain.php index 2fa646a5..4b7392a3 100644 --- a/src/Block/BlockLoaderChain.php +++ b/src/Block/BlockLoaderChain.php @@ -21,7 +21,7 @@ final class BlockLoaderChain implements BlockLoaderInterface /** * @var BlockLoaderInterface[] */ - private $loaders; + private array $loaders; /** * @param BlockLoaderInterface[] $loaders diff --git a/src/Block/BlockRenderer.php b/src/Block/BlockRenderer.php index f42d2fe0..ae5559c4 100644 --- a/src/Block/BlockRenderer.php +++ b/src/Block/BlockRenderer.php @@ -26,28 +26,17 @@ */ final class BlockRenderer implements BlockRendererInterface { - /** - * @var BlockServiceManagerInterface - */ - private $blockServiceManager; + private BlockServiceManagerInterface $blockServiceManager; - /** - * @var StrategyManagerInterface - */ - private $exceptionStrategyManager; + private StrategyManagerInterface $exceptionStrategyManager; - /** - * @var LoggerInterface|null - */ - private $logger; + private ?LoggerInterface $logger; /** * This property hold the last response available from the child or sibling block * The cacheable attributes must be cascaded to the parent. - * - * @var Response|null */ - private $lastResponse; + private ?Response $lastResponse = null; /** * @param BlockServiceManagerInterface $blockServiceManager Block service manager diff --git a/src/Block/BlockServiceManager.php b/src/Block/BlockServiceManager.php index 22b95209..b38a5821 100644 --- a/src/Block/BlockServiceManager.php +++ b/src/Block/BlockServiceManager.php @@ -25,27 +25,21 @@ final class BlockServiceManager implements BlockServiceManagerInterface /** * @var array */ - private $services; + private array $services; - /** - * @var ContainerInterface - */ - private $container; + private ContainerInterface $container; - /** - * @var bool - */ - private $inValidate = false; + private bool $inValidate = false; /** * @var array */ - private $contexts; + private array $contexts; /** * @var string[] */ - private $containerTypes; + private array $containerTypes; /** * NEXT_MAJOR: make $containerTypes not nullable. diff --git a/src/Block/Loader/ServiceLoader.php b/src/Block/Loader/ServiceLoader.php index d7a88db8..ab15f2b0 100644 --- a/src/Block/Loader/ServiceLoader.php +++ b/src/Block/Loader/ServiceLoader.php @@ -22,7 +22,7 @@ final class ServiceLoader implements BlockLoaderInterface /** * @var string[] */ - private $types; + private array $types; /** * @param string[] $types diff --git a/src/Block/Service/AbstractBlockService.php b/src/Block/Service/AbstractBlockService.php index 7457db64..3fccd2f8 100644 --- a/src/Block/Service/AbstractBlockService.php +++ b/src/Block/Service/AbstractBlockService.php @@ -24,10 +24,7 @@ */ abstract class AbstractBlockService implements BlockServiceInterface { - /** - * @var Environment - */ - private $twig; + private Environment $twig; public function __construct(Environment $twig) { @@ -41,7 +38,7 @@ public function __construct(Environment $twig) */ public function renderResponse(string $view, array $parameters = [], ?Response $response = null): Response { - $response = $response ?? new Response(); + $response ??= new Response(); $response->setContent($this->twig->render($view, $parameters)); diff --git a/src/Block/Service/MenuBlockService.php b/src/Block/Service/MenuBlockService.php index 37d8c8f2..9639c12a 100644 --- a/src/Block/Service/MenuBlockService.php +++ b/src/Block/Service/MenuBlockService.php @@ -36,15 +36,9 @@ */ class MenuBlockService extends AbstractBlockService implements EditableBlockService { - /** - * @var MenuProviderInterface - */ - private $menuProvider; + private MenuProviderInterface $menuProvider; - /** - * @var MenuRegistryInterface - */ - private $menuRegistry; + private MenuRegistryInterface $menuRegistry; public function __construct( Environment $twig, diff --git a/src/Cache/HttpCacheHandler.php b/src/Cache/HttpCacheHandler.php index b0716fc9..33340840 100644 --- a/src/Cache/HttpCacheHandler.php +++ b/src/Cache/HttpCacheHandler.php @@ -22,10 +22,7 @@ */ final class HttpCacheHandler implements HttpCacheHandlerInterface { - /** - * @var int|null - */ - private $currentTtl; + private ?int $currentTtl = null; public function alterResponse(Response $response): void { diff --git a/src/Command/DebugBlocksCommand.php b/src/Command/DebugBlocksCommand.php index dc7621f8..fa943e9b 100644 --- a/src/Command/DebugBlocksCommand.php +++ b/src/Command/DebugBlocksCommand.php @@ -26,10 +26,7 @@ final class DebugBlocksCommand extends Command { protected static $defaultName = 'debug:sonata:block'; - /** - * @var BlockServiceManagerInterface - */ - private $blockManager; + private BlockServiceManagerInterface $blockManager; public function __construct(BlockServiceManagerInterface $blockManager) { @@ -68,7 +65,7 @@ public function execute(InputInterface $input, OutputInterface $output): int try { foreach ($resolver->resolve() as $key => $val) { - $output->writeln(sprintf(' %-30s%s', $key, json_encode($val))); + $output->writeln(sprintf(' %-30s%s', $key, json_encode($val, \JSON_THROW_ON_ERROR))); } } catch (MissingOptionsException $e) { foreach ($resolver->getDefinedOptions() as $option) { diff --git a/src/DependencyInjection/Configuration.php b/src/DependencyInjection/Configuration.php index 8f0f61c5..9bd33898 100644 --- a/src/DependencyInjection/Configuration.php +++ b/src/DependencyInjection/Configuration.php @@ -28,14 +28,12 @@ final class Configuration implements ConfigurationInterface /** * @var array */ - private $defaultContainerTemplates; + private array $defaultContainerTemplates; /** * NEXT_MAJOR: remove this member. - * - * @var bool */ - private $httpCacheDisabled = false; + private bool $httpCacheDisabled = false; /** * @param array $defaultContainerTemplates diff --git a/src/Event/BlockEvent.php b/src/Event/BlockEvent.php index 055fcefa..688ee9bb 100644 --- a/src/Event/BlockEvent.php +++ b/src/Event/BlockEvent.php @@ -21,12 +21,12 @@ final class BlockEvent extends Event /** * @var array */ - private $settings; + private array $settings; /** * @var BlockInterface[] */ - private $blocks = []; + private array $blocks = []; /** * @param array $settings diff --git a/src/Exception/Filter/DebugOnlyFilter.php b/src/Exception/Filter/DebugOnlyFilter.php index cb8f67b8..4b6ca948 100644 --- a/src/Exception/Filter/DebugOnlyFilter.php +++ b/src/Exception/Filter/DebugOnlyFilter.php @@ -22,10 +22,7 @@ */ final class DebugOnlyFilter implements FilterInterface { - /** - * @var bool - */ - private $debug; + private bool $debug; public function __construct(bool $debug) { diff --git a/src/Exception/Filter/IgnoreClassFilter.php b/src/Exception/Filter/IgnoreClassFilter.php index a433d4d1..2d259469 100644 --- a/src/Exception/Filter/IgnoreClassFilter.php +++ b/src/Exception/Filter/IgnoreClassFilter.php @@ -23,10 +23,7 @@ */ final class IgnoreClassFilter implements FilterInterface { - /** - * @var string - */ - private $class; + private string $class; public function __construct(string $class) { diff --git a/src/Exception/Renderer/InlineDebugRenderer.php b/src/Exception/Renderer/InlineDebugRenderer.php index 989c43ca..b579acc5 100644 --- a/src/Exception/Renderer/InlineDebugRenderer.php +++ b/src/Exception/Renderer/InlineDebugRenderer.php @@ -25,25 +25,13 @@ */ final class InlineDebugRenderer implements RendererInterface { - /** - * @var string - */ - private $template; + private string $template; - /** - * @var bool - */ - private $forceStyle; + private bool $forceStyle; - /** - * @var bool - */ - private $debug; + private bool $debug; - /** - * @var Environment - */ - private $twig; + private Environment $twig; public function __construct(Environment $twig, string $template, bool $debug, bool $forceStyle = true) { @@ -55,7 +43,7 @@ public function __construct(Environment $twig, string $template, bool $debug, bo public function render(\Exception $exception, BlockInterface $block, ?Response $response = null): Response { - $response = $response ?? new Response(); + $response ??= new Response(); // enforce debug mode or ignore silently if (!$this->debug) { diff --git a/src/Exception/Renderer/InlineRenderer.php b/src/Exception/Renderer/InlineRenderer.php index 71157ad7..e49b283d 100644 --- a/src/Exception/Renderer/InlineRenderer.php +++ b/src/Exception/Renderer/InlineRenderer.php @@ -24,15 +24,9 @@ */ final class InlineRenderer implements RendererInterface { - /** - * @var string - */ - private $template; + private string $template; - /** - * @var Environment - */ - private $twig; + private Environment $twig; public function __construct(Environment $twig, string $template) { @@ -49,7 +43,7 @@ public function render(\Exception $exception, BlockInterface $block, ?Response $ $content = $this->twig->render($this->template, $parameters); - $response = $response ?? new Response(); + $response ??= new Response(); $response->setContent($content); return $response; diff --git a/src/Exception/Strategy/StrategyManager.php b/src/Exception/Strategy/StrategyManager.php index 35002cef..e53e8428 100644 --- a/src/Exception/Strategy/StrategyManager.php +++ b/src/Exception/Strategy/StrategyManager.php @@ -27,40 +27,31 @@ */ final class StrategyManager implements StrategyManagerInterface { - /** - * @var ContainerInterface - */ - private $container; + private ContainerInterface $container; /** * @var array */ - private $filters; + private array $filters; /** * @var array */ - private $renderers; + private array $renderers; /** * @var array */ - private $blockFilters; + private array $blockFilters; /** * @var array */ - private $blockRenderers; + private array $blockRenderers; - /** - * @var string|null - */ - private $defaultFilter; + private ?string $defaultFilter = null; - /** - * @var string|null - */ - private $defaultRenderer; + private ?string $defaultRenderer = null; /** * @psalm-suppress ContainerDependency @@ -115,7 +106,7 @@ public function setDefaultRenderer(string $name): void public function handleException(\Throwable $exception, BlockInterface $block, ?Response $response = null): Response { - $response = $response ?? new Response(); + $response ??= new Response(); $response->setPrivate(); $filter = $this->getBlockFilter($block); diff --git a/src/Form/Type/ContainerTemplateType.php b/src/Form/Type/ContainerTemplateType.php index c8d8400f..f7fbc028 100644 --- a/src/Form/Type/ContainerTemplateType.php +++ b/src/Form/Type/ContainerTemplateType.php @@ -25,7 +25,7 @@ final class ContainerTemplateType extends AbstractType /** * @var array */ - private $templateChoices; + private array $templateChoices; /** * @param array $templateChoices diff --git a/src/Form/Type/ServiceListType.php b/src/Form/Type/ServiceListType.php index 08f813b3..f722c359 100644 --- a/src/Form/Type/ServiceListType.php +++ b/src/Form/Type/ServiceListType.php @@ -22,10 +22,7 @@ final class ServiceListType extends AbstractType { - /** - * @var BlockServiceManagerInterface - */ - private $manager; + private BlockServiceManagerInterface $manager; public function __construct(BlockServiceManagerInterface $manager) { diff --git a/src/Menu/MenuRegistry.php b/src/Menu/MenuRegistry.php index 183ea964..4fdeb37d 100644 --- a/src/Menu/MenuRegistry.php +++ b/src/Menu/MenuRegistry.php @@ -21,7 +21,7 @@ final class MenuRegistry implements MenuRegistryInterface /** * @var string[] */ - private $names = []; + private array $names = []; public function add(string $name): void { diff --git a/src/Meta/Metadata.php b/src/Meta/Metadata.php index 1002c536..0d20e38e 100644 --- a/src/Meta/Metadata.php +++ b/src/Meta/Metadata.php @@ -18,30 +18,18 @@ */ final class Metadata implements MetadataInterface { - /** - * @var string - */ - private $title; + private string $title; - /** - * @var string|null - */ - private $description; + private ?string $description; - /** - * @var string|null - */ - private $image; + private ?string $image; - /** - * @var string|null - */ - private $domain; + private ?string $domain; /** * @var array */ - private $options; + private array $options; /** * @param array $options diff --git a/src/Profiler/DataCollector/BlockDataCollector.php b/src/Profiler/DataCollector/BlockDataCollector.php index 3a126bfd..2059528f 100644 --- a/src/Profiler/DataCollector/BlockDataCollector.php +++ b/src/Profiler/DataCollector/BlockDataCollector.php @@ -25,15 +25,12 @@ */ final class BlockDataCollector extends DataCollector { - /** - * @var BlockHelper - */ - private $blocksHelper; + private BlockHelper $blocksHelper; /** * @var string[] */ - private $containerTypes; + private array $containerTypes; /** * @param BlockHelper $blockHelper Block renderer diff --git a/src/Templating/Helper/BlockHelper.php b/src/Templating/Helper/BlockHelper.php index 8f581dfe..5c135776 100644 --- a/src/Templating/Helper/BlockHelper.php +++ b/src/Templating/Helper/BlockHelper.php @@ -56,44 +56,28 @@ class BlockHelper { /** * NEXT_MAJOR: remove. - * - * @var BlockServiceManagerInterface|null */ - private $blockServiceManager; + private ?BlockServiceManagerInterface $blockServiceManager = null; /** * NEXT_MAJOR: remove this member and all related code to usages within this class. - * - * @var CacheManagerInterface|null */ - private $cacheManager; + private ?CacheManagerInterface $cacheManager = null; /** * NEXT_MAJOR: remove. * * @var array{by_class: array, by_type: array} */ - private $cacheBlocks = ['by_class' => [], 'by_type' => []]; + private array $cacheBlocks = ['by_class' => [], 'by_type' => []]; - /** - * @var BlockRendererInterface - */ - private $blockRenderer; + private BlockRendererInterface $blockRenderer; - /** - * @var BlockContextManagerInterface - */ - private $blockContextManager; + private BlockContextManagerInterface $blockContextManager; - /** - * @var HttpCacheHandlerInterface|null - */ - private $cacheHandler; + private ?HttpCacheHandlerInterface $cacheHandler = null; - /** - * @var EventDispatcherInterface - */ - private $eventDispatcher; + private EventDispatcherInterface $eventDispatcher; /** * This property is a state variable holdings all assets used by the block for the current PHP request @@ -101,23 +85,20 @@ class BlockHelper * * @var array{css: array, js: array} */ - private $assets = ['css' => [], 'js' => []]; + private array $assets = ['css' => [], 'js' => []]; /** * @var array> * @phpstan-var array */ - private $traces = []; + private array $traces = []; /** * @var array */ - private $eventTraces = []; + private array $eventTraces = []; - /** - * @var Stopwatch|null - */ - private $stopwatch; + private ?Stopwatch $stopwatch = null; /** * NEXT_MAJOR: remove the deprecated signature and cleanup the constructor. diff --git a/src/Twig/GlobalVariables.php b/src/Twig/GlobalVariables.php index 1a24c4f5..3ab00461 100644 --- a/src/Twig/GlobalVariables.php +++ b/src/Twig/GlobalVariables.php @@ -23,7 +23,7 @@ final class GlobalVariables /** * @var string[] */ - private $templates; + private array $templates; /** * @param string[] $templates diff --git a/tests/Block/BlockRendererTest.php b/tests/Block/BlockRendererTest.php index 9c86b6e3..31117545 100644 --- a/tests/Block/BlockRendererTest.php +++ b/tests/Block/BlockRendererTest.php @@ -44,10 +44,7 @@ final class BlockRendererTest extends TestCase */ private $exceptionStrategyManager; - /** - * @var BlockRenderer - */ - private $renderer; + private BlockRenderer $renderer; /** * Setup test object. diff --git a/tests/Command/DebugBlocksCommandTest.php b/tests/Command/DebugBlocksCommandTest.php index 3bfe2b1a..3f827c28 100644 --- a/tests/Command/DebugBlocksCommandTest.php +++ b/tests/Command/DebugBlocksCommandTest.php @@ -33,10 +33,7 @@ */ final class DebugBlocksCommandTest extends TestCase { - /** - * @var Application - */ - private $application; + private Application $application; protected function setUp(): void { diff --git a/tests/DependencyInjection/Compiler/TweakCompilerPassTest.php b/tests/DependencyInjection/Compiler/TweakCompilerPassTest.php index 700e22e6..3b263493 100644 --- a/tests/DependencyInjection/Compiler/TweakCompilerPassTest.php +++ b/tests/DependencyInjection/Compiler/TweakCompilerPassTest.php @@ -20,10 +20,7 @@ final class TweakCompilerPassTest extends TestCase { - /** - * @var ContainerBuilder - */ - private $container; + private ContainerBuilder $container; protected function setUp(): void { diff --git a/tests/Exception/Strategy/StrategyManagerTest.php b/tests/Exception/Strategy/StrategyManagerTest.php index 0c72e820..ba526b70 100644 --- a/tests/Exception/Strategy/StrategyManagerTest.php +++ b/tests/Exception/Strategy/StrategyManagerTest.php @@ -29,10 +29,7 @@ */ final class StrategyManagerTest extends TestCase { - /** - * @var StrategyManager - */ - private $manager; + private StrategyManager $manager; /** * @var MockObject&ContainerInterface @@ -42,22 +39,22 @@ final class StrategyManagerTest extends TestCase /** * @var array */ - private $filters = []; + private array $filters = []; /** * @var array */ - private $renderers = []; + private array $renderers = []; /** * @var array */ - private $blockFilters = []; + private array $blockFilters = []; /** * @var array */ - private $blockRenderers = []; + private array $blockRenderers = []; /** * @var MockObject&RendererInterface diff --git a/tests/Templating/Helper/BlockHelperTest.php b/tests/Templating/Helper/BlockHelperTest.php index 1b1ef22a..31e1ab5e 100644 --- a/tests/Templating/Helper/BlockHelperTest.php +++ b/tests/Templating/Helper/BlockHelperTest.php @@ -64,9 +64,7 @@ public function testRenderEventWithNoListener(): void $blockRenderer = $this->createMock(BlockRendererInterface::class); $blockContextManager = $this->createMock(BlockContextManagerInterface::class); $eventDispatcher = $this->createMock(EventDispatcherInterface::class); - $eventDispatcher->expects(static::once())->method('dispatch')->willReturnCallback(static function (BlockEvent $event): BlockEvent { - return $event; - }); + $eventDispatcher->expects(static::once())->method('dispatch')->willReturnCallback(static fn (BlockEvent $event): BlockEvent => $event); $helper = new BlockHelper($blockRenderer, $blockContextManager, $eventDispatcher); @@ -88,9 +86,7 @@ public function testRenderEventWithListeners(): void $blockContextManager = $this->createMock(BlockContextManagerInterface::class); $blockContextManager->expects(static::once())->method('get')->willReturnCallback( - static function (BlockInterface $block): BlockContext { - return new BlockContext($block, $block->getSettings()); - } + static fn (BlockInterface $block): BlockContext => new BlockContext($block, $block->getSettings()) ); $eventDispatcher = $this->createMock(EventDispatcherInterface::class); diff --git a/tests/Twig/Extension/BlockExtensionTest.php b/tests/Twig/Extension/BlockExtensionTest.php index c043ac2d..96016996 100644 --- a/tests/Twig/Extension/BlockExtensionTest.php +++ b/tests/Twig/Extension/BlockExtensionTest.php @@ -29,15 +29,9 @@ final class BlockExtensionTest extends TestCase */ private $blockHelper; - /** - * @var BlockExtension - */ - private $blockExtension; + private BlockExtension $blockExtension; - /** - * @var Environment - */ - private $env; + private Environment $env; protected function setUp(): void { @@ -48,9 +42,7 @@ protected function setUp(): void $this->env = new Environment($this->createMock(LoaderInterface::class)); $this->env->addExtension($this->blockExtension); $this->env->addRuntimeLoader(new FactoryRuntimeLoader([ - BlockHelper::class => function (): BlockHelper { - return $this->blockHelper; - }, + BlockHelper::class => fn (): BlockHelper => $this->blockHelper, ])); }