| Conditions | 4 |
| Paths | 3 |
| Total Lines | 14 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 4 |
| Changes | 0 | ||
| 1 | <?php |
||
| 27 | 25 | public function __construct($title, $subtitle = null, $imageUrl = null) |
|
| 28 | { |
||
| 29 | 25 | if (mb_strlen($title) > 80) { |
|
| 30 | 2 | throw new \InvalidArgumentException('In a element, the "title" field should not exceed 80 characters.'); |
|
| 31 | } |
||
| 32 | |||
| 33 | 23 | if (!empty($subtitle) && mb_strlen($subtitle) > 80) { |
|
| 34 | 2 | throw new \InvalidArgumentException('In a element, the "subtitle" field should not exceed 80 characters.'); |
|
| 35 | } |
||
| 36 | |||
| 37 | 21 | $this->title = $title; |
|
| 38 | 21 | $this->subtitle = $subtitle; |
|
| 39 | 21 | $this->imageUrl = $imageUrl; |
|
| 40 | 21 | } |
|
| 41 | |||
| 89 |