From 216b022670606bd0eaaea07345947bf29a0d7307 Mon Sep 17 00:00:00 2001 From: Pierre du Plessis Date: Mon, 7 Dec 2020 13:14:02 +0200 Subject: [PATCH] Fix CS --- src/Storage/StorageFactory.php | 1 + tests/ToggleTest.php | 14 ++++++++++++-- tests/UtilTest.php | 5 +---- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/Storage/StorageFactory.php b/src/Storage/StorageFactory.php index 6237ff2..95f95a1 100644 --- a/src/Storage/StorageFactory.php +++ b/src/Storage/StorageFactory.php @@ -41,6 +41,7 @@ public static function factory($config): StorageInterface } throw new \InvalidArgumentException(sprintf('File with extension %s is not supported', $extension)); + // no break default: throw new \InvalidArgumentException(sprintf('The 1st argument for %s expects an array, string or instance of StorageInterface, %s given', __METHOD__, is_object($config) ? get_class($config) : gettype($config))); } diff --git a/tests/ToggleTest.php b/tests/ToggleTest.php index 2339b9f..61f892f 100644 --- a/tests/ToggleTest.php +++ b/tests/ToggleTest.php @@ -115,8 +115,18 @@ public function testIsActiveExpression(): void public function testIsActiveStringClass(): void { $features = [ - 'foo' => new class { public function __toString() { return '1'; }}, - 'bar' => new class { public function __toString() { return '0'; }}, + 'foo' => new class() { + public function __toString() + { + return '1'; + } + }, + 'bar' => new class() { + public function __toString() + { + return '0'; + } + }, ]; $instance = new Toggle(StorageFactory::factory($features)); diff --git a/tests/UtilTest.php b/tests/UtilTest.php index 6032951..ce1935e 100644 --- a/tests/UtilTest.php +++ b/tests/UtilTest.php @@ -14,10 +14,7 @@ namespace SolidWorx\Toggler\Tests; use PHPUnit\Framework\TestCase; -use SolidWorx\Toggler\Storage\StorageFactory; -use SolidWorx\Toggler\Toggle; use SolidWorx\Toggler\Util; -use Symfony\Component\ExpressionLanguage\Expression; class UtilTest extends TestCase { @@ -62,7 +59,7 @@ public function isNotTruthyProvider(): iterable yield ['NO']; yield ['N']; yield [null]; - yield [new \stdClass]; + yield [new \stdClass()]; yield [[]]; } }