Completed
Push — master ( 8468f5...860016 )
by Chris
05:04
created
php/hamle/Parse.php 2 patches
Doc Comments   +12 added lines patch added patch discarded remove patch
@@ -92,6 +92,9 @@  discard block
 block discarded – undo
92 92
     }
93 93
   }
94 94
 
95
+  /**
96
+   * @param string $s
97
+   */
95 98
   function parseSnip($s) {
96 99
     //save root tags
97 100
     /** @var Tag[] $roots */
@@ -223,6 +226,9 @@  discard block
 block discarded – undo
223 226
     }
224 227
   }
225 228
 
229
+  /**
230
+   * @param string $qs
231
+   */
226 232
   function parseQueryString($qs) {
227 233
     $out = [];
228 234
     foreach(explode('&',$qs) as $s) {
@@ -240,6 +246,9 @@  discard block
 block discarded – undo
240 246
 
241 247
   }
242 248
 
249
+  /**
250
+   * @param integer $indent
251
+   */
243 252
   function consumeBlock($indent) {
244 253
     $out = array();
245 254
     $m = array();
@@ -254,6 +263,9 @@  discard block
 block discarded – undo
254 263
     return $out;
255 264
   }
256 265
 
266
+  /**
267
+   * @param integer $indent
268
+   */
257 269
   function indentLevel($indent) {
258 270
     if (!isset($this->indents)) $this->indents = array();
259 271
     if (!count($this->indents)) {
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 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,9 +192,9 @@  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);
197
+              $param = str_replace('+', '%2B', $param);
198 198
 //              parse_str($param, $attr);
199 199
               $attr = $this->parseQueryString($param);
200 200
             }
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
               if ($s[0] == ".") $class[] = substr($s, 1);
206 206
               if ($s[0] == "!") $ref = substr($s, 1);
207 207
             }
208
-            if($ref)
208
+            if ($ref)
209 209
               $hTag = new Tag\DynHtml($tag, $class, $attr, $id, $ref);
210 210
             else
211 211
               $hTag = new Tag\Html($tag, $class, $attr, $id);
@@ -225,8 +225,8 @@  discard block
 block discarded – undo
225 225
 
226 226
   function parseQueryString($qs) {
227 227
     $out = [];
228
-    foreach(explode('&',$qs) as $s) {
229
-      list($k, $v) = explode('=',$s,2);
228
+    foreach (explode('&', $qs) as $s) {
229
+      list($k, $v) = explode('=', $s, 2);
230 230
       $out[urldecode($k)] = urldecode($v);
231 231
     }
232 232
     return $out;
Please login to merge, or discard this patch.