| Total Complexity | 6 |
| Total Lines | 33 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 26 | class Image |
||
| 27 | { |
||
| 28 | private string $alt; |
||
| 29 | private int $height; |
||
| 30 | private int $width; |
||
| 31 | private string $url; |
||
| 32 | |||
| 33 | public function __construct(\SimpleXMLElement $xml) |
||
| 34 | { |
||
| 35 | $this->alt = $xml['alt'] ? $xml['alt']->__toString() : ''; |
||
| 36 | $this->height = (int) $xml['height']; |
||
| 37 | $this->width = (int) $xml['width']; |
||
| 38 | $this->url = $xml->__toString(); |
||
| 39 | } |
||
| 40 | |||
| 41 | public function getAlt(): string |
||
| 42 | { |
||
| 43 | return $this->alt; |
||
| 44 | } |
||
| 45 | |||
| 46 | public function getHeight(): int |
||
| 47 | { |
||
| 48 | return $this->height; |
||
| 49 | } |
||
| 50 | |||
| 51 | public function getWidth(): int |
||
| 52 | { |
||
| 53 | return $this->width; |
||
| 54 | } |
||
| 55 | |||
| 56 | public function getUrl(): string |
||
| 59 | } |
||
| 60 | } |
||
| 61 |