mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-09-13 13:57:10 +02:00
Applied CS fixer
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Source;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
@@ -15,9 +16,8 @@ use App\Entity\Meta\Law;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author kevinfrantz
|
||||
*
|
||||
*
|
||||
* @see https://www.doctrine-project.org/projects/doctrine-orm/en/2.6/reference/inheritance-mapping.html
|
||||
* @ORM\Entity
|
||||
* @ORM\Table(name="source")
|
||||
@@ -30,7 +30,6 @@ abstract class AbstractSource extends AbstractEntity implements SourceInterface
|
||||
use RelationAttribut,GroupSourcesAttribut, LawAttribut;
|
||||
|
||||
/**
|
||||
*
|
||||
* @var RelationInterface
|
||||
* @ORM\OneToOne(targetEntity="App\Entity\Meta\Relation",cascade={"persist", "remove"})
|
||||
* @ORM\JoinColumn(name="relation_id", referencedColumnName="id")
|
||||
@@ -39,16 +38,15 @@ abstract class AbstractSource extends AbstractEntity implements SourceInterface
|
||||
protected $relation;
|
||||
|
||||
/**
|
||||
*
|
||||
* @todo Implement that just one table on database level is needed!
|
||||
* @todo Rename table to use the right schema
|
||||
*
|
||||
* @var Collection|GroupSource[]
|
||||
* @ORM\ManyToMany(targetEntity="GroupSource")
|
||||
*/
|
||||
protected $groups;
|
||||
|
||||
/**
|
||||
*
|
||||
* @ORM\OneToOne(targetEntity="Law",cascade={"persist", "remove"})
|
||||
* @ORM\JoinColumn(name="law_id", referencedColumnName="id")
|
||||
*
|
||||
|
@@ -1,36 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Source\Attribut;
|
||||
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use App\Entity\Source\GroupSourceInterface;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author kevinfrantz
|
||||
*
|
||||
*/
|
||||
trait GroupSourcesAttribut
|
||||
{
|
||||
/**
|
||||
*
|
||||
* @var Collection|GroupSourceInterface[]
|
||||
*/
|
||||
protected $groups;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @return Collection|GroupSourceInterface[]
|
||||
*/
|
||||
public function getGroupSources():Collection{
|
||||
public function getGroupSources(): Collection
|
||||
{
|
||||
return $this->groups;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param Collection|GroupSourceInterface[] $groups
|
||||
*/
|
||||
public function setGroupSources(Collection $groups):void{
|
||||
public function setGroupSources(Collection $groups): void
|
||||
{
|
||||
$this->groups = $groups;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -1,24 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Source\Attribut;
|
||||
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use App\Entity\Source\GroupSourceInterface;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author kevinfrantz
|
||||
*
|
||||
*/
|
||||
interface GroupSourcesAttributInterface
|
||||
{
|
||||
/**
|
||||
* @param Collection|GroupSourceInterface[] $groups
|
||||
*/
|
||||
public function setGroupSources(Collection $groups):void;
|
||||
|
||||
public function setGroupSources(Collection $groups): void;
|
||||
|
||||
/**
|
||||
* @return Collection|GroupSourceInterface[]
|
||||
*/
|
||||
public function getGroupSources():Collection;
|
||||
public function getGroupSources(): Collection;
|
||||
}
|
||||
|
||||
|
@@ -1,18 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Source\Attribut;
|
||||
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author kevinfrantz
|
||||
*
|
||||
*/
|
||||
trait MembersAttribut
|
||||
{
|
||||
|
||||
/**
|
||||
*
|
||||
* @var Collection
|
||||
*/
|
||||
protected $members;
|
||||
@@ -27,4 +24,3 @@ trait MembersAttribut
|
||||
$this->members = $members;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -1,17 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Source\Attribut;
|
||||
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
|
||||
/**
|
||||
* Allows to group other sources in a source
|
||||
* Allows to group other sources in a source.
|
||||
*
|
||||
* @author kevinfrantz
|
||||
*
|
||||
*/
|
||||
interface MembersAttributInterface
|
||||
{
|
||||
|
||||
/**
|
||||
* @param Collection $members
|
||||
*/
|
||||
@@ -21,4 +20,4 @@ interface MembersAttributInterface
|
||||
* @return Collection
|
||||
*/
|
||||
public function getMembers(): Collection;
|
||||
}
|
||||
}
|
||||
|
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Source;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
@@ -8,7 +9,6 @@ use App\Entity\Source\Attribut\MembersAttribut;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author kevinfrantz
|
||||
* @ORM\Table(name="source_group")
|
||||
* @ORM\Entity
|
||||
@@ -18,15 +18,14 @@ final class GroupSource extends AbstractSource implements MembersAttributInterfa
|
||||
use MembersAttribut;
|
||||
|
||||
/**
|
||||
*
|
||||
* @var Collection
|
||||
* @ORM\ManyToMany(targetEntity="AbstractSource")
|
||||
*/
|
||||
protected $members;
|
||||
|
||||
public function __construct() {
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->members = new ArrayCollection();
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -1,14 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Source;
|
||||
|
||||
use App\Entity\Source\Attribut\MembersAttributInterface;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*
|
||||
* @todo Map the not jet mapped functions!
|
||||
*
|
||||
*/
|
||||
interface GroupSourceInterface extends MembersAttributInterface
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -5,7 +5,6 @@ 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\Source\NameSourceInterface;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
|
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Source\Operation;
|
||||
|
||||
use App\Logic\Result\ResultInterface;
|
||||
@@ -9,7 +10,6 @@ use Doctrine\ORM\Mapping as ORM;
|
||||
use App\Entity\Source\AbstractSource;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author kevinfrantz
|
||||
* @ORM\Entity
|
||||
* @ORM\Table(name="source_operation")
|
||||
@@ -19,7 +19,6 @@ use App\Entity\Source\AbstractSource;
|
||||
*/
|
||||
abstract class AbstractOperation extends AbstractSource implements OperationInterface
|
||||
{
|
||||
|
||||
/**
|
||||
* The result MUST NOT be saved via Doctrine!
|
||||
*
|
||||
@@ -28,7 +27,6 @@ abstract class AbstractOperation extends AbstractSource implements OperationInte
|
||||
protected $result;
|
||||
|
||||
/**
|
||||
*
|
||||
* @var ArrayCollection|OperandInterface[]
|
||||
*/
|
||||
protected $operands;
|
||||
|
@@ -19,12 +19,13 @@ class AndOperation extends AbstractOperation
|
||||
throw new \Exception('Operands must be defined!');
|
||||
}
|
||||
$this->result = new Result();
|
||||
/**
|
||||
/*
|
||||
* @var OperandInterface
|
||||
*/
|
||||
foreach ($this->operands->toArray() as $operand) {
|
||||
if (!$operand->getResult()->getBool()) {
|
||||
$this->result->setAll(false);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Source;
|
||||
|
||||
use App\Entity\Attribut\IdAttributInterface;
|
||||
@@ -7,7 +8,6 @@ use App\Entity\Source\Attribut\GroupSourcesAttributInterface;
|
||||
use App\Entity\Attribut\LawAttributInterface;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
interface SourceInterface extends IdAttributInterface, EntityInterface, GroupSourcesAttributInterface, LawAttributInterface
|
||||
|
Reference in New Issue
Block a user