Skip to content

Commit

Permalink
Misc: update coding standard fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
satrun77 committed Nov 17, 2021
1 parent 7464365 commit 4da71e5
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 13 deletions.
3 changes: 3 additions & 0 deletions .php-cs-fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
'import_constants' => null,
'import_functions' => null,
],
'concat_space' => [
'spacing' => 'one',
],
'binary_operator_spaces' => [
'default' => 'align',
],
Expand Down
2 changes: 1 addition & 1 deletion src/Template/Parser/TemplateBlock.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 %>'
Expand Down
12 changes: 6 additions & 6 deletions tests/ParseSpacelessTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -78,7 +83,7 @@ public static function get_template_global_variables()
public static function Hello(?string $name): string
{
return html_entity_decode(
'<div> <span>Hello</span> <strong>'.$name.'</strong></div>',
'<div> <span>Hello</span> <strong>' . $name . '</strong></div>',
ENT_QUOTES | ENT_XML1,
'UTF-8'
);
Expand All @@ -88,9 +93,4 @@ public static function Concat(): string
{
return html_entity_decode(implode('', func_get_args()), ENT_QUOTES | ENT_XML1, 'UTF-8');
}

public static function tearDownAfterClass()
{
// Disable teardown to prevent db access
}
}
12 changes: 6 additions & 6 deletions tests/ParseTemplateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
*/
class ParseTemplateTest extends SapphireTest
{
public static function tearDownAfterClass()
{
// Disable teardown to prevent db access
}

public function testTemplateUsage()
{
// Template to render
Expand Down Expand Up @@ -168,7 +173,7 @@ protected function assertTemplate(string $template, string $expected): void
// Add path to templates used for testing
Config::modify()->set(SSViewer::class, 'themes', [
'$public',
__DIR__.'/support',
__DIR__ . '/support',
'$default',
]);

Expand All @@ -178,9 +183,4 @@ protected function assertTemplate(string $template, string $expected): void
// Assert template output matches the expected
$this->assertXmlStringEqualsXmlString($expected, $output);
}

public static function tearDownAfterClass()
{
// Disable teardown to prevent db access
}
}

0 comments on commit 4da71e5

Please sign in to comment.