Internal compiler classes always return a string (#918)

* Internal compiler classes always return a string (the internal has_code flag has been removed for simplicity)
* Add :string method signature to compile method everywhere.
This commit is contained in:
Simon Wisselink
2024-03-25 13:44:06 +01:00
committed by GitHub
parent e161babbd4
commit 7255b4d73c
58 changed files with 253 additions and 246 deletions

View File

@@ -41,8 +41,8 @@ class smarty_compiler_getparamsshort extends Base
*/
public $shorttag_order = array('s1', 's2', 's3');
public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = [], $tag = null, $function = null)
{
public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = [], $tag = null, $function = null): string
{
$_attr = $this->getAttributes($compiler, $args);
$output = '<?php echo "array(';
foreach ($_attr as $key => $value) {