mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-09-13 13:57:10 +02:00
In between commit Exception refactoring
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
namespace Infinito\Attribut;
|
||||
|
||||
use Infinito\DBAL\Types\Meta\Right\LayerType;
|
||||
use Infinito\Exception\NoValidChoiceException;
|
||||
use Infinito\Exception\Type\InvalidChoiceTypeException;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
@@ -20,14 +20,14 @@ trait LayerAttribut
|
||||
protected $layer;
|
||||
|
||||
/**
|
||||
*
|
||||
* @param string $layer
|
||||
*
|
||||
* @throws NoValidChoiceException
|
||||
* @throws InvalidChoiceTypeException
|
||||
*/
|
||||
public function setLayer(string $layer): void
|
||||
{
|
||||
if (!in_array($layer, LayerType::getValues())) {
|
||||
throw new NoValidChoiceException("'$layer' is not a correct layer type.");
|
||||
throw new InvalidChoiceTypeException("'$layer' is not a correct layer type.");
|
||||
}
|
||||
$this->layer = $layer;
|
||||
}
|
||||
|
Reference in New Issue
Block a user