From 6cdbf0518305ecaa2ede4e3e49ecb2c6f53c61d4 Mon Sep 17 00:00:00 2001 From: Evert Harmeling Date: Wed, 15 Nov 2023 13:49:06 +0100 Subject: [PATCH] Fix php-cs-fixer errors --- .../SymfonycastsSassExtension.php | 9 +++---- tests/ConfigurationTest.php | 27 ++++++++++++------- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/src/DependencyInjection/SymfonycastsSassExtension.php b/src/DependencyInjection/SymfonycastsSassExtension.php index 5c485f3..f3bef1f 100644 --- a/src/DependencyInjection/SymfonycastsSassExtension.php +++ b/src/DependencyInjection/SymfonycastsSassExtension.php @@ -17,9 +17,6 @@ use Symfony\Component\DependencyInjection\Extension\Extension; use Symfony\Component\DependencyInjection\Loader; -use function basename; -use function in_array; - class SymfonycastsSassExtension extends Extension implements ConfigurationInterface { public function load(array $configs, ContainerBuilder $container): void @@ -64,17 +61,17 @@ public function getConfigTreeBuilder(): TreeBuilder ->end() ->validate() ->ifTrue(static function (array $paths): bool { - if (count($paths) === 1) { + if (1 === \count($paths)) { return false; } $filenames = []; foreach ($paths as $path) { - $filename = basename($path, '.scss'); + $filename = \basename($path, '.scss'); $filenames[$filename] = $filename; } - return count($filenames) !== count($paths); + return \count($filenames) !== \count($paths); }) ->thenInvalid('The root sass-paths need to end with unique filenames.') ->end() diff --git a/tests/ConfigurationTest.php b/tests/ConfigurationTest.php index 6409541..cd0dee9 100644 --- a/tests/ConfigurationTest.php +++ b/tests/ConfigurationTest.php @@ -2,6 +2,13 @@ declare(strict_types=1); +/* + * This file is part of the SymfonyCasts SassBundle package. + * Copyright (c) SymfonyCasts + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace Symfonycasts\SassBundle\Tests; use Matthias\SymfonyConfigTest\PhpUnit\ConfigurationTestCaseTrait; @@ -22,9 +29,9 @@ public function testSingleSassRootPath(): void $this->assertConfigurationIsValid([ 'symfonycasts_sass' => [ 'root_sass' => [ - '%kernel.project_dir%/assets/scss/app.scss' - ] - ] + '%kernel.project_dir%/assets/scss/app.scss', + ], + ], ]); } @@ -34,9 +41,9 @@ public function testMultipleSassRootPaths(): void 'symfonycasts_sass' => [ 'root_sass' => [ '%kernel.project_dir%/assets/scss/app.scss', - '%kernel.project_dir%/assets/admin/scss/admin.scss' - ] - ] + '%kernel.project_dir%/assets/admin/scss/admin.scss', + ], + ], ]); } @@ -46,10 +53,10 @@ public function testMultipleSassRootPathsWithSameFilename(): void 'symfonycasts_sass' => [ 'root_sass' => [ '%kernel.project_dir%/assets/scss/app.scss', - '%kernel.project_dir%/assets/admin/scss/app.scss' - ] - ] + '%kernel.project_dir%/assets/admin/scss/app.scss', + ], + ], ], - 'Invalid configuration for path "symfonycasts_sass.root_sass": The root sass-paths need to end with unique filenames.'); + 'Invalid configuration for path "symfonycasts_sass.root_sass": The root sass-paths need to end with unique filenames.'); } }