From eb77157e4c9cf2ae24966dc694843378fb46793b Mon Sep 17 00:00:00 2001 From: Kevin Frantz Date: Wed, 3 Oct 2018 16:14:15 +0200 Subject: [PATCH] Optimized namespaes --- .../src/Controller/SourceController.php | 4 ++-- .../Creator/Factory/AbstractSourceFactory.php | 2 +- .../Template/Source/SourceTemplateFactory.php | 2 +- .../Attribut/BlacklistAttributInterface.php | 2 +- .../Attribut/ChildsAttributeInterface.php | 2 +- .../Attribut/ConditionAttributInterface.php | 2 +- .../Entity/Attribut/GrantAttributInterface.php | 2 +- .../Entity/Attribut/IdAttributInterface.php | 2 +- .../Entity/Attribut/LawAttributInterface.php | 2 +- .../Entity/Attribut/LayerAttributInterface.php | 2 +- .../Entity/Attribut/NameAttributInterface.php | 2 +- .../src/Entity/Attribut/NameSourceAttribut.php | 2 +- .../Attribut/NameSourceAttributInterface.php | 4 ++-- .../Entity/Attribut/NodeAttributInterface.php | 2 +- .../src/Entity/Attribut/ParentAttribut.php | 2 +- .../Attribut/ParentAttributInterface.php | 2 +- .../Attribut/ParentsAttributInterface.php | 2 +- .../Attribut/RecieverAttributInterface.php | 2 +- .../RecieverGroupAttributInterface.php | 2 +- .../Entity/Attribut/RightAttributInterface.php | 2 +- .../Attribut/RightsAttributInterface.php | 2 +- .../src/Entity/Attribut/SourceAttribut.php | 2 +- .../Attribut/SourceAttributInterface.php | 4 ++-- .../Entity/Attribut/TypeAttributInterface.php | 2 +- .../Entity/Attribut/UserAttributInterface.php | 2 +- .../src/Entity/Attribut/UserSourceAttribut.php | 2 +- .../Attribut/UserSourceAttributInterface.php | 4 ++-- .../Attribut/WhitelistAttributInterface.php | 2 +- application/src/Entity/LawInterface.php | 6 +++--- .../src/Entity/Method/NodeGrantedInterface.php | 2 +- application/src/Entity/Node.php | 2 +- application/src/Entity/NodeInterface.php | 10 +++++----- .../{Source => }/RecieverGroupInterface.php | 4 ++-- application/src/Entity/RightInterface.php | 16 ++++++++-------- .../src/Entity/Source/AbstractSource.php | 5 +++-- application/src/Entity/Source/NameSource.php | 4 ++-- .../src/Entity/Source/NameSourceInterface.php | 4 ++-- .../Source/Operation/AbstractOperation.php | 7 +++++-- .../Entity/Source/Operation/AndOperation.php | 2 +- .../src/Entity/Source/SourceInterface.php | 13 +++++++++++++ application/src/Entity/Source/UserSource.php | 6 +++--- .../src/Entity/Source/UserSourceInterface.php | 6 +++--- application/src/Entity/SourceInterface.php | 13 ------------- application/src/Entity/User.php | 5 ++--- application/src/Entity/UserInterface.php | 2 +- application/src/Security/SourceVoter.php | 2 +- .../Security/Source/AbstractSourceFacade.php | 2 +- .../Security/Source/UserSourceFacade.php | 18 +++++++----------- application/tests/unit/Entity/UserTest.php | 2 +- 49 files changed, 97 insertions(+), 98 deletions(-) rename application/src/Entity/{Source => }/RecieverGroupInterface.php (68%) create mode 100644 application/src/Entity/Source/SourceInterface.php delete mode 100644 application/src/Entity/SourceInterface.php diff --git a/application/src/Controller/SourceController.php b/application/src/Controller/SourceController.php index 7c72343..a919c77 100644 --- a/application/src/Controller/SourceController.php +++ b/application/src/Controller/SourceController.php @@ -3,12 +3,12 @@ namespace App\Controller; use Symfony\Component\HttpFoundation\Response; -use App\Entity\AbstractSource; +use App\Entity\Method; use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\HttpFoundation\Request; use App\Creator\Factory\Template\Source\SourceTemplateFactory; use FOS\RestBundle\Controller\FOSRestController; -use App\Entity\SourceInterface; +use App\Entity\Source\SourceInterface; use App\Creator\Factory\Template\Source\SourceTemplateFormFactory; use App\Creator\Factory\Form\Source\SourceFormFactory; use Symfony\Component\HttpFoundation\RedirectResponse; diff --git a/application/src/Creator/Factory/AbstractSourceFactory.php b/application/src/Creator/Factory/AbstractSourceFactory.php index 864e430..36d9167 100644 --- a/application/src/Creator/Factory/AbstractSourceFactory.php +++ b/application/src/Creator/Factory/AbstractSourceFactory.php @@ -2,7 +2,7 @@ namespace App\Creator\Factory; -use App\Entity\SourceInterface; +use App\Entity\Source\SourceInterface; /** * @author kevinfrantz diff --git a/application/src/Creator/Factory/Template/Source/SourceTemplateFactory.php b/application/src/Creator/Factory/Template/Source/SourceTemplateFactory.php index 19f0cb3..af2b39a 100644 --- a/application/src/Creator/Factory/Template/Source/SourceTemplateFactory.php +++ b/application/src/Creator/Factory/Template/Source/SourceTemplateFactory.php @@ -2,7 +2,7 @@ namespace App\Creator\Factory\Template\Source; -use App\Entity\SourceInterface; +use App\Entity\Source\SourceInterface; use Symfony\Component\HttpFoundation\Request; use Creator\Factory\AbstractSourceFactory; diff --git a/application/src/Entity/Attribut/BlacklistAttributInterface.php b/application/src/Entity/Attribut/BlacklistAttributInterface.php index e26a198..1ca7497 100644 --- a/application/src/Entity/Attribut/BlacklistAttributInterface.php +++ b/application/src/Entity/Attribut/BlacklistAttributInterface.php @@ -1,6 +1,6 @@ isGranted($right, $layer) && $law->isGranted($userSourceNode, $layer, $right); } + public function getUser(): UserInterface + {} - public function getUser(): User - { - //FILL - } - public function setUser(User $user): void - { - //FILL - } + public function setUser(UserInterface $user): void + {} } diff --git a/application/tests/unit/Entity/UserTest.php b/application/tests/unit/Entity/UserTest.php index 8db4a8e..347f96a 100644 --- a/application/tests/unit/Entity/UserTest.php +++ b/application/tests/unit/Entity/UserTest.php @@ -5,7 +5,7 @@ namespace tests\unit\Entity; use PHPUnit\Framework\TestCase; use App\Entity\User; use App\Entity\Law; -use App\Entity\UserSource; +use App\Entity\Source\UserSource; use App\Entity\Node; /**