Skip to content

Commit 76062c8

Browse files
committed
Fix CS
1 parent 6513bc4 commit 76062c8

File tree

13 files changed

+26
-25
lines changed

13 files changed

+26
-25
lines changed

extra/cache-extra/Tests/IntegrationTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function getExtensions()
2929
protected function getRuntimeLoaders()
3030
{
3131
return [
32-
new class() implements RuntimeLoaderInterface {
32+
new class implements RuntimeLoaderInterface {
3333
public function load(string $class): ?object
3434
{
3535
return CacheRuntime::class === $class ? new CacheRuntime(new ArrayAdapter()) : null;

extra/markdown-extra/Tests/FunctionalTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function testMarkdown(string $template, string $expected)
3737
=====
3838
3939
Great!
40-
EOF
40+
EOF,
4141
]));
4242
$twig->addExtension(new MarkdownExtension());
4343
$twig->addRuntimeLoader(new class($class) implements RuntimeLoaderInterface {

src/Extension/AbstractExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public function getLastModified(): int
5353
$lastModified = filemtime($filename);
5454

5555
// Track modifications of the runtime class if it exists and follows the naming convention
56-
if (str_ends_with($filename, 'Extension.php') && is_file($filename = substr($filename, 0, -13) . 'Runtime.php')) {
56+
if (str_ends_with($filename, 'Extension.php') && is_file($filename = substr($filename, 0, -13).'Runtime.php')) {
5757
$lastModified = max($lastModified, filemtime($filename));
5858
}
5959

src/Extension/CoreExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -917,7 +917,7 @@ public static function keys($array): array
917917
}
918918

919919
/**
920-
* Invokes a callable
920+
* Invokes a callable.
921921
*
922922
* @internal
923923
*/

src/Lexer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class Lexer
5353
(?<DNUM>(?&LNUM)(?:(?&FRAC))?) # Decimal number 123_456.456
5454
)(?:(?&DNUM)(?:(?&EXPONENT))?) # 123_456.456E+10
5555
/Ax';
56-
56+
5757
public const REGEX_DQ_STRING_DELIM = '/"/A';
5858
public const REGEX_DQ_STRING_PART = '/[^#"\\\\]*(?:(?:\\\\.|#(?!\{))[^#"\\\\]*)*/As';
5959
public const REGEX_INLINE_COMMENT = '/#[^\n]*/A';

src/Template.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,7 @@ protected function loadTemplate($template, $templateName = null, $line = null, $
318318

319319
/**
320320
* @internal
321+
*
321322
* @return $this
322323
*/
323324
public function unwrap(): self
@@ -492,7 +493,7 @@ protected function hasMacro(string $name, array $context): bool
492493
return $parent->hasMacro($name, $context);
493494
}
494495

495-
protected function getTemplateForMacro(string $name, array $context, int $line, Source $source): Template
496+
protected function getTemplateForMacro(string $name, array $context, int $line, Source $source): self
496497
{
497498
if (method_exists($this, $name)) {
498499
return $this;

tests/DeprecatedCallableInfoTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function testTriggerDeprecation($expected, DeprecatedCallableInfo $info)
3030
if (\E_USER_DEPRECATED === $type) {
3131
$deprecations[] = $msg;
3232
}
33-
33+
3434
return false;
3535
});
3636

@@ -62,7 +62,7 @@ public function testTriggerDeprecationWithoutFileOrLine()
6262
if (\E_USER_DEPRECATED === $type) {
6363
$deprecations[] = $msg;
6464
}
65-
65+
6666
return false;
6767
});
6868

tests/EnvironmentTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ public function testExtensionsAreNotInitializedWhenRenderingACompiledTemplate()
179179

180180
// force compilation
181181
$twig = new Environment($loader = new ArrayLoader(['index' => '{{ foo }}']), $options);
182-
$twig->addExtension($extension = new class() extends AbstractExtension {
182+
$twig->addExtension($extension = new class extends AbstractExtension {
183183
public bool $throw = false;
184184

185185
public function getFilters(): array
@@ -475,7 +475,7 @@ protected function getMockLoader($templateName, $templateContent)
475475
public function testResettingGlobals()
476476
{
477477
$twig = new Environment(new ArrayLoader(['index' => '']));
478-
$twig->addExtension(new class() extends AbstractExtension implements GlobalsInterface {
478+
$twig->addExtension(new class extends AbstractExtension implements GlobalsInterface {
479479
public function getGlobals(): array
480480
{
481481
return [

tests/ErrorTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function testTwigExceptionGuessWithMissingVarAndArrayLoader()
4141
{% block foo %}
4242
{{ foo.bar }}
4343
{% endblock %}
44-
EOHTML
44+
EOHTML,
4545
]);
4646

4747
$twig = new Environment($loader, ['strict_variables' => true, 'debug' => true, 'cache' => false]);
@@ -70,7 +70,7 @@ public function testTwigExceptionGuessWithExceptionAndArrayLoader()
7070
{% block foo %}
7171
{{ foo.bar }}
7272
{% endblock %}
73-
EOHTML
73+
EOHTML,
7474
]);
7575
$twig = new Environment($loader, ['strict_variables' => true, 'debug' => true, 'cache' => false]);
7676

@@ -163,7 +163,7 @@ public function testTwigArrayFilterThrowsRuntimeExceptions()
163163
{% for n in variable|filter(x => x > 3) %}
164164
This list contains {{n}}.
165165
{% endfor %}
166-
EOHTML
166+
EOHTML,
167167
]);
168168

169169
$twig = new Environment($loader, ['debug' => true, 'cache' => false]);
@@ -190,7 +190,7 @@ public function testTwigArrayMapThrowsRuntimeExceptions()
190190
{% for n in variable|map(x => x * 3) %}
191191
{{- n -}}
192192
{% endfor %}
193-
EOHTML
193+
EOHTML,
194194
]);
195195

196196
$twig = new Environment($loader, ['debug' => true, 'cache' => false]);
@@ -215,7 +215,7 @@ public function testTwigArrayReduceThrowsRuntimeExceptions()
215215
'reduce-null.html' => <<<EOHTML
216216
{# We expect a runtime error if `variable` is not traversable #}
217217
{{ variable|reduce((carry, x) => carry + x) }}
218-
EOHTML
218+
EOHTML,
219219
]);
220220

221221
$twig = new Environment($loader, ['debug' => true, 'cache' => false]);

tests/ExpressionParserTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ public function testUnknownTestWithoutSuggestions()
408408
public function testCompiledCodeForDynamicTest()
409409
{
410410
$env = new Environment(new ArrayLoader(['index' => '{{ "a" is foo_foo_bar_bar }}']), ['cache' => false, 'autoescape' => false]);
411-
$env->addExtension(new class() extends AbstractExtension {
411+
$env->addExtension(new class extends AbstractExtension {
412412
public function getTests()
413413
{
414414
return [
@@ -423,7 +423,7 @@ public function getTests()
423423
public function testCompiledCodeForDynamicFunction()
424424
{
425425
$env = new Environment(new ArrayLoader(['index' => '{{ foo_foo_bar_bar("a") }}']), ['cache' => false, 'autoescape' => false]);
426-
$env->addExtension(new class() extends AbstractExtension {
426+
$env->addExtension(new class extends AbstractExtension {
427427
public function getFunctions()
428428
{
429429
return [
@@ -438,7 +438,7 @@ public function getFunctions()
438438
public function testCompiledCodeForDynamicFilter()
439439
{
440440
$env = new Environment(new ArrayLoader(['index' => '{{ "a"|foo_foo_bar_bar }}']), ['cache' => false, 'autoescape' => false]);
441-
$env->addExtension(new class() extends AbstractExtension {
441+
$env->addExtension(new class extends AbstractExtension {
442442
public function getFilters()
443443
{
444444
return [
@@ -569,10 +569,10 @@ public function testTwoWordTestPrecedence()
569569
public function testUnaryPrecedenceChange()
570570
{
571571
$env = new Environment(new ArrayLoader(), ['cache' => false, 'autoescape' => false]);
572-
$env->addExtension(new class () extends AbstractExtension {
572+
$env->addExtension(new class extends AbstractExtension {
573573
public function getOperators()
574574
{
575-
$class = new class (new ConstantExpression('foo', 1), 1) extends AbstractUnary {
575+
$class = new class(new ConstantExpression('foo', 1), 1) extends AbstractUnary {
576576
public function operator(Compiler $compiler): Compiler
577577
{
578578
return $compiler->raw('!');

0 commit comments

Comments
 (0)