HTMLFormatter   A
last analyzed

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
/* @description     Transformation Style Sheets - Revolutionising PHP templating    *
3
 * @author          Tom Butler [email protected]                                             *
4
 * @copyright       2017 Tom Butler <[email protected]> | https://r.je/                      *
5
 * @license         http://www.opensource.org/licenses/bsd-license.php  BSD License *
6
 * @version         1.2                                                             */
7
namespace Transphporm\Formatter;
8
class HTMLFormatter {
9
    private $templateFunction;
10
11
    public function __construct(\Transphporm\TSSFunction\Template $templateFunction) {
12
        $this->templateFunction = $templateFunction;
13
    }
14
15
    public function html($val) {
16
		return $this->templateFunction->run(['<template>' . $val . '</template>']);
17
	}
18
19
	public function debug($val) {
20
		ob_start();
21
		var_dump($val);
22
		return $this->html('<pre>' . ob_get_clean() . '</pre>');
23
	}
24
}
25