| Conditions | 5 |
| Paths | 5 |
| Total Lines | 20 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 5.583 |
| Changes | 0 | ||
| 1 | <?php |
||
| 33 | 2 | public function __construct(string $title, TextElementInterface $text, string $confirm, string $deny) |
|
| 34 | { |
||
| 35 | 2 | if (\strlen($title) > 100) { |
|
| 36 | throw new \InvalidArgumentException('$title too long!'); |
||
| 37 | } |
||
| 38 | 2 | if (\strlen($text->jsonSerialize()['text']) > 300) { |
|
| 39 | throw new \InvalidArgumentException('$text too long!'); |
||
| 40 | } |
||
| 41 | 2 | if (\strlen($confirm) > 30) { |
|
| 42 | throw new \InvalidArgumentException('$confirm too long!'); |
||
| 43 | } |
||
| 44 | 2 | if (\strlen($deny) > 30) { |
|
| 45 | throw new \InvalidArgumentException('$deny too long!'); |
||
| 46 | } |
||
| 47 | |||
| 48 | 2 | $this->title = new PlainTextElement($title); |
|
| 49 | 2 | $this->text = $text; |
|
| 50 | 2 | $this->confirm = new PlainTextElement($confirm); |
|
| 51 | 2 | $this->deny = new PlainTextElement($deny); |
|
| 52 | 2 | } |
|
| 53 | } |
||
| 54 |