From acdb153b1cfe8a51a5cba3278b8ae4000b509042 Mon Sep 17 00:00:00 2001 From: Remy Bos <27890746+sjokkateer@users.noreply.github.com> Date: Thu, 19 May 2022 11:05:39 +0200 Subject: [PATCH 1/3] ATTRIBUTE: Attribute::addValue() add return type --- More/EAV/Attribute.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/More/EAV/Attribute.php b/More/EAV/Attribute.php index 46ba9f4..6c36cb2 100644 --- a/More/EAV/Attribute.php +++ b/More/EAV/Attribute.php @@ -15,7 +15,7 @@ class Attribute implements \Stringable $this->values = new SplObjectStorage(); } - public function addValue(Value $value) + public function addValue(Value $value): void { $this->values->attach($value); } From c365008429af834f96c78b76996d4d02e4dfeffa Mon Sep 17 00:00:00 2001 From: Remy Bos <27890746+sjokkateer@users.noreply.github.com> Date: Thu, 19 May 2022 11:07:06 +0200 Subject: [PATCH 2/3] ENTITY: Entity::__construct() add type declaration to parameter --- More/EAV/Entity.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/More/EAV/Entity.php b/More/EAV/Entity.php index 1a619e1..3539c10 100644 --- a/More/EAV/Entity.php +++ b/More/EAV/Entity.php @@ -16,7 +16,7 @@ class Entity implements \Stringable /** * @param Value[] $values */ - public function __construct(private string $name, $values) + public function __construct(private string $name, array $values) { $this->values = new SplObjectStorage(); From 83df396fc9f567e152cbc7e26795e869ea141bef Mon Sep 17 00:00:00 2001 From: Remy Bos <27890746+sjokkateer@users.noreply.github.com> Date: Thu, 19 May 2022 11:14:56 +0200 Subject: [PATCH 3/3] EAV TESTS: EAVTest::testCanAddAttributeToEntity() add return type --- More/EAV/Tests/EAVTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/More/EAV/Tests/EAVTest.php b/More/EAV/Tests/EAVTest.php index 12b4efc..bb491d8 100644 --- a/More/EAV/Tests/EAVTest.php +++ b/More/EAV/Tests/EAVTest.php @@ -11,7 +11,7 @@ use PHPUnit\Framework\TestCase; class EAVTest extends TestCase { - public function testCanAddAttributeToEntity() + public function testCanAddAttributeToEntity(): void { $colorAttribute = new Attribute('color'); $colorSilver = new Value($colorAttribute, 'silver');