diff --git a/src/Formatter/Views/FormatPslTags.php b/src/Formatter/Views/FormatPslTags.php index cd22b8a..aee4d59 100644 --- a/src/Formatter/Views/FormatPslTags.php +++ b/src/Formatter/Views/FormatPslTags.php @@ -38,10 +38,10 @@ protected function psl_tags() function ($matches) { // Trim the content inside the PHP tags, removing trailing semicolons $val = trim($matches[1]); - $val = trim($val, ';'); + $val = str_ends_with(')', $val) ? $val . ';' : $val; // Reformat the PHP content and return it - return '<' . '?php ' . $val . '; ?' . '>'; + return '<' . '?php ' . $val . ' ?' . '>'; }, $this->contents );