From 70f37ca367005317645690b600e02aa4611a1a98 Mon Sep 17 00:00:00 2001 From: Damian Zabawa Date: Fri, 8 Oct 2021 14:26:11 +0200 Subject: [PATCH] Fixed cs --- src/lib/Configuration/Provider/CKEditor.php | 26 +++++++++---------- .../Configuration/Provider/CKEditorTest.php | 2 +- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/lib/Configuration/Provider/CKEditor.php b/src/lib/Configuration/Provider/CKEditor.php index caecc0f9..2b2549d8 100644 --- a/src/lib/Configuration/Provider/CKEditor.php +++ b/src/lib/Configuration/Provider/CKEditor.php @@ -51,7 +51,7 @@ public function getName(): string public function getConfiguration(): array { return [ - 'toolbar' => \array_values($this->getToolbar()), + 'toolbar' => array_values($this->getToolbar()), ]; } @@ -66,7 +66,7 @@ private function getToolbar(): array $this->getSiteAccessConfigArray(RichText::TOOLBARS_SA_SETTINGS_ID) ); - if (\in_array(self::CUSTOM_STYLE_INLINE, $filteredButtons) && !$this->hasInlineCustomStyles()) { + if (in_array(self::CUSTOM_STYLE_INLINE, $filteredButtons) && !$this->hasInlineCustomStyles()) { return $this->removeInlineCustomStyleButton($filteredButtons); } @@ -83,29 +83,29 @@ private function filterButtonsByGroups( ): array { $buttons = []; - $groupsConfiguration = \array_filter( + $groupsConfiguration = array_filter( $groupsConfiguration, static function (array $group): bool { return $group['visible']; } ); - \uasort($groupsConfiguration, static function (array $a, array $b): int { + uasort($groupsConfiguration, static function (array $a, array $b): int { return $b['priority'] <=> $a['priority']; }); foreach ($groupsConfiguration as $configuration) { $filteredButtons = $this->filterButtons($configuration['buttons'] ?? []); - if (\count($filteredButtons) === 0) { + if (count($filteredButtons) === 0) { continue; } - $buttons = \array_merge($buttons, $filteredButtons, [self::SEPARATOR]); + $buttons = array_merge($buttons, $filteredButtons, [self::SEPARATOR]); } // Removes last separator from the buttons list. - \array_pop($buttons); + array_pop($buttons); return $buttons; } @@ -117,25 +117,25 @@ static function (array $group): bool { */ private function filterButtons(array $buttons): array { - $buttons = \array_filter($buttons, static function (array $button): bool { + $buttons = array_filter($buttons, static function (array $button): bool { return $button['visible']; }); - \uasort($buttons, static function (array $a, array $b): int { + uasort($buttons, static function (array $a, array $b): int { return $b['priority'] <=> $a['priority']; }); - return \array_keys($buttons); + return array_keys($buttons); } private function hasInlineCustomStyles(): bool { $enabledCustomStyles = $this->getSiteAccessConfigArray('fieldtypes.ezrichtext.custom_styles'); - return 0 !== \count(\array_filter( + return 0 !== count(array_filter( $this->customStylesConfiguration, static function (array $customStyle, string $name) use ($enabledCustomStyles): bool { - return \in_array($name, $enabledCustomStyles, true) && $customStyle['inline']; + return in_array($name, $enabledCustomStyles, true) && $customStyle['inline']; }, ARRAY_FILTER_USE_BOTH )); @@ -146,7 +146,7 @@ static function (array $customStyle, string $name) use ($enabledCustomStyles): b */ private function removeInlineCustomStyleButton(array $filteredButtons): array { - return \array_filter( + return array_filter( $filteredButtons, static function (string $buttonValue): bool { return $buttonValue !== self::CUSTOM_STYLE_INLINE; diff --git a/tests/lib/Configuration/Provider/CKEditorTest.php b/tests/lib/Configuration/Provider/CKEditorTest.php index 20285afd..3c848d1a 100644 --- a/tests/lib/Configuration/Provider/CKEditorTest.php +++ b/tests/lib/Configuration/Provider/CKEditorTest.php @@ -38,7 +38,7 @@ public function testGetConfiguration(): void $provider = $this->createProvider(); $this->configResolver - ->expects($this->exactly(1)) + ->expects(self::once()) ->method('hasParameter') ->willReturn(false);