Skip to content
This repository has been archived by the owner on Mar 1, 2024. It is now read-only.

Commit

Permalink
Merge pull request #15 from hellofresh/patch/get-rid-of-baberlei-assert
Browse files Browse the repository at this point in the history
Remove baberlei/assert dependency
  • Loading branch information
Nenad Stojanovikj authored Aug 16, 2019
2 parents 62e5651 + cc95090 commit 2c7f926
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
3 changes: 1 addition & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
12 changes: 7 additions & 5 deletions src/Domain/StreamName.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

namespace HelloFresh\Engine\Domain;

use Assert\Assertion;

/**
* Class StreamName
*
Expand All @@ -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;
}

Expand Down

0 comments on commit 2c7f926

Please sign in to comment.