Skip to content
This repository was archived by the owner on Sep 6, 2025. It is now read-only.

Commit 232b904

Browse files
author
Nenad Stojanovikj
committed
Remove usage of Assertion in StreamName
1 parent 17c75ab commit 232b904

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/Domain/StreamName.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
namespace HelloFresh\Engine\Domain;
44

5-
use Assert\Assertion;
6-
75
/**
86
* Class StreamName
97
*
@@ -22,9 +20,13 @@ class StreamName
2220
*/
2321
public function __construct($name)
2422
{
25-
Assertion::string($name, 'StreamName must be a string');
26-
Assertion::notEmpty($name, 'StreamName must not be empty');
27-
Assertion::maxLength($name, 200, 'StreamName should not be longer than 200 chars');
23+
if (!\is_string($name)) {
24+
throw new \InvalidArgumentException('StreamName must be a string!');
25+
}
26+
$len = \strlen($name);
27+
if ($len === 0 || $len > 200) {
28+
throw new \InvalidArgumentException('StreamName must not be empty and not longer than 200 chars!');
29+
}
2830
$this->name = $name;
2931
}
3032

0 commit comments

Comments
 (0)