Completed
Push — master ( c6418a...51b3a1 )
by Chris
03:33
created
php/hamle/Run.php 1 patch
Unused Use Statements   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
25 25
  */
26 26
 namespace Seufert\Hamle;
27 27
 
28
-use Seufert\Hamle\Exception\RunTime;
28
+use Seufert\Hamle\Exception\RunTime;
29 29
 use Seufert\Hamle\Model;
30 30
 
31 31
 /**
Please login to merge, or discard this patch.
php/hamle/Scope.php 2 patches
Unused Use Statements   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@
 block discarded – undo
1 1
 <?php
2 2
 namespace Seufert\Hamle;
3 3
 
4
-use Seufert\Hamle\Exception\OutOfScope;
5
-use Seufert\Hamle\Exception\Unsupported;
6
-use Seufert\Hamle\Exception\RunTime;
4
+use Seufert\Hamle\Exception\OutOfScope;
5
+use Seufert\Hamle\Exception\Unsupported;
6
+use Seufert\Hamle\Exception\RunTime;
7 7
 use Seufert\Hamle\Model;
8 8
 
9 9
 /**
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@
 block discarded – undo
67 67
       self::$namedScopes[$name]->rewind();
68 68
       return self::$namedScopes[$name];
69 69
     } else
70
-      if(self::$returnZeroOnNoScope)
70
+      if (self::$returnZeroOnNoScope)
71 71
         return new Model\Zero();
72 72
       throw new RunTime("Unable to find scope ($name)");
73 73
   }
Please login to merge, or discard this patch.
php/hamle/Tag/Snippet.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@
 block discarded – undo
45 45
 
46 46
   static function decodeClassId($s) {
47 47
     $out = $m = array();
48
-    if(preg_match('/^[a-zA-Z0-9\_]+/', $s, $m))
48
+    if (preg_match('/^[a-zA-Z0-9\_]+/', $s, $m))
49 49
       $out['type'] = $m[0];
50 50
     preg_match_all('/[#\.][a-zA-Z0-9\-\_]+/m', $s, $m);
51 51
     if (isset($m[0])) foreach ($m[0] as $s) {
Please login to merge, or discard this patch.
php/hamle/Parse.php 2 patches
Unused Use Statements   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -24,8 +24,8 @@
 block discarded – undo
24 24
 
25 25
  */
26 26
 namespace Seufert\Hamle;
27
-use Seufert\Hamle\Exception\ParseError;
28
-use Seufert\Hamle\Parse\Filter as ParseFilter;
27
+use Seufert\Hamle\Exception\ParseError;
28
+use Seufert\Hamle\Parse\Filter as ParseFilter;
29 29
 use Seufert\Hamle\Text;
30 30
 
31 31
 /**
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
         $i = self::indentLevel($indent);
158 158
         unset($m[0]);
159 159
         switch (strlen($code) ? $code[0] : ($textcode ? $textcode : "")) {
160
-          case "|": //Control Tag
160
+          case "|" : //Control Tag
161 161
             if ($code == "|snippet")
162 162
               $hTag = new Tag\Snippet($text);
163 163
             elseif ($code == "|form")
@@ -192,10 +192,10 @@  discard block
 block discarded – undo
192 192
             break;
193 193
           default:
194 194
             $attr = array();
195
-            if(isset($params[0]) && $params[0] == "[") {
195
+            if (isset($params[0]) && $params[0] == "[") {
196 196
               $param = substr($params, 1, strlen($params) - 2);
197
-              $param = str_replace('+','%2B', $param);
198
-              $param = str_replace('\\&','%26', $param);
197
+              $param = str_replace('+', '%2B', $param);
198
+              $param = str_replace('\\&', '%26', $param);
199 199
 //              parse_str($param, $attr);
200 200
               $attr = $this->parseQueryString($param);
201 201
             }
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
               if ($s[0] == ".") $class[] = substr($s, 1);
207 207
               if ($s[0] == "!") $ref = substr($s, 1);
208 208
             }
209
-            if($ref)
209
+            if ($ref)
210 210
               $hTag = new Tag\DynHtml($tag, $class, $attr, $id, $ref);
211 211
             else
212 212
               $hTag = new Tag\Html($tag, $class, $attr, $id);
@@ -219,16 +219,16 @@  discard block
 block discarded – undo
219 219
         else
220 220
           $this->root[] = $hTag;
221 221
       } else
222
-        throw new ParseError("Unable to parse line {$this->lineNo}\n\"$line\"/" . preg_last_error());
222
+        throw new ParseError("Unable to parse line {$this->lineNo}\n\"$line\"/".preg_last_error());
223 223
       $this->lineNo++;
224 224
     }
225 225
   }
226 226
 
227 227
   function parseQueryString($qs) {
228 228
     $out = [];
229
-    foreach(explode('&',$qs) as $s) {
230
-      $kv = explode('=',$s,2);
231
-      $out[urldecode($kv[0])] = isset($kv[1])?urldecode($kv[1]):null;
229
+    foreach (explode('&', $qs) as $s) {
230
+      $kv = explode('=', $s, 2);
231
+      $out[urldecode($kv[0])] = isset($kv[1]) ?urldecode($kv[1]) : null;
232 232
     }
233 233
     return $out;
234 234
   }
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
     $m = array();
247 247
     while ($this->lineNo + 1 < $this->lineCount &&
248 248
         (!trim($this->lines[$this->lineNo + 1]) ||
249
-            preg_match('/^(\s){' . $indent . '}((\s)+[^\s].*)$/',
249
+            preg_match('/^(\s){'.$indent.'}((\s)+[^\s].*)$/',
250 250
                 $this->lines[$this->lineNo + 1], $m))) {
251 251
       if (trim($this->lines[$this->lineNo + 1]))
252 252
         $out[] = $m[2];
Please login to merge, or discard this patch.
php/autoload.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -34,11 +34,11 @@
 block discarded – undo
34 34
  * @param string $class Class name to be autoloaded
35 35
  */
36 36
 spl_autoload_register(function($class) {
37
-  if(strpos($class, "Seufert\\Hamle\\") === 0) {
37
+  if (strpos($class, "Seufert\\Hamle\\") === 0) {
38 38
     $s = DIRECTORY_SEPARATOR;
39
-    $class = str_replace("\\",$s,substr($class,14));
39
+    $class = str_replace("\\", $s, substr($class, 14));
40 40
     $path = __DIR__.$s."hamle".$s."$class.php";
41
-    if(is_file($path)) include_once($path);
41
+    if (is_file($path)) include_once($path);
42 42
   }
43
-},true,true);
43
+},true, true);
44 44
 
Please login to merge, or discard this patch.
php/hamle/Setup.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -40,8 +40,8 @@  discard block
 block discarded – undo
40 40
    */
41 41
   public function cachePath($f) {
42 42
     $s = DIRECTORY_SEPARATOR;
43
-    $dir = implode($s,[__DIR__,"..","..","cache",""]);
44
-    if(!is_dir($dir)) mkdir($dir);
43
+    $dir = implode($s, [__DIR__, "..", "..", "cache", ""]);
44
+    if (!is_dir($dir)) mkdir($dir);
45 45
     return $dir.$f;
46 46
   }
47 47
 
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
    * @throws Exception\RunTime
68 68
    */
69 69
   public function getModelTypeID($typeId, $sort = [], $limit = 0, $offset = 0) {
70
-    if(count($typeId) > 1)
70
+    if (count($typeId) > 1)
71 71
       throw new Exception\RunTime("Unable to open more than one ID at a time");
72 72
     return new Model\Zero();
73 73
   }
Please login to merge, or discard this patch.
php/hamle/Exception/ParseError.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@
 block discarded – undo
32 32
 
33 33
   function __construct($message = "", $code = 0, $previous = NULL) {
34 34
     ///@todo  Include Line number & file name within parse error exceptions
35
-    $message .= ", on line " . Hamle\Hamle::getLineNo() . " in file ?.hamle";
35
+    $message .= ", on line ".Hamle\Hamle::getLineNo()." in file ?.hamle";
36 36
     parent::__construct($message, $code, $previous);
37 37
   }
38 38
 
Please login to merge, or discard this patch.
php/hamle/Tag.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -144,11 +144,11 @@  discard block
 block discarded – undo
144 144
     //if(strtoupper($this->type) == "A") var_dump($this);
145 145
     $ind = $doIndent ? str_pad("", $indent, " ") : "";
146 146
     $oneliner = ((count($this->content) > 1 || $this->tags) ? false : true);
147
-    $out = $ind . $this->renderStTag() . ($oneliner ? "" : "\n");
147
+    $out = $ind.$this->renderStTag().($oneliner ? "" : "\n");
148 148
     if ($this->content) $out .= $this->renderContent($ind, $oneliner);
149 149
     foreach ($this->tags as $tag)
150 150
       $out .= $tag->render($indent + self::INDENT_SIZE);
151
-    $out .= ($oneliner ? "" : $ind) . $this->renderEnTag() . "\n";
151
+    $out .= ($oneliner ? "" : $ind).$this->renderEnTag()."\n";
152 152
     return $out;
153 153
   }
154 154
 
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
   function renderContent($pad = "", $oneliner = false) {
163 163
     $out = "";
164 164
     foreach ($this->content as $c)
165
-      $out .= ($oneliner ? "" : $pad) . $c . ($oneliner ? "" : "\n");
165
+      $out .= ($oneliner ? "" : $pad).$c.($oneliner ? "" : "\n");
166 166
     return $out;
167 167
   }
168 168
 
Please login to merge, or discard this patch.
php/hamle/Field.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -112,19 +112,19 @@  discard block
 block discarded – undo
112 112
 
113 113
   function getValue() {
114 114
     if (!is_null($this->setValue)) return $this->setValue;
115
-    if (isset($_REQUEST[$this->form . "_" . $this->name])) {
115
+    if (isset($_REQUEST[$this->form."_".$this->name])) {
116 116
       if (get_magic_quotes_runtime())
117
-        return stripslashes($_REQUEST[$this->form . "_" . $this->name]);
117
+        return stripslashes($_REQUEST[$this->form."_".$this->name]);
118 118
       else
119
-        return $_REQUEST[$this->form . "_" . $this->name];
119
+        return $_REQUEST[$this->form."_".$this->name];
120 120
     }
121 121
     return $this->opt['default'];
122 122
   }
123 123
 
124 124
   function getInputAttStatic(&$atts, &$type, &$content) {
125
-    $atts['id'] = $atts['name'] = $this->form . "_" . $this->name;
125
+    $atts['id'] = $atts['name'] = $this->form."_".$this->name;
126 126
     $atts['type'] = "text";
127
-    $atts['class'][] = str_replace(['Seufert\\','\\'],['','_'],get_class($this));
127
+    $atts['class'][] = str_replace(['Seufert\\', '\\'], ['', '_'], get_class($this));
128 128
   }
129 129
 
130 130
   function getInputAttDynamic(&$atts, &$type, &$content) {
@@ -142,8 +142,8 @@  discard block
 block discarded – undo
142 142
   }
143 143
 
144 144
   function getLabelAttStatic(&$atts, &$type, &$content) {
145
-    $atts['class'][] = str_replace(['Seufert\\','\\'],['','_'],get_class($this));
146
-    $atts["for"] = $this->form . "_" . $this->name;
145
+    $atts['class'][] = str_replace(['Seufert\\', '\\'], ['', '_'], get_class($this));
146
+    $atts["for"] = $this->form."_".$this->name;
147 147
     $content = array($this->opt['label']);
148 148
   }
149 149
 
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
   }
152 152
 
153 153
   function getHintAttStatic(&$atts, &$type, &$content) {
154
-    $atts['class'][] = str_replace(['Seufert\\','\\'],['','_'],get_class($this));
154
+    $atts['class'][] = str_replace(['Seufert\\', '\\'], ['', '_'], get_class($this));
155 155
     $atts['class'][] = "hamleFormHint";
156 156
   }
157 157
 
Please login to merge, or discard this patch.