diff --git a/src/Component/ComponentItemFactory.php b/src/Component/ComponentItemFactory.php index ee4d165..9979330 100644 --- a/src/Component/ComponentItemFactory.php +++ b/src/Component/ComponentItemFactory.php @@ -149,7 +149,7 @@ private function createFakeParamValues(array $parameters, array $variation): arr if (\is_array($type)) { $paramValue[$name] = $this->createVariationParameters($type, $variation[$name] ?? []); } else { - if (array_key_exists($name, $variation) && is_null($variation[$name])) { + if (\array_key_exists($name, $variation) && null === $variation[$name]) { $paramValue = [$name => null]; } else { $paramValue = $this->faker->getFakeData([$name => $type], $variation[$name] ?? null); diff --git a/tests/Functional/Service/ComponentItemFactoryTest.php b/tests/Functional/Service/ComponentItemFactoryTest.php index 3aa92ef..915705d 100644 --- a/tests/Functional/Service/ComponentItemFactoryTest.php +++ b/tests/Functional/Service/ComponentItemFactoryTest.php @@ -140,7 +140,7 @@ public function testFactoryCreatesDefaultVariationWithParameterTypes(): void self::assertIsFloat($component->getVariations()['default']['complex']['amount']); } - public function testCreateObjectParameter() + public function testCreateObjectParameter(): void { $data = [ 'name' => 'component', @@ -156,11 +156,11 @@ public function testCreateObjectParameter() 'variation1' => [ 'car' => [ 'color' => 'blue', - ] + ], ], 'variation2' => [ 'car' => null, - ] + ], ], ];