@@ -38,6 +38,6 @@ |
||
| 38 | 38 | */ |
| 39 | 39 | public static function compile(Compiler $compiler, $value) |
| 40 | 40 | { |
| 41 | - return 'nl2br((string) ' . $value . ')'; |
|
| 41 | + return 'nl2br((string) '.$value.')'; |
|
| 42 | 42 | } |
| 43 | 43 | } |
| 44 | 44 | \ No newline at end of file |
@@ -121,8 +121,8 @@ discard block |
||
| 121 | 121 | $equation); |
| 122 | 122 | |
| 123 | 123 | $delim = $equation[0]; |
| 124 | - $open = $delim . '.'; |
|
| 125 | - $close = '.' . $delim; |
|
| 124 | + $open = $delim.'.'; |
|
| 125 | + $close = '.'.$delim; |
|
| 126 | 126 | $equation = substr($equation, 1, - 1); |
| 127 | 127 | $out = ''; |
| 128 | 128 | $ptr = 1; |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | $out .= $substr; |
| 140 | 140 | $equation = substr($equation, $ptr); |
| 141 | 141 | $ptr = 0; |
| 142 | - ++ $allowcomma; |
|
| 142 | + ++$allowcomma; |
|
| 143 | 143 | if ($allowcomma === 1) { |
| 144 | 144 | $allowed[] = ','; |
| 145 | 145 | } |
@@ -150,17 +150,17 @@ discard block |
||
| 150 | 150 | $ptr = 0; |
| 151 | 151 | } elseif ($substr === $open) { |
| 152 | 152 | // pre-replaced variable |
| 153 | - preg_match('#.*\((?:[^()]*?|(?R))\)' . str_replace('.', '\\.', $close) . '#', substr($equation, 2), $m); |
|
| 153 | + preg_match('#.*\((?:[^()]*?|(?R))\)'.str_replace('.', '\\.', $close).'#', substr($equation, 2), $m); |
|
| 154 | 154 | if (empty($m)) { |
| 155 | - preg_match('#.*?' . str_replace('.', '\\.', $close) . '#', substr($equation, 2), $m); |
|
| 155 | + preg_match('#.*?'.str_replace('.', '\\.', $close).'#', substr($equation, 2), $m); |
|
| 156 | 156 | } |
| 157 | 157 | $out .= substr($m[0], 0, - 2); |
| 158 | - $equation = substr($equation, strlen($m[0]) + 2); |
|
| 158 | + $equation = substr($equation, strlen($m[0])+2); |
|
| 159 | 159 | $ptr = 0; |
| 160 | 160 | } elseif ($substr === '(') { |
| 161 | 161 | // opening parenthesis |
| 162 | 162 | if ($allowcomma > 0) { |
| 163 | - ++ $allowcomma; |
|
| 163 | + ++$allowcomma; |
|
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | $out .= $substr; |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | } elseif ($substr === ')') { |
| 170 | 170 | // closing parenthesis |
| 171 | 171 | if ($allowcomma > 0) { |
| 172 | - -- $allowcomma; |
|
| 172 | + --$allowcomma; |
|
| 173 | 173 | if ($allowcomma === 0) { |
| 174 | 174 | array_pop($allowed); |
| 175 | 175 | } |
@@ -181,19 +181,19 @@ discard block |
||
| 181 | 181 | } elseif ($ptr >= strlen($equation)) { |
| 182 | 182 | // parse error if we've consumed the entire equation without finding anything valid |
| 183 | 183 | throw new CompilationException($compiler, |
| 184 | - 'Math : Syntax error or variable undefined in equation ' . $equationSrc . ' at ' . $substr); |
|
| 184 | + 'Math : Syntax error or variable undefined in equation '.$equationSrc.' at '.$substr); |
|
| 185 | 185 | } else { |
| 186 | 186 | // nothing special, advance |
| 187 | - ++ $ptr; |
|
| 187 | + ++$ptr; |
|
| 188 | 188 | } |
| 189 | 189 | } |
| 190 | 190 | if ($format !== '\'\'') { |
| 191 | - $out = 'sprintf(' . $format . ', ' . $out . ')'; |
|
| 191 | + $out = 'sprintf('.$format.', '.$out.')'; |
|
| 192 | 192 | } |
| 193 | 193 | if ($assign !== '\'\'') { |
| 194 | - return '($this->assignInScope(' . $out . ', ' . $assign . '))'; |
|
| 194 | + return '($this->assignInScope('.$out.', '.$assign.'))'; |
|
| 195 | 195 | } |
| 196 | 196 | |
| 197 | - return '(' . $out . ')'; |
|
| 197 | + return '('.$out.')'; |
|
| 198 | 198 | } |
| 199 | 199 | } |
| 200 | 200 | \ No newline at end of file |
@@ -46,11 +46,11 @@ |
||
| 46 | 46 | $out = array(); |
| 47 | 47 | foreach ($rest as $key => $value) { |
| 48 | 48 | if (!is_numeric($key) && !strstr($key, '$this->scope')) { |
| 49 | - $key = "'" . $key . "'"; |
|
| 49 | + $key = "'".$key."'"; |
|
| 50 | 50 | } |
| 51 | - $out[] = $key . '=>' . $value; |
|
| 51 | + $out[] = $key.'=>'.$value; |
|
| 52 | 52 | } |
| 53 | 53 | |
| 54 | - return 'array(' . implode(', ', $out) . ')'; |
|
| 54 | + return 'array('.implode(', ', $out).')'; |
|
| 55 | 55 | } |
| 56 | 56 | } |
| 57 | 57 | \ No newline at end of file |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | { |
| 98 | 98 | if (is_array($name)) { |
| 99 | 99 | reset($name); |
| 100 | - foreach ($name as $k => $v){ |
|
| 100 | + foreach ($name as $k => $v) { |
|
| 101 | 101 | $this->data[$k] = $v; |
| 102 | 102 | } |
| 103 | 103 | } else { |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | if ($merge === true && is_array($val)) { |
| 149 | - $this->data[$key] = $val + $this->data[$key]; |
|
| 149 | + $this->data[$key] = $val+$this->data[$key]; |
|
| 150 | 150 | } else { |
| 151 | 151 | $this->data[$key][] = $val; |
| 152 | 152 | } |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | } |
| 160 | 160 | |
| 161 | 161 | if ($merge === true && is_array($val)) { |
| 162 | - $this->data[$name] = $val + $this->data[$name]; |
|
| 162 | + $this->data[$name] = $val+$this->data[$name]; |
|
| 163 | 163 | } else { |
| 164 | 164 | $this->data[$name][] = $val; |
| 165 | 165 | } |
@@ -258,7 +258,7 @@ discard block |
||
| 258 | 258 | if (isset($this->data[$name])) { |
| 259 | 259 | return $this->data[$name]; |
| 260 | 260 | } else { |
| 261 | - throw new Exception('Tried to read a value that was not assigned yet : "' . $name . '"'); |
|
| 261 | + throw new Exception('Tried to read a value that was not assigned yet : "'.$name.'"'); |
|
| 262 | 262 | } |
| 263 | 263 | } |
| 264 | 264 | } |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | |
| 71 | 71 | $out .= $this->export($var, $scope); |
| 72 | 72 | |
| 73 | - return $out . '</div></div>'; |
|
| 73 | + return $out.'</div></div>'; |
|
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | /** |
@@ -84,16 +84,16 @@ discard block |
||
| 84 | 84 | $out = ''; |
| 85 | 85 | foreach ($var as $i => $v) { |
| 86 | 86 | if (is_array($v) || (is_object($v) && $v instanceof Iterator)) { |
| 87 | - $out .= $i . ' (' . (is_array($v) ? 'array' : 'object: ' . get_class($v)) . ')'; |
|
| 87 | + $out .= $i.' ('.(is_array($v) ? 'array' : 'object: '.get_class($v)).')'; |
|
| 88 | 88 | if ($v === $scope) { |
| 89 | - $out .= ' (current scope):<div style="background:#ccc;padding-left:20px;">' . $this->export($v, $scope) . '</div>'; |
|
| 89 | + $out .= ' (current scope):<div style="background:#ccc;padding-left:20px;">'.$this->export($v, $scope).'</div>'; |
|
| 90 | 90 | } else { |
| 91 | - $out .= ':<div style="padding-left:20px;">' . $this->export($v, $scope) . '</div>'; |
|
| 91 | + $out .= ':<div style="padding-left:20px;">'.$this->export($v, $scope).'</div>'; |
|
| 92 | 92 | } |
| 93 | 93 | } elseif (is_object($v)) { |
| 94 | - $out .= $this->exportObj($i . ' (object: ' . get_class($v) . '):', $v); |
|
| 94 | + $out .= $this->exportObj($i.' (object: '.get_class($v).'):', $v); |
|
| 95 | 95 | } else { |
| 96 | - $out .= $this->exportVar($i . ' = ', $v); |
|
| 96 | + $out .= $this->exportVar($i.' = ', $v); |
|
| 97 | 97 | } |
| 98 | 98 | } |
| 99 | 99 | |
@@ -109,13 +109,13 @@ discard block |
||
| 109 | 109 | protected function exportVar($i, $v) |
| 110 | 110 | { |
| 111 | 111 | if (is_string($v) || is_bool($v) || is_numeric($v)) { |
| 112 | - return $i . htmlentities(var_export($v, true)) . '<br />'; |
|
| 112 | + return $i.htmlentities(var_export($v, true)).'<br />'; |
|
| 113 | 113 | } elseif (is_null($v)) { |
| 114 | - return $i . 'null<br />'; |
|
| 114 | + return $i.'null<br />'; |
|
| 115 | 115 | } elseif (is_resource($v)) { |
| 116 | - return $i . 'resource(' . get_resource_type($v) . ')<br />'; |
|
| 116 | + return $i.'resource('.get_resource_type($v).')<br />'; |
|
| 117 | 117 | } else { |
| 118 | - return $i . htmlentities(var_export($v, true)) . '<br />'; |
|
| 118 | + return $i.htmlentities(var_export($v, true)).'<br />'; |
|
| 119 | 119 | } |
| 120 | 120 | } |
| 121 | 121 | |
@@ -128,14 +128,14 @@ discard block |
||
| 128 | 128 | protected function exportObj($i, $obj) |
| 129 | 129 | { |
| 130 | 130 | if (array_search($obj, $this->outputObjects, true) !== false) { |
| 131 | - return $i . ' [recursion, skipped]<br />'; |
|
| 131 | + return $i.' [recursion, skipped]<br />'; |
|
| 132 | 132 | } |
| 133 | 133 | |
| 134 | 134 | $this->outputObjects[] = $obj; |
| 135 | 135 | |
| 136 | - $list = (array)$obj; |
|
| 136 | + $list = (array) $obj; |
|
| 137 | 137 | |
| 138 | - $protectedLength = strlen(get_class($obj)) + 2; |
|
| 138 | + $protectedLength = strlen(get_class($obj))+2; |
|
| 139 | 139 | |
| 140 | 140 | $out = array(); |
| 141 | 141 | |
@@ -153,10 +153,10 @@ discard block |
||
| 153 | 153 | |
| 154 | 154 | $params = array(); |
| 155 | 155 | foreach ($method->getParameters() as $param) { |
| 156 | - $params[] = ($param->isPassedByReference() ? '&' : '') . '$' . $param->getName() . ($param->isOptional() ? ' = ' . var_export($param->getDefaultValue(), true) : ''); |
|
| 156 | + $params[] = ($param->isPassedByReference() ? '&' : '').'$'.$param->getName().($param->isOptional() ? ' = '.var_export($param->getDefaultValue(), true) : ''); |
|
| 157 | 157 | } |
| 158 | 158 | |
| 159 | - $out['method'] .= '(method) ' . $method->getName() . '(' . implode(', ', $params) . ')<br />'; |
|
| 159 | + $out['method'] .= '(method) '.$method->getName().'('.implode(', ', $params).')<br />'; |
|
| 160 | 160 | } |
| 161 | 161 | } |
| 162 | 162 | |
@@ -175,19 +175,19 @@ discard block |
||
| 175 | 175 | $out[$key] = ''; |
| 176 | 176 | } |
| 177 | 177 | |
| 178 | - $out[$key] .= '(' . $key . ') '; |
|
| 178 | + $out[$key] .= '('.$key.') '; |
|
| 179 | 179 | |
| 180 | 180 | if (is_array($attributeValue)) { |
| 181 | - $out[$key] .= $attributeName . ' (array):<br /> |
|
| 182 | - <div style="padding-left:20px;">' . $this->export($attributeValue, false) . '</div>'; |
|
| 181 | + $out[$key] .= $attributeName.' (array):<br /> |
|
| 182 | + <div style="padding-left:20px;">' . $this->export($attributeValue, false).'</div>'; |
|
| 183 | 183 | } elseif (is_object($attributeValue)) { |
| 184 | - $out[$key] .= $this->exportObj($attributeName . ' (object: ' . get_class($attributeValue) . '):', $attributeValue); |
|
| 184 | + $out[$key] .= $this->exportObj($attributeName.' (object: '.get_class($attributeValue).'):', $attributeValue); |
|
| 185 | 185 | } else { |
| 186 | - $out[$key] .= $this->exportVar($attributeName . ' = ', $attributeValue); |
|
| 186 | + $out[$key] .= $this->exportVar($attributeName.' = ', $attributeValue); |
|
| 187 | 187 | } |
| 188 | 188 | } |
| 189 | 189 | |
| 190 | - $return = $i . '<br /><div style="padding-left:20px;">'; |
|
| 190 | + $return = $i.'<br /><div style="padding-left:20px;">'; |
|
| 191 | 191 | |
| 192 | 192 | if (!empty($out['method'])) { |
| 193 | 193 | $return .= $out['method']; |
@@ -205,6 +205,6 @@ discard block |
||
| 205 | 205 | $return .= $out['private']; |
| 206 | 206 | } |
| 207 | 207 | |
| 208 | - return $return . '</div>'; |
|
| 208 | + return $return.'</div>'; |
|
| 209 | 209 | } |
| 210 | 210 | } |
@@ -38,15 +38,15 @@ |
||
| 38 | 38 | public function process($value, $numwords = false) |
| 39 | 39 | { |
| 40 | 40 | if ($numwords || preg_match('#^[^0-9]+$#', $value)) { |
| 41 | - return mb_convert_case((string)$value, MB_CASE_TITLE, $this->core->getCharset()); |
|
| 41 | + return mb_convert_case((string) $value, MB_CASE_TITLE, $this->core->getCharset()); |
|
| 42 | 42 | } else { |
| 43 | - $bits = explode(' ', (string)$value); |
|
| 43 | + $bits = explode(' ', (string) $value); |
|
| 44 | 44 | $out = ''; |
| 45 | - foreach ($bits as $k => $v){ |
|
| 45 | + foreach ($bits as $k => $v) { |
|
| 46 | 46 | if (preg_match('#^[^0-9]+$#', $v)) { |
| 47 | - $out .= ' ' . mb_convert_case($v, MB_CASE_TITLE, $this->core->getCharset()); |
|
| 47 | + $out .= ' '.mb_convert_case($v, MB_CASE_TITLE, $this->core->getCharset()); |
|
| 48 | 48 | } else { |
| 49 | - $out .= ' ' . $v; |
|
| 49 | + $out .= ' '.$v; |
|
| 50 | 50 | } |
| 51 | 51 | } |
| 52 | 52 | |
@@ -66,7 +66,7 @@ |
||
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | $block = &$compiler->getCurrentBlock(); |
| 69 | - $block['params']['hasElse'] = Compiler::PHP_OPEN . "else {\n" . Compiler::PHP_CLOSE . $content . Compiler::PHP_OPEN . "\n}" . Compiler::PHP_CLOSE; |
|
| 69 | + $block['params']['hasElse'] = Compiler::PHP_OPEN."else {\n".Compiler::PHP_CLOSE.$content.Compiler::PHP_OPEN."\n}".Compiler::PHP_CLOSE; |
|
| 70 | 70 | |
| 71 | 71 | return ''; |
| 72 | 72 | } |
@@ -66,7 +66,7 @@ |
||
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | $block = &$compiler->getCurrentBlock(); |
| 69 | - $block['params']['hasElse'] = Compiler::PHP_OPEN . "else {\n" . Compiler::PHP_CLOSE . $content . Compiler::PHP_OPEN . "\n}" . Compiler::PHP_CLOSE; |
|
| 69 | + $block['params']['hasElse'] = Compiler::PHP_OPEN."else {\n".Compiler::PHP_CLOSE.$content.Compiler::PHP_OPEN."\n}".Compiler::PHP_CLOSE; |
|
| 70 | 70 | |
| 71 | 71 | return ''; |
| 72 | 72 | } |
@@ -66,7 +66,7 @@ |
||
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | $block = &$compiler->getCurrentBlock(); |
| 69 | - $block['params']['hasElse'] = Compiler::PHP_OPEN . "else {\n" . Compiler::PHP_CLOSE . $content . Compiler::PHP_OPEN . "\n}" . Compiler::PHP_CLOSE; |
|
| 69 | + $block['params']['hasElse'] = Compiler::PHP_OPEN."else {\n".Compiler::PHP_CLOSE.$content.Compiler::PHP_OPEN."\n}".Compiler::PHP_CLOSE; |
|
| 70 | 70 | |
| 71 | 71 | return ''; |
| 72 | 72 | } |