Code optimation by PHP-Code Sniffer

This commit is contained in:
2020-04-02 21:13:35 +02:00
parent 725ca5b149
commit ac5a3f1d5a
314 changed files with 665 additions and 1688 deletions

View File

@@ -18,8 +18,6 @@ trait ActionTypeAttribut
protected $actionType;
/**
* @param string $actionType
*
* @throws InvalidChoiceTypeException
*/
public function setActionType(string $actionType): void
@@ -30,9 +28,6 @@ trait ActionTypeAttribut
$this->actionType = $actionType;
}
/**
* @return string
*/
public function getActionType(): string
{
return $this->actionType;

View File

@@ -13,15 +13,11 @@ interface ActionTypeAttributInterface
{
/**
* @see ActionType
*
* @param string $actionType
*/
public function setActionType(string $actionType): void;
/**
* @see ActionType
*
* @return string
*/
public function getActionType(): string;
}

View File

@@ -16,9 +16,6 @@ trait ClassAttribut
*/
private $class;
/**
* @param string $class
*/
public function setClass(string $class): void
{
if (class_exists($class)) {
@@ -29,17 +26,11 @@ trait ClassAttribut
throw new NotFoundHttpException('Class '.$class.' couldn\'t be found!');
}
/**
* @return string
*/
public function getClass(): string
{
return $this->class;
}
/**
* @return bool
*/
public function hasClass(): bool
{
return isset($this->class);

View File

@@ -9,14 +9,8 @@ interface ClassAttributInterface
{
const CLASS_ATTRIBUT_NAME = 'class';
/**
* @param string $class
*/
public function setClass(string $class): void;
/**
* @return string
*/
public function getClass(): string;
/**

View File

@@ -11,17 +11,11 @@ trait CollectionAttribut
*/
protected $collection;
/**
* @return Collection
*/
public function getCollection(): Collection
{
return $this->collection;
}
/**
* @param Collection $collection
*/
public function setCollection(Collection $collection): void
{
$this->collection = $collection;

View File

@@ -16,17 +16,11 @@ trait CreatorRelationAttribut
*/
protected $creatorRelation;
/**
* @param CreatorRelationInterface $creatorRelation
*/
public function setCreatorRelation(CreatorRelationInterface $creatorRelation)
{
$this->creatorRelation = $creatorRelation;
}
/**
* @return CreatorRelationInterface
*/
public function getCreatorRelation(): CreatorRelationInterface
{
return $this->creatorRelation;

View File

@@ -11,13 +11,7 @@ interface CreatorRelationAttributInterface
{
const CREATORRELATION_ATTRIBUT_NAME = 'creatorRelation';
/**
* @param CreatorRelationInterface $creatorRelation
*/
public function setCreatorRelation(CreatorRelationInterface $creatorRelation);
/**
* @return CreatorRelationInterface
*/
public function getCreatorRelation(): CreatorRelationInterface;
}

View File

@@ -19,9 +19,6 @@ trait CrudAttribut
*/
protected $crud;
/**
* @param string $crud
*/
public function setCrud(string $crud): void
{
if (!in_array($crud, CRUDType::getValues())) {
@@ -30,9 +27,6 @@ trait CrudAttribut
$this->crud = $crud;
}
/**
* @return string
*/
public function getCrud(): string
{
return $this->crud;

View File

@@ -14,17 +14,11 @@ trait GrantAttribut
*/
protected $grant;
/**
* @param bool $grant
*/
public function setGrant(bool $grant): void
{
$this->grant = $grant;
}
/**
* @return bool
*/
public function getGrant(): bool
{
return $this->grant;

View File

@@ -12,13 +12,7 @@ interface GrantAttributInterface
*/
const GRANT_ATTRIBUT_NAME = 'grant';
/**
* @param bool $grant
*/
public function setGrant(bool $grant): void;
/**
* @return bool
*/
public function getGrant(): bool;
}

View File

@@ -14,25 +14,16 @@ trait IdAttribut
*/
protected $id;
/**
* @param int $id
*/
public function setId(int $id): void
{
$this->id = $id;
}
/**
* @return int|null
*/
public function getId(): ?int
{
return $this->id;
}
/**
* @return bool
*/
public function hasId(): bool
{
return isset($this->id);

View File

@@ -9,9 +9,6 @@ interface IdAttributInterface
{
const ID_ATTRIBUT_NAME = 'id';
/**
* @param int $id
*/
public function setId(int $id): void;
/**
@@ -19,8 +16,6 @@ interface IdAttributInterface
* Use instead:.
*
* @see self::hasId()
*
* @return int|null
*/
public function getId(): ?int;

View File

@@ -16,17 +16,11 @@ trait LawAttribut
*/
protected $law;
/**
* @param LawInterface $law
*/
public function setLaw(LawInterface $law): void
{
$this->law = $law;
}
/**
* @return LawInterface
*/
public function getLaw(): LawInterface
{
return $this->law;

View File

@@ -20,8 +20,6 @@ trait LayerAttribut
protected $layer;
/**
* @param string $layer
*
* @throws InvalidChoiceTypeException
*/
public function setLayer(string $layer): void
@@ -32,9 +30,6 @@ trait LayerAttribut
$this->layer = $layer;
}
/**
* @return string
*/
public function getLayer(): string
{
return $this->layer;

View File

@@ -7,13 +7,7 @@ namespace Infinito\Attribut;
*/
interface LayerAttributInterface
{
/**
* @param string $layer
*/
public function setLayer(string $layer): void;
/**
* @return string
*/
public function getLayer(): string;
}

View File

@@ -16,17 +16,11 @@ trait LayerRepositoryFactoryServiceAttribut
*/
protected $layerRepositoryFactoryService;
/**
* @param LayerRepositoryFactoryServiceInterface $layerRepositoryFactoryService
*/
public function setLayerRepositoryFactoryService(LayerRepositoryFactoryServiceInterface $layerRepositoryFactoryService): void
{
$this->layerRepositoryFactoryService = $layerRepositoryFactoryService;
}
/**
* @return LayerRepositoryFactoryServiceInterface
*/
public function getLayerRepositoryFactoryService(): LayerRepositoryFactoryServiceInterface
{
return $this->layerRepositoryFactoryService;

View File

@@ -9,13 +9,7 @@ use Infinito\Domain\Repository\LayerRepositoryFactoryServiceInterface;
*/
interface LayerRepositoryFactoryServiceAttributInterface
{
/**
* @param LayerRepositoryFactoryServiceInterface $layerRepositoryFactoryService
*/
public function setLayerRepositoryFactoryService(LayerRepositoryFactoryServiceInterface $layerRepositoryFactoryService): void;
/**
* @return LayerRepositoryFactoryServiceInterface
*/
public function getLayerRepositoryFactoryService(): LayerRepositoryFactoryServiceInterface;
}

View File

@@ -24,17 +24,11 @@ trait RecieverAttribut
$this->reciever = $reciever;
}
/**
* @return SourceInterface
*/
public function getReciever(): SourceInterface
{
return $this->reciever;
}
/**
* @return bool
*/
public function hasReciever(): bool
{
return isset($this->reciever);

View File

@@ -14,9 +14,6 @@ interface RecieverAttributInterface
*/
public function setReciever(?SourceInterface $reciever): void;
/**
* @return SourceInterface
*/
public function getReciever(): SourceInterface;
/**

View File

@@ -17,8 +17,6 @@ trait RelationAttribut
protected $relation;
/**
* @param RelationInterface $relation
*
* @see RelationAttributInterface
*/
public function setRelation(RelationInterface $relation): void
@@ -28,8 +26,6 @@ trait RelationAttribut
/**
* @see RelationAttributInterface
*
* @return RelationInterface
*/
public function getRelation(): RelationInterface
{

View File

@@ -9,13 +9,7 @@ use Infinito\Entity\Meta\Relation\RelationInterface;
*/
interface RelationAttributInterface
{
/**
* @param RelationInterface $relation
*/
public function setRelation(RelationInterface $relation): void;
/**
* @return RelationInterface
*/
public function getRelation(): RelationInterface;
}

View File

@@ -16,17 +16,11 @@ trait RequestAttribut
*/
protected $request;
/**
* @param Request $request
*/
public function setRequest(Request $request): void
{
$this->request = $request;
}
/**
* @return Request
*/
public function getRequest(): Request
{
return $this->request;

View File

@@ -9,13 +9,7 @@ use Symfony\Component\HttpFoundation\Request;
*/
interface RequestAttributInterface
{
/**
* @param Request $request
*/
public function setRequest(Request $request): void;
/**
* @return Request
*/
public function getRequest(): Request;
}

View File

@@ -16,25 +16,16 @@ trait RequestedEntityAttribut
*/
private $requestedEntity;
/**
* @return RequestedEntityInterface
*/
public function getRequestedEntity(): RequestedEntityInterface
{
return $this->requestedEntity;
}
/**
* @param RequestedEntityInterface $requestedEntity
*/
public function setRequestedEntity(RequestedEntityInterface $requestedEntity): void
{
$this->requestedEntity = $requestedEntity;
}
/**
* @return bool
*/
public function hasRequestedEntity(): bool
{
return isset($this->requestedEntity);

View File

@@ -9,18 +9,9 @@ use Infinito\Domain\Request\Entity\RequestedEntityInterface;
*/
interface RequestedEntityAttributInterface
{
/**
* @return bool
*/
public function hasRequestedEntity(): bool;
/**
* @return RequestedEntityInterface
*/
public function getRequestedEntity(): RequestedEntityInterface;
/**
* @param RequestedEntityInterface $requestedEntity
*/
public function setRequestedEntity(RequestedEntityInterface $requestedEntity): void;
}

View File

@@ -16,25 +16,16 @@ trait RequestedRightAttribut
*/
protected $requestedRight;
/**
* @param RequestedRightInterface $requestedRight
*/
public function setRequestedRight(RequestedRightInterface $requestedRight): void
{
$this->requestedRight = $requestedRight;
}
/**
* @return bool
*/
public function hasRequestedRight(): bool
{
return isset($this->requestedRight);
}
/**
* @return RequestedRightInterface
*/
public function getRequestedRight(): RequestedRightInterface
{
return $this->requestedRight;

View File

@@ -9,18 +9,9 @@ use Infinito\Domain\Request\Right\RequestedRightInterface;
*/
interface RequestedRightAttributInterface
{
/**
* @return bool
*/
public function hasRequestedRight(): bool;
/**
* @param RequestedRightInterface $requestedRight
*/
public function setRequestedRight(RequestedRightInterface $requestedRight): void;
/**
* @return RequestedRightInterface
*/
public function getRequestedRight(): RequestedRightInterface;
}

View File

@@ -19,8 +19,6 @@ trait SlugAttribut
/**
* @todo Maybe throw an other Exception here?
*
* @param string $slug
*
* @throws ValueInvalidException
*/
public function setSlug(string $slug): void
@@ -31,17 +29,11 @@ trait SlugAttribut
$this->slug = $slug;
}
/**
* @return string|null
*/
public function getSlug(): ?string
{
return $this->slug;
}
/**
* @return bool
*/
public function hasSlug(): bool
{
return isset($this->slug);

View File

@@ -9,9 +9,6 @@ interface SlugAttributInterface
{
const SLUG_ATTRIBUT_NAME = 'slug';
/**
* @param string $slug
*/
public function setSlug(string $slug): void;
/**
@@ -19,8 +16,6 @@ interface SlugAttributInterface
* Use instead:.
*
* @see self::hasSlug()
*
* @return string|null
*/
public function getSlug(): ?string;

View File

@@ -16,17 +16,11 @@ trait SourceAttribut
*/
protected $source;
/**
* @return SourceInterface
*/
public function getSource(): SourceInterface
{
return $this->source;
}
/**
* @param SourceInterface $source
*/
public function setSource(SourceInterface $source): void
{
$this->source = $source;

View File

@@ -14,13 +14,7 @@ interface SourceAttributInterface
*/
const SOURCE_ATTRIBUT_NAME = 'source';
/**
* @return SourceInterface
*/
public function getSource(): SourceInterface;
/**
* @param SourceInterface $source
*/
public function setSource(SourceInterface $source): void;
}

View File

@@ -14,17 +14,11 @@ trait TextAttribut
*/
protected $text;
/**
* @return string
*/
public function getText(): string
{
return $this->text;
}
/**
* @param string $text
*/
public function setText(string $text): void
{
$this->text = $text;

View File

@@ -27,9 +27,6 @@ trait TimestampAttribut
$this->timestamp = $timestamp;
}
/**
* @return \DateTime
*/
public function getTimestamp(): \DateTime
{
return $this->timestamp;

View File

@@ -17,8 +17,5 @@ interface TimestampAttributInterface
*/
public function setTimestamp(\DateTime $timestamp): void;
/**
* @return \DateTime
*/
public function getTimestamp(): \DateTime;
}

View File

@@ -17,25 +17,16 @@ trait UserAttribut
*/
protected $user;
/**
* @param UserInterface $user
*/
public function setUser(UserInterface $user): void
{
$this->user = $user;
}
/**
* @return UserInterface
*/
public function getUser(): UserInterface
{
return $this->user;
}
/**
* @return bool
*/
public function hasUser(): bool
{
return isset($this->user);

View File

@@ -14,14 +14,8 @@ interface UserAttributInterface
*/
public const USER_ATTRIBUT_NAME = 'user';
/**
* @param UserInterface $user
*/
public function setUser(UserInterface $user): void;
/**
* @return UserInterface
*/
public function getUser(): UserInterface;
/**

View File

@@ -14,17 +14,11 @@ trait VersionAttribut
*/
protected $version;
/**
* @param int $version
*/
public function setVersion(int $version): void
{
$this->version = $version;
}
/**
* @return int
*/
public function getVersion(): int
{
return $this->version;

View File

@@ -19,15 +19,11 @@ interface VersionAttributInterface
/**
* Returns the revision version of the entity.
*
* @return int
*/
public function getVersion(): int;
/**
* Sets the revision version of the entity.
*
* @param int $version
*/
public function setVersion(int $version): void;
}