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