@@ -48,9 +48,9 @@ discard block |
||
| 48 | 48 | function toHTML(bool $escape = false): string |
| 49 | 49 | { |
| 50 | 50 | if ($escape) { |
| 51 | - return '<?=htmlspecialchars(' . $this->toPHP() . ')?>'; |
|
| 51 | + return '<?=htmlspecialchars('.$this->toPHP().')?>'; |
|
| 52 | 52 | } |
| 53 | - return '<?=' . $this->toPHP() . '?>'; |
|
| 53 | + return '<?='.$this->toPHP().'?>'; |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | function toPHP(): string |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | |
| 61 | 61 | function toPHPVar(): string |
| 62 | 62 | { |
| 63 | - return 'Hamle\\Scope::get()->hamleGet(' . Text::varToCode($this->var) . ')'; |
|
| 63 | + return 'Hamle\\Scope::get()->hamleGet('.Text::varToCode($this->var).')'; |
|
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | function getOrCreateModel(Model $parent = null): Model |
@@ -64,9 +64,9 @@ discard block |
||
| 64 | 64 | function toHTML(bool $escape = false): string |
| 65 | 65 | { |
| 66 | 66 | if ($escape) { |
| 67 | - return '<?=htmlspecialchars(' . $this->toPHP() . ')?>'; |
|
| 67 | + return '<?=htmlspecialchars('.$this->toPHP().')?>'; |
|
| 68 | 68 | } |
| 69 | - return '<?=' . $this->toPHP() . '?>'; |
|
| 69 | + return '<?='.$this->toPHP().'?>'; |
|
| 70 | 70 | } |
| 71 | 71 | function toPHP(): string |
| 72 | 72 | { |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | foreach ($this->sel as $s) { |
| 81 | 81 | $sel[] = "hamleGet('$s')"; |
| 82 | 82 | } |
| 83 | - return $this->func->toPHP() . '->' . implode('->', $sel); |
|
| 83 | + return $this->func->toPHP().'->'.implode('->', $sel); |
|
| 84 | 84 | } else { |
| 85 | 85 | return $this->func->toPHP(); |
| 86 | 86 | } |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | return $this->func->getOrCreateModel($parent); |
| 96 | 96 | } |
| 97 | 97 | throw new RuntimeException( |
| 98 | - 'Unsupported func type encountered:' . |
|
| 98 | + 'Unsupported func type encountered:'. |
|
| 99 | 99 | ($this->func ? get_class($this->func) : 'Unknown'), |
| 100 | 100 | ); |
| 101 | 101 | } |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | $model = $this->getOrCreateModel(); |
| 115 | 115 | if (!$model instanceof WriteModel) { |
| 116 | 116 | throw new RuntimeException( |
| 117 | - 'Can only set values on WriteModel, got ' . get_class($model), |
|
| 117 | + 'Can only set values on WriteModel, got '.get_class($model), |
|
| 118 | 118 | ); |
| 119 | 119 | } |
| 120 | 120 | $model->hamleSet($this->sel[0], $value); |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | { |
| 43 | 43 | $m = []; |
| 44 | 44 | if ( |
| 45 | - !preg_match('/^ +([><]) +(' . self::REGEX_FUNCSEL . '+)(.*)$/', $s, $m) |
|
| 45 | + !preg_match('/^ +([><]) +('.self::REGEX_FUNCSEL.'+)(.*)$/', $s, $m) |
|
| 46 | 46 | ) { |
| 47 | 47 | throw new ParseError("Unable to read \$ sub func in '$s'"); |
| 48 | 48 | } |
@@ -71,18 +71,18 @@ discard block |
||
| 71 | 71 | public function toPHP(): string |
| 72 | 72 | { |
| 73 | 73 | $limit = |
| 74 | - Hamle\Text::varToCode($this->sortlimit['sort']) . |
|
| 75 | - ',' . |
|
| 76 | - $this->sortlimit['limit'] . |
|
| 77 | - ',' . |
|
| 78 | - $this->sortlimit['offset'] . |
|
| 79 | - ',' . |
|
| 74 | + Hamle\Text::varToCode($this->sortlimit['sort']). |
|
| 75 | + ','. |
|
| 76 | + $this->sortlimit['limit']. |
|
| 77 | + ','. |
|
| 78 | + $this->sortlimit['offset']. |
|
| 79 | + ','. |
|
| 80 | 80 | $this->grouptype['grouptype']; |
| 81 | - $sub = $this->sub ? '->' . $this->sub->toPHP() : ''; |
|
| 82 | - return 'hamleRel(' . |
|
| 83 | - $this->dir . |
|
| 84 | - ',' . |
|
| 85 | - Hamle\Text::varToCode($this->filt['tag']) . |
|
| 81 | + $sub = $this->sub ? '->'.$this->sub->toPHP() : ''; |
|
| 82 | + return 'hamleRel('. |
|
| 83 | + $this->dir. |
|
| 84 | + ','. |
|
| 85 | + Hamle\Text::varToCode($this->filt['tag']). |
|
| 86 | 86 | ",$limit)$sub"; |
| 87 | 87 | } |
| 88 | 88 | |
@@ -101,8 +101,8 @@ discard block |
||
| 101 | 101 | if (!$model->valid()) { |
| 102 | 102 | if (!$parent instanceof Hamle\WriteModel) { |
| 103 | 103 | throw new \RuntimeException( |
| 104 | - 'Cant create model, ' . |
|
| 105 | - get_class($parent) . |
|
| 104 | + 'Cant create model, '. |
|
| 105 | + get_class($parent). |
|
| 106 | 106 | ' must implement Hamle\\WriteModel.', |
| 107 | 107 | ); |
| 108 | 108 | } |
@@ -38,11 +38,11 @@ |
||
| 38 | 38 | |
| 39 | 39 | function toPHP(): string |
| 40 | 40 | { |
| 41 | - return '$form->getField(' . Text::varToCode($this->var) . ')->getValue()'; |
|
| 41 | + return '$form->getField('.Text::varToCode($this->var).')->getValue()'; |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | function toHTML(bool $escape = false): string |
| 45 | 45 | { |
| 46 | - return '<?=' . $this->toPHP() . '?>'; |
|
| 46 | + return '<?='.$this->toPHP().'?>'; |
|
| 47 | 47 | } |
| 48 | 48 | } |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | throw new ParseError("Unable to parse filter expression \"$s\""); |
| 73 | 73 | } |
| 74 | 74 | if (method_exists(Filter::class, $this->filter)) { |
| 75 | - $this->filter = Filter::class . '::' . $this->filter; |
|
| 75 | + $this->filter = Filter::class.'::'.$this->filter; |
|
| 76 | 76 | } elseif ( |
| 77 | 77 | in_array($this->filter, ['round', 'strtoupper', 'strtolower', 'ucfirst']) |
| 78 | 78 | ) { |
@@ -92,9 +92,9 @@ discard block |
||
| 92 | 92 | function toHTML(bool $escape = false): string |
| 93 | 93 | { |
| 94 | 94 | if ($escape) { |
| 95 | - return '<?=htmlspecialchars(' . $this->toPHP() . ')?>'; |
|
| 95 | + return '<?=htmlspecialchars('.$this->toPHP().')?>'; |
|
| 96 | 96 | } |
| 97 | - return '<?=' . $this->toPHP() . '?>'; |
|
| 97 | + return '<?='.$this->toPHP().'?>'; |
|
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | function toPHPpre(): string |
@@ -114,14 +114,14 @@ discard block |
||
| 114 | 114 | } |
| 115 | 115 | $o = ''; |
| 116 | 116 | foreach ($this->vars as $v) { |
| 117 | - $o .= ',' . $this->varToCode($v); |
|
| 117 | + $o .= ','.$this->varToCode($v); |
|
| 118 | 118 | } |
| 119 | 119 | return "$o)$post"; |
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | function toPHP(): string |
| 123 | 123 | { |
| 124 | - return $this->toPHPpre() . $this->what->toPHPVar() . $this->toPHPpost(); |
|
| 124 | + return $this->toPHPpre().$this->what->toPHPVar().$this->toPHPpost(); |
|
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | static function itersplit(mixed $v, string $sep = ','): Model |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | function __construct(string $s, int $mode = self::TOKEN_CONTROL) |
| 38 | 38 | { |
| 39 | 39 | $m = []; |
| 40 | - if (preg_match('/^(.*) ' . self::REGEX_COMP_OPER . ' (.*)$/', $s, $m)) { |
|
| 40 | + if (preg_match('/^(.*) '.self::REGEX_COMP_OPER.' (.*)$/', $s, $m)) { |
|
| 41 | 41 | $this->param1 = new Text($m[1], Text::TOKEN_HTML); |
| 42 | 42 | $this->param2 = new Text($m[3], Text::TOKEN_HTML); |
| 43 | 43 | $this->operator = $m[2]; |
@@ -56,14 +56,14 @@ discard block |
||
| 56 | 56 | switch ($this->operator) { |
| 57 | 57 | case 'equals': |
| 58 | 58 | case 'equal': |
| 59 | - return $p1 . ' == ' . $p2; |
|
| 59 | + return $p1.' == '.$p2; |
|
| 60 | 60 | case 'notequals': |
| 61 | 61 | case 'notequal': |
| 62 | - return $p1 . ' != ' . $p2; |
|
| 62 | + return $p1.' != '.$p2; |
|
| 63 | 63 | case 'less': |
| 64 | - return $p1 . ' < ' . $p2; |
|
| 64 | + return $p1.' < '.$p2; |
|
| 65 | 65 | case 'greater': |
| 66 | - return $p1 . ' > ' . $p2; |
|
| 66 | + return $p1.' > '.$p2; |
|
| 67 | 67 | case 'has': |
| 68 | 68 | return "in_array($p2, $p1)"; |
| 69 | 69 | case 'starts': |
@@ -43,6 +43,6 @@ |
||
| 43 | 43 | |
| 44 | 44 | static function filterText(string $s): string |
| 45 | 45 | { |
| 46 | - return "/*<![CDATA[*/\n" . $s . '/*]]>*/'; |
|
| 46 | + return "/*<![CDATA[*/\n".$s.'/*]]>*/'; |
|
| 47 | 47 | } |
| 48 | 48 | } |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | /** |
| 60 | 60 | * @psalm-suppress UnresolvableInclude |
| 61 | 61 | */ |
| 62 | - require_once ME_DIR . '/lib/phpsass/SassParser.php'; |
|
| 62 | + require_once ME_DIR.'/lib/phpsass/SassParser.php'; |
|
| 63 | 63 | $sp = new SassParser([ |
| 64 | 64 | 'cache' => false, |
| 65 | 65 | 'style' => stdConf::get('me.developer') |
@@ -71,6 +71,6 @@ discard block |
||
| 71 | 71 | $tree = $sp->toTree($s); |
| 72 | 72 | $out = $tree->render(); |
| 73 | 73 | $pad = str_pad('', $indent, ' '); |
| 74 | - return $pad . str_replace("\n", "\n$pad", trim($out)); |
|
| 74 | + return $pad.str_replace("\n", "\n$pad", trim($out)); |
|
| 75 | 75 | } |
| 76 | 76 | } |