Skip to content

Commit a384c23

Browse files
Various CS fixes
1 parent 771dc85 commit a384c23

File tree

62 files changed

+117
-124
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+117
-124
lines changed

.php-cs-fixer.dist.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
'(?P<EXTRA>.*)??',
4545
preg_quote($fileHeaderParts[1], '/'),
4646
'/s',
47-
])
47+
]),
4848
],
4949
])
5050
->setRiskyAllowed(true)

src/Symfony/Bundle/FrameworkBundle/Command/DebugAutowiringCommand.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
use Symfony\Component\Console\Input\InputOption;
2121
use Symfony\Component\Console\Output\OutputInterface;
2222
use Symfony\Component\Console\Style\SymfonyStyle;
23-
use Symfony\Component\DependencyInjection\Attribute\Target;
2423
use Symfony\Component\ErrorHandler\ErrorRenderer\FileLinkFormatter;
2524

2625
/**

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@
6161
use Symfony\Component\DependencyInjection\Alias;
6262
use Symfony\Component\DependencyInjection\Argument\IteratorArgument;
6363
use Symfony\Component\DependencyInjection\Argument\ServiceLocatorArgument;
64-
use Symfony\Component\DependencyInjection\Attribute\Target;
6564
use Symfony\Component\DependencyInjection\ChildDefinition;
6665
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
6766
use Symfony\Component\DependencyInjection\Compiler\ServiceLocatorTagPass;
@@ -3323,13 +3322,13 @@ private function registerRateLimiterConfiguration(array $config, ContainerBuilde
33233322
throw new LogicException(\sprintf('Compound rate limiter "%s" requires at least one sub-limiter.', $name));
33243323
}
33253324

3326-
if (\array_diff($limiterConfig['limiters'], $limiters)) {
3325+
if (array_diff($limiterConfig['limiters'], $limiters)) {
33273326
throw new LogicException(\sprintf('Compound rate limiter "%s" requires at least one sub-limiter to be configured.', $name));
33283327
}
33293328

33303329
$container->register($limiterId = 'limiter.'.$name, CompoundRateLimiterFactory::class)
33313330
->addTag('rate_limiter', ['name' => $name])
3332-
->addArgument(new IteratorArgument(\array_map(
3331+
->addArgument(new IteratorArgument(array_map(
33333332
static fn (string $name) => new Reference('limiter.'.$name),
33343333
$limiterConfig['limiters']
33353334
)))

src/Symfony/Bundle/FrameworkBundle/Tests/Controller/ControllerHelperTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class ControllerHelperTest extends AbstractControllerTest
1919
{
2020
protected function createController()
2121
{
22-
return new class() extends ControllerHelper {
22+
return new class extends ControllerHelper {
2323
public function __construct()
2424
{
2525
}
@@ -36,26 +36,26 @@ public function testSync()
3636
$r = new \ReflectionClass(ControllerHelper::class);
3737
$m = $r->getMethod('getSubscribedServices');
3838
$helperSrc = file($r->getFileName());
39-
$helperSrc = implode('', array_slice($helperSrc, $m->getStartLine() - 1, $r->getEndLine() - $m->getStartLine()));
39+
$helperSrc = implode('', \array_slice($helperSrc, $m->getStartLine() - 1, $r->getEndLine() - $m->getStartLine()));
4040

4141
$r = new \ReflectionClass(AbstractController::class);
4242
$m = $r->getMethod('getSubscribedServices');
4343
$abstractSrc = file($r->getFileName());
4444
$code = [
45-
implode('', array_slice($abstractSrc, $m->getStartLine() - 1, $m->getEndLine() - $m->getStartLine() + 1)),
45+
implode('', \array_slice($abstractSrc, $m->getStartLine() - 1, $m->getEndLine() - $m->getStartLine() + 1)),
4646
];
4747

4848
foreach ($r->getMethods(\ReflectionMethod::IS_PROTECTED) as $m) {
4949
if ($m->getDocComment()) {
5050
$code[] = ' '.$m->getDocComment();
5151
}
52-
$code[] = substr_replace(implode('', array_slice($abstractSrc, $m->getStartLine() - 1, $m->getEndLine() - $m->getStartLine() + 1)), 'public', 4, 9);
52+
$code[] = substr_replace(implode('', \array_slice($abstractSrc, $m->getStartLine() - 1, $m->getEndLine() - $m->getStartLine() + 1)), 'public', 4, 9);
5353
}
5454
foreach ($r->getMethods(\ReflectionMethod::IS_PRIVATE) as $m) {
5555
if ($m->getDocComment()) {
5656
$code[] = ' '.$m->getDocComment();
5757
}
58-
$code[] = implode('', array_slice($abstractSrc, $m->getStartLine() - 1, $m->getEndLine() - $m->getStartLine() + 1));
58+
$code[] = implode('', \array_slice($abstractSrc, $m->getStartLine() - 1, $m->getEndLine() - $m->getStartLine() + 1));
5959
}
6060
$code = implode("\n", $code);
6161

src/Symfony/Bundle/SecurityBundle/Debug/TraceableFirewallListener.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
use Symfony\Bundle\SecurityBundle\Security\LazyFirewallContext;
1717
use Symfony\Component\HttpKernel\Event\RequestEvent;
1818
use Symfony\Component\Security\Http\Authenticator\Debug\TraceableAuthenticatorManagerListener;
19-
use Symfony\Component\Security\Http\Firewall\AbstractListener;
2019
use Symfony\Component\Security\Http\Firewall\FirewallListenerInterface;
2120
use Symfony\Contracts\Service\ResetInterface;
2221

src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/LoginThrottlingFactory.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
1515
use Symfony\Component\Config\Definition\Builder\NodeDefinition;
16-
use Symfony\Component\DependencyInjection\Attribute\Target;
1716
use Symfony\Component\DependencyInjection\ChildDefinition;
1817
use Symfony\Component\DependencyInjection\ContainerBuilder;
1918
use Symfony\Component\DependencyInjection\Exception\LogicException;

src/Symfony/Bundle/SecurityBundle/Tests/DataCollector/SecurityDataCollectorTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
use Symfony\Component\Security\Core\Role\RoleHierarchy;
3434
use Symfony\Component\Security\Core\User\InMemoryUser;
3535
use Symfony\Component\Security\Http\Firewall\AbstractListener;
36-
use Symfony\Component\Security\Http\Firewall\FirewallListenerInterface;
3736
use Symfony\Component\Security\Http\FirewallMapInterface;
3837
use Symfony\Component\Security\Http\Logout\LogoutUrlGenerator;
3938
use Symfony\Component\VarDumper\Caster\ClassStub;

src/Symfony/Bundle/SecurityBundle/Tests/Debug/TraceableFirewallListenerTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
use Symfony\Component\Security\Http\Authenticator\Passport\SelfValidatingPassport;
3232
use Symfony\Component\Security\Http\Firewall\AbstractListener;
3333
use Symfony\Component\Security\Http\Firewall\AuthenticatorManagerListener;
34-
use Symfony\Component\Security\Http\Firewall\FirewallListenerInterface;
3534
use Symfony\Component\Security\Http\Logout\LogoutUrlGenerator;
3635

3736
/**

src/Symfony/Bundle/TwigBundle/Tests/DependencyInjection/TwigExtensionTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public function testLoadFullConfiguration(string $format, ?string $buildDir)
105105
$this->assertEquals('ISO-8859-1', $options['charset'], '->load() sets the charset option');
106106
$this->assertTrue($options['debug'], '->load() sets the debug option');
107107
$this->assertTrue($options['strict_variables'], '->load() sets the strict_variables option');
108-
$this->assertEquals($buildDir !== null ? new Reference('twig.template_cache.chain') : '%kernel.cache_dir%/twig', $options['cache'], '->load() sets the cache option');
108+
$this->assertEquals(null !== $buildDir ? new Reference('twig.template_cache.chain') : '%kernel.cache_dir%/twig', $options['cache'], '->load() sets the cache option');
109109
}
110110

111111
/**
@@ -156,7 +156,7 @@ public function testLoadProdCacheConfiguration(string $format, ?string $buildDir
156156

157157
// Twig options
158158
$options = $container->getDefinition('twig')->getArgument(1);
159-
$this->assertEquals($buildDir !== null ? new Reference('twig.template_cache.chain') : '%kernel.cache_dir%/twig', $options['cache'], '->load() sets cache option to CacheChain reference');
159+
$this->assertEquals(null !== $buildDir ? new Reference('twig.template_cache.chain') : '%kernel.cache_dir%/twig', $options['cache'], '->load() sets cache option to CacheChain reference');
160160
}
161161

162162
/**

src/Symfony/Component/AssetMapper/Compiler/Parser/JavascriptSequenceParser.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,16 +138,16 @@ public function parseUntil(int $position): void
138138
while (false !== $endPos = strpos($this->content, $matchChar, $endPos)) {
139139
$backslashes = 0;
140140
$i = $endPos - 1;
141-
while ($i >= 0 && $this->content[$i] === '\\') {
142-
$backslashes++;
143-
$i--;
141+
while ($i >= 0 && '\\' === $this->content[$i]) {
142+
++$backslashes;
143+
--$i;
144144
}
145145

146146
if (0 === $backslashes % 2) {
147147
break;
148148
}
149149

150-
$endPos++;
150+
++$endPos;
151151
}
152152

153153
if (false === $endPos) {

0 commit comments

Comments
 (0)