diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php index eabef6f..db15e85 100644 --- a/.php-cs-fixer.php +++ b/.php-cs-fixer.php @@ -16,6 +16,9 @@ 'import_constants' => null, 'import_functions' => null, ], + 'concat_space' => [ + 'spacing' => 'one', + ], 'binary_operator_spaces' => [ 'default' => 'align', ], diff --git a/src/Template/Parser/TemplateBlock.php b/src/Template/Parser/TemplateBlock.php index 215a786..a3355c6 100755 --- a/src/Template/Parser/TemplateBlock.php +++ b/src/Template/Parser/TemplateBlock.php @@ -32,7 +32,7 @@ public static function template(array $res): string $arguments = '['; // First the values from '<% arg %>' foreach (static::$arguments as $name => $value) { - $arguments .= "'".$name."' => ".$value.','; + $arguments .= "'" . $name . "' => " . $value . ','; } // Construct 'Content' argument that would hold the content from the body of '<% template %>' diff --git a/tests/ParseSpacelessTest.php b/tests/ParseSpacelessTest.php index 8819dcf..fcb4289 100644 --- a/tests/ParseSpacelessTest.php +++ b/tests/ParseSpacelessTest.php @@ -12,6 +12,11 @@ */ class ParseSpacelessTest extends SapphireTest implements TemplateGlobalProvider { + public static function tearDownAfterClass() + { + // Disable teardown to prevent db access + } + public function testSimpleSpaceCleanUp() { $template = <<<'Template' @@ -78,7 +83,7 @@ public static function get_template_global_variables() public static function Hello(?string $name): string { return html_entity_decode( - '