Passed
Push — master ( e26cd8...29faa5 )
by Paul
05:06
created

Review   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 30
ccs 0
cts 15
cp 0
rs 10
c 0
b 0
f 0
wmc 4

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __get() 0 6 2
A __toString() 0 4 1
A __construct() 0 3 1
1
<?php
2
3
namespace GeminiLabs\SiteReviews\Modules\Html;
4
5
class Review
6
{
7
	/**
8
	 * @var array
9
	 */
10
	protected $values;
11
12
	public function __construct( array $values )
13
	{
14
		$this->values = $values;
15
	}
16
17
	/**
18
	 * @return string
19
	 */
20
	public function __get( $key )
21
	{
22
		if( array_key_exists( $key, $this->values )) {
23
			return $this->values[$key];
24
		}
25
		return '';
26
	}
27
28
	/**
29
	 * @return string
30
	 */
31
	public function __toString()
32
	{
33
		return array_reduce( $this->values, function( $carry, $value ) {
34
			return $carry.$value;
35
		});
36
	}
37
}
38