Optimized Interface structure

This commit is contained in:
Kevin Frantz 2018-09-24 18:41:26 +02:00
parent a6fac55be4
commit 1087c6b2ad
56 changed files with 177 additions and 141 deletions

View File

@ -4,12 +4,12 @@ namespace App\Creator\Modificator\Entity;
use App\DBAL\Types\LayerType;
use App\DBAL\Types\RightType;
use App\Entity\NodeInterface;
use App\Entity\Interfaces\NodeInterface;
use App\Entity\Right;
use App\Entity\LawInterface;
use App\Entity\Interfaces\LawInterface;
use App\DBAL\Types\RecieverType;
use App\Entity\RightInterface;
use App\Entity\RecieverGroupInterface;
use App\Entity\Interfaces\RightInterface;
use App\Entity\Interfaces\RecieverGroupInterface;
use App\Entity\RecieverGroup;
/**

View File

@ -5,6 +5,8 @@ namespace App\Entity;
use App\Entity\Attribut\NodeAttribut;
use Doctrine\ORM\Mapping as ORM;
use JMS\Serializer\Annotation\Exclude;
use App\Entity\Interfaces\SourceInterface;
use App\Entity\Interfaces\NodeInterface;
/**
* @author kevinfrantz

View File

@ -2,7 +2,7 @@
namespace App\Entity\Attribut;
use App\Entity\NodeInterface;
use App\Entity\Interfaces\NodeInterface;
use Doctrine\Common\Collections\Collection;
/**

View File

@ -1,6 +1,6 @@
<?php
namespace App\Entity\Attribut;
namespace App\Entity\Attribut\Interfaces;
/**
* @author kevinfrantz

View File

@ -1,6 +1,6 @@
<?php
namespace App\Entity\Attribut;
namespace App\Entity\Attribut\Interfaces;
use Doctrine\Common\Collections\Collection;

View File

@ -1,6 +1,6 @@
<?php
namespace App\Entity\Attribut;
namespace App\Entity\Attribut\Interfaces;
use App\Logic\Operation\OperationInterface;

View File

@ -1,6 +1,6 @@
<?php
namespace App\Entity\Attribut;
namespace App\Entity\Attribut\Interfaces;
/**
* @author kevinfrantz

View File

@ -1,6 +1,6 @@
<?php
namespace App\Entity\Attribut;
namespace App\Entity\Attribut\Interfaces;
/**
* @author kevinfrantz

View File

@ -1,8 +1,8 @@
<?php
namespace App\Entity\Attribut;
namespace App\Entity\Attribut\Interfaces;
use App\Entity\LawInterface;
use App\Entity\Interfaces\LawInterface;
/**
* @author kevinfrantz

View File

@ -1,6 +1,6 @@
<?php
namespace App\Entity\Attribut;
namespace App\Entity\Attribut\Interfaces;
/**
* @author kevinfrantz

View File

@ -1,6 +1,6 @@
<?php
namespace App\Entity\Attribut;
namespace App\Entity\Attribut\Interfaces;
/**
* @author kevinfrantz

View File

@ -1,8 +1,8 @@
<?php
namespace App\Entity\Attribut;
namespace App\Entity\Attribut\Interfaces;
use App\Entity\NameSourceInterface;
use App\Entity\Interfaces\NameSourceInterface;
/**
* @author kevinfrantz

View File

@ -1,8 +1,8 @@
<?php
namespace App\Entity\Attribut;
namespace App\Entity\Attribut\Interfaces;
use App\Entity\NodeInterface;
use App\Entity\Interfaces\NodeInterface;
/**
* @author kevinfrantz

View File

@ -1,6 +1,6 @@
<?php
namespace Entity\Attribut;
namespace App\Entity\Attribut\Interfaces;
/**
* @author kevinfrantz

View File

@ -1,6 +1,6 @@
<?php
namespace App\Entity\Attribut;
namespace App\Entity\Attribut\Interfaces;
use Doctrine\Common\Collections\Collection;

View File

@ -1,6 +1,6 @@
<?php
namespace App\Entity\Attribut;
namespace App\Entity\Attribut\Interfaces;
/**
* @author kevinfrantz

View File

@ -1,8 +1,8 @@
<?php
namespace App\Entity\Attribut;
namespace App\Entity\Attribut\Interfaces;
use App\Entity\RecieverGroupInterface;
use App\Entity\Interfaces\RecieverGroupInterface;
/**
* @author kevinfrantz

View File

@ -1,8 +1,8 @@
<?php
namespace App\Entity\Attribut;
namespace App\Entity\Attribut\Interfaces;
use App\Entity\RightInterface;
use App\Entity\Interfaces\RightInterface;
/**
* @author kevinfrantz

View File

@ -1,6 +1,6 @@
<?php
namespace App\Entity\Attribut;
namespace App\Entity\Attribut\Interfaces;
use Doctrine\Common\Collections\Collection;

View File

@ -1,8 +1,8 @@
<?php
namespace App\Entity\Attribut;
namespace App\Entity\Attribut\Interfaces;
use App\Entity\SourceInterface;
use App\Entity\Interfaces\SourceInterface;
/**
* @author kevinfrantz

View File

@ -1,6 +1,6 @@
<?php
namespace App\Entity\Attribut;
namespace App\Entity\Attribut\Interfaces;
/**
* @author kevinfrantz

View File

@ -0,0 +1,15 @@
<?php
namespace App\Entity\Attribut\Interfaces;
use App\Entity\Interfaces\UserInterface;
/**
* @author kevinfrantz
*/
interface UserAttributInterface
{
public function setUser(UserInterface $user): void;
public function getUser(): UserInterface;
}

View File

@ -1,8 +1,8 @@
<?php
namespace Entity\Attribut;
namespace App\Entity\Attribut\Interfaces;
use App\Entity\UserSourceInterface;
use App\Entity\Interfaces\UserSourceInterface;
/**
* @author kevinfrantz

View File

@ -1,6 +1,6 @@
<?php
namespace App\Entity\Attribut;
namespace App\Entity\Attribut\Interfaces;
/**
* @author kevinfrantz

View File

@ -2,7 +2,7 @@
namespace App\Entity\Attribut;
use App\Entity\LawInterface;
use App\Entity\Interfaces\LawInterface;
/**
* @author kevinfrantz

View File

@ -2,7 +2,7 @@
namespace App\Entity\Attribut;
use App\Entity\NameSourceInterface;
use App\Entity\Interfaces\NameSourceInterface;
/**
* @author kevinfrantz

View File

@ -2,7 +2,7 @@
namespace App\Entity\Attribut;
use App\Entity\NodeInterface;
use App\Entity\Interfaces\NodeInterface;
/**
* @author kevinfrantz

View File

@ -2,6 +2,8 @@
namespace Entity\Attribut;
use App\Entity\Attribut\Interfaces\ParentAttributInterface;
/**
* @author kevinfrantz
*/

View File

@ -2,7 +2,7 @@
namespace App\Entity\Attribut;
use App\Entity\NodeInterface;
use App\Entity\Interfaces\NodeInterface;
use Doctrine\Common\Collections\Collection;
/**

View File

@ -2,7 +2,7 @@
namespace App\Entity\Attribut;
use App\Entity\RecieverGroupInterface;
use App\Entity\Interfaces\RecieverGroupInterface;
/**
* @author kevinfrantz

View File

@ -2,7 +2,7 @@
namespace App\Entity\Attribut;
use App\Entity\RightInterface;
use App\Entity\Interfaces\RightInterface;
/**
* @author kevinfrantz

View File

@ -2,7 +2,7 @@
namespace App\Entity\Attribut;
use App\Entity\SourceInterface;
use App\Entity\Interfaces\SourceInterface;
/**
* @author kevinfrantz

View File

@ -3,6 +3,7 @@
namespace App\Entity\Attribut;
use App\Entity\User;
use App\Entity\Interfaces\UserInterface;
/**
* @author kevinfrantz
@ -14,12 +15,12 @@ trait UserAttribut
*/
protected $user;
public function setUser(User $user): void
public function setUser(UserInterface $user): void
{
$this->user = $user;
}
public function getUser(): User
public function getUser(): UserInterface
{
return $this->user;
}

View File

@ -1,15 +0,0 @@
<?php
namespace App\Entity\Attribut;
use App\Entity\User;
/**
* @author kevinfrantz
*/
interface UserAttributInterface
{
public function setUser(User $user): void;
public function getUser(): User;
}

View File

@ -2,7 +2,7 @@
namespace Entity\Attribut;
use App\Entity\UserSourceInterface;
use App\Entity\Interfaces\UserSourceInterface;
/**
* @author kevinfrantz

View File

@ -0,0 +1,14 @@
<?php
namespace App\Entity\Interfaces;
use App\Entity\Attribut\Interfaces\RightsAttributInterface;
use App\Entity\Method\Interfaces\NodeGrantedInterface;
use App\Entity\Attribut\Interfaces\NodeAttributInterface;
/**
* @author kevinfrantz
*/
interface LawInterface extends RightsAttributInterface, NodeGrantedInterface, NodeAttributInterface
{
}

View File

@ -1,8 +1,8 @@
<?php
namespace App\Entity;
namespace App\Entity\Interfaces;
use App\Entity\Attribut\NameAttributInterface;
use App\Entity\Attribut\Interfaces\NameAttributInterface;
/**
* @author kevinfrantz

View File

@ -0,0 +1,16 @@
<?php
namespace App\Entity\Interfaces;
use App\Entity\Attribut\Interfaces\SourceAttributInterface;
use App\Entity\Attribut\Interfaces\IdAttributInterface;
use App\Entity\Attribut\Interfaces\ParentsAttributInterface;
use App\Entity\Attribut\Interfaces\ChildsAttributeInterface;
use App\Entity\Attribut\Interfaces\LawAttributInterface;
/**
* @author kevinfrantz
*/
interface NodeInterface extends SourceAttributInterface, IdAttributInterface, ParentsAttributInterface, ChildsAttributeInterface, LawAttributInterface
{
}

View File

@ -1,9 +1,9 @@
<?php
namespace App\Entity;
namespace App\Entity\Interfaces;
use App\Entity\Attribut\NodeAttributInterface;
use App\Entity\Attribut\RecieverAttributInterface;
use App\Entity\Attribut\Interfaces\NodeAttributInterface;
use App\Entity\Attribut\Interfaces\RecieverAttributInterface;
use Doctrine\Common\Collections\ArrayCollection;
/**

View File

@ -0,0 +1,19 @@
<?php
namespace App\Entity\Interfaces;
use App\Entity\Attribut\Interfaces\TypeAttributInterface;
use App\Entity\Attribut\Interfaces\LawAttributInterface;
use App\Entity\Method\Interfaces\NodeGrantedInterface;
use App\Entity\Attribut\Interfaces\RecieverGroupAttributInterface;
use App\Entity\Attribut\Interfaces\GrantAttributInterface;
use App\Entity\Attribut\Interfaces\NodeAttributInterface;
use App\Entity\Attribut\Interfaces\ConditionAttributInterface;
use App\Entity\Attribut\Interfaces\LayerAttributInterface;
/**
* @author kevinfrantz
*/
interface RightInterface extends TypeAttributInterface, LawAttributInterface, NodeGrantedInterface, GrantAttributInterface, RecieverGroupAttributInterface, NodeAttributInterface, ConditionAttributInterface, LayerAttributInterface
{
}

View File

@ -0,0 +1,13 @@
<?php
namespace App\Entity\Interfaces;
use App\Entity\Attribut\Interfaces\NodeAttributInterface;
use App\Entity\Attribut\Interfaces\IdAttributInterface;
/**
* @author kevinfrantz
*/
interface SourceInterface extends IdAttributInterface, NodeAttributInterface
{
}

View File

@ -0,0 +1,15 @@
<?php
namespace App\Entity\Interfaces;
use FOS\UserBundle\Model\UserInterface as FOSUserInterface;
use App\Entity\Attribut\Interfaces\SourceAttributInterface;
/**
*
* @author kevinfrantz
*
*/
interface UserInterface extends FOSUserInterface, SourceAttributInterface
{
}

View File

@ -0,0 +1,13 @@
<?php
namespace App\Entity\Interfaces;
use App\Entity\Attribut\Interfaces\UserAttributInterface;
use App\Entity\Attribut\Interfaces\NameSourceAttributInterface;
/**
* @author kevinfrantz
*/
interface UserSourceInterface extends SourceInterface, UserAttributInterface, NameSourceAttributInterface
{
}

View File

@ -6,6 +6,8 @@ use Doctrine\ORM\Mapping as ORM;
use App\Entity\Attribut\RightsAttribute;
use Doctrine\Common\Collections\ArrayCollection;
use App\Entity\Attribut\NodeAttribut;
use App\Entity\Interfaces\LawInterface;
use App\Entity\Interfaces\NodeInterface;
/**
* @author kevinfrantz

View File

@ -1,14 +0,0 @@
<?php
namespace App\Entity;
use App\Entity\Attribut\RightsAttributInterface;
use App\Entity\Method\NodeGrantedInterface;
use App\Entity\Attribut\NodeAttributInterface;
/**
* @author kevinfrantz
*/
interface LawInterface extends RightsAttributInterface, NodeGrantedInterface, NodeAttributInterface
{
}

View File

@ -1,8 +1,8 @@
<?php
namespace App\Entity\Method;
namespace App\Entity\Method\Interfaces;
use App\Entity\NodeInterface;
use App\Entity\Interfaces\NodeInterface;
/**
* @author kevinfrantz

View File

@ -5,6 +5,7 @@ namespace App\Entity;
use App\Entity\Attribut\NameAttribut;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
use App\Entity\Interfaces\NameSourceInterface;
/**
* @author kevinfrantz

View File

@ -9,6 +9,9 @@ use App\Entity\Attribut\ParentsAttribut;
use App\Entity\Attribut\ChildsAttribut;
use App\Entity\Attribut\LawAttribut;
use Doctrine\Common\Collections\ArrayCollection;
use App\Entity\Interfaces\NodeInterface;
use App\Entity\Interfaces\SourceInterface;
use App\Entity\Interfaces\LawInterface;
/**
* @author kevinfrantz

View File

@ -1,16 +0,0 @@
<?php
namespace App\Entity;
use App\Entity\Attribut\SourceAttributInterface;
use App\Entity\Attribut\IdAttributInterface;
use App\Entity\Attribut\ParentsAttributInterface;
use App\Entity\Attribut\ChildsAttributeInterface;
use App\Entity\Attribut\LawAttributInterface;
/**
* @author kevinfrantz
*/
interface NodeInterface extends SourceAttributInterface, IdAttributInterface, ParentsAttributInterface, ChildsAttributeInterface, LawAttributInterface
{
}

View File

@ -9,6 +9,8 @@ use App\DBAL\Types\RecieverType;
use Symfony\Component\Intl\Exception\NotImplementedException;
use Doctrine\ORM\Mapping as ORM;
use Fresh\DoctrineEnumBundle\Validator\Constraints as DoctrineAssert;
use App\Entity\Interfaces\RecieverGroupInterface;
use App\Entity\Interfaces\NodeInterface;
/**
* @author kevinfrantz

View File

@ -14,6 +14,10 @@ use App\Logic\Operation\OperationInterface;
use App\Entity\Attribut\ConditionAttribut;
use App\Entity\Attribut\RecieverGroupAttribut;
use App\Entity\Attribut\LayerAttribut;
use App\Entity\Interfaces\LawInterface;
use App\Entity\Interfaces\RecieverGroupInterface;
use App\Entity\Interfaces\NodeInterface;
use App\Entity\Interfaces\RightInterface;
/**
* @author kevinfrantz

View File

@ -1,19 +0,0 @@
<?php
namespace App\Entity;
use App\Entity\Attribut\TypeAttributInterface;
use App\Entity\Attribut\LawAttributInterface;
use App\Entity\Method\NodeGrantedInterface;
use App\Entity\Attribut\RecieverGroupAttributInterface;
use App\Entity\Attribut\GrantAttributInterface;
use App\Entity\Attribut\NodeAttributInterface;
use App\Entity\Attribut\ConditionAttributInterface;
use App\Entity\Attribut\LayerAttributInterface;
/**
* @author kevinfrantz
*/
interface RightInterface extends TypeAttributInterface, LawAttributInterface, NodeGrantedInterface, GrantAttributInterface, RecieverGroupAttributInterface, NodeAttributInterface, ConditionAttributInterface, LayerAttributInterface
{
}

View File

@ -1,13 +0,0 @@
<?php
namespace App\Entity;
use App\Entity\Attribut\NodeAttributInterface;
use App\Entity\Attribut\IdAttributInterface;
/**
* @author kevinfrantz
*/
interface SourceInterface extends IdAttributInterface, NodeAttributInterface
{
}

View File

@ -4,17 +4,19 @@ namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use FOS\UserBundle\Model\User as BaseUser;
use App\Entity\Attribut\SourceAttributInterface;
use App\Entity\Attribut\Interfaces\SourceAttributInterface;
use App\Entity\Attribut\SourceAttribut;
use App\Entity\Attribut\IdAttribut;
use App\Creator\Modificator\Entity\LawModificator;
use App\Entity\Interfaces\UserInterface;
use App\Entity\Interfaces\UserSourceInterface;
/**
* @author kevinfrantz
* @ORM\Table(name="user")
* @ORM\Entity(repositoryClass="App\Repository\UserRepository")
*/
class User extends BaseUser implements SourceAttributInterface
class User extends BaseUser implements UserInterface
{
use SourceAttribut,IdAttribut;

View File

@ -6,6 +6,8 @@ use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
use App\Entity\Attribut\UserAttribut;
use App\Entity\Attribut\NameSourceAttribut;
use App\Entity\Interfaces\UserSourceInterface;
use App\Entity\Interfaces\NameSourceInterface;
/**
* @author kevinfrantz

View File

@ -1,13 +0,0 @@
<?php
namespace App\Entity;
use App\Entity\Attribut\UserAttributInterface;
use App\Entity\Attribut\NameSourceAttributInterface;
/**
* @author kevinfrantz
*/
interface UserSourceInterface extends SourceInterface, UserAttributInterface, NameSourceAttributInterface
{
}