| Total Complexity | 7 |
| Total Lines | 61 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 2 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 10 | class Reviews extends ArrayObject |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * @var array |
||
| 14 | */ |
||
| 15 | public $args; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * @var int |
||
| 19 | */ |
||
| 20 | public $max_num_pages; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * @var array |
||
| 24 | */ |
||
| 25 | public $reviews; |
||
| 26 | |||
| 27 | public function __construct( array $reviews, $maxPageCount, array $args ) |
||
| 33 | } |
||
| 34 | |||
| 35 | /** |
||
| 36 | * @return string |
||
| 37 | */ |
||
| 38 | public function __toString() |
||
| 39 | { |
||
| 40 | return (string)$this->build(); |
||
| 41 | } |
||
| 42 | |||
| 43 | /** |
||
| 44 | * @return ReviewsHtml |
||
| 45 | */ |
||
| 46 | public function build() |
||
| 47 | { |
||
| 48 | $args = glsr( SiteReviewsDefaults::class )->merge( $this->args ); |
||
| 49 | return glsr( SiteReviewsPartial::class )->build( $args, $this ); |
||
| 50 | } |
||
| 51 | |||
| 52 | /** |
||
| 53 | * @param mixed $key |
||
| 54 | * @return mixed |
||
| 55 | */ |
||
| 56 | public function offsetGet( $key ) { |
||
| 57 | if( property_exists( $this, $key )) { |
||
| 58 | return $this->key; |
||
|
|
|||
| 59 | } |
||
| 60 | return array_key_exists( $key, $this->reviews ) |
||
| 61 | ? $this->reviews[$key] |
||
| 62 | : null; |
||
| 63 | } |
||
| 64 | |||
| 65 | /** |
||
| 66 | * @return void |
||
| 67 | */ |
||
| 68 | public function render() |
||
| 71 | } |
||
| 72 | } |
||
| 73 |