Test Failed
Pull Request — 1.2 (#90)
by
unknown
02:45
created
lib/plugins/builtin/functions/strip_tags.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -22,9 +22,9 @@
 block discarded – undo
22 22
  */
23 23
 function Dwoo_Plugin_strip_tags_compile(Dwoo_Compiler $compiler, $value, $addspace = true)
24 24
 {
25
-    if ($addspace === 'true') {
26
-        return "preg_replace('#<[^>]*>#', ' ', $value)";
27
-    } else {
28
-        return "strip_tags($value)";
29
-    }
25
+	if ($addspace === 'true') {
26
+		return "preg_replace('#<[^>]*>#', ' ', $value)";
27
+	} else {
28
+		return "strip_tags($value)";
29
+	}
30 30
 }
Please login to merge, or discard this patch.
lib/plugins/builtin/functions/extends.php 1 patch
Indentation   +126 added lines, -126 removed lines patch added patch discarded remove patch
@@ -21,18 +21,18 @@  discard block
 block discarded – undo
21 21
  */
22 22
 class Dwoo_Plugin_extends extends Dwoo_Plugin implements Dwoo_ICompilable
23 23
 {
24
-    protected static $childSource;
25
-    protected static $regex;
26
-    protected static $l;
27
-    protected static $r;
28
-    protected static $lastReplacement;
29
-
30
-    public static function compile(Dwoo_Compiler $compiler, $file)
31
-    {
32
-        list($l, $r) = $compiler->getDelimiters();
33
-        self::$l = preg_quote($l, '/');
34
-        self::$r = preg_quote($r, '/');
35
-        self::$regex = '/
24
+	protected static $childSource;
25
+	protected static $regex;
26
+	protected static $l;
27
+	protected static $r;
28
+	protected static $lastReplacement;
29
+
30
+	public static function compile(Dwoo_Compiler $compiler, $file)
31
+	{
32
+		list($l, $r) = $compiler->getDelimiters();
33
+		self::$l = preg_quote($l, '/');
34
+		self::$r = preg_quote($r, '/');
35
+		self::$regex = '/
36 36
 			'.self::$l.'block\s(["\']?)(.+?)\1'.self::$r.'(?:\r?\n?)
37 37
 			((?:
38 38
 				(?R)
@@ -47,118 +47,118 @@  discard block
 block discarded – undo
47 47
 			'.self::$l.'\/block'.self::$r.'
48 48
 			/six';
49 49
 
50
-        if ($compiler->getLooseOpeningHandling()) {
51
-            self::$l .= '\s*';
52
-            self::$r = '\s*'.self::$r;
53
-        }
54
-        $inheritanceTree = array(array('source' => $compiler->getTemplateSource()));
55
-        $curPath = dirname($compiler->getDwoo()->getTemplate()->getResourceIdentifier()).DIRECTORY_SEPARATOR;
56
-        $curTpl = $compiler->getDwoo()->getTemplate();
57
-
58
-        while (!empty($file)) {
59
-            if ($file === '""' || $file === "''" || (substr($file, 0, 1) !== '"' && substr($file, 0, 1) !== '\'')) {
60
-                throw new Dwoo_Compilation_Exception($compiler, 'Extends : The file name must be a non-empty string');
61
-            }
62
-
63
-            if (preg_match('#^["\']([a-z]{2,}):(.*?)["\']$#i', $file, $m)) {
64
-                // resource:identifier given, extract them
65
-                $resource = $m[1];
66
-                $identifier = $m[2];
67
-            } else {
68
-                // get the current template's resource
69
-                $resource = $curTpl->getResourceName();
70
-                $identifier = substr($file, 1, -1);
71
-            }
72
-
73
-            try {
74
-                $parent = $compiler->getDwoo()->templateFactory($resource, $identifier, null, null, null, $curTpl);
75
-            } catch (Dwoo_Security_Exception $e) {
76
-                throw new Dwoo_Compilation_Exception($compiler, 'Extends : Security restriction : '.$e->getMessage());
77
-            } catch (Dwoo_Exception $e) {
78
-                throw new Dwoo_Compilation_Exception($compiler, 'Extends : '.$e->getMessage());
79
-            }
80
-
81
-            if ($parent === null) {
82
-                throw new Dwoo_Compilation_Exception($compiler, 'Extends : Resource "'.$resource.':'.$identifier.'" not found.');
83
-            } elseif ($parent === false) {
84
-                throw new Dwoo_Compilation_Exception($compiler, 'Extends : Resource "'.$resource.'" does not support extends.');
85
-            }
86
-
87
-            $curTpl = $parent;
88
-            $newParent = array('source' => $parent->getSource(), 'resource' => $resource, 'identifier' => $parent->getResourceIdentifier(), 'uid' => $parent->getUid());
89
-            if (array_search($newParent, $inheritanceTree, true) !== false) {
90
-                throw new Dwoo_Compilation_Exception($compiler, 'Extends : Recursive template inheritance detected');
91
-            }
92
-            $inheritanceTree[] = $newParent;
93
-
94
-            if (preg_match('/^'.self::$l.'extends(?:\(?\s*|\s+)(?:file=)?\s*((["\']).+?\2|\S+?)\s*\)?\s*?'.self::$r.'/i', $parent->getSource(), $match)) {
95
-                $curPath = dirname($identifier).DIRECTORY_SEPARATOR;
96
-                if (isset($match[2]) && $match[2] == '"') {
97
-                    $file = '"'.str_replace('"', '\\"', substr($match[1], 1, -1)).'"';
98
-                } elseif (isset($match[2]) && $match[2] == "'") {
99
-                    $file = '"'.substr($match[1], 1, -1).'"';
100
-                } else {
101
-                    $file = '"'.$match[1].'"';
102
-                }
103
-            } else {
104
-                $file = false;
105
-            }
106
-        }
107
-
108
-        while (true) {
109
-            $parent = array_pop($inheritanceTree);
110
-            $child = end($inheritanceTree);
111
-            self::$childSource = $child['source'];
112
-            self::$lastReplacement = count($inheritanceTree) === 1;
113
-            if (!isset($newSource)) {
114
-                $newSource = $parent['source'];
115
-            }
116
-            $newSource = preg_replace_callback(self::$regex, array('Dwoo_Plugin_extends', 'replaceBlock'), $newSource);
117
-            $newSource = $l.'do extendsCheck('.var_export($parent['resource'].':'.$parent['identifier'], true).')'.$r.$newSource;
118
-
119
-            if (self::$lastReplacement) {
120
-                break;
121
-            }
122
-        }
123
-        $compiler->setTemplateSource($newSource);
124
-        $compiler->recompile();
125
-    }
126
-
127
-    protected static function replaceBlock(array $matches)
128
-    {
129
-        $matches[3] = self::removeTrailingNewline($matches[3]);
130
-
131
-        if (preg_match_all(self::$regex, self::$childSource, $override) && in_array($matches[2], $override[2])) {
132
-            $key = array_search($matches[2], $override[2]);
133
-            $override = self::removeTrailingNewline($override[3][$key]);
134
-
135
-            $l = stripslashes(self::$l);
136
-            $r = stripslashes(self::$r);
137
-
138
-            if (self::$lastReplacement) {
139
-                return preg_replace('/'.self::$l.'\$dwoo\.parent'.self::$r.'/is', $matches[3], $override);
140
-            }
141
-
142
-            return $l.'block '.$matches[1].$matches[2].$matches[1].$r.preg_replace('/'.self::$l.'\$dwoo\.parent'.self::$r.'/is', $matches[3], $override).$l.'/block'.$r;
143
-        }
144
-
145
-        if (preg_match(self::$regex, $matches[3])) {
146
-            return preg_replace_callback(self::$regex, array('Dwoo_Plugin_extends', 'replaceBlock'), $matches[3]);
147
-        }
148
-
149
-        if (self::$lastReplacement) {
150
-            return $matches[3];
151
-        }
152
-
153
-        return  $matches[0];
154
-    }
155
-
156
-    protected static function removeTrailingNewline($text)
157
-    {
158
-        return substr($text, -1) === "\n"
159
-                ? substr($text, -2, 1) === "\r"
160
-                    ? substr($text, 0, -2)
161
-                    : substr($text, 0, -1)
162
-                : $text;
163
-    }
50
+		if ($compiler->getLooseOpeningHandling()) {
51
+			self::$l .= '\s*';
52
+			self::$r = '\s*'.self::$r;
53
+		}
54
+		$inheritanceTree = array(array('source' => $compiler->getTemplateSource()));
55
+		$curPath = dirname($compiler->getDwoo()->getTemplate()->getResourceIdentifier()).DIRECTORY_SEPARATOR;
56
+		$curTpl = $compiler->getDwoo()->getTemplate();
57
+
58
+		while (!empty($file)) {
59
+			if ($file === '""' || $file === "''" || (substr($file, 0, 1) !== '"' && substr($file, 0, 1) !== '\'')) {
60
+				throw new Dwoo_Compilation_Exception($compiler, 'Extends : The file name must be a non-empty string');
61
+			}
62
+
63
+			if (preg_match('#^["\']([a-z]{2,}):(.*?)["\']$#i', $file, $m)) {
64
+				// resource:identifier given, extract them
65
+				$resource = $m[1];
66
+				$identifier = $m[2];
67
+			} else {
68
+				// get the current template's resource
69
+				$resource = $curTpl->getResourceName();
70
+				$identifier = substr($file, 1, -1);
71
+			}
72
+
73
+			try {
74
+				$parent = $compiler->getDwoo()->templateFactory($resource, $identifier, null, null, null, $curTpl);
75
+			} catch (Dwoo_Security_Exception $e) {
76
+				throw new Dwoo_Compilation_Exception($compiler, 'Extends : Security restriction : '.$e->getMessage());
77
+			} catch (Dwoo_Exception $e) {
78
+				throw new Dwoo_Compilation_Exception($compiler, 'Extends : '.$e->getMessage());
79
+			}
80
+
81
+			if ($parent === null) {
82
+				throw new Dwoo_Compilation_Exception($compiler, 'Extends : Resource "'.$resource.':'.$identifier.'" not found.');
83
+			} elseif ($parent === false) {
84
+				throw new Dwoo_Compilation_Exception($compiler, 'Extends : Resource "'.$resource.'" does not support extends.');
85
+			}
86
+
87
+			$curTpl = $parent;
88
+			$newParent = array('source' => $parent->getSource(), 'resource' => $resource, 'identifier' => $parent->getResourceIdentifier(), 'uid' => $parent->getUid());
89
+			if (array_search($newParent, $inheritanceTree, true) !== false) {
90
+				throw new Dwoo_Compilation_Exception($compiler, 'Extends : Recursive template inheritance detected');
91
+			}
92
+			$inheritanceTree[] = $newParent;
93
+
94
+			if (preg_match('/^'.self::$l.'extends(?:\(?\s*|\s+)(?:file=)?\s*((["\']).+?\2|\S+?)\s*\)?\s*?'.self::$r.'/i', $parent->getSource(), $match)) {
95
+				$curPath = dirname($identifier).DIRECTORY_SEPARATOR;
96
+				if (isset($match[2]) && $match[2] == '"') {
97
+					$file = '"'.str_replace('"', '\\"', substr($match[1], 1, -1)).'"';
98
+				} elseif (isset($match[2]) && $match[2] == "'") {
99
+					$file = '"'.substr($match[1], 1, -1).'"';
100
+				} else {
101
+					$file = '"'.$match[1].'"';
102
+				}
103
+			} else {
104
+				$file = false;
105
+			}
106
+		}
107
+
108
+		while (true) {
109
+			$parent = array_pop($inheritanceTree);
110
+			$child = end($inheritanceTree);
111
+			self::$childSource = $child['source'];
112
+			self::$lastReplacement = count($inheritanceTree) === 1;
113
+			if (!isset($newSource)) {
114
+				$newSource = $parent['source'];
115
+			}
116
+			$newSource = preg_replace_callback(self::$regex, array('Dwoo_Plugin_extends', 'replaceBlock'), $newSource);
117
+			$newSource = $l.'do extendsCheck('.var_export($parent['resource'].':'.$parent['identifier'], true).')'.$r.$newSource;
118
+
119
+			if (self::$lastReplacement) {
120
+				break;
121
+			}
122
+		}
123
+		$compiler->setTemplateSource($newSource);
124
+		$compiler->recompile();
125
+	}
126
+
127
+	protected static function replaceBlock(array $matches)
128
+	{
129
+		$matches[3] = self::removeTrailingNewline($matches[3]);
130
+
131
+		if (preg_match_all(self::$regex, self::$childSource, $override) && in_array($matches[2], $override[2])) {
132
+			$key = array_search($matches[2], $override[2]);
133
+			$override = self::removeTrailingNewline($override[3][$key]);
134
+
135
+			$l = stripslashes(self::$l);
136
+			$r = stripslashes(self::$r);
137
+
138
+			if (self::$lastReplacement) {
139
+				return preg_replace('/'.self::$l.'\$dwoo\.parent'.self::$r.'/is', $matches[3], $override);
140
+			}
141
+
142
+			return $l.'block '.$matches[1].$matches[2].$matches[1].$r.preg_replace('/'.self::$l.'\$dwoo\.parent'.self::$r.'/is', $matches[3], $override).$l.'/block'.$r;
143
+		}
144
+
145
+		if (preg_match(self::$regex, $matches[3])) {
146
+			return preg_replace_callback(self::$regex, array('Dwoo_Plugin_extends', 'replaceBlock'), $matches[3]);
147
+		}
148
+
149
+		if (self::$lastReplacement) {
150
+			return $matches[3];
151
+		}
152
+
153
+		return  $matches[0];
154
+	}
155
+
156
+	protected static function removeTrailingNewline($text)
157
+	{
158
+		return substr($text, -1) === "\n"
159
+				? substr($text, -2, 1) === "\r"
160
+					? substr($text, 0, -2)
161
+					: substr($text, 0, -1)
162
+				: $text;
163
+	}
164 164
 }
Please login to merge, or discard this patch.
lib/plugins/builtin/functions/count_characters.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -22,9 +22,9 @@
 block discarded – undo
22 22
  */
23 23
 function Dwoo_Plugin_count_characters_compile(Dwoo_Compiler $compiler, $value, $count_spaces = false)
24 24
 {
25
-    if ($count_spaces === 'false') {
26
-        return 'preg_match_all(\'#[^\s\pZ]#u\', '.$value.', $tmp)';
27
-    } else {
28
-        return 'mb_strlen('.$value.', $this->charset)';
29
-    }
25
+	if ($count_spaces === 'false') {
26
+		return 'preg_match_all(\'#[^\s\pZ]#u\', '.$value.', $tmp)';
27
+	} else {
28
+		return 'mb_strlen('.$value.', $this->charset)';
29
+	}
30 30
 }
Please login to merge, or discard this patch.
lib/plugins/builtin/functions/nl2br.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,5 +21,5 @@
 block discarded – undo
21 21
  */
22 22
 function Dwoo_Plugin_nl2br_compile(Dwoo_Compiler $compiler, $value)
23 23
 {
24
-    return 'nl2br((string) '.$value.')';
24
+	return 'nl2br((string) '.$value.')';
25 25
 }
Please login to merge, or discard this patch.
lib/plugins/builtin/functions/indent.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,5 +23,5 @@
 block discarded – undo
23 23
  */
24 24
 function Dwoo_Plugin_indent_compile(Dwoo_Compiler $compiler, $value, $by = 4, $char = ' ')
25 25
 {
26
-    return "preg_replace('#^#m', '".str_repeat(substr($char, 1, -1), trim($by, '"\''))."', $value)";
26
+	return "preg_replace('#^#m', '".str_repeat(substr($char, 1, -1), trim($by, '"\''))."', $value)";
27 27
 }
Please login to merge, or discard this patch.
lib/plugins/builtin/functions/cycle.php 1 patch
Indentation   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -27,45 +27,45 @@
 block discarded – undo
27 27
  */
28 28
 class Dwoo_Plugin_cycle extends Dwoo_Plugin
29 29
 {
30
-    protected $cycles = array();
30
+	protected $cycles = array();
31 31
 
32
-    public function process($name = 'default', $values = null, $print = true, $advance = true, $delimiter = ',', $assign = null, $reset = false)
33
-    {
34
-        if ($values !== null) {
35
-            if (is_string($values)) {
36
-                $values = explode($delimiter, $values);
37
-            }
32
+	public function process($name = 'default', $values = null, $print = true, $advance = true, $delimiter = ',', $assign = null, $reset = false)
33
+	{
34
+		if ($values !== null) {
35
+			if (is_string($values)) {
36
+				$values = explode($delimiter, $values);
37
+			}
38 38
 
39
-            if (!isset($this->cycles[$name]) || $this->cycles[$name]['values'] !== $values) {
40
-                $this->cycles[$name]['index'] = 0;
41
-            }
39
+			if (!isset($this->cycles[$name]) || $this->cycles[$name]['values'] !== $values) {
40
+				$this->cycles[$name]['index'] = 0;
41
+			}
42 42
 
43
-            $this->cycles[$name]['values'] = array_values($values);
44
-        } elseif (isset($this->cycles[$name])) {
45
-            $values = $this->cycles[$name]['values'];
46
-        }
43
+			$this->cycles[$name]['values'] = array_values($values);
44
+		} elseif (isset($this->cycles[$name])) {
45
+			$values = $this->cycles[$name]['values'];
46
+		}
47 47
 
48
-        if ($reset) {
49
-            $this->cycles[$name]['index'] = 0;
50
-        }
48
+		if ($reset) {
49
+			$this->cycles[$name]['index'] = 0;
50
+		}
51 51
 
52
-        if ($print) {
53
-            $out = $values[$this->cycles[$name]['index']];
54
-        } else {
55
-            $out = null;
56
-        }
52
+		if ($print) {
53
+			$out = $values[$this->cycles[$name]['index']];
54
+		} else {
55
+			$out = null;
56
+		}
57 57
 
58
-        if ($advance) {
59
-            if ($this->cycles[$name]['index'] >= count($values) - 1) {
60
-                $this->cycles[$name]['index'] = 0;
61
-            } else {
62
-                ++$this->cycles[$name]['index'];
63
-            }
64
-        }
58
+		if ($advance) {
59
+			if ($this->cycles[$name]['index'] >= count($values) - 1) {
60
+				$this->cycles[$name]['index'] = 0;
61
+			} else {
62
+				++$this->cycles[$name]['index'];
63
+			}
64
+		}
65 65
 
66
-        if ($assign === null) {
67
-            return $out;
68
-        }
69
-        $this->dwoo->assignInScope($out, $assign);
70
-    }
66
+		if ($assign === null) {
67
+			return $out;
68
+		}
69
+		$this->dwoo->assignInScope($out, $assign);
70
+	}
71 71
 }
Please login to merge, or discard this patch.
lib/plugins/builtin/functions/counter.php 1 patch
Indentation   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -26,52 +26,52 @@
 block discarded – undo
26 26
  */
27 27
 class Dwoo_Plugin_counter extends Dwoo_Plugin
28 28
 {
29
-    protected $counters = array();
29
+	protected $counters = array();
30 30
 
31
-    public function process($name = 'default', $start = null, $skip = null, $direction = null, $print = null, $assign = null)
32
-    {
33
-        // init counter
34
-        if (!isset($this->counters[$name])) {
35
-            $this->counters[$name] = array(
36
-                'count' => $start === null ? 1 : (int) $start,
37
-                'skip' => $skip === null ? 1 : (int) $skip,
38
-                'print' => $print === null ? true : (bool) $print,
39
-                'assign' => $assign === null ? null : (string) $assign,
40
-                'direction' => strtolower($direction) === 'down' ? -1 : 1,
41
-            );
42
-        }
43
-        // increment
44
-        else {
45
-            // override setting if present
46
-            if ($skip !== null) {
47
-                $this->counters[$name]['skip'] = (int) $skip;
48
-            }
31
+	public function process($name = 'default', $start = null, $skip = null, $direction = null, $print = null, $assign = null)
32
+	{
33
+		// init counter
34
+		if (!isset($this->counters[$name])) {
35
+			$this->counters[$name] = array(
36
+				'count' => $start === null ? 1 : (int) $start,
37
+				'skip' => $skip === null ? 1 : (int) $skip,
38
+				'print' => $print === null ? true : (bool) $print,
39
+				'assign' => $assign === null ? null : (string) $assign,
40
+				'direction' => strtolower($direction) === 'down' ? -1 : 1,
41
+			);
42
+		}
43
+		// increment
44
+		else {
45
+			// override setting if present
46
+			if ($skip !== null) {
47
+				$this->counters[$name]['skip'] = (int) $skip;
48
+			}
49 49
 
50
-            if ($direction !== null) {
51
-                $this->counters[$name]['direction'] = strtolower($direction) === 'down' ? -1 : 1;
52
-            }
50
+			if ($direction !== null) {
51
+				$this->counters[$name]['direction'] = strtolower($direction) === 'down' ? -1 : 1;
52
+			}
53 53
 
54
-            if ($print !== null) {
55
-                $this->counters[$name]['print'] = (bool) $print;
56
-            }
54
+			if ($print !== null) {
55
+				$this->counters[$name]['print'] = (bool) $print;
56
+			}
57 57
 
58
-            if ($assign !== null) {
59
-                $this->counters[$name]['assign'] = (string) $assign;
60
-            }
58
+			if ($assign !== null) {
59
+				$this->counters[$name]['assign'] = (string) $assign;
60
+			}
61 61
 
62
-            if ($start !== null) {
63
-                $this->counters[$name]['count'] = (int) $start;
64
-            } else {
65
-                $this->counters[$name]['count'] += ($this->counters[$name]['skip'] * $this->counters[$name]['direction']);
66
-            }
67
-        }
62
+			if ($start !== null) {
63
+				$this->counters[$name]['count'] = (int) $start;
64
+			} else {
65
+				$this->counters[$name]['count'] += ($this->counters[$name]['skip'] * $this->counters[$name]['direction']);
66
+			}
67
+		}
68 68
 
69
-        $out = $this->counters[$name]['count'];
69
+		$out = $this->counters[$name]['count'];
70 70
 
71
-        if ($this->counters[$name]['assign'] !== null) {
72
-            $this->dwoo->assignInScope($out, $this->counters[$name]['assign']);
73
-        } elseif ($this->counters[$name]['print'] === true) {
74
-            return $out;
75
-        }
76
-    }
71
+		if ($this->counters[$name]['assign'] !== null) {
72
+			$this->dwoo->assignInScope($out, $this->counters[$name]['assign']);
73
+		} elseif ($this->counters[$name]['print'] === true) {
74
+			return $out;
75
+		}
76
+	}
77 77
 }
Please login to merge, or discard this patch.
lib/plugins/builtin/functions/extendsCheck.php 1 patch
Indentation   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -19,26 +19,26 @@  discard block
 block discarded – undo
19 19
  */
20 20
 function Dwoo_Plugin_extendsCheck_compile(Dwoo_Compiler $compiler, $file)
21 21
 {
22
-    preg_match('#^["\']([a-z]{2,}):(.*?)["\']$#i', $file, $m);
23
-    $resource = $m[1];
24
-    $identifier = $m[2];
22
+	preg_match('#^["\']([a-z]{2,}):(.*?)["\']$#i', $file, $m);
23
+	$resource = $m[1];
24
+	$identifier = $m[2];
25 25
 
26
-    $tpl = $compiler->getDwoo()->templateFactory($resource, $identifier);
26
+	$tpl = $compiler->getDwoo()->templateFactory($resource, $identifier);
27 27
 
28
-    if ($tpl === null) {
29
-        throw new Dwoo_Compilation_Exception($compiler, 'Load Templates : Resource "'.$resource.':'.$identifier.'" not found.');
30
-    } elseif ($tpl === false) {
31
-        throw new Dwoo_Compilation_Exception($compiler, 'Load Templates : Resource "'.$resource.'" does not support includes.');
32
-    }
28
+	if ($tpl === null) {
29
+		throw new Dwoo_Compilation_Exception($compiler, 'Load Templates : Resource "'.$resource.':'.$identifier.'" not found.');
30
+	} elseif ($tpl === false) {
31
+		throw new Dwoo_Compilation_Exception($compiler, 'Load Templates : Resource "'.$resource.'" does not support includes.');
32
+	}
33 33
 
34
-    $out = '\'\';// checking for modification in '.$resource.':'.$identifier."\r\n";
34
+	$out = '\'\';// checking for modification in '.$resource.':'.$identifier."\r\n";
35 35
 
36
-    $modCheck = $tpl->getIsModifiedCode();
36
+	$modCheck = $tpl->getIsModifiedCode();
37 37
 
38
-    if ($modCheck) {
39
-        $out .= 'if (!('.$modCheck.')) { ob_end_clean(); return false; }';
40
-    } else {
41
-        $out .= 'try {
38
+	if ($modCheck) {
39
+		$out .= 'if (!('.$modCheck.')) { ob_end_clean(); return false; }';
40
+	} else {
41
+		$out .= 'try {
42 42
 	$tpl = $this->templateFactory("'.$resource.'", "'.$identifier.'");
43 43
 } catch (Dwoo_Exception $e) {
44 44
 	$this->triggerError(\'Load Templates : Resource <em>'.$resource.'</em> was not added to Dwoo, can not extend <em>'.$identifier.'</em>\', E_USER_WARNING);
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 elseif ($tpl === false)
49 49
 	$this->triggerError(\'Load Templates : Resource "'.$resource.'" does not support extends.\', E_USER_WARNING);
50 50
 if ($tpl->getUid() != "'.$tpl->getUid().'") { ob_end_clean(); return false; }';
51
-    }
51
+	}
52 52
 
53
-    return $out;
53
+	return $out;
54 54
 }
Please login to merge, or discard this patch.
lib/plugins/builtin/functions/wordwrap.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,5 +24,5 @@
 block discarded – undo
24 24
  */
25 25
 function Dwoo_Plugin_wordwrap_compile(Dwoo_Compiler $compiler, $value, $length = 80, $break = "\n", $cut = false)
26 26
 {
27
-    return 'wordwrap('.$value.','.$length.','.$break.','.$cut.')';
27
+	return 'wordwrap('.$value.','.$length.','.$break.','.$cut.')';
28 28
 }
Please login to merge, or discard this patch.