Completed
Push — master ( 479b8e...e72ae9 )
by Richard
02:38
created

HTMLFormatter   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 1
dl 0
loc 17
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A html() 0 3 1
A debug() 0 5 1
1
<?php
2
namespace Transphporm\Formatter;
3
class HTMLFormatter {
4
    private $templateFunction;
5
6
    public function __construct(\Transphporm\TSSFunction\Template $templateFunction) {
7
        $this->templateFunction = $templateFunction;
8
    }
9
10
    public function html($val) {
11
		return $this->templateFunction->run([$val]);
12
	}
13
14
	public function debug($val) {
15
		ob_start();
16
		var_dump($val);
17
		return $this->html('<pre>' . ob_get_clean() . '</pre>');
18
	}
19
}
20