From 7dd12dd181dbd682e3a25c13bd728456b211fae8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wojciech=20B=C5=82oszyk?= Date: Tue, 5 May 2020 15:21:50 +0200 Subject: [PATCH] Drop unnesessary constructor --- src/Block/BlockContextManager.php | 2 +- src/Block/Service/AbstractAdminBlockService.php | 9 --------- src/Block/Service/AbstractBlockService.php | 2 +- 3 files changed, 2 insertions(+), 11 deletions(-) diff --git a/src/Block/BlockContextManager.php b/src/Block/BlockContextManager.php index 1bf795cb..20d4a28f 100644 --- a/src/Block/BlockContextManager.php +++ b/src/Block/BlockContextManager.php @@ -153,7 +153,7 @@ public function get($meta, array $settings = []) */ protected function setDefaultSettings(OptionsResolverInterface $optionsResolver, BlockInterface $block) { - if (__CLASS__ !== \get_called_class()) { + if (__CLASS__ !== static::class) { @trigger_error( 'The '.__METHOD__.' is deprecated since version 2.3, to be renamed in 4.0.' .' Use '.__CLASS__.'::configureSettings instead.', diff --git a/src/Block/Service/AbstractAdminBlockService.php b/src/Block/Service/AbstractAdminBlockService.php index a29184a6..42a495bc 100644 --- a/src/Block/Service/AbstractAdminBlockService.php +++ b/src/Block/Service/AbstractAdminBlockService.php @@ -17,7 +17,6 @@ use Sonata\BlockBundle\Meta\Metadata; use Sonata\BlockBundle\Model\BlockInterface; use Sonata\CoreBundle\Validator\ErrorElement; -use Symfony\Component\Templating\EngineInterface; @trigger_error( 'The '.__NAMESPACE__.'\AbstractAdminBlockService class is deprecated since sonata-project/block-bundle 3.16 '. @@ -32,14 +31,6 @@ */ abstract class AbstractAdminBlockService extends AbstractBlockService implements AdminBlockServiceInterface { - /** - * @param string $name - */ - public function __construct($name, EngineInterface $templating) - { - parent::__construct($name, $templating); - } - public function buildCreateForm(FormMapper $formMapper, BlockInterface $block) { $this->buildEditForm($formMapper, $block); diff --git a/src/Block/Service/AbstractBlockService.php b/src/Block/Service/AbstractBlockService.php index 73bb217b..8fecbb1c 100644 --- a/src/Block/Service/AbstractBlockService.php +++ b/src/Block/Service/AbstractBlockService.php @@ -48,7 +48,7 @@ abstract class AbstractBlockService implements BlockServiceInterface * * @param Environment|EngineInterface|string $templatingOrDeprecatedName */ - public function __construct($templatingOrDeprecatedName = null, EngineInterface $templating = null) + public function __construct($templatingOrDeprecatedName = null, ?EngineInterface $templating = null) { // $this->twig = $twig; // NEXT_MAJOR: Uncomment the previous assignment and remove the following lines in this method.