Skip to content

Commit

Permalink
Fix CS
Browse files Browse the repository at this point in the history
  • Loading branch information
pierredup committed Dec 7, 2020
1 parent 1593ad5 commit 216b022
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/Storage/StorageFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)));
}
Expand Down
14 changes: 12 additions & 2 deletions tests/ToggleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
5 changes: 1 addition & 4 deletions tests/UtilTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -62,7 +59,7 @@ public function isNotTruthyProvider(): iterable
yield ['NO'];
yield ['N'];
yield [null];
yield [new \stdClass];
yield [new \stdClass()];
yield [[]];
}
}

0 comments on commit 216b022

Please sign in to comment.