Optimized Attributes and tests for it

This commit is contained in:
Kevin Frantz
2019-02-07 13:14:55 +01:00
parent f85b0118a7
commit 25e63d4983
13 changed files with 245 additions and 11 deletions

View File

@@ -5,12 +5,14 @@ namespace App\Attribut;
use Doctrine\Common\Collections\Collection;
/**
* @see ChildsAttributInterface
*
* @author kevinfrantz
*/
trait ChildsAttribut
{
/**
* @var Collection|ChildsAttributeInterface[]
* @var Collection|ChildsAttributInterface[]
*/
protected $childs;

View File

@@ -7,7 +7,7 @@ use Doctrine\Common\Collections\Collection;
/**
* @author kevinfrantz
*/
interface ChildsAttributeInterface
interface ChildsAttributInterface
{
public function setChilds(Collection $childs): void;

View File

@@ -7,6 +7,8 @@ namespace App\Attribut;
*/
interface ClassAttributInterface
{
const CLASS_ATTRIBUT_NAME = 'class';
/**
* @param string $class
*/

View File

@@ -4,6 +4,8 @@ This folder containes the attributs which are used by entity, domain logic etc.
Each attribut containes out of an interface and a trait.
## Interface
The interface MUST define a __get-__ and a __set-method__. Optional an interface can define a __has-method__.
For meta processing an interface SHOULD contain one constant which is named by the schema __<<ATTRIBUT>>_ATTRIBUT_NAME__.
An interface MUST NOT implement other constants.
### Methods
#### Set
The __setter__ MUST return nothing(void). It SHOULD throw an exception if the value is not valid.

View File

@@ -6,8 +6,10 @@ use Doctrine\Common\Collections\Collection;
/**
* @author kevinfrantz
*
* @see RightsAttributInterface
*/
trait RightsAttribute
trait RightsAttribut
{
/**
* @var Collection

View File

@@ -10,6 +10,8 @@ use App\Entity\Meta\RightInterface;
*/
interface RightsAttributInterface
{
const RIGHTS_ATTRIBUT_NAME = 'rights';
/**
* @param Collection|RightInterface[] $rights
*/