From 48697c8b12ff50df0e3f0b4ede6d09584c00684a Mon Sep 17 00:00:00 2001 From: Kevin Frantz Date: Wed, 31 Oct 2018 20:47:51 +0100 Subject: [PATCH] Refactored method name --- application/src/Entity/Attribut/MembersAttribut.php | 4 ++-- .../src/Entity/Attribut/MembersAttributInterface.php | 2 +- .../tests/Unit/Entity/Attribut/MembersAttributTest.php | 10 +++++----- application/tests/Unit/Entity/Meta/RecieverTest.php | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/application/src/Entity/Attribut/MembersAttribut.php b/application/src/Entity/Attribut/MembersAttribut.php index 7b3b2b1..3a35cf8 100644 --- a/application/src/Entity/Attribut/MembersAttribut.php +++ b/application/src/Entity/Attribut/MembersAttribut.php @@ -31,7 +31,7 @@ trait MembersAttribut * * @return Collection|MembersAttributInterface[] Returns all members till the defined dimension */ - public function getMembersInclusiveChildren(?int $dimension = null, Collection $members = null): Collection + public function getMembersIncludingChildren(?int $dimension = null, Collection $members = null): Collection { $dimension = is_int($dimension) ? $dimension - 1 : null; $members = $members ?? new ArrayCollection(); @@ -39,7 +39,7 @@ trait MembersAttribut if (!$members->contains($member)) { $members->add($member); if ($this->continueIncludeMembersLoop($dimension) && $member instanceof MembersAttributInterface) { - $member->getMembersInclusiveChildren($dimension, $members); + $member->getMembersIncludingChildren($dimension, $members); } } } diff --git a/application/src/Entity/Attribut/MembersAttributInterface.php b/application/src/Entity/Attribut/MembersAttributInterface.php index 67ae2e1..f2488f1 100644 --- a/application/src/Entity/Attribut/MembersAttributInterface.php +++ b/application/src/Entity/Attribut/MembersAttributInterface.php @@ -24,5 +24,5 @@ interface MembersAttributInterface /** * @return Collection */ - public function getMembersInclusiveChildren(int $dimension = null): Collection; + public function getMembersIncludingChildren(int $dimension = null): Collection; } diff --git a/application/tests/Unit/Entity/Attribut/MembersAttributTest.php b/application/tests/Unit/Entity/Attribut/MembersAttributTest.php index 90e6386..e8ca2b2 100644 --- a/application/tests/Unit/Entity/Attribut/MembersAttributTest.php +++ b/application/tests/Unit/Entity/Attribut/MembersAttributTest.php @@ -27,7 +27,7 @@ class MembersAttributTest extends AbstractTestCase { $this->expectException(\TypeError::class); $this->membersAttribut->getMembers(); - $this->membersAttribut->getMembersInclusiveChildren(); + $this->membersAttribut->getMembersIncludingChildren(); } private function getContinueIncludeMemberLoopResult($dimension): bool @@ -69,7 +69,7 @@ class MembersAttributTest extends AbstractTestCase $source3->setMembers(new ArrayCollection([$source4])); $members = new ArrayCollection([$source1, $source2, $source3]); $this->assertNull($this->membersAttribut->setMembers($members)); - $this->assertEquals(3, $this->membersAttribut->getMembersInclusiveChildren(1)->count()); + $this->assertEquals(3, $this->membersAttribut->getMembersIncludingChildren(1)->count()); } public function test3DimensionsMembersInclusiveChildren(): void @@ -87,7 +87,7 @@ class MembersAttributTest extends AbstractTestCase $this->assertEquals(1, $source2->getMembers()->count()); $this->assertEquals(1, $source3->getMembers()->count()); $this->assertEquals(0, $source4->getMembers()->count()); - $this->assertEquals(3, $this->membersAttribut->getMembersInclusiveChildren(3)->count()); + $this->assertEquals(3, $this->membersAttribut->getMembersIncludingChildren(3)->count()); } public function testMembersIncludingChildrenInfinite(): void @@ -105,7 +105,7 @@ class MembersAttributTest extends AbstractTestCase $source5->setMembers(new ArrayCollection([$source6])); $this->membersAttribut->setMembers(new ArrayCollection([$source1])); - $this->assertEquals(6, $this->membersAttribut->getMembersInclusiveChildren()->count()); + $this->assertEquals(6, $this->membersAttribut->getMembersIncludingChildren()->count()); } public function testMemberWithoutMembers(): void @@ -113,6 +113,6 @@ class MembersAttributTest extends AbstractTestCase $source1 = new class() extends AbstractSource { }; $this->membersAttribut->setMembers(new ArrayCollection([$source1])); - $this->assertEquals(1, $this->membersAttribut->getMembersInclusiveChildren()->count()); + $this->assertEquals(1, $this->membersAttribut->getMembersIncludingChildren()->count()); } } diff --git a/application/tests/Unit/Entity/Meta/RecieverTest.php b/application/tests/Unit/Entity/Meta/RecieverTest.php index 673ef13..6d94658 100644 --- a/application/tests/Unit/Entity/Meta/RecieverTest.php +++ b/application/tests/Unit/Entity/Meta/RecieverTest.php @@ -1,6 +1,6 @@