diff --git a/composer.json b/composer.json index 2ac862d..a7f30ac 100644 --- a/composer.json +++ b/composer.json @@ -12,8 +12,7 @@ "require": { "php": ">=7.0", "ramsey/uuid": "^3.0", - "easyframework/collections": "^7.0.0", - "beberlei/assert": "^3.1" + "easyframework/collections": "^7.0.0" }, "require-dev": { "phpunit/phpunit": "^5.3", diff --git a/src/Domain/StreamName.php b/src/Domain/StreamName.php index 1f04629..a4524ff 100644 --- a/src/Domain/StreamName.php +++ b/src/Domain/StreamName.php @@ -2,8 +2,6 @@ namespace HelloFresh\Engine\Domain; -use Assert\Assertion; - /** * Class StreamName * @@ -22,9 +20,13 @@ class StreamName */ public function __construct($name) { - Assertion::string($name, 'StreamName must be a string'); - Assertion::notEmpty($name, 'StreamName must not be empty'); - Assertion::maxLength($name, 200, 'StreamName should not be longer than 200 chars'); + if (!\is_string($name)) { + throw new \InvalidArgumentException('StreamName must be a string!'); + } + $len = \strlen($name); + if ($len === 0 || $len > 200) { + throw new \InvalidArgumentException('StreamName must not be empty and not longer than 200 chars!'); + } $this->name = $name; }