Implemented draft for PureSourceCreateType Test and adapted classes to it

This commit is contained in:
Kevin Frantz
2019-02-13 18:03:25 +01:00
parent aafde4c0f9
commit 1bc85c994e
14 changed files with 93 additions and 22 deletions

View File

@@ -4,6 +4,8 @@ namespace App\Attribut;
/**
* @author kevinfrantz
*
* @see IdAttributInterface
*/
trait IdAttribut
{
@@ -12,16 +14,25 @@ trait IdAttribut
*/
protected $id;
/**
* @param int $id
*/
public function setId(int $id): void
{
$this->id = $id;
}
public function getId(): int
/**
* @return int|null
*/
public function getId(): ?int
{
return $this->id;
}
/**
* @return bool
*/
public function hasId(): bool
{
return isset($this->id);

View File

@@ -13,9 +13,14 @@ interface IdAttributInterface
public function setId(int $id): void;
/**
* @return int
* Don't use this function to check if an id is set.
* Use instead:.
*
* @see self::hasId()
*
* @return int|null
*/
public function getId(): int;
public function getId(): ?int;
/**
* @return bool Checks if attribute is set

View File

@@ -30,9 +30,9 @@ trait SlugAttribut
}
/**
* @return string
* @return string|null
*/
public function getSlug(): string
public function getSlug(): ?string
{
return $this->slug;
}

View File

@@ -15,9 +15,14 @@ interface SlugAttributInterface
public function setSlug(string $slug): void;
/**
* @return string
* Don't use this function to check if a slug is set
* Use instead:.
*
* @see self::hasSlug()
*
* @return string|null
*/
public function getSlug(): string;
public function getSlug(): ?string;
/**
* @return bool Checks if a slug is set