Passed
Push — master ( 998a95...21763d )
by Federico
02:41
created

block.php ➔ jBlockClose()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
	function jBlock() {
4
		return ob_start();
5
	}
6
7
	function jBlockClose() {
8
		return ob_get_clean();
9
	}
10
11
	function jBlockEnd() {
12
		return ob_get_clean();
13
	}
14
15
	function minifyOutput($_buffer) {
16
		$search = array ( '/\>[^\S ]+/s', '/[^\S ]+\</s', '/(\s)+/s' );
17
		$replace = array ( '>', '<', '\\1' );
18
		if (preg_match("/\<html/i",$_buffer) == 1 && preg_match("/\<\/html\>/i",$_buffer) == 1)
19
			$_buffer = preg_replace($search, $replace, utf8_decode($_buffer));
20
		return utf8_encode($_buffer);
21
	}
22
?>
0 ignored issues
show
Best Practice introduced by
It is not recommended to use PHP's closing tag ?> in files other than templates.

Using a closing tag in PHP files that only contain PHP code is not recommended as you might accidentally add whitespace after the closing tag which would then be output by PHP. This can cause severe problems, for example headers cannot be sent anymore.

A simple precaution is to leave off the closing tag as it is not required, and it also has no negative effects whatsoever.

Loading history...
23