| @@ -35,7 +35,7 @@ | ||
| 35 | 35 |      { | 
| 36 | 36 | $this->name = $name; | 
| 37 | 37 | $this->open = $open; | 
| 38 | - $this->close= $close; | |
| 38 | + $this->close = $close; | |
| 39 | 39 | } | 
| 40 | 40 | |
| 41 | 41 | abstract public function compile(string $content):string; | 
| @@ -6,7 +6,7 @@ discard block | ||
| 6 | 6 | public function parseEchoValue($var):string | 
| 7 | 7 |      { | 
| 8 | 8 | // 任意变量名: 中文点下划线英文数字 | 
| 9 | -        $code = preg_replace_callback('/\B[$](\?)?[:]([.\w\x{4e00}-\x{9aff}]+)(\s*)(\( ( (?>[^()]+) | (?4) )* \) )?/ux', [$this,'echoValueCallback'], $var); | |
| 9 | +        $code = preg_replace_callback('/\B[$](\?)?[:]([.\w\x{4e00}-\x{9aff}]+)(\s*)(\( ( (?>[^()]+) | (?4) )* \) )?/ux', [$this, 'echoValueCallback'], $var); | |
| 10 | 10 | $error = preg_last_error(); | 
| 11 | 11 |          if ($error !== PREG_NO_ERROR) { | 
| 12 | 12 | throw new \Exception($error); | 
| @@ -16,14 +16,14 @@ discard block | ||
| 16 | 16 | |
| 17 | 17 | protected function echoValueCallback($matchs) | 
| 18 | 18 |      { | 
| 19 | - $name=$matchs[2]; | |
| 20 | -        if ($matchs[1]==='?') { | |
| 19 | + $name = $matchs[2]; | |
| 20 | +        if ($matchs[1] === '?') { | |
| 21 | 21 |              return '$this->has("'.$name.'")'; | 
| 22 | 22 | } | 
| 23 | 23 |          if (isset($matchs[4])) { | 
| 24 | 24 |              if (preg_match('/\((.+)\)/', $matchs[4], $v)) { | 
| 25 | 25 | $args = trim($v[1]); | 
| 26 | - $args= strlen($args) ?','.$args:''; | |
| 26 | + $args = strlen($args) ? ','.$args : ''; | |
| 27 | 27 |                  return '$this->get("'.$name.'"'.$args.')'; | 
| 28 | 28 | } | 
| 29 | 29 | } |