From d8870e906f510db451be028b60939cad95e22875 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Sat, 15 Apr 2023 00:54:21 +0200 Subject: [PATCH] DX: rector in docs directory --- docs/source/_static/code/exports/CountPerson.php | 15 +++------------ .../widgets/ChillMainConfiguration.php | 9 +-------- 2 files changed, 4 insertions(+), 20 deletions(-) diff --git a/docs/source/_static/code/exports/CountPerson.php b/docs/source/_static/code/exports/CountPerson.php index afe19c73b..a77ff1be5 100644 --- a/docs/source/_static/code/exports/CountPerson.php +++ b/docs/source/_static/code/exports/CountPerson.php @@ -50,18 +50,9 @@ class CountPerson implements ExportInterface public function getLabels($key, array $values, $data) { // the Closure which will be executed by the formatter. - return function ($value) { - switch ($value) { - case '_header': - // we have to process specifically the '_header' string, - // which will be used by the formatter to show a column title - return $this->getTitle(); - - default: - // for all value, we do not process them and return them - // immediatly - return $value; - } + return fn($value) => match ($value) { + '_header' => $this->getTitle(), + default => $value, }; } diff --git a/docs/source/development/user-interface/widgets/ChillMainConfiguration.php b/docs/source/development/user-interface/widgets/ChillMainConfiguration.php index 9eca0ae76..b4567729c 100644 --- a/docs/source/development/user-interface/widgets/ChillMainConfiguration.php +++ b/docs/source/development/user-interface/widgets/ChillMainConfiguration.php @@ -23,19 +23,12 @@ class ChillMainConfiguration implements ConfigurationInterface { use AddWidgetConfigurationTrait; - /** - * @var ContainerBuilder - */ - private $containerBuilder; - public function __construct( array $widgetFactories, - ContainerBuilder $containerBuilder + private ContainerBuilder $containerBuilder ) { // we register here widget factories (see below) $this->setWidgetFactories($widgetFactories); - // we will need the container builder later... - $this->containerBuilder = $containerBuilder; } public function getConfigTreeBuilder()