Total Complexity | 6 |
Total Lines | 45 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 0 |
1 | <?php |
||
8 | class ReviewHtml extends ArrayObject |
||
9 | { |
||
10 | /** |
||
11 | * @var Review |
||
12 | */ |
||
13 | public $review; |
||
14 | |||
15 | /** |
||
16 | * @var array |
||
17 | */ |
||
18 | public $values; |
||
19 | |||
20 | public function __construct(Review $review, array $values = []) |
||
21 | { |
||
22 | $this->review = $review; |
||
23 | $this->values = $values; |
||
24 | parent::__construct($values, ArrayObject::STD_PROP_LIST | ArrayObject::ARRAY_AS_PROPS); |
||
25 | } |
||
26 | |||
27 | /** |
||
28 | * @return string|void |
||
29 | */ |
||
30 | public function __toString() |
||
31 | { |
||
32 | if (empty($this->values)) { |
||
33 | return; |
||
34 | } |
||
35 | return glsr(Template::class)->build('templates/review', [ |
||
36 | 'context' => $this->values, |
||
37 | 'review' => $this->review, |
||
38 | ]); |
||
39 | } |
||
40 | |||
41 | /** |
||
42 | * @param mixed $key |
||
43 | * @return mixed |
||
44 | */ |
||
45 | public function offsetGet($key) |
||
53 | } |
||
54 | } |
||
55 |