Skip to content

Commit

Permalink
Update coding standard
Browse files Browse the repository at this point in the history
  • Loading branch information
xificurk committed Dec 21, 2019
1 parent f5030fb commit 39bf21d
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -26,7 +26,7 @@
"phpstan/phpstan-nette": "^0.12.0",
"damejidlo/phpstan-nette-tester": "^0.2.0",
"jakub-onderka/php-parallel-lint": "^1.0",
"nepada/coding-standard": "^6.3.0",
"nepada/coding-standard": "^7.0.0",
"nette/bootstrap": "^3.0@dev",
"nette/di": "^3.0.1@dev",
"nette/application": "^3.0@dev",
Expand Down
2 changes: 1 addition & 1 deletion src/Bridges/BustCacheDI/BustCacheExtension.php
Expand Up @@ -34,7 +34,7 @@ public function beforeCompile(): void
assert($latteFactory instanceof Nette\DI\Definitions\FactoryDefinition);
$latteFactory->getResultDefinition()->addSetup(
'?->onCompile[] = function (' . Latte\Engine::class . ' $engine): void { $engine->addMacro("bustCache", new ' . BustCacheMacro::class . '(?, ?)); }',
['@self', $this->wwwDir, $this->debugMode]
['@self', $this->wwwDir, $this->debugMode],
);
}

Expand Down
2 changes: 1 addition & 1 deletion tests/Bridges/BustCacheDI/BustCacheExtensionTest.phpt
Expand Up @@ -37,7 +37,7 @@ class BustCacheExtensionTest extends TestCase
Assert::noError(
function () use ($latte): void {
$latte->compile('{bustCache test}');
}
},
);
}

Expand Down
20 changes: 10 additions & 10 deletions tests/BustCache/BustCacheMacroTest.phpt
Expand Up @@ -28,28 +28,28 @@ class BustCacheMacroTest extends TestCase
Assert::true($node->empty);
Assert::same(
'<?php echo LR\Filters::escapeHtmlText(\'/test.txt?a1d0c6e83f\') ?>',
$node->openingCode
$node->openingCode,
);

$node = $compiler->expandMacro('bustCache', "'/test.txt'");
Assert::true($node->empty);
Assert::same(
'<?php echo LR\Filters::escapeHtmlText(\'/test.txt?a1d0c6e83f\') ?>',
$node->openingCode
$node->openingCode,
);

$node = $compiler->expandMacro('bustCache', '/test.txt');
Assert::true($node->empty);
Assert::same(
'<?php echo LR\Filters::escapeHtmlText(\'/test.txt?a1d0c6e83f\') ?>',
$node->openingCode
$node->openingCode,
);

$node = $compiler->expandMacro('bustCache', '$file');
Assert::true($node->empty);
Assert::same(
'<?php echo LR\Filters::escapeHtmlText(LR\Filters::safeUrl($file . \'?\' . Nepada\BustCache\Helpers::hash(\'' . self::FIXTURES_DIR . '\' . $file))) ?>',
$node->openingCode
$node->openingCode,
);
}

Expand All @@ -62,14 +62,14 @@ class BustCacheMacroTest extends TestCase
Assert::true($node->empty);
Assert::same(
'<?php echo LR\Filters::escapeHtmlText(LR\Filters::safeUrl("/test.txt" . \'?\' . Nepada\BustCache\Helpers::timestamp(\'' . self::FIXTURES_DIR . '\' . "/test.txt"))) ?>',
$node->openingCode
$node->openingCode,
);

$node = $compiler->expandMacro('bustCache', '$file');
Assert::true($node->empty);
Assert::same(
'<?php echo LR\Filters::escapeHtmlText(LR\Filters::safeUrl($file . \'?\' . Nepada\BustCache\Helpers::timestamp(\'' . self::FIXTURES_DIR . '\' . $file))) ?>',
$node->openingCode
$node->openingCode,
);
}

Expand All @@ -89,31 +89,31 @@ class BustCacheMacroTest extends TestCase
$compiler->expandMacro('bustCache', 'test', null, Latte\MacroNode::PREFIX_NONE);
},
Latte\CompileException::class,
'Unknown %a?%attribute n:%a?%bustCache'
'Unknown %a?%attribute n:%a?%bustCache',
);

Assert::exception(
function () use ($compiler): void {
$compiler->expandMacro('bustCache', 'test', '|modify');
},
Latte\CompileException::class,
'Modifiers are not allowed in {bustCache}.'
'Modifiers are not allowed in {bustCache}.',
);

Assert::exception(
function () use ($compiler): void {
$compiler->expandMacro('bustCache', '');
},
Latte\CompileException::class,
'Missing file name in {bustCache}.'
'Missing file name in {bustCache}.',
);

Assert::exception(
function () use ($compiler): void {
$compiler->expandMacro('bustCache', 'multi, word');
},
Latte\CompileException::class,
'Multiple arguments are not supported in {bustCache}.'
'Multiple arguments are not supported in {bustCache}.',
);
}

Expand Down
4 changes: 2 additions & 2 deletions tests/BustCache/HelpersTest.phpt
Expand Up @@ -28,15 +28,15 @@ class HelpersTest extends TestCase
Nepada\BustCache\Helpers::timestamp('nonExistent');
},
Nepada\BustCache\FileNotFoundException::class,
'Unable to read file \'nonExistent\' - the file does not exist or is not readable.'
'Unable to read file \'nonExistent\' - the file does not exist or is not readable.',
);

Assert::exception(
function (): void {
Nepada\BustCache\Helpers::hash('nonExistent');
},
Nepada\BustCache\FileNotFoundException::class,
'Unable to read file \'nonExistent\' - the file does not exist or is not readable.'
'Unable to read file \'nonExistent\' - the file does not exist or is not readable.',
);
}

Expand Down

0 comments on commit 39bf21d

Please sign in to comment.