Completed
Branch master (b65d76)
by David
04:29
created
lib/Dwoo/Plugins/Functions/PluginReturnCompile.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -34,10 +34,10 @@
 block discarded – undo
34 34
  */
35 35
 function PluginReturnCompile(Compiler $compiler, array $rest = array())
36 36
 {
37
-    $out = array();
38
-    foreach ($rest as $var => $val) {
39
-        $out[] = '$this->setReturnValue(' . var_export($var, true) . ', ' . $val . ')';
40
-    }
37
+	$out = array();
38
+	foreach ($rest as $var => $val) {
39
+		$out[] = '$this->setReturnValue(' . var_export($var, true) . ', ' . $val . ')';
40
+	}
41 41
 
42
-    return '(' . implode('.', $out) . ')';
42
+	return '(' . implode('.', $out) . ')';
43 43
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -36,8 +36,8 @@
 block discarded – undo
36 36
 {
37 37
     $out = array();
38 38
     foreach ($rest as $var => $val) {
39
-        $out[] = '$this->setReturnValue(' . var_export($var, true) . ', ' . $val . ')';
39
+        $out[] = '$this->setReturnValue('.var_export($var, true).', '.$val.')';
40 40
     }
41 41
 
42
-    return '(' . implode('.', $out) . ')';
42
+    return '('.implode('.', $out).')';
43 43
 }
Please login to merge, or discard this patch.
lib/Dwoo/Plugins/Functions/PluginNl2brCompile.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,5 +28,5 @@
 block discarded – undo
28 28
  */
29 29
 function PluginNl2brCompile(Compiler $compiler, $value)
30 30
 {
31
-    return 'nl2br((string) ' . $value . ')';
31
+	return 'nl2br((string) ' . $value . ')';
32 32
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,5 +28,5 @@
 block discarded – undo
28 28
  */
29 29
 function PluginNl2brCompile(Compiler $compiler, $value)
30 30
 {
31
-    return 'nl2br((string) ' . $value . ')';
31
+    return 'nl2br((string) '.$value.')';
32 32
 }
Please login to merge, or discard this patch.
lib/Dwoo/Plugins/Functions/PluginStripTagsCompile.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -36,9 +36,9 @@
 block discarded – undo
36 36
  */
37 37
 function PluginStripTagsCompile(Compiler $compiler, $value, $addspace = true)
38 38
 {
39
-    if ($addspace === 'true') {
40
-        return "preg_replace('#<[^>]*>#', ' ', $value)";
41
-    } else {
42
-        return "strip_tags($value)";
43
-    }
39
+	if ($addspace === 'true') {
40
+		return "preg_replace('#<[^>]*>#', ' ', $value)";
41
+	} else {
42
+		return "strip_tags($value)";
43
+	}
44 44
 }
Please login to merge, or discard this patch.
lib/Dwoo/Plugins/Functions/PluginReverse.php 2 patches
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -29,17 +29,17 @@
 block discarded – undo
29 29
  */
30 30
 function PluginReverse(Core $dwoo, $value, $preserve_keys = false)
31 31
 {
32
-    if (is_array($value)) {
33
-        return array_reverse($value, $preserve_keys);
34
-    } elseif (($charset = $dwoo->getCharset()) === 'iso-8859-1') {
35
-        return strrev((string)$value);
36
-    } else {
37
-        $strlen = mb_strlen($value);
38
-        $out    = '';
39
-        while ($strlen --) {
40
-            $out .= mb_substr($value, $strlen, 1, $charset);
41
-        }
32
+	if (is_array($value)) {
33
+		return array_reverse($value, $preserve_keys);
34
+	} elseif (($charset = $dwoo->getCharset()) === 'iso-8859-1') {
35
+		return strrev((string)$value);
36
+	} else {
37
+		$strlen = mb_strlen($value);
38
+		$out    = '';
39
+		while ($strlen --) {
40
+			$out .= mb_substr($value, $strlen, 1, $charset);
41
+		}
42 42
 
43
-        return $out;
44
-    }
43
+		return $out;
44
+	}
45 45
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -32,11 +32,11 @@
 block discarded – undo
32 32
     if (is_array($value)) {
33 33
         return array_reverse($value, $preserve_keys);
34 34
     } elseif (($charset = $dwoo->getCharset()) === 'iso-8859-1') {
35
-        return strrev((string)$value);
35
+        return strrev((string) $value);
36 36
     } else {
37 37
         $strlen = mb_strlen($value);
38 38
         $out    = '';
39
-        while ($strlen --) {
39
+        while ($strlen--) {
40 40
             $out .= mb_substr($value, $strlen, 1, $charset);
41 41
         }
42 42
 
Please login to merge, or discard this patch.
lib/Dwoo/Plugins/Functions/PluginCatCompile.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,5 +28,5 @@
 block discarded – undo
28 28
  */
29 29
 function PluginCatCompile(Compiler $compiler, $value, array $rest)
30 30
 {
31
-    return '(' . $value . ').(' . implode(').(', $rest) . ')';
31
+	return '(' . $value . ').(' . implode(').(', $rest) . ')';
32 32
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,5 +28,5 @@
 block discarded – undo
28 28
  */
29 29
 function PluginCatCompile(Compiler $compiler, $value, array $rest)
30 30
 {
31
-    return '(' . $value . ').(' . implode(').(', $rest) . ')';
31
+    return '('.$value.').('.implode(').(', $rest).')';
32 32
 }
Please login to merge, or discard this patch.
lib/Dwoo/Plugins/Functions/PluginCycle.php 2 patches
Indentation   +45 added lines, -45 removed lines patch added patch discarded remove patch
@@ -34,56 +34,56 @@
 block discarded – undo
34 34
  */
35 35
 class PluginCycle extends Plugin
36 36
 {
37
-    protected $cycles = array();
37
+	protected $cycles = array();
38 38
 
39
-    /**
40
-     * @param string $name
41
-     * @param null   $values
42
-     * @param bool   $print
43
-     * @param bool   $advance
44
-     * @param string $delimiter
45
-     * @param null   $assign
46
-     * @param bool   $reset
47
-     *
48
-     * @return null
49
-     */
50
-    public function process($name = 'default', $values = null, $print = true, $advance = true, $delimiter = ',', $assign = null, $reset = false)
51
-    {
52
-        if ($values !== null) {
53
-            if (is_string($values)) {
54
-                $values = explode($delimiter, $values);
55
-            }
39
+	/**
40
+	 * @param string $name
41
+	 * @param null   $values
42
+	 * @param bool   $print
43
+	 * @param bool   $advance
44
+	 * @param string $delimiter
45
+	 * @param null   $assign
46
+	 * @param bool   $reset
47
+	 *
48
+	 * @return null
49
+	 */
50
+	public function process($name = 'default', $values = null, $print = true, $advance = true, $delimiter = ',', $assign = null, $reset = false)
51
+	{
52
+		if ($values !== null) {
53
+			if (is_string($values)) {
54
+				$values = explode($delimiter, $values);
55
+			}
56 56
 
57
-            if (!isset($this->cycles[$name]) || $this->cycles[$name]['values'] !== $values) {
58
-                $this->cycles[$name]['index'] = 0;
59
-            }
57
+			if (!isset($this->cycles[$name]) || $this->cycles[$name]['values'] !== $values) {
58
+				$this->cycles[$name]['index'] = 0;
59
+			}
60 60
 
61
-            $this->cycles[$name]['values'] = array_values($values);
62
-        } elseif (isset($this->cycles[$name])) {
63
-            $values = $this->cycles[$name]['values'];
64
-        }
61
+			$this->cycles[$name]['values'] = array_values($values);
62
+		} elseif (isset($this->cycles[$name])) {
63
+			$values = $this->cycles[$name]['values'];
64
+		}
65 65
 
66
-        if ($reset) {
67
-            $this->cycles[$name]['index'] = 0;
68
-        }
66
+		if ($reset) {
67
+			$this->cycles[$name]['index'] = 0;
68
+		}
69 69
 
70
-        if ($print) {
71
-            $out = $values[$this->cycles[$name]['index']];
72
-        } else {
73
-            $out = null;
74
-        }
70
+		if ($print) {
71
+			$out = $values[$this->cycles[$name]['index']];
72
+		} else {
73
+			$out = null;
74
+		}
75 75
 
76
-        if ($advance) {
77
-            if ($this->cycles[$name]['index'] >= count($values) - 1) {
78
-                $this->cycles[$name]['index'] = 0;
79
-            } else {
80
-                ++ $this->cycles[$name]['index'];
81
-            }
82
-        }
76
+		if ($advance) {
77
+			if ($this->cycles[$name]['index'] >= count($values) - 1) {
78
+				$this->cycles[$name]['index'] = 0;
79
+			} else {
80
+				++ $this->cycles[$name]['index'];
81
+			}
82
+		}
83 83
 
84
-        if ($assign === null) {
85
-            return $out;
86
-        }
87
-        $this->core->assignInScope($out, $assign);
88
-    }
84
+		if ($assign === null) {
85
+			return $out;
86
+		}
87
+		$this->core->assignInScope($out, $assign);
88
+	}
89 89
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -74,10 +74,10 @@
 block discarded – undo
74 74
         }
75 75
 
76 76
         if ($advance) {
77
-            if ($this->cycles[$name]['index'] >= count($values) - 1) {
77
+            if ($this->cycles[$name]['index'] >= count($values)-1) {
78 78
                 $this->cycles[$name]['index'] = 0;
79 79
             } else {
80
-                ++ $this->cycles[$name]['index'];
80
+                ++$this->cycles[$name]['index'];
81 81
             }
82 82
         }
83 83
 
Please login to merge, or discard this patch.
lib/Dwoo/Plugins/Functions/PluginExtendsCheckCompile.php 2 patches
Indentation   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -26,26 +26,26 @@  discard block
 block discarded – undo
26 26
  */
27 27
 function PluginExtendsCheckCompile(Compiler $compiler, $file)
28 28
 {
29
-    preg_match('#^["\']([a-z]{2,}):(.*?)["\']$#i', $file, $m);
30
-    $resource   = $m[1];
31
-    $identifier = $m[2];
29
+	preg_match('#^["\']([a-z]{2,}):(.*?)["\']$#i', $file, $m);
30
+	$resource   = $m[1];
31
+	$identifier = $m[2];
32 32
 
33
-    $tpl = $compiler->getDwoo()->templateFactory($resource, $identifier);
33
+	$tpl = $compiler->getDwoo()->templateFactory($resource, $identifier);
34 34
 
35
-    if ($tpl === null) {
36
-        throw new CompilationException($compiler, 'Load Templates : Resource "' . $resource . ':' . $identifier . '" not found.');
37
-    } elseif ($tpl === false) {
38
-        throw new CompilationException($compiler, 'Load Templates : Resource "' . $resource . '" does not support includes.');
39
-    }
35
+	if ($tpl === null) {
36
+		throw new CompilationException($compiler, 'Load Templates : Resource "' . $resource . ':' . $identifier . '" not found.');
37
+	} elseif ($tpl === false) {
38
+		throw new CompilationException($compiler, 'Load Templates : Resource "' . $resource . '" does not support includes.');
39
+	}
40 40
 
41
-    $out = '\'\';// checking for modification in ' . $resource . ':' . $identifier . "\r\n";
41
+	$out = '\'\';// checking for modification in ' . $resource . ':' . $identifier . "\r\n";
42 42
 
43
-    $modCheck = $tpl->getIsModifiedCode();
43
+	$modCheck = $tpl->getIsModifiedCode();
44 44
 
45
-    if ($modCheck) {
46
-        $out .= 'if (!(' . $modCheck . ')) { ob_end_clean(); return false; }';
47
-    } else {
48
-        $out .= 'try {
45
+	if ($modCheck) {
46
+		$out .= 'if (!(' . $modCheck . ')) { ob_end_clean(); return false; }';
47
+	} else {
48
+		$out .= 'try {
49 49
 	$tpl = $this->templateFactory("' . $resource . '", "' . $identifier . '");
50 50
 } catch (Dwoo\Exception $e) {
51 51
 	$this->triggerError(\'Load Templates : Resource <em>' . $resource . '</em> was not added to Dwoo, can not extend <em>' . $identifier . '</em>\', E_USER_WARNING);
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 elseif ($tpl === false)
56 56
 	$this->triggerError(\'Load Templates : Resource "' . $resource . '" does not support extends.\', E_USER_WARNING);
57 57
 if ($tpl->getUid() != "' . $tpl->getUid() . '") { ob_end_clean(); return false; }';
58
-    }
58
+	}
59 59
 
60
-    return $out;
60
+	return $out;
61 61
 }
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -33,28 +33,28 @@
 block discarded – undo
33 33
     $tpl = $compiler->getDwoo()->templateFactory($resource, $identifier);
34 34
 
35 35
     if ($tpl === null) {
36
-        throw new CompilationException($compiler, 'Load Templates : Resource "' . $resource . ':' . $identifier . '" not found.');
36
+        throw new CompilationException($compiler, 'Load Templates : Resource "'.$resource.':'.$identifier.'" not found.');
37 37
     } elseif ($tpl === false) {
38
-        throw new CompilationException($compiler, 'Load Templates : Resource "' . $resource . '" does not support includes.');
38
+        throw new CompilationException($compiler, 'Load Templates : Resource "'.$resource.'" does not support includes.');
39 39
     }
40 40
 
41
-    $out = '\'\';// checking for modification in ' . $resource . ':' . $identifier . "\r\n";
41
+    $out = '\'\';// checking for modification in '.$resource.':'.$identifier."\r\n";
42 42
 
43 43
     $modCheck = $tpl->getIsModifiedCode();
44 44
 
45 45
     if ($modCheck) {
46
-        $out .= 'if (!(' . $modCheck . ')) { ob_end_clean(); return false; }';
46
+        $out .= 'if (!('.$modCheck.')) { ob_end_clean(); return false; }';
47 47
     } else {
48 48
         $out .= 'try {
49
-	$tpl = $this->templateFactory("' . $resource . '", "' . $identifier . '");
49
+	$tpl = $this->templateFactory("' . $resource.'", "'.$identifier.'");
50 50
 } catch (Dwoo\Exception $e) {
51
-	$this->triggerError(\'Load Templates : Resource <em>' . $resource . '</em> was not added to Dwoo, can not extend <em>' . $identifier . '</em>\', E_USER_WARNING);
51
+	$this->triggerError(\'Load Templates : Resource <em>' . $resource.'</em> was not added to Dwoo, can not extend <em>'.$identifier.'</em>\', E_USER_WARNING);
52 52
 }
53 53
 if ($tpl === null)
54
-	$this->triggerError(\'Load Templates : Resource "' . $resource . ':' . $identifier . '" was not found.\', E_USER_WARNING);
54
+	$this->triggerError(\'Load Templates : Resource "' . $resource.':'.$identifier.'" was not found.\', E_USER_WARNING);
55 55
 elseif ($tpl === false)
56
-	$this->triggerError(\'Load Templates : Resource "' . $resource . '" does not support extends.\', E_USER_WARNING);
57
-if ($tpl->getUid() != "' . $tpl->getUid() . '") { ob_end_clean(); return false; }';
56
+	$this->triggerError(\'Load Templates : Resource "' . $resource.'" does not support extends.\', E_USER_WARNING);
57
+if ($tpl->getUid() != "' . $tpl->getUid().'") { ob_end_clean(); return false; }';
58 58
     }
59 59
 
60 60
     return $out;
Please login to merge, or discard this patch.
lib/Dwoo/Plugins/Functions/PluginWhitespaceCompile.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,5 +37,5 @@
 block discarded – undo
37 37
  */
38 38
 function PluginWhitespaceCompile(Compiler $compiler, $value, $with = ' ')
39 39
 {
40
-    return "preg_replace('#\s+#'.(strcasecmp(\$this->charset, 'utf-8')===0?'u':''), $with, $value)";
40
+	return "preg_replace('#\s+#'.(strcasecmp(\$this->charset, 'utf-8')===0?'u':''), $with, $value)";
41 41
 }
Please login to merge, or discard this patch.
lib/Dwoo/Plugins/Functions/PluginWordwrapCompile.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,5 +31,5 @@
 block discarded – undo
31 31
  */
32 32
 function PluginWordwrapCompile(Compiler $compiler, $value, $length = 80, $break = "\n", $cut = false)
33 33
 {
34
-    return 'wordwrap(' . $value . ',' . $length . ',' . $break . ',' . $cut . ')';
34
+	return 'wordwrap(' . $value . ',' . $length . ',' . $break . ',' . $cut . ')';
35 35
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,5 +31,5 @@
 block discarded – undo
31 31
  */
32 32
 function PluginWordwrapCompile(Compiler $compiler, $value, $length = 80, $break = "\n", $cut = false)
33 33
 {
34
-    return 'wordwrap(' . $value . ',' . $length . ',' . $break . ',' . $cut . ')';
34
+    return 'wordwrap('.$value.','.$length.','.$break.','.$cut.')';
35 35
 }
Please login to merge, or discard this patch.