Completed
Push — master ( 59146c...3247b1 )
by Tom
02:22
created

StringFormatter   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 3
Bugs 0 Features 1
Metric Value
wmc 5
c 3
b 0
f 1
lcom 0
cbo 0
dl 0
loc 25
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A uppercase() 0 3 1
A lowercase() 0 3 1
A titlecase() 0 3 1
A html() 0 5 1
A debug() 0 5 1
1
<?php
2
/* @description     Transformation Style Sheets - Revolutionising PHP templating    *
3
 * @author          Tom Butler [email protected]                                             *
4
 * @copyright       2015 Tom Butler <[email protected]> | https://r.je/                      *
5
 * @license         http://www.opensource.org/licenses/bsd-license.php  BSD License *
6
 * @version         1.0                                                             */
7
namespace Transphporm\Formatter;
8
class StringFormatter {
9
	public function uppercase($val) {
10
		return strtoupper($val);
11
	}
12
13
	public function lowercase($val) {
14
		return strtolower($val);
15
	}
16
17
	public function titlecase($val) {
18
		return ucwords($val);
19
	}
20
21
	public function html($val) {
22
		$doc = new \DomDocument();
23
		$doc->loadXML($val);
24
		return $doc->documentElement;
25
	}
26
27
	public function debug($val) {
28
		ob_start();
29
		var_dump($val);
1 ignored issue
show
Security Debugging Code introduced by
var_dump($val); looks like debug code. Are you sure you do not want to remove it? This might expose sensitive data.
Loading history...
30
		return $this->html('<pre>' . ob_get_clean() . '</pre>');
31
	}
32
}