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

Review::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 0
loc 3
ccs 0
cts 3
cp 0
crap 2
rs 10
c 0
b 0
f 0
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