In between commit Exception refactoring

This commit is contained in:
Kevin Frantz
2019-04-14 23:37:30 +02:00
parent 679bfd2079
commit 9f179ead73
64 changed files with 256 additions and 241 deletions

View File

@@ -2,7 +2,7 @@
namespace Infinito\Attribut;
use Infinito\Exception\UnvalidValueException;
use Infinito\Exception\Validation\ValueInvalidException;
/**
* @author kevinfrantz
@@ -17,14 +17,15 @@ trait SlugAttribut
protected $slug;
/**
* @todo Maybe throw an other Exception here?
* @param string $slug
*
* @throws UnvalidValueException
*
* @throws ValueInvalidException
*/
public function setSlug(string $slug): void
{
if (is_numeric($slug)) {
throw new UnvalidValueException('A slug must not be numeric!');
throw new ValueInvalidException('A slug must not be numeric!');
}
$this->slug = $slug;
}