Completed
Push — master ( 1bff6a...345056 )
by
unknown
01:32
created

Builder::getKey()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace EnergieProduction\Chart\Criterias;
4
5
use EnergieProduction\Chart\Expression;
6
7
abstract class Builder implements Criteria {
8
9
	protected $content;
10
11
	public function __construct($content)
12
	{
13
		$this->content = $content;
14
	}
15
16
	public function render()
17
	{
18
	    if ($this->content instanceof Expression) {
19
			return [$this->getKey() => "#!!" . $this->content->render() . "!!#"];
20
	    }
21
22
		return [$this->getKey() => $this->content];
23
	}
24
25
	protected function getKey()
26
	{
27
		return lcfirst(class_basename(get_class($this)));
28
	}
29
}
30