| @@ -301,14 +301,14 @@ | ||
| 301 | 301 |      private function peg_f1($i) { $return = array(); | 
| 302 | 302 |                                                    array_walk_recursive($i, function($a) use (&$return) { $return[] = $a; }); | 
| 303 | 303 | return $return; | 
| 304 | - } | |
| 304 | + } | |
| 305 | 305 |      private function peg_f2($text) { return new \Seufert\Hamle\TextNode\StringLit(join('',$text)); } | 
| 306 | 306 |      private function peg_f3($body) { return $body; } | 
| 307 | 307 |      private function peg_f4($name) { | 
| 308 | 308 | return new \Seufert\Hamle\TextNode\ScopeId(null, null, new \Seufert\Hamle\TextNode\ModelParam($name)); } | 
| 309 | 309 |      private function peg_f5($expr, $chain) { if(!$chain) return $expr; | 
| 310 | - $top = array_pop($chain); | |
| 311 | -                           while($chain) { $top = array_pop($chain)->withChain($top); } return $expr->withChain($top); } | |
| 310 | + $top = array_pop($chain); | |
| 311 | +                            while($chain) { $top = array_pop($chain)->withChain($top); } return $expr->withChain($top); } | |
| 312 | 312 |      private function peg_f6($sub) { return $sub; } | 
| 313 | 313 |      private function peg_f7($filter) { return $filter; } | 
| 314 | 314 |      private function peg_f8($name) { return new \Seufert\Hamle\TextNode\ModelParam($name, null); } | 
| @@ -306,7 +306,9 @@ | ||
| 306 | 306 |      private function peg_f3($body) { return $body; } | 
| 307 | 307 |      private function peg_f4($name) { | 
| 308 | 308 | return new \Seufert\Hamle\TextNode\ScopeId(null, null, new \Seufert\Hamle\TextNode\ModelParam($name)); } | 
| 309 | -    private function peg_f5($expr, $chain) { if(!$chain) return $expr; | |
| 309 | +    private function peg_f5($expr, $chain) { if(!$chain) { | |
| 310 | + return $expr; | |
| 311 | + } | |
| 310 | 312 | $top = array_pop($chain); | 
| 311 | 313 |                             while($chain) { $top = array_pop($chain)->withChain($top); } return $expr->withChain($top); } | 
| 312 | 314 |      private function peg_f6($sub) { return $sub; } | 
| @@ -67,7 +67,7 @@ discard block | ||
| 67 | 67 | private $peg_currPos = 0; | 
| 68 | 68 | private $peg_reportedPos = 0; | 
| 69 | 69 | private $peg_cachedPos = 0; | 
| 70 | -    private $peg_cachedPosDetails = array('line' => 1, 'column' => 1, 'seenCR' => false ); | |
| 70 | +    private $peg_cachedPosDetails = array('line' => 1, 'column' => 1, 'seenCR' => false); | |
| 71 | 71 | private $peg_maxFailPos = 0; | 
| 72 | 72 | private $peg_maxFailExpected = array(); | 
| 73 | 73 | private $peg_silentFails = 0; | 
| @@ -78,7 +78,7 @@ discard block | ||
| 78 | 78 | $this->peg_currPos = 0; | 
| 79 | 79 | $this->peg_reportedPos = 0; | 
| 80 | 80 | $this->peg_cachedPos = 0; | 
| 81 | -      $this->peg_cachedPosDetails = array('line' => 1, 'column' => 1, 'seenCR' => false ); | |
| 81 | +      $this->peg_cachedPosDetails = array('line' => 1, 'column' => 1, 'seenCR' => false); | |
| 82 | 82 | $this->peg_maxFailPos = 0; | 
| 83 | 83 | $this->peg_maxFailExpected = array(); | 
| 84 | 84 | $this->peg_silentFails = 0; | 
| @@ -121,7 +121,7 @@ discard block | ||
| 121 | 121 |      private function expected($description) { | 
| 122 | 122 | throw $this->peg_buildException( | 
| 123 | 123 | null, | 
| 124 | -        array(array("type" => "other", "description" => $description )), | |
| 124 | +        array(array("type" => "other", "description" => $description)), | |
| 125 | 125 | $this->peg_reportedPos | 
| 126 | 126 | ); | 
| 127 | 127 | } | 
| @@ -152,7 +152,7 @@ discard block | ||
| 152 | 152 |        if ($this->peg_cachedPos !== $pos) { | 
| 153 | 153 |          if ($this->peg_cachedPos > $pos) { | 
| 154 | 154 | $this->peg_cachedPos = 0; | 
| 155 | - $this->peg_cachedPosDetails = array( "line" => 1, "column" => 1, "seenCR" => false ); | |
| 155 | +          $this->peg_cachedPosDetails = array("line" => 1, "column" => 1, "seenCR" => false); | |
| 156 | 156 | } | 
| 157 | 157 | $this->peg_advancePos($this->peg_cachedPosDetails, $this->peg_cachedPos, $pos); | 
| 158 | 158 | $this->peg_cachedPos = $pos; | 
| @@ -213,7 +213,7 @@ discard block | ||
| 213 | 213 | |
| 214 | 214 | $foundDesc = $found ? json_encode($found) : "end of input"; | 
| 215 | 215 | |
| 216 | - $message = "Expected " . $expectedDesc . " but " . $foundDesc . " found."; | |
| 216 | + $message = "Expected ".$expectedDesc." but ".$foundDesc." found."; | |
| 217 | 217 | } | 
| 218 | 218 | |
| 219 | 219 | return new SyntaxError( | 
| @@ -304,13 +304,13 @@ discard block | ||
| 304 | 304 |                                                    array_walk_recursive($i, function($a) use (&$return) { $return[] = $a; }); | 
| 305 | 305 | return $return; | 
| 306 | 306 | } | 
| 307 | -    private function peg_f2($text) { return new \Seufert\Hamle\TextNode\StringLit(join('',$text)); } | |
| 307 | +    private function peg_f2($text) { return new \Seufert\Hamle\TextNode\StringLit(join('', $text)); } | |
| 308 | 308 |      private function peg_f3($body) { return $body; } | 
| 309 | 309 |      private function peg_f4($name) { | 
| 310 | 310 | return new \Seufert\Hamle\TextNode\ScopeId(null, null, new \Seufert\Hamle\TextNode\ModelParam($name)); } | 
| 311 | -    private function peg_f5($expr, $chain) { if(!$chain) return $expr; | |
| 311 | +    private function peg_f5($expr, $chain) { if (!$chain) return $expr; | |
| 312 | 312 | $top = array_pop($chain); | 
| 313 | -                           while($chain) { $top = array_pop($chain)->withChain($top); } return $expr->withChain($top); } | |
| 313 | +                           while ($chain) { $top = array_pop($chain)->withChain($top); } return $expr->withChain($top); } | |
| 314 | 314 |      private function peg_f6($sub) { return $sub; } | 
| 315 | 315 |      private function peg_f7($filter) { return $filter; } | 
| 316 | 316 |      private function peg_f8($name) { return new \Seufert\Hamle\TextNode\ModelParam($name, null); } | 
| @@ -323,7 +323,7 @@ discard block | ||
| 323 | 323 |      private function peg_f15($query) { return new \Seufert\Hamle\TextNode\Query($query); } | 
| 324 | 324 |      private function peg_f16($id, $query) { return array_merge([['q'=>'type', 'id'=> $id]], $query); } | 
| 325 | 325 |      private function peg_f17($query) { return array_merge([['q'=>'type', 'id'=> '*']], $query); } | 
| 326 | -    private function peg_f18($rel, $sub) { return \Seufert\Hamle\TextNode\RelQuery::for($rel, $sub); } | |
| 326 | +    private function peg_f18($rel, $sub) { return \Seufert\Hamle\TextNode\RelQuery::for ($rel, $sub); } | |
| 327 | 327 |      private function peg_f19($id) { return ['q'=>'id', 'id'=> $id]; } | 
| 328 | 328 |      private function peg_f20($id) { return ['q'=>'type', 'id'=> $id]; } | 
| 329 | 329 |      private function peg_f21($id) { return ['q'=>'tag', 'id'=> $id]; } | 
| @@ -337,25 +337,25 @@ discard block | ||
| 337 | 337 |      private function peg_f29($func, $args) { return new \Seufert\Hamle\TextNode\FilterFunc($func, null, $args); } | 
| 338 | 338 |      private function peg_f30($func) { return new \Seufert\Hamle\TextNode\FilterFunc($func); } | 
| 339 | 339 |      private function peg_f31($arg) { return $arg; } | 
| 340 | -    private function peg_f32($s, $n, $d) { return \Seufert\Hamle\TextNode\FloatLit((float)"$s$n.$d"); } | |
| 340 | +    private function peg_f32($s, $n, $d) { return \Seufert\Hamle\TextNode\FloatLit((float) "$s$n.$d"); } | |
| 341 | 341 |      private function peg_f33($parts) { return $parts[1]; } | 
| 342 | 342 |      private function peg_f34($s, $e, $post) { | 
| 343 | 343 | return \Seufert\Hamle\TextNode\StringConcat::fromParser($s, $e, $post); | 
| 344 | 344 | } | 
| 345 | -    private function peg_f35($s) { return new \Seufert\Hamle\TextNode\StringLit(join('',$s)); } | |
| 345 | +    private function peg_f35($s) { return new \Seufert\Hamle\TextNode\StringLit(join('', $s)); } | |
| 346 | 346 |      private function peg_f36($parts) { return new \Seufert\Hamle\TextNode\StringLit($parts[1]); } | 
| 347 | 347 |      private function peg_f37($chars) { return join('', $chars); } | 
| 348 | 348 |      private function peg_f38($c) { return $c; } | 
| 349 | 349 |      private function peg_f39($s) { return $s; } | 
| 350 | 350 |      private function peg_f40($char) { return $char; } | 
| 351 | 351 |      private function peg_f41($sequence) { return $sequence; } | 
| 352 | -    private function peg_f42($n) { return (int)join('', $n); } | |
| 353 | -    private function peg_f43($sign, $n) { return new \Seufert\Hamle\TextNode\IntLit((int)($sign.join('', $n))); } | |
| 354 | -    private function peg_f44($p, $ex) { return $p.join('',$ex); } | |
| 352 | +    private function peg_f42($n) { return (int) join('', $n); } | |
| 353 | +    private function peg_f43($sign, $n) { return new \Seufert\Hamle\TextNode\IntLit((int) ($sign.join('', $n))); } | |
| 354 | +    private function peg_f44($p, $ex) { return $p.join('', $ex); } | |
| 355 | 355 |      private function peg_f45($p, $s) { return $p.join('', $s); } | 
| 356 | 356 |      private function peg_f46($s) { return join('', $s); } | 
| 357 | -    private function peg_f47($name) { return join('',$name); } | |
| 358 | -    private function peg_f48($char_) { return str_replace(['f', 'n', 'r', 't'], ["\f","\n","\r","\t"], $char_); } | |
| 357 | +    private function peg_f47($name) { return join('', $name); } | |
| 358 | +    private function peg_f48($char_) { return str_replace(['f', 'n', 'r', 't'], ["\f", "\n", "\r", "\t"], $char_); } | |
| 359 | 359 | |
| 360 | 360 |      private function peg_parseHtmlInput() { | 
| 361 | 361 | |
| @@ -3316,79 +3316,79 @@ discard block | ||
| 3316 | 3316 | |
| 3317 | 3317 | $this->peg_FAILED = new \stdClass; | 
| 3318 | 3318 |      $this->peg_c0 = "{"; | 
| 3319 | -    $this->peg_c1 = array( "type" => "literal", "value" => "{", "description" => "\"{\"" ); | |
| 3319 | +    $this->peg_c1 = array("type" => "literal", "value" => "{", "description" => "\"{\""); | |
| 3320 | 3320 | $this->peg_c2 = "}"; | 
| 3321 | - $this->peg_c3 = array( "type" => "literal", "value" => "}", "description" => "\"}\"" ); | |
| 3321 | +    $this->peg_c3 = array("type" => "literal", "value" => "}", "description" => "\"}\""); | |
| 3322 | 3322 | $this->peg_c4 = "$"; | 
| 3323 | - $this->peg_c5 = array( "type" => "literal", "value" => "$", "description" => "\"$\"" ); | |
| 3323 | +    $this->peg_c5 = array("type" => "literal", "value" => "$", "description" => "\"$\""); | |
| 3324 | 3324 | $this->peg_c6 = "|"; | 
| 3325 | - $this->peg_c7 = array( "type" => "literal", "value" => "|", "description" => "\"|\"" ); | |
| 3325 | +    $this->peg_c7 = array("type" => "literal", "value" => "|", "description" => "\"|\""); | |
| 3326 | 3326 |      $this->peg_c8 = "("; | 
| 3327 | -    $this->peg_c9 = array( "type" => "literal", "value" => "(", "description" => "\"(\"" ); | |
| 3327 | +    $this->peg_c9 = array("type" => "literal", "value" => "(", "description" => "\"(\""); | |
| 3328 | 3328 | $this->peg_c10 = ")"; | 
| 3329 | - $this->peg_c11 = array( "type" => "literal", "value" => ")", "description" => "\")\"" ); | |
| 3329 | +    $this->peg_c11 = array("type" => "literal", "value" => ")", "description" => "\")\""); | |
| 3330 | 3330 | $this->peg_c12 = "["; | 
| 3331 | - $this->peg_c13 = array( "type" => "literal", "value" => "[", "description" => "\"[\"" ); | |
| 3331 | +    $this->peg_c13 = array("type" => "literal", "value" => "[", "description" => "\"[\""); | |
| 3332 | 3332 | $this->peg_c14 = "]"; | 
| 3333 | - $this->peg_c15 = array( "type" => "literal", "value" => "]", "description" => "\"]\"" ); | |
| 3333 | +    $this->peg_c15 = array("type" => "literal", "value" => "]", "description" => "\"]\""); | |
| 3334 | 3334 | $this->peg_c16 = "*"; | 
| 3335 | - $this->peg_c17 = array( "type" => "literal", "value" => "*", "description" => "\"*\"" ); | |
| 3335 | +    $this->peg_c17 = array("type" => "literal", "value" => "*", "description" => "\"*\""); | |
| 3336 | 3336 | $this->peg_c18 = " "; | 
| 3337 | - $this->peg_c19 = array( "type" => "literal", "value" => " ", "description" => "\" \"" ); | |
| 3337 | +    $this->peg_c19 = array("type" => "literal", "value" => " ", "description" => "\" \""); | |
| 3338 | 3338 | $this->peg_c20 = "/^[><]/"; | 
| 3339 | - $this->peg_c21 = array( "type" => "class", "value" => "[><]", "description" => "[><]" ); | |
| 3339 | +    $this->peg_c21 = array("type" => "class", "value" => "[><]", "description" => "[><]"); | |
| 3340 | 3340 | $this->peg_c22 = "#"; | 
| 3341 | - $this->peg_c23 = array( "type" => "literal", "value" => "#", "description" => "\"#\"" ); | |
| 3341 | +    $this->peg_c23 = array("type" => "literal", "value" => "#", "description" => "\"#\""); | |
| 3342 | 3342 | $this->peg_c24 = ","; | 
| 3343 | - $this->peg_c25 = array( "type" => "literal", "value" => ",", "description" => "\",\"" ); | |
| 3343 | +    $this->peg_c25 = array("type" => "literal", "value" => ",", "description" => "\",\""); | |
| 3344 | 3344 | $this->peg_c26 = "."; | 
| 3345 | - $this->peg_c27 = array( "type" => "literal", "value" => ".", "description" => "\".\"" ); | |
| 3345 | +    $this->peg_c27 = array("type" => "literal", "value" => ".", "description" => "\".\""); | |
| 3346 | 3346 | $this->peg_c28 = "^"; | 
| 3347 | - $this->peg_c29 = array( "type" => "literal", "value" => "^", "description" => "\"^\"" ); | |
| 3347 | +    $this->peg_c29 = array("type" => "literal", "value" => "^", "description" => "\"^\""); | |
| 3348 | 3348 | $this->peg_c30 = "@"; | 
| 3349 | - $this->peg_c31 = array( "type" => "literal", "value" => "@", "description" => "\"@\"" ); | |
| 3349 | +    $this->peg_c31 = array("type" => "literal", "value" => "@", "description" => "\"@\""); | |
| 3350 | 3350 | $this->peg_c32 = ":"; | 
| 3351 | - $this->peg_c33 = array( "type" => "literal", "value" => ":", "description" => "\":\"" ); | |
| 3351 | +    $this->peg_c33 = array("type" => "literal", "value" => ":", "description" => "\":\""); | |
| 3352 | 3352 | $this->peg_c34 = "-"; | 
| 3353 | - $this->peg_c35 = array( "type" => "literal", "value" => "-", "description" => "\"-\"" ); | |
| 3353 | +    $this->peg_c35 = array("type" => "literal", "value" => "-", "description" => "\"-\""); | |
| 3354 | 3354 | $this->peg_c36 = ">"; | 
| 3355 | - $this->peg_c37 = array( "type" => "literal", "value" => ">", "description" => "\">\"" ); | |
| 3355 | +    $this->peg_c37 = array("type" => "literal", "value" => ">", "description" => "\">\""); | |
| 3356 | 3356 | $this->peg_c38 = "!"; | 
| 3357 | - $this->peg_c39 = array( "type" => "literal", "value" => "!", "description" => "\"!\"" ); | |
| 3357 | +    $this->peg_c39 = array("type" => "literal", "value" => "!", "description" => "\"!\""); | |
| 3358 | 3358 | $this->peg_c40 = "/^[0-9]/"; | 
| 3359 | - $this->peg_c41 = array( "type" => "class", "value" => "[0-9]", "description" => "[0-9]" ); | |
| 3359 | +    $this->peg_c41 = array("type" => "class", "value" => "[0-9]", "description" => "[0-9]"); | |
| 3360 | 3360 | $this->peg_c42 = "\""; | 
| 3361 | - $this->peg_c43 = array( "type" => "literal", "value" => "\"", "description" => "\"\\\"\"" ); | |
| 3361 | +    $this->peg_c43 = array("type" => "literal", "value" => "\"", "description" => "\"\\\"\""); | |
| 3362 | 3362 | $this->peg_c44 = "'"; | 
| 3363 | - $this->peg_c45 = array( "type" => "literal", "value" => "'", "description" => "\"'\"" ); | |
| 3364 | -    $this->peg_c46 = array("type" => "other", "description" => "string" ); | |
| 3363 | +    $this->peg_c45 = array("type" => "literal", "value" => "'", "description" => "\"'\""); | |
| 3364 | +    $this->peg_c46 = array("type" => "other", "description" => "string"); | |
| 3365 | 3365 | $this->peg_c47 = "\\"; | 
| 3366 | - $this->peg_c48 = array( "type" => "literal", "value" => "\\", "description" => "\"\\\\\"" ); | |
| 3367 | -    $this->peg_c49 = array("type" => "any", "description" => "any character" ); | |
| 3366 | +    $this->peg_c48 = array("type" => "literal", "value" => "\\", "description" => "\"\\\\\""); | |
| 3367 | +    $this->peg_c49 = array("type" => "any", "description" => "any character"); | |
| 3368 | 3368 | $this->peg_c50 = "/^[a-zA-Z_]/"; | 
| 3369 | - $this->peg_c51 = array( "type" => "class", "value" => "[a-zA-Z_]", "description" => "[a-zA-Z_]" ); | |
| 3369 | +    $this->peg_c51 = array("type" => "class", "value" => "[a-zA-Z_]", "description" => "[a-zA-Z_]"); | |
| 3370 | 3370 | $this->peg_c52 = "/^[a-zA-Z0-9_]/"; | 
| 3371 | - $this->peg_c53 = array( "type" => "class", "value" => "[a-zA-Z0-9_]", "description" => "[a-zA-Z0-9_]" ); | |
| 3371 | +    $this->peg_c53 = array("type" => "class", "value" => "[a-zA-Z0-9_]", "description" => "[a-zA-Z0-9_]"); | |
| 3372 | 3372 | $this->peg_c54 = "/^[a-zA-Z_-]/"; | 
| 3373 | - $this->peg_c55 = array( "type" => "class", "value" => "[a-zA-Z_-]", "description" => "[a-zA-Z_-]" ); | |
| 3373 | +    $this->peg_c55 = array("type" => "class", "value" => "[a-zA-Z_-]", "description" => "[a-zA-Z_-]"); | |
| 3374 | 3374 | $this->peg_c56 = "/^[0-9a-zA-Z_-]/"; | 
| 3375 | - $this->peg_c57 = array( "type" => "class", "value" => "[0-9a-zA-Z_-]", "description" => "[0-9a-zA-Z_-]" ); | |
| 3375 | +    $this->peg_c57 = array("type" => "class", "value" => "[0-9a-zA-Z_-]", "description" => "[0-9a-zA-Z_-]"); | |
| 3376 | 3376 |      $this->peg_c58 = "/^[^{\\\$]/"; | 
| 3377 | -    $this->peg_c59 = array( "type" => "class", "value" => "[{\$]", "description" => "[{\$]" ); | |
| 3377 | +    $this->peg_c59 = array("type" => "class", "value" => "[{\$]", "description" => "[{\$]"); | |
| 3378 | 3378 | $this->peg_c60 = "/^[a-z]/"; | 
| 3379 | - $this->peg_c61 = array( "type" => "class", "value" => "[a-z]", "description" => "[a-z]" ); | |
| 3379 | +    $this->peg_c61 = array("type" => "class", "value" => "[a-z]", "description" => "[a-z]"); | |
| 3380 | 3380 |      $this->peg_c62 = "/^[^{]/"; | 
| 3381 | -    $this->peg_c63 = array( "type" => "class", "value" => "[{]", "description" => "[{]" ); | |
| 3381 | +    $this->peg_c63 = array("type" => "class", "value" => "[{]", "description" => "[{]"); | |
| 3382 | 3382 |      $this->peg_c64 = "/^[\\n\\r\\x{2028}\\x{2029}]/"; | 
| 3383 | -    $this->peg_c65 = array( "type" => "class", "value" => "[\n\r\x{2028}\x{2029}]", "description" => "[\n\r\x{2028}\x{2029}]" ); | |
| 3383 | +    $this->peg_c65 = array("type" => "class", "value" => "[\n\r\x{2028}\x{2029}]", "description" => "[\n\r\x{2028}\x{2029}]"); | |
| 3384 | 3384 | $this->peg_c66 = "/^['\"\\\\fnrt]/"; | 
| 3385 | - $this->peg_c67 = array( "type" => "class", "value" => "['\"\\fnrt]", "description" => "['\"\\fnrt]" ); | |
| 3385 | +    $this->peg_c67 = array("type" => "class", "value" => "['\"\\fnrt]", "description" => "['\"\\fnrt]"); | |
| 3386 | 3386 | |
| 3387 | - $peg_startRuleFunctions = array( 'HtmlInput' => array($this, "peg_parseHtmlInput"), 'CodeInput' => array($this, "peg_parseCodeInput"), 'ControlInput' => array($this, "peg_parseControlInput") ); | |
| 3387 | +    $peg_startRuleFunctions = array('HtmlInput' => array($this, "peg_parseHtmlInput"), 'CodeInput' => array($this, "peg_parseCodeInput"), 'ControlInput' => array($this, "peg_parseControlInput")); | |
| 3388 | 3388 | $peg_startRuleFunction = array($this, "peg_parseHtmlInput"); | 
| 3389 | 3389 |      if (isset($options["startRule"])) { | 
| 3390 | 3390 |        if (!(isset($peg_startRuleFunctions[$options["startRule"]]))) { | 
| 3391 | -        throw new \Exception("Can't start parsing from rule \"" + $options["startRule"] + "\"."); | |
| 3391 | +        throw new \Exception("Can't start parsing from rule \"" +$options["startRule"] + "\"."); | |
| 3392 | 3392 | } | 
| 3393 | 3393 | |
| 3394 | 3394 | $peg_startRuleFunction = $peg_startRuleFunctions[$options["startRule"]]; | 
| @@ -3402,7 +3402,7 @@ discard block | ||
| 3402 | 3402 | return $peg_result; | 
| 3403 | 3403 |      } else { | 
| 3404 | 3404 |        if ($peg_result !== $this->peg_FAILED && $this->peg_currPos < $this->input_length) { | 
| 3405 | -        $this->peg_fail(array("type" => "end", "description" => "end of input" )); | |
| 3405 | +        $this->peg_fail(array("type" => "end", "description" => "end of input")); | |
| 3406 | 3406 | } | 
| 3407 | 3407 | |
| 3408 | 3408 | $exception = $this->peg_buildException(null, $this->peg_maxFailExpected, $this->peg_maxFailPos); | 
| @@ -48,7 +48,7 @@ | ||
| 48 | 48 |      if (!is_dir($dir)) { | 
| 49 | 49 | mkdir($dir); | 
| 50 | 50 | } | 
| 51 | - return $dir . $f; | |
| 51 | + return $dir.$f; | |
| 52 | 52 | } | 
| 53 | 53 | |
| 54 | 54 | /** | 
| @@ -37,6 +37,6 @@ | ||
| 37 | 37 | |
| 38 | 38 | function isClicked() | 
| 39 | 39 |    { | 
| 40 | - return isset($_REQUEST[$this->form . '_' . $this->name]); | |
| 40 | + return isset($_REQUEST[$this->form.'_'.$this->name]); | |
| 41 | 41 | } | 
| 42 | 42 | } | 
| @@ -49,8 +49,8 @@ | ||
| 49 | 49 |      if (!is_null($this->setValue)) { | 
| 50 | 50 | return $this->setValue; | 
| 51 | 51 | } | 
| 52 | -    if (isset($_REQUEST[$this->form . '__submit'])) { | |
| 53 | - return isset($_REQUEST[$this->form . '_' . $this->name]); | |
| 52 | +    if (isset($_REQUEST[$this->form.'__submit'])) { | |
| 53 | + return isset($_REQUEST[$this->form.'_'.$this->name]); | |
| 54 | 54 | } | 
| 55 | 55 | return $this->opt['default']; | 
| 56 | 56 | } | 
| @@ -33,7 +33,7 @@ | ||
| 33 | 33 | |
| 34 | 34 | public function toPHP(): string | 
| 35 | 35 |    { | 
| 36 | -    $o = 'Hamle\\Scope::getName(' . Text::varToCode($this->name) . ')'; | |
| 36 | +    $o = 'Hamle\\Scope::getName('.Text::varToCode($this->name).')'; | |
| 37 | 37 |      if ($this->immediate) { | 
| 38 | 38 | $o = $this->immediate->apply($o); | 
| 39 | 39 | } | 
| @@ -20,7 +20,7 @@ | ||
| 20 | 20 | |
| 21 | 21 | public function apply(string $out): string | 
| 22 | 22 |    { | 
| 23 | -    $o = "{$out}->hamleGet(" . Text::varToCode($this->name) . ')'; | |
| 23 | +    $o = "{$out}->hamleGet(".Text::varToCode($this->name).')'; | |
| 24 | 24 |      if ($this->chain) { | 
| 25 | 25 | $o = $this->chain->apply($o); | 
| 26 | 26 | } | 
| @@ -22,7 +22,7 @@ discard block | ||
| 22 | 22 | $this->chain = $chain; | 
| 23 | 23 | $this->args = $args; | 
| 24 | 24 |      if (method_exists(Filter::class, $func)) { | 
| 25 | - $this->func = Filter::class . '::' . $func; | |
| 25 | + $this->func = Filter::class.'::'.$func; | |
| 26 | 26 | } elseif ( | 
| 27 | 27 | in_array($func, ['round', 'strtoupper', 'strtolower', 'ucfirst']) | 
| 28 | 28 |      ) { | 
| @@ -48,7 +48,7 @@ discard block | ||
| 48 | 48 | $this->args, | 
| 49 | 49 | ); | 
| 50 | 50 | array_unshift($args, $out); | 
| 51 | -    $o = "{$this->func}(" . join(',', $args) . ')'; | |
| 51 | +    $o = "{$this->func}(".join(',', $args).')'; | |
| 52 | 52 |      if ($this->chain) { | 
| 53 | 53 | $o = $this->chain->apply($o); | 
| 54 | 54 | } | 
| @@ -40,7 +40,7 @@ discard block | ||
| 40 | 40 | $o = self::queryId($this->filters); | 
| 41 | 41 |      } else { | 
| 42 | 42 | $o = | 
| 43 | -        'Hamle\Run::modelTypeTags(' . self::queryParams($this->filters) . ')'; | |
| 43 | +        'Hamle\Run::modelTypeTags('.self::queryParams($this->filters).')'; | |
| 44 | 44 | } | 
| 45 | 45 |      if ($this->immediate) { | 
| 46 | 46 | $o = $this->immediate->apply($o); | 
| @@ -127,8 +127,8 @@ discard block | ||
| 127 | 127 | ]; | 
| 128 | 128 |      if (!$type || $type === '*') { | 
| 129 | 129 | $opt[0] = Text::varToCode($id); | 
| 130 | -      return 'Hamle\Run::modelId(' . join(',', $opt) . ')'; | |
| 130 | +      return 'Hamle\Run::modelId('.join(',', $opt).')'; | |
| 131 | 131 | } | 
| 132 | -    return 'Hamle\Run::modelTypeId(' . join(',', $opt) . ')'; | |
| 132 | +    return 'Hamle\Run::modelTypeId('.join(',', $opt).')'; | |
| 133 | 133 | } | 
| 134 | 134 | } | 
| @@ -40,7 +40,7 @@ discard block | ||
| 40 | 40 | $this->source[] = $ref; | 
| 41 | 41 | $this->baseType = $tag; | 
| 42 | 42 | self::$var++; | 
| 43 | - $this->varname = "\$dynhtml" . self::$var; | |
| 43 | + $this->varname = "\$dynhtml".self::$var; | |
| 44 | 44 | } | 
| 45 | 45 | |
| 46 | 46 | function render($indent = 0, $minify = false) | 
| @@ -53,16 +53,16 @@ discard block | ||
| 53 | 53 | 'content' => $this->content, | 
| 54 | 54 | ]); | 
| 55 | 55 | $out = | 
| 56 | - '<?php ' . | |
| 57 | - $this->varname . | |
| 58 | -      "=$data; echo Hamle\\Tag\\DynHtml::toStTag(" . | |
| 59 | - $this->varname . | |
| 56 | + '<?php '. | |
| 57 | + $this->varname. | |
| 58 | +      "=$data; echo Hamle\\Tag\\DynHtml::toStTag(". | |
| 59 | + $this->varname. | |
| 60 | 60 | ",\$form)."; | 
| 61 | - $out .= "implode(\"\\n\"," . $this->varname . "['content'])."; | |
| 61 | + $out .= "implode(\"\\n\",".$this->varname."['content'])."; | |
| 62 | 62 | $out .= | 
| 63 | -      'Hamle\\Tag\\DynHtml::toEnTag(' . | |
| 64 | - $this->varname . | |
| 65 | - ",\$form)?>" . | |
| 63 | +      'Hamle\\Tag\\DynHtml::toEnTag('. | |
| 64 | + $this->varname. | |
| 65 | + ",\$form)?>". | |
| 66 | 66 | ($minify ? '' : "\n"); | 
| 67 | 67 | return $out; | 
| 68 | 68 | } | 
| @@ -79,20 +79,20 @@ discard block | ||
| 79 | 79 | ->getField($source) | 
| 80 | 80 | ->getDynamicAtt($d['base'], $d['opt'], $d['type'], $d['content']); | 
| 81 | 81 | } | 
| 82 | - $out = '<' . $d['type'] . ' '; | |
| 82 | + $out = '<'.$d['type'].' '; | |
| 83 | 83 |      foreach ($d['opt'] as $k => $v) { | 
| 84 | 84 |        if (is_array($v)) { | 
| 85 | 85 |          foreach ($v as $k2 => $v2) { | 
| 86 | 86 |            if ($v[$k2] instanceof Text) { | 
| 87 | -            $v[$k2] = eval('return ' . $v[$k2]->toPHP() . ';'); | |
| 87 | +            $v[$k2] = eval('return '.$v[$k2]->toPHP().';'); | |
| 88 | 88 | } | 
| 89 | 89 | } | 
| 90 | 90 |          $v = implode(' ', $v); | 
| 91 | 91 | } | 
| 92 | 92 |        if ($v instanceof H\Text) { | 
| 93 | -        $v = eval('return ' . $v->toPHP() . ';'); | |
| 93 | +        $v = eval('return '.$v->toPHP().';'); | |
| 94 | 94 | } | 
| 95 | - $out .= $k . "=\"" . htmlspecialchars($v) . "\" "; | |
| 95 | + $out .= $k."=\"".htmlspecialchars($v)."\" "; | |
| 96 | 96 | } | 
| 97 | 97 | $out .= in_array($d['type'], self::$selfCloseTags) ? '/>' : '>'; | 
| 98 | 98 | return $out; | 
| @@ -102,6 +102,6 @@ discard block | ||
| 102 | 102 |    { | 
| 103 | 103 | return in_array($d['type'], self::$selfCloseTags) | 
| 104 | 104 | ? '' | 
| 105 | - : '</' . $d['type'] . '>'; | |
| 105 | + : '</'.$d['type'].'>'; | |
| 106 | 106 | } | 
| 107 | 107 | } |