From 25020bbe97d346261ba942977d7dcd77d21f8e46 Mon Sep 17 00:00:00 2001 From: Kevin Frantz Date: Sun, 28 Oct 2018 15:25:32 +0100 Subject: [PATCH] Moved meta entities to meta --- application/src/Controller/LawController.php | 4 ++-- .../Modificator/Entity/LawModificator.php | 18 +++++++++--------- .../src/Entity/Attribut/LawAttribut.php | 2 +- .../Entity/Attribut/LawAttributInterface.php | 2 +- .../Entity/Attribut/RecieverGroupAttribut.php | 2 +- .../RecieverGroupAttributInterface.php | 2 +- .../src/Entity/Attribut/RelationAttribut.php | 2 +- .../Attribut/RelationAttributInterface.php | 2 +- .../src/Entity/Attribut/RightAttribut.php | 2 +- .../Entity/Attribut/RightAttributInterface.php | 2 +- application/src/Entity/Meta/AbstractMeta.php | 13 +++++++++++++ application/src/Entity/{ => Meta}/Law.php | 9 ++++++--- .../src/Entity/{ => Meta}/LawInterface.php | 4 ++-- application/src/Entity/Meta/MetaInterface.php | 15 +++++++++++++++ .../src/Entity/{ => Meta}/RecieverGroup.php | 4 ++-- .../{ => Meta}/RecieverGroupInterface.php | 4 ++-- application/src/Entity/{ => Meta}/Relation.php | 4 ++-- .../Entity/{ => Meta}/RelationInterface.php | 4 ++-- application/src/Entity/{ => Meta}/Right.php | 4 ++-- .../src/Entity/{ => Meta}/RightInterface.php | 6 +++--- .../Entity/Method/RelationGrantedInterface.php | 2 +- .../src/Entity/Source/AbstractSource.php | 6 +++--- application/tests/unit/Entity/UserTest.php | 7 ++++--- 23 files changed, 76 insertions(+), 44 deletions(-) create mode 100644 application/src/Entity/Meta/AbstractMeta.php rename application/src/Entity/{ => Meta}/Law.php (92%) rename application/src/Entity/{ => Meta}/LawInterface.php (75%) create mode 100644 application/src/Entity/Meta/MetaInterface.php rename application/src/Entity/{ => Meta}/RecieverGroup.php (93%) rename application/src/Entity/{ => Meta}/RecieverGroupInterface.php (81%) rename application/src/Entity/{ => Meta}/Relation.php (96%) rename application/src/Entity/{ => Meta}/RelationInterface.php (85%) rename application/src/Entity/{ => Meta}/Right.php (97%) rename application/src/Entity/{ => Meta}/RightInterface.php (87%) diff --git a/application/src/Controller/LawController.php b/application/src/Controller/LawController.php index 60cff99..9ae4bb2 100644 --- a/application/src/Controller/LawController.php +++ b/application/src/Controller/LawController.php @@ -5,8 +5,8 @@ use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\HttpFoundation\Request; -use App\Entity\Law; -use App\Entity\LawInterface; +use App\Entity\Meta\Law; +use App\Entity\Meta\LawInterface; /** * diff --git a/application/src/Creator/Modificator/Entity/LawModificator.php b/application/src/Creator/Modificator/Entity/LawModificator.php index 597a8b8..afd15c9 100644 --- a/application/src/Creator/Modificator/Entity/LawModificator.php +++ b/application/src/Creator/Modificator/Entity/LawModificator.php @@ -4,20 +4,20 @@ namespace App\Creator\Modificator\Entity; use App\DBAL\Types\LayerType; use App\DBAL\Types\RightType; -use App\Entity\NodeInterface; -use App\Entity\Right; -use App\Entity\LawInterface; +use App\Entity\Meta\RelationInterface; +use App\Entity\Meta\Right; +use App\Entity\Meta\LawInterface; use App\DBAL\Types\RecieverType; -use App\Entity\RightInterface; -use App\Entity\RecieverGroupInterface; -use App\Entity\RecieverGroup; +use App\Entity\Meta\RightInterface; +use App\Entity\Meta\RecieverGroupInterface; +use App\Entity\Meta\RecieverGroup; /** * @author kevinfrantz */ abstract class LawModificator { - public static function grantAllRights(LawInterface $law, NodeInterface $node): void + public static function grantAllRights(LawInterface $law, RelationInterface $node): void { foreach (LayerType::getChoices() as $layerKey => $layerValue) { foreach (RightType::getChoices() as $rightKey => $rightValue) { @@ -28,7 +28,7 @@ abstract class LawModificator } } - public static function createRight(LawInterface $law, NodeInterface $node, string $type, string $layer): RightInterface + public static function createRight(LawInterface $law, RelationInterface $node, string $type, string $layer): RightInterface { $right = new Right(); $right->setType($type); @@ -39,7 +39,7 @@ abstract class LawModificator return $right; } - public static function createRecieverGroup(NodeInterface $node, string $reciever): RecieverGroupInterface + public static function createRecieverGroup(RelationInterface $node, string $reciever): RecieverGroupInterface { $recieverGroup = new RecieverGroup(); $recieverGroup->setNode($node); diff --git a/application/src/Entity/Attribut/LawAttribut.php b/application/src/Entity/Attribut/LawAttribut.php index ed634b0..058e845 100644 --- a/application/src/Entity/Attribut/LawAttribut.php +++ b/application/src/Entity/Attribut/LawAttribut.php @@ -2,7 +2,7 @@ namespace App\Entity\Attribut; -use App\Entity\LawInterface; +use App\Entity\Meta\LawInterface; /** * @author kevinfrantz diff --git a/application/src/Entity/Attribut/LawAttributInterface.php b/application/src/Entity/Attribut/LawAttributInterface.php index 3926b55..d42952c 100644 --- a/application/src/Entity/Attribut/LawAttributInterface.php +++ b/application/src/Entity/Attribut/LawAttributInterface.php @@ -2,7 +2,7 @@ namespace App\Entity\Attribut; -use App\Entity\LawInterface; +use App\Entity\Meta\LawInterface; /** * @author kevinfrantz diff --git a/application/src/Entity/Attribut/RecieverGroupAttribut.php b/application/src/Entity/Attribut/RecieverGroupAttribut.php index ead37d6..aae2a1f 100644 --- a/application/src/Entity/Attribut/RecieverGroupAttribut.php +++ b/application/src/Entity/Attribut/RecieverGroupAttribut.php @@ -2,7 +2,7 @@ namespace App\Entity\Attribut; -use App\Entity\RecieverGroupInterface; +use App\Entity\Meta\RecieverGroupInterface; /** * @author kevinfrantz diff --git a/application/src/Entity/Attribut/RecieverGroupAttributInterface.php b/application/src/Entity/Attribut/RecieverGroupAttributInterface.php index 6027fcc..1c9e043 100644 --- a/application/src/Entity/Attribut/RecieverGroupAttributInterface.php +++ b/application/src/Entity/Attribut/RecieverGroupAttributInterface.php @@ -2,7 +2,7 @@ namespace App\Entity\Attribut; -use App\Entity\RecieverGroupInterface; +use App\Entity\Meta\RecieverGroupInterface; /** * @author kevinfrantz diff --git a/application/src/Entity/Attribut/RelationAttribut.php b/application/src/Entity/Attribut/RelationAttribut.php index 2fc87b9..9e5d328 100644 --- a/application/src/Entity/Attribut/RelationAttribut.php +++ b/application/src/Entity/Attribut/RelationAttribut.php @@ -2,7 +2,7 @@ namespace App\Entity\Attribut; -use App\Entity\RelationInterface; +use App\Entity\Meta\RelationInterface; /** * @author kevinfrantz diff --git a/application/src/Entity/Attribut/RelationAttributInterface.php b/application/src/Entity/Attribut/RelationAttributInterface.php index fba0773..4f02939 100644 --- a/application/src/Entity/Attribut/RelationAttributInterface.php +++ b/application/src/Entity/Attribut/RelationAttributInterface.php @@ -2,7 +2,7 @@ namespace App\Entity\Attribut; -use App\Entity\RelationInterface; +use App\Entity\Meta\RelationInterface; /** * @author kevinfrantz diff --git a/application/src/Entity/Attribut/RightAttribut.php b/application/src/Entity/Attribut/RightAttribut.php index 564695b..245970a 100644 --- a/application/src/Entity/Attribut/RightAttribut.php +++ b/application/src/Entity/Attribut/RightAttribut.php @@ -2,7 +2,7 @@ namespace App\Entity\Attribut; -use App\Entity\RightInterface; +use App\Entity\Meta\RightInterface; /** * @author kevinfrantz diff --git a/application/src/Entity/Attribut/RightAttributInterface.php b/application/src/Entity/Attribut/RightAttributInterface.php index cd9970b..ef418f2 100644 --- a/application/src/Entity/Attribut/RightAttributInterface.php +++ b/application/src/Entity/Attribut/RightAttributInterface.php @@ -2,7 +2,7 @@ namespace App\Entity\Attribut; -use App\Entity\RightInterface; +use App\Entity\Meta\RightInterface; /** * @author kevinfrantz diff --git a/application/src/Entity/Meta/AbstractMeta.php b/application/src/Entity/Meta/AbstractMeta.php new file mode 100644 index 0000000..0a11353 --- /dev/null +++ b/application/src/Entity/Meta/AbstractMeta.php @@ -0,0 +1,13 @@ +rights->toArray() as $right) { diff --git a/application/src/Entity/LawInterface.php b/application/src/Entity/Meta/LawInterface.php similarity index 75% rename from application/src/Entity/LawInterface.php rename to application/src/Entity/Meta/LawInterface.php index 6de598b..2f02b96 100644 --- a/application/src/Entity/LawInterface.php +++ b/application/src/Entity/Meta/LawInterface.php @@ -1,6 +1,6 @@ assertInstanceOf(Node::class, $this->user->getSource()->getNode()); + $this->assertInstanceOf(Relation::class, $this->user->getSource()->getNode()); } public function testLaw(): void