Completed
Push — master ( 3dcfcd...bf2930 )
by David
30s
created
lib/Dwoo/Plugins/Functions/PluginLoadTemplatesCompile.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -48,9 +48,9 @@  discard block
 block discarded – undo
48 48
     $tpl = $compiler->getDwoo()->templateFactory($resource, $identifier);
49 49
 
50 50
     if ($tpl === null) {
51
-        throw new CompilationException($compiler, 'Load Templates : Resource "' . $resource . ':' . $identifier . '" not found.');
51
+        throw new CompilationException($compiler, 'Load Templates : Resource "'.$resource.':'.$identifier.'" not found.');
52 52
     } elseif ($tpl === false) {
53
-        throw new CompilationException($compiler, 'Load Templates : Resource "' . $resource . '" does not support includes.');
53
+        throw new CompilationException($compiler, 'Load Templates : Resource "'.$resource.'" does not support includes.');
54 54
     }
55 55
 
56 56
     $cmp = clone $compiler;
@@ -62,23 +62,23 @@  discard block
 block discarded – undo
62 62
         $compiler->addUsedPlugin($plugin, $type);
63 63
     }
64 64
 
65
-    $out = '\'\';// checking for modification in ' . $resource . ':' . $identifier . "\r\n";
65
+    $out = '\'\';// checking for modification in '.$resource.':'.$identifier."\r\n";
66 66
 
67 67
     $modCheck = $tpl->getIsModifiedCode();
68 68
 
69 69
     if ($modCheck) {
70
-        $out .= 'if (!(' . $modCheck . ')) { ob_end_clean(); return false; }';
70
+        $out .= 'if (!('.$modCheck.')) { ob_end_clean(); return false; }';
71 71
     } else {
72 72
         $out .= 'try {
73
-	$tpl = $this->templateFactory("' . $resource . '", "' . $identifier . '");
73
+	$tpl = $this->templateFactory("' . $resource.'", "'.$identifier.'");
74 74
 } catch (Dwoo\Exception $e) {
75
-	$this->triggerError(\'Load Templates : Resource <em>' . $resource . '</em> was not added to Dwoo, can not extend <em>' . $identifier . '</em>\', E_USER_WARNING);
75
+	$this->triggerError(\'Load Templates : Resource <em>' . $resource.'</em> was not added to Dwoo, can not extend <em>'.$identifier.'</em>\', E_USER_WARNING);
76 76
 }
77 77
 if ($tpl === null)
78
-	$this->triggerError(\'Load Templates : Resource "' . $resource . ':' . $identifier . '" was not found.\', E_USER_WARNING);
78
+	$this->triggerError(\'Load Templates : Resource "' . $resource.':'.$identifier.'" was not found.\', E_USER_WARNING);
79 79
 elseif ($tpl === false)
80
-	$this->triggerError(\'Load Templates : Resource "' . $resource . '" does not support extends.\', E_USER_WARNING);
81
-if ($tpl->getUid() != "' . $tpl->getUid() . '") { ob_end_clean(); return false; }';
80
+	$this->triggerError(\'Load Templates : Resource "' . $resource.'" does not support extends.\', E_USER_WARNING);
81
+if ($tpl->getUid() != "' . $tpl->getUid().'") { ob_end_clean(); return false; }';
82 82
     }
83 83
 
84 84
     return $out;
Please login to merge, or discard this patch.
lib/Dwoo/Plugins/Functions/PluginStringFormatCompile.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,5 +29,5 @@
 block discarded – undo
29 29
  */
30 30
 function PluginStringFormatCompile(Compiler $compiler, $value, $format)
31 31
 {
32
-    return 'sprintf(' . $format . ',' . $value . ')';
32
+    return 'sprintf('.$format.','.$value.')';
33 33
 }
Please login to merge, or discard this patch.
lib/Dwoo/Plugins/Functions/PluginDefaultCompile.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,5 +29,5 @@
 block discarded – undo
29 29
  */
30 30
 function PluginDefaultCompile(Compiler $compiler, $value, $default = '')
31 31
 {
32
-    return '(($tmp = ' . $value . ')===null||$tmp===\'\' ? ' . $default . ' : $tmp)';
32
+    return '(($tmp = '.$value.')===null||$tmp===\'\' ? '.$default.' : $tmp)';
33 33
 }
Please login to merge, or discard this patch.
lib/Dwoo/Plugins/Functions/PluginAssignCompile.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,5 +29,5 @@
 block discarded – undo
29 29
  */
30 30
 function PluginAssignCompile(Compiler $compiler, $value, $var)
31 31
 {
32
-    return '$this->assignInScope(' . $value . ', ' . $var . ')';
32
+    return '$this->assignInScope('.$value.', '.$var.')';
33 33
 }
Please login to merge, or discard this patch.
lib/Dwoo/Plugins/Functions/PluginUpperCompile.php 1 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 PluginUpperCompile(Compiler $compiler, $value)
30 30
 {
31
-    return 'mb_strtoupper((string) ' . $value . ', $this->charset)';
31
+    return 'mb_strtoupper((string) '.$value.', $this->charset)';
32 32
 }
Please login to merge, or discard this patch.
lib/Dwoo/Plugins/Functions/PluginDump.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 
63 63
         $out .= $this->export($var, $scope);
64 64
 
65
-        return $out . '</div></div>';
65
+        return $out.'</div></div>';
66 66
     }
67 67
 
68 68
     protected function export($var, $scope)
@@ -70,16 +70,16 @@  discard block
 block discarded – undo
70 70
         $out = '';
71 71
         foreach ($var as $i => $v) {
72 72
             if (is_array($v) || (is_object($v) && $v instanceof Iterator)) {
73
-                $out .= $i . ' (' . (is_array($v) ? 'array' : 'object: ' . get_class($v)) . ')';
73
+                $out .= $i.' ('.(is_array($v) ? 'array' : 'object: '.get_class($v)).')';
74 74
                 if ($v === $scope) {
75
-                    $out .= ' (current scope):<div style="background:#ccc;padding-left:20px;">' . $this->export($v, $scope) . '</div>';
75
+                    $out .= ' (current scope):<div style="background:#ccc;padding-left:20px;">'.$this->export($v, $scope).'</div>';
76 76
                 } else {
77
-                    $out .= ':<div style="padding-left:20px;">' . $this->export($v, $scope) . '</div>';
77
+                    $out .= ':<div style="padding-left:20px;">'.$this->export($v, $scope).'</div>';
78 78
                 }
79 79
             } elseif (is_object($v)) {
80
-                $out .= $this->exportObj($i . ' (object: ' . get_class($v) . '):', $v);
80
+                $out .= $this->exportObj($i.' (object: '.get_class($v).'):', $v);
81 81
             } else {
82
-                $out .= $this->exportVar($i . ' = ', $v);
82
+                $out .= $this->exportVar($i.' = ', $v);
83 83
             }
84 84
         }
85 85
 
@@ -89,27 +89,27 @@  discard block
 block discarded – undo
89 89
     protected function exportVar($i, $v)
90 90
     {
91 91
         if (is_string($v) || is_bool($v) || is_numeric($v)) {
92
-            return $i . htmlentities(var_export($v, true)) . '<br />';
92
+            return $i.htmlentities(var_export($v, true)).'<br />';
93 93
         } elseif (is_null($v)) {
94
-            return $i . 'null<br />';
94
+            return $i.'null<br />';
95 95
         } elseif (is_resource($v)) {
96
-            return $i . 'resource(' . get_resource_type($v) . ')<br />';
96
+            return $i.'resource('.get_resource_type($v).')<br />';
97 97
         } else {
98
-            return $i . htmlentities(var_export($v, true)) . '<br />';
98
+            return $i.htmlentities(var_export($v, true)).'<br />';
99 99
         }
100 100
     }
101 101
 
102 102
     protected function exportObj($i, $obj)
103 103
     {
104 104
         if (array_search($obj, $this->outputObjects, true) !== false) {
105
-            return $i . ' [recursion, skipped]<br />';
105
+            return $i.' [recursion, skipped]<br />';
106 106
         }
107 107
 
108 108
         $this->outputObjects[] = $obj;
109 109
 
110
-        $list = (array)$obj;
110
+        $list = (array) $obj;
111 111
 
112
-        $protectedLength = strlen(get_class($obj)) + 2;
112
+        $protectedLength = strlen(get_class($obj))+2;
113 113
 
114 114
         $out = array();
115 115
 
@@ -127,10 +127,10 @@  discard block
 block discarded – undo
127 127
 
128 128
                 $params = array();
129 129
                 foreach ($method->getParameters() as $param) {
130
-                    $params[] = ($param->isPassedByReference() ? '&' : '') . '$' . $param->getName() . ($param->isOptional() ? ' = ' . var_export($param->getDefaultValue(), true) : '');
130
+                    $params[] = ($param->isPassedByReference() ? '&' : '').'$'.$param->getName().($param->isOptional() ? ' = '.var_export($param->getDefaultValue(), true) : '');
131 131
                 }
132 132
 
133
-                $out['method'] .= '(method) ' . $method->getName() . '(' . implode(', ', $params) . ')<br />';
133
+                $out['method'] .= '(method) '.$method->getName().'('.implode(', ', $params).')<br />';
134 134
             }
135 135
         }
136 136
 
@@ -149,19 +149,19 @@  discard block
 block discarded – undo
149 149
                 $out[$key] = '';
150 150
             }
151 151
 
152
-            $out[$key] .= '(' . $key . ') ';
152
+            $out[$key] .= '('.$key.') ';
153 153
 
154 154
             if (is_array($attributeValue)) {
155
-                $out[$key] .= $attributeName . ' (array):<br />
156
-							<div style="padding-left:20px;">' . $this->export($attributeValue, false) . '</div>';
155
+                $out[$key] .= $attributeName.' (array):<br />
156
+							<div style="padding-left:20px;">' . $this->export($attributeValue, false).'</div>';
157 157
             } elseif (is_object($attributeValue)) {
158
-                $out[$key] .= $this->exportObj($attributeName . ' (object: ' . get_class($attributeValue) . '):', $attributeValue);
158
+                $out[$key] .= $this->exportObj($attributeName.' (object: '.get_class($attributeValue).'):', $attributeValue);
159 159
             } else {
160
-                $out[$key] .= $this->exportVar($attributeName . ' = ', $attributeValue);
160
+                $out[$key] .= $this->exportVar($attributeName.' = ', $attributeValue);
161 161
             }
162 162
         }
163 163
 
164
-        $return = $i . '<br /><div style="padding-left:20px;">';
164
+        $return = $i.'<br /><div style="padding-left:20px;">';
165 165
 
166 166
         if (!empty($out['method'])) {
167 167
             $return .= $out['method'];
@@ -179,6 +179,6 @@  discard block
 block discarded – undo
179 179
             $return .= $out['private'];
180 180
         }
181 181
 
182
-        return $return . '</div>';
182
+        return $return.'</div>';
183 183
     }
184 184
 }
Please login to merge, or discard this patch.
lib/Dwoo/Plugins/Functions/PluginCounter.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -51,35 +51,35 @@
 block discarded – undo
51 51
         // init counter
52 52
         if (!isset($this->counters[$name])) {
53 53
             $this->counters[$name] = array(
54
-                'count'     => $start === null ? 1 : (int)$start,
55
-                'skip'      => $skip === null ? 1 : (int)$skip,
56
-                'print'     => $print === null ? true : (bool)$print,
57
-                'assign'    => $assign === null ? null : (string)$assign,
58
-                'direction' => strtolower($direction) === 'down' ? - 1 : 1,
54
+                'count'     => $start === null ? 1 : (int) $start,
55
+                'skip'      => $skip === null ? 1 : (int) $skip,
56
+                'print'     => $print === null ? true : (bool) $print,
57
+                'assign'    => $assign === null ? null : (string) $assign,
58
+                'direction' => strtolower($direction) === 'down' ? -1 : 1,
59 59
             );
60 60
         } // increment
61 61
         else {
62 62
             // override setting if present
63 63
             if ($skip !== null) {
64
-                $this->counters[$name]['skip'] = (int)$skip;
64
+                $this->counters[$name]['skip'] = (int) $skip;
65 65
             }
66 66
 
67 67
             if ($direction !== null) {
68
-                $this->counters[$name]['direction'] = strtolower($direction) === 'down' ? - 1 : 1;
68
+                $this->counters[$name]['direction'] = strtolower($direction) === 'down' ? -1 : 1;
69 69
             }
70 70
 
71 71
             if ($print !== null) {
72
-                $this->counters[$name]['print'] = (bool)$print;
72
+                $this->counters[$name]['print'] = (bool) $print;
73 73
             }
74 74
 
75 75
             if ($assign !== null) {
76
-                $this->counters[$name]['assign'] = (string)$assign;
76
+                $this->counters[$name]['assign'] = (string) $assign;
77 77
             }
78 78
 
79 79
             if ($start !== null) {
80
-                $this->counters[$name]['count'] = (int)$start;
80
+                $this->counters[$name]['count'] = (int) $start;
81 81
             } else {
82
-                $this->counters[$name]['count'] += ($this->counters[$name]['skip'] * $this->counters[$name]['direction']);
82
+                $this->counters[$name]['count'] += ($this->counters[$name]['skip']*$this->counters[$name]['direction']);
83 83
             }
84 84
         }
85 85
 
Please login to merge, or discard this patch.
lib/Dwoo/Plugins/Functions/PluginRegexReplace.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
  */
31 31
 function PluginRegexReplace(Core $dwoo, $value, $search, $replace)
32 32
 {
33
-    $search = (array)$search;
33
+    $search = (array) $search;
34 34
     $cnt    = count($search);
35 35
 
36 36
     for ($i = 0; $i < $cnt; ++ $i) {
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
         }
41 41
 
42 42
         if (preg_match('#[a-z\s]+$#is', $search[$i], $m) && (strpos($m[0], 'e') !== false)) {
43
-            $search[$i] = substr($search[$i], 0, - strlen($m[0])) . str_replace(array(
43
+            $search[$i] = substr($search[$i], 0, - strlen($m[0])).str_replace(array(
44 44
                     'e',
45 45
                     ' '
46 46
                 ), '', $m[0]);
Please login to merge, or discard this patch.
lib/Dwoo/Plugins/Functions/PluginDateFormat.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@
 block discarded – undo
57 57
             '%t',
58 58
             '%T'
59 59
         );
60
-        $_win_to   = array(
60
+        $_win_to = array(
61 61
             '%m/%d/%y',
62 62
             '%b',
63 63
             "\n",
Please login to merge, or discard this patch.