| Conditions | 3 |
| Paths | 3 |
| Total Lines | 12 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 35 | public function __construct($stringData) |
||
| 36 | { |
||
| 37 | if (!is_string($stringData)) { |
||
| 38 | throw new InvalidArgumentException('Given data is not a string'); |
||
| 39 | } |
||
| 40 | |||
| 41 | if (!preg_match('#^image/(jpeg|gif|tiff|bmp)$#', $stringData, $matches)) { |
||
| 42 | throw new RuntimeException('Given MimeType is not in a valid format. Need: "image/<type>"'); |
||
| 43 | } |
||
| 44 | |||
| 45 | $this->setStringData($stringData); |
||
| 46 | } |
||
| 47 | |||
| 62 |