diff --git a/src/Component/Data/FixtureData.php b/src/Component/Data/FixtureData.php index f417219..498c2c5 100644 --- a/src/Component/Data/FixtureData.php +++ b/src/Component/Data/FixtureData.php @@ -9,13 +9,13 @@ /** * @codeCoverageIgnore */ -class FixtureData +readonly class FixtureData { public function __construct( - public readonly string $className, + public string $className, /** @param array $properties */ - public readonly array $properties, - public readonly array $params = [] + public array $properties, + public array $params = [] ) { } } diff --git a/src/Component/Data/Generator/ScalarGenerator.php b/src/Component/Data/Generator/ScalarGenerator.php index dd0fcd9..64f68c6 100644 --- a/src/Component/Data/Generator/ScalarGenerator.php +++ b/src/Component/Data/Generator/ScalarGenerator.php @@ -30,7 +30,7 @@ public function supports(string $type, mixed $context = null): bool 'integer', 'double', 'boolean', - ]); + ], true); } public function generate(string $type, mixed $context = null): float|object|bool|int|string|null @@ -41,8 +41,6 @@ public function generate(string $type, mixed $context = null): float|object|bool public function createParamValue(string $type): bool|int|float|string|null { switch (strtolower($type)) { - default: - return null; case 'string': return $this->generator->text(20); case 'int': @@ -54,6 +52,8 @@ public function createParamValue(string $type): bool|int|float|string|null case 'float': case 'double': return $this->generator->randomFloat(); + default: + return null; } } } diff --git a/tests/Unit/Component/ComponentItemFactoryTest.php b/tests/Unit/Component/ComponentItemFactoryTest.php index fd6a77b..44fd8c8 100644 --- a/tests/Unit/Component/ComponentItemFactoryTest.php +++ b/tests/Unit/Component/ComponentItemFactoryTest.php @@ -38,13 +38,13 @@ public function testValidComponent(array $componentData): void $componentItemFactory = new ComponentItemFactory( $validatorMock, $categoryServiceMock, - static::createMock(Faker::class) + $this->createMock(Faker::class) ); $item = $componentItemFactory->create($componentData); - static::assertInstanceOf(ComponentItem::class, $item); - static::assertInstanceOf(ComponentCategory::class, $item->getCategory()); + $this->assertInstanceOf(ComponentItem::class, $item); + $this->assertInstanceOf(ComponentCategory::class, $item->getCategory()); } public function testInvalidCategory(): void @@ -78,7 +78,7 @@ public function testGetParamsFromVariables(): void $result = $componentItemFactory->getParamsFromVariables($variables); - static::assertEquals([ + $this->assertEquals([ 'var' => [ 'separated' => [ 'by' => [