From 3f70171df66ef2af47d58f8cb3a22c1a8c2c51e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Sapone?= Date: Fri, 1 Mar 2024 18:43:04 +0100 Subject: [PATCH] Fix CI --- .github/workflows/ci.yaml | 2 +- src/Controller/IframeController.php | 2 +- src/Controller/StoryController.php | 2 +- src/Dto/Menu.php | 2 +- src/Factory/ComponentFactory.php | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index f1207b7..4a20ed5 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -31,7 +31,7 @@ jobs: run: composer-require-checker - name: Composer Unused - run: composer-unused --excludePackage=symfony/dependency-injection --excludePackage=symfony/property-access + run: composer-unused php-cs-fixer: runs-on: ubuntu-latest diff --git a/src/Controller/IframeController.php b/src/Controller/IframeController.php index bab9dbf..7fc336c 100644 --- a/src/Controller/IframeController.php +++ b/src/Controller/IframeController.php @@ -26,7 +26,7 @@ public function __construct( ) { } - public function __invoke(Request $request, ?Profiler $profiler, Component $component = null): Response + public function __invoke(Request $request, ?Profiler $profiler, ?Component $component = null): Response { if ($profiler instanceof Profiler) { $profiler->disable(); diff --git a/src/Controller/StoryController.php b/src/Controller/StoryController.php index 00be5e2..f18e084 100644 --- a/src/Controller/StoryController.php +++ b/src/Controller/StoryController.php @@ -31,7 +31,7 @@ public function __construct( ) { } - public function __invoke(Request $request, Component $component = null): Response + public function __invoke(Request $request, ?Component $component = null): Response { if (!$component instanceof Component) { return new Response($this->twig->render('@IQ2iArqui/view/story.html.twig', [ diff --git a/src/Dto/Menu.php b/src/Dto/Menu.php index 713bd13..d2a17f1 100644 --- a/src/Dto/Menu.php +++ b/src/Dto/Menu.php @@ -56,7 +56,7 @@ public function addChild(self|MenuItem $child): static public function reorderChildren(): static { - usort($this->children, static fn (Menu|MenuItem $itemA, Menu|MenuItem $itemB): int => strcmp($itemA->getLabel(), $itemB->getLabel())); + usort($this->children, static fn (Menu|MenuItem $itemA, Menu|MenuItem $itemB): int => strcmp((string) $itemA->getLabel(), (string) $itemB->getLabel())); return $this; } diff --git a/src/Factory/ComponentFactory.php b/src/Factory/ComponentFactory.php index 6365a08..c5d556f 100644 --- a/src/Factory/ComponentFactory.php +++ b/src/Factory/ComponentFactory.php @@ -48,7 +48,7 @@ public function createFromRequest(Request $request): ?Component $componentName = $config['name'] ?? null; if (null === $componentName) { $componentName = pathinfo(str_replace('.yaml', '', (string) $componentPath), \PATHINFO_FILENAME); - $componentName = ucfirst(strtolower(trim(preg_replace(['/([A-Z])/', '/[_\s]+/'], ['_$1', ' '], $componentName)))); + $componentName = ucfirst(strtolower(trim((string) preg_replace(['/([A-Z])/', '/[_\s]+/'], ['_$1', ' '], $componentName)))); } $isComponent = false; @@ -77,7 +77,7 @@ public function createFromRequest(Request $request): ?Component foreach ($config['variants'] as $variantPath => $variantConfig) { $variantName = $variantConfig['name'] ?? null; if (null === $variantName) { - $variantName = ucfirst(strtolower(trim(preg_replace(['/([A-Z])/', '/[_\s]+/'], ['_$1', ' '], (string) $variantPath)))); + $variantName = ucfirst(strtolower(trim((string) preg_replace(['/([A-Z])/', '/[_\s]+/'], ['_$1', ' '], (string) $variantPath)))); } $variant = new Variant($variantPath, $variantName);