Optimized Tests and attributes

This commit is contained in:
Kevin Frantz
2019-01-27 18:38:21 +01:00
parent 0593a8f1c3
commit 17a6ee1dc6
7 changed files with 45 additions and 6 deletions

View File

@@ -7,6 +7,8 @@ use App\Exception\NoValidChoiceException;
/**
* @author kevinfrantz
*
* @see LayerAttributInterface
*/
trait LayerAttribut
{
@@ -25,7 +27,7 @@ trait LayerAttribut
public function setLayer(string $layer): void
{
if (!array_key_exists($layer, LayerType::getChoices())) {
throw new NoValidChoiceException();
throw new NoValidChoiceException("'$layer' is not a correct layer type.");
}
$this->layer = $layer;
}