Optimized namespaes

This commit is contained in:
Kevin Frantz 2018-10-03 16:14:15 +02:00
parent 871c100d28
commit eb77157e4c
49 changed files with 97 additions and 98 deletions

View File

@ -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;

View File

@ -2,7 +2,7 @@
namespace App\Creator\Factory;
use App\Entity\SourceInterface;
use App\Entity\Source\SourceInterface;
/**
* @author kevinfrantz

View File

@ -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;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -2,9 +2,9 @@
namespace App\Entity;
use App\Entity\Attribut\Interfaces\RightsAttributInterface;
use App\Entity\Method\Interfaces\NodeGrantedInterface;
use App\Entity\Attribut\Interfaces\NodeAttributInterface;
use App\Entity\Attribut\RightsAttributInterface;
use App\Entity\Method\NodeGrantedInterface;
use App\Entity\Attribut\NodeAttributInterface;
/**
* @author kevinfrantz

View File

@ -1,6 +1,6 @@
<?php
namespace App\Entity\Method\Interfaces;
namespace App\Entity\Method;
use App\Entity\NodeInterface;

View File

@ -10,7 +10,7 @@ use App\Entity\Attribut\ChildsAttribut;
use App\Entity\Attribut\LawAttribut;
use Doctrine\Common\Collections\ArrayCollection;
use App\Entity\NodeInterface;
use App\Entity\SourceInterface;
use App\Entity\Source\SourceInterface;
use App\Entity\LawInterface;
/**

View File

@ -2,11 +2,11 @@
namespace App\Entity;
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;
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

View File

@ -2,8 +2,8 @@
namespace App\Entity;
use App\Entity\Attribut\Interfaces\NodeAttributInterface;
use App\Entity\Attribut\Interfaces\RecieverAttributInterface;
use App\Entity\Attribut\NodeAttributInterface;
use App\Entity\Attribut\RecieverAttributInterface;
use Doctrine\Common\Collections\ArrayCollection;
/**

View File

@ -2,14 +2,14 @@
namespace App\Entity;
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;
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

View File

@ -1,12 +1,13 @@
<?php
namespace App\Entity;
namespace App\Entity\Source;
use App\Entity\Attribut\NodeAttribut;
use Doctrine\ORM\Mapping as ORM;
use JMS\Serializer\Annotation\Exclude;
use App\Entity\SourceInterface;
use App\Entity\Source\SourceInterface;
use App\Entity\NodeInterface;
use App\Entity\AbstractEntity;
/**
* @author kevinfrantz

View File

@ -1,11 +1,11 @@
<?php
namespace App\Entity;
namespace App\Entity\Source;
use App\Entity\Attribut\NameAttribut;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
use App\Entity\NameSourceInterface;
use App\Entity\Source\NameSourceInterface;
/**
* @author kevinfrantz

View File

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

View File

@ -1,14 +1,15 @@
<?php
namespace App\Entity;
namespace App\Entity\Source\Operation;
use App\Logic\Result\ResultInterface;
use App\Logic\Operation\OperationInterface;
use App\Logic\Operation\OperandInterface;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
use App\Entity\Source\AbstractSource;
/**
*
* @author kevinfrantz
* @ORM\Entity
* @ORM\Table(name="source_operation")
@ -18,6 +19,7 @@ use Doctrine\ORM\Mapping as ORM;
*/
abstract class AbstractOperation extends AbstractSource implements OperationInterface
{
/**
* The result MUST NOT be saved via Doctrine!
*
@ -26,6 +28,7 @@ abstract class AbstractOperation extends AbstractSource implements OperationInte
protected $result;
/**
*
* @var ArrayCollection|OperandInterface[]
*/
protected $operands;

View File

@ -1,6 +1,6 @@
<?php
namespace App\Entity;
namespace App\Entity\Source\Operation;
use App\Logic\Operation\OperandInterface;
use App\Logic\Result\Result;

View File

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

View File

@ -1,13 +1,13 @@
<?php
namespace App\Entity;
namespace App\Entity\Source;
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\UserSourceInterface;
use App\Entity\NameSourceInterface;
use App\Entity\Source\UserSourceInterface;
use App\Entity\Source\NameSourceInterface;
/**
* @author kevinfrantz

View File

@ -1,9 +1,9 @@
<?php
namespace App\Entity;
namespace App\Entity\Source;
use App\Entity\Attribut\Interfaces\UserAttributInterface;
use App\Entity\Attribut\Interfaces\NameSourceAttributInterface;
use App\Entity\Attribut\UserAttributInterface;
use App\Entity\Attribut\NameSourceAttributInterface;
/**
* @author kevinfrantz

View File

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

View File

@ -4,12 +4,11 @@ namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use FOS\UserBundle\Model\User as BaseUser;
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\UserInterface;
use App\Entity\UserSourceInterface;
use App\Entity\Source\UserSourceInterface;
use App\Entity\Source\UserSource;
/**
* @author kevinfrantz

View File

@ -2,7 +2,7 @@
namespace App\Entity;
use FOS\UserBundle\Model\UserInterface as FOSUserInterface;
use App\Entity\Attribut\Interfaces\SourceAttributInterface;
use App\Entity\Attribut\SourceAttributInterface;
/**
*

View File

@ -4,7 +4,7 @@ namespace App\Security;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
use Symfony\Component\Security\Core\Authorization\Voter\Voter;
use App\DBAL\Types\RightType;
use App\Entity\SourceInterface;
use App\Entity\Source\SourceInterface;
use App\DBAL\Types\LayerType;
use App\Entity\UserInterface;

View File

@ -3,7 +3,7 @@
namespace App\Structur\Facade\Security\Source;
use App\Entity\NodeInterface;
use App\Entity\SourceInterface;
use App\Entity\Source\SourceInterface;
use App\Entity\User;
use App\DBAL\Types\RightType;
use App\DBAL\Types\LayerType;

View File

@ -2,9 +2,9 @@
namespace App\Structur\Facade\Security\Source;
use App\Entity\NameSourceInterface;
use App\Entity\User;
use App\Entity\UserSourceInterface;
use App\Entity\Source\NameSourceInterface;
use App\Entity\UserInterface;
use App\Entity\Source\UserSourceInterface;
use App\DBAL\Types\RightType;
use App\DBAL\Types\LayerType;
@ -38,14 +38,10 @@ class UserSourceFacade extends AbstractSourceFacade implements UserSourceInterfa
return $this->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
{}
}

View File

@ -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;
/**