Skip to content

Commit 8fbc1d6

Browse files
keradusfabpot
authored andcommitted
chore: PHP CS Fixer fixes
1 parent 9fb2ba2 commit 8fbc1d6

File tree

44 files changed

+78
-64
lines changed

Some content is hidden

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

44 files changed

+78
-64
lines changed

src/Symfony/Bridge/Doctrine/Tests/ArgumentResolver/EntityValueResolverTest.php

-1
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,6 @@ private function createRegistry(?ObjectManager $manager = null): ManagerRegistry
494494
$registry->method('getManager')->willReturn($manager);
495495
}
496496

497-
498497
return $registry;
499498
}
500499
}

src/Symfony/Bridge/Doctrine/Tests/Form/DataTransformer/CollectionToArrayTransformerTest.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,7 @@ public function testTransformReadableCollection()
7474
3 => 'bar',
7575
];
7676

77-
$collection = new class($array) implements ReadableCollection
78-
{
77+
$collection = new class($array) implements ReadableCollection {
7978
public function __construct(private readonly array $array)
8079
{
8180
}

src/Symfony/Component/Cache/Tests/Adapter/AbstractRedisAdapterTestCase.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
namespace Symfony\Component\Cache\Tests\Adapter;
1313

1414
use Psr\Cache\CacheItemPoolInterface;
15-
use Relay\Relay;
1615
use Relay\Cluster as RelayCluster;
16+
use Relay\Relay;
1717
use Symfony\Component\Cache\Adapter\RedisAdapter;
1818

1919
abstract class AbstractRedisAdapterTestCase extends AdapterTestCase

src/Symfony/Component/Cache/Tests/Adapter/PredisReplicationAdapterTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ public static function setUpBeforeClass(): void
2727
$hosts = explode(' ', getenv('REDIS_REPLICATION_HOSTS'));
2828
$lastArrayKey = array_key_last($hosts);
2929
$hostTable = [];
30-
foreach($hosts as $key => $host) {
30+
foreach ($hosts as $key => $host) {
3131
$hostInformation = array_combine(['host', 'port'], explode(':', $host));
32-
if($lastArrayKey === $key) {
32+
if ($lastArrayKey === $key) {
3333
$hostInformation['role'] = 'master';
3434
}
3535
$hostTable[] = $hostInformation;

src/Symfony/Component/Cache/Tests/Adapter/RelayClusterAdapterTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111

1212
namespace Symfony\Component\Cache\Tests\Adapter;
1313

14-
use Relay\Relay;
15-
use Relay\Cluster as RelayCluster;
1614
use Psr\Cache\CacheItemPoolInterface;
15+
use Relay\Cluster as RelayCluster;
16+
use Relay\Relay;
1717
use Symfony\Component\Cache\Adapter\AbstractAdapter;
1818
use Symfony\Component\Cache\Adapter\RedisAdapter;
1919
use Symfony\Component\Cache\Exception\InvalidArgumentException;

src/Symfony/Component/Cache/Tests/Traits/RedisProxiesTest.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
namespace Symfony\Component\Cache\Tests\Traits;
1313

1414
use PHPUnit\Framework\TestCase;
15-
use Relay\Relay;
1615
use Relay\Cluster as RelayCluster;
16+
use Relay\Relay;
1717
use Symfony\Component\Cache\Traits\RedisProxyTrait;
1818
use Symfony\Component\Cache\Traits\RelayClusterProxy;
1919
use Symfony\Component\Cache\Traits\RelayProxy;
@@ -124,7 +124,6 @@ public function testRelayProxy()
124124
$this->assertEquals($expectedProxy, $proxy);
125125
}
126126

127-
128127
/**
129128
* @requires extension relay
130129
*/

src/Symfony/Component/Cache/Traits/RedisTrait.php

+7-7
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
use Predis\Connection\Replication\ReplicationInterface as Predis2ReplicationInterface;
2121
use Predis\Response\ErrorInterface;
2222
use Predis\Response\Status;
23-
use Relay\Relay;
2423
use Relay\Cluster as RelayCluster;
24+
use Relay\Relay;
2525
use Relay\Sentinel;
2626
use Symfony\Component\Cache\Exception\CacheException;
2727
use Symfony\Component\Cache\Exception\InvalidArgumentException;
@@ -382,20 +382,20 @@ public static function createConnection(#[\SensitiveParameter] string $dsn, arra
382382
try {
383383
$relayClusterContext = $params['relay_cluster_context'];
384384

385-
foreach (['allow_self_signed', 'verify_peer_name','verify_peer'] as $contextStreamBoolField) {
386-
if(isset($relayClusterContext['stream'][$contextStreamBoolField])) {
385+
foreach (['allow_self_signed', 'verify_peer_name', 'verify_peer'] as $contextStreamBoolField) {
386+
if (isset($relayClusterContext['stream'][$contextStreamBoolField])) {
387387
$relayClusterContext['stream'][$contextStreamBoolField] = filter_var($relayClusterContext['stream'][$contextStreamBoolField], \FILTER_VALIDATE_BOOL);
388388
}
389389
}
390390

391-
foreach (['use-cache', 'client-tracking','throw-on-error','client-invalidations','reply-literal','persistent'] as $contextBoolField) {
392-
if(isset($relayClusterContext[$contextBoolField])) {
391+
foreach (['use-cache', 'client-tracking', 'throw-on-error', 'client-invalidations', 'reply-literal', 'persistent'] as $contextBoolField) {
392+
if (isset($relayClusterContext[$contextBoolField])) {
393393
$relayClusterContext[$contextBoolField] = filter_var($relayClusterContext[$contextBoolField], \FILTER_VALIDATE_BOOL);
394394
}
395395
}
396396

397-
foreach (['max-retries', 'serializer','compression','compression-level'] as $contextIntField) {
398-
if(isset($relayClusterContext[$contextIntField])) {
397+
foreach (['max-retries', 'serializer', 'compression', 'compression-level'] as $contextIntField) {
398+
if (isset($relayClusterContext[$contextIntField])) {
399399
$relayClusterContext[$contextIntField] = filter_var($relayClusterContext[$contextIntField], \FILTER_VALIDATE_INT);
400400
}
401401
}

src/Symfony/Component/Cache/Traits/RelayClusterProxy.php

+7-6
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function __construct(
3737
int|float $command_timeout = 0,
3838
bool $persistent = false,
3939
#[\SensitiveParameter] mixed $auth = null,
40-
array|null $context = null
40+
array|null $context = null,
4141
) {
4242
$this->initializeLazyObject()->__construct(...\func_get_args());
4343
}
@@ -157,7 +157,6 @@ public function endpointId(): array|false
157157
return $this->initializeLazyObject()->endpointId(...\func_get_args());
158158
}
159159

160-
161160
public function rawCommand(array|string $key_or_address, string $cmd, mixed ...$args): mixed
162161
{
163162
return $this->initializeLazyObject()->rawCommand(...\func_get_args());
@@ -383,12 +382,13 @@ public function bitpos(mixed $key, int $bit, ?int $start = null, ?int $end = nul
383382
return $this->initializeLazyObject()->bitpos(...\func_get_args());
384383
}
385384

386-
public function blmove(mixed $srckey, mixed $dstkey, string $srcpos, string $dstpos, float $timeout): \Relay\Cluster|string|null|false
385+
public function blmove(mixed $srckey, mixed $dstkey, string $srcpos, string $dstpos, float $timeout): \Relay\Cluster|string|false|null
387386
{
388387
return $this->initializeLazyObject()->blmove(...\func_get_args());
389388
}
390389

391-
public function lmove(mixed $srckey, mixed $dstkey, string $srcpos, string $dstpos): Cluster|string|null|false {
390+
public function lmove(mixed $srckey, mixed $dstkey, string $srcpos, string $dstpos): Cluster|string|false|null
391+
{
392392
return $this->initializeLazyObject()->lmove(...\func_get_args());
393393
}
394394

@@ -662,7 +662,8 @@ public function ltrim(mixed $key, int $start, int $end): \Relay\Cluster|bool
662662
return $this->initializeLazyObject()->ltrim(...\func_get_args());
663663
}
664664

665-
public static function maxMemory(): int {
665+
public static function maxMemory(): int
666+
{
666667
return \Relay\Cluster::maxMemory();
667668
}
668669

@@ -1083,7 +1084,7 @@ public function zrangestore(mixed $dstkey, mixed $srckey, mixed $start, mixed $e
10831084

10841085
public function zrank(mixed $key, mixed $rank, bool $withscore = false): Cluster|array|int|false
10851086
{
1086-
return $this->initializeLazyObject()->zrank(...\func_get_args());
1087+
return $this->initializeLazyObject()->zrank(...\func_get_args());
10871088
}
10881089

10891090
public function zrangebylex(mixed $key, mixed $min, mixed $max, int $offset = -1, int $count = -1): \Relay\Cluster|array|false

src/Symfony/Component/Clock/Test/ClockSensitiveTrait.php

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
use Symfony\Component\Clock\Clock;
1818
use Symfony\Component\Clock\ClockInterface;
1919
use Symfony\Component\Clock\MockClock;
20-
2120
use function Symfony\Component\Clock\now;
2221

2322
/**

src/Symfony/Component/Clock/Tests/ClockTest.php

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
use Symfony\Component\Clock\MockClock;
1919
use Symfony\Component\Clock\NativeClock;
2020
use Symfony\Component\Clock\Test\ClockSensitiveTrait;
21-
2221
use function Symfony\Component\Clock\now;
2322

2423
class ClockTest extends TestCase

src/Symfony/Component/Console/Formatter/OutputFormatter.php

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespace Symfony\Component\Console\Formatter;
1313

1414
use Symfony\Component\Console\Exception\InvalidArgumentException;
15-
1615
use function Symfony\Component\String\b;
1716

1817
/**

src/Symfony/Component/Console/Helper/QuestionHelper.php

-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
use Symfony\Component\Console\Question\ChoiceQuestion;
2525
use Symfony\Component\Console\Question\Question;
2626
use Symfony\Component\Console\Terminal;
27-
2827
use function Symfony\Component\String\s;
2928

3029
/**

src/Symfony/Component/Form/Tests/Extension/Csrf/EventListener/CsrfValidationListenerTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public function testArrayCsrfToken()
6767
$validation->preSubmit($event);
6868

6969
$this->assertInstanceOf(FormErrorIterator::class, $this->form->getErrors());
70-
$this->assertGreaterThan(0, count($this->form->getErrors()));
70+
$this->assertGreaterThan(0, \count($this->form->getErrors()));
7171
}
7272

7373
public function testMaxPostSizeExceeded()

src/Symfony/Component/HtmlSanitizer/TextSanitizer/UrlSanitizer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ private static function matchAllowedHostParts(array $uriParts, array $trustedPar
132132
{
133133
// Check each chunk of the domain is valid
134134
foreach ($trustedParts as $key => $trustedPart) {
135-
if (!array_key_exists($key, $uriParts) || $uriParts[$key] !== $trustedPart) {
135+
if (!\array_key_exists($key, $uriParts) || $uriParts[$key] !== $trustedPart) {
136136
return false;
137137
}
138138
}

src/Symfony/Component/HttpClient/Response/AmpResponseV5.php

-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
use Symfony\Component\HttpClient\Internal\Canary;
3131
use Symfony\Component\HttpClient\Internal\ClientState;
3232
use Symfony\Contracts\HttpClient\ResponseInterface;
33-
3433
use function Amp\delay;
3534
use function Amp\Future\awaitFirst;
3635

src/Symfony/Component/Lock/Store/RedisStore.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313

1414
use Predis\Response\Error;
1515
use Predis\Response\ServerException;
16-
use Relay\Relay;
1716
use Relay\Cluster as RelayCluster;
17+
use Relay\Relay;
1818
use Symfony\Component\Lock\Exception\InvalidTtlException;
1919
use Symfony\Component\Lock\Exception\LockConflictedException;
2020
use Symfony\Component\Lock\Exception\LockStorageException;

src/Symfony/Component/Lock/Tests/Store/AbstractRedisStoreTestCase.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111

1212
namespace Symfony\Component\Lock\Tests\Store;
1313

14-
use Relay\Relay;
1514
use Relay\Cluster as RelayCluster;
15+
use Relay\Relay;
1616
use Symfony\Component\Lock\Exception\InvalidArgumentException;
1717
use Symfony\Component\Lock\Exception\LockConflictedException;
1818
use Symfony\Component\Lock\Key;

src/Symfony/Component/Lock/Tests/Store/RelayClusterStoreTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public static function setUpBeforeClass(): void
3636
self::markTestSkipped('The Relay\Cluster class is required.');
3737
}
3838

39-
if (getenv('REDIS_CLUSTER_HOSTS') === false) {
39+
if (false === getenv('REDIS_CLUSTER_HOSTS')) {
4040
self::markTestSkipped('REDIS_CLUSTER_HOSTS env var is not defined.');
4141
}
4242
}

src/Symfony/Component/Messenger/DependencyInjection/MessengerPass.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ private function registerReceivers(ContainerBuilder $container, array $busIds):
270270
$failureTransportsMap[$tag['alias']] = $receiverMapping[$id];
271271
}
272272
}
273-
if (!isset($tag['is_consumable']) || $tag['is_consumable'] !== false) {
273+
if (!isset($tag['is_consumable']) || false !== $tag['is_consumable']) {
274274
$consumableReceiverNames[] = $tag['alias'] ?? $id;
275275
}
276276
}

src/Symfony/Component/Security/Http/AccessToken/OAuth2/Oauth2TokenHandler.php

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
use Symfony\Component\Security\Http\AccessToken\AccessTokenHandlerInterface;
1919
use Symfony\Component\Security\Http\Authenticator\Passport\Badge\UserBadge;
2020
use Symfony\Contracts\HttpClient\HttpClientInterface;
21-
2221
use function Symfony\Component\String\u;
2322

2423
/**

src/Symfony/Component/Security/Http/AccessToken/Oidc/OidcTrait.php

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespace Symfony\Component\Security\Http\AccessToken\Oidc;
1313

1414
use Symfony\Component\Security\Core\User\OidcUser;
15-
1615
use function Symfony\Component\String\u;
1716

1817
/**

src/Symfony/Component/Security/Http/Tests/Authenticator/Passport/Badge/UserBadgeTest.php

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
use Symfony\Component\Security\Http\Authenticator\Passport\Badge\UserBadge;
1818
use Symfony\Component\String\Slugger\AsciiSlugger;
1919
use Symfony\Component\String\UnicodeString;
20-
2120
use function Symfony\Component\String\u;
2221

2322
class UserBadgeTest extends TestCase

src/Symfony/Component/Semaphore/Store/RedisStore.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111

1212
namespace Symfony\Component\Semaphore\Store;
1313

14-
use Relay\Relay;
1514
use Relay\Cluster as RelayCluster;
15+
use Relay\Relay;
1616
use Symfony\Component\Semaphore\Exception\InvalidArgumentException;
1717
use Symfony\Component\Semaphore\Exception\SemaphoreAcquiringException;
1818
use Symfony\Component\Semaphore\Exception\SemaphoreExpiredException;

src/Symfony/Component/Semaphore/Tests/Store/AbstractRedisStoreTestCase.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111

1212
namespace Symfony\Component\Semaphore\Tests\Store;
1313

14-
use Relay\Relay;
1514
use Relay\Cluster as RelayCluster;
15+
use Relay\Relay;
1616
use Symfony\Component\Semaphore\PersistingStoreInterface;
1717
use Symfony\Component\Semaphore\Store\RedisStore;
1818

src/Symfony/Component/Semaphore/Tests/Store/RelayClusterStoreTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public static function setUpBeforeClass(): void
2424
self::markTestSkipped('The Relay\Cluster class is required.');
2525
}
2626

27-
if (getenv('REDIS_CLUSTER_HOSTS') === false) {
27+
if (false === getenv('REDIS_CLUSTER_HOSTS')) {
2828
self::markTestSkipped('REDIS_CLUSTER_HOSTS env var is not defined.');
2929
}
3030
}

src/Symfony/Component/Serializer/Tests/Attribute/DiscriminatorMapTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function testExceptionWithEmptyMappingProperty()
4949
public function testExceptionWithMissingDefaultTypeInMapping()
5050
{
5151
$this->expectException(InvalidArgumentException::class);
52-
$this->expectExceptionMessage(sprintf('Default type "bar" given to "%s" must be present in "mapping" types.', DiscriminatorMap::class));
52+
$this->expectExceptionMessage(\sprintf('Default type "bar" given to "%s" must be present in "mapping" types.', DiscriminatorMap::class));
5353
new DiscriminatorMap(typeProperty: 'type', mapping: ['foo' => 'FooClass'], defaultType: 'bar');
5454
}
5555
}

src/Symfony/Component/Serializer/Tests/Command/DebugCommandTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
use Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactory;
1818
use Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactoryInterface;
1919
use Symfony\Component\Serializer\Mapping\Loader\AttributeLoader;
20-
use Symfony\Component\Serializer\Tests\Dummy\DummyClassWithDiscriminatorMap;
2120
use Symfony\Component\Serializer\Tests\Dummy\DummyClassOne;
21+
use Symfony\Component\Serializer\Tests\Dummy\DummyClassWithDiscriminatorMap;
2222

2323
/**
2424
* @author Loïc Frémont <lc.fremont@gmail.com>

src/Symfony/Component/Serializer/Tests/Normalizer/AbstractObjectNormalizerTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,7 @@ public function getMetadataFor($value): ClassMetadataInterface
577577
);
578578
}
579579

580-
throw new InvalidArgumentException(sprintf('"%s" is not handled.', $value));
580+
throw new InvalidArgumentException(\sprintf('"%s" is not handled.', $value));
581581
}
582582

583583
public function hasMetadataFor($value): bool

src/Symfony/Component/String/Tests/FunctionsTest.php

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
use Symfony\Component\String\AbstractString;
1616
use Symfony\Component\String\ByteString;
1717
use Symfony\Component\String\UnicodeString;
18-
1918
use function Symfony\Component\String\b;
2019
use function Symfony\Component\String\s;
2120
use function Symfony\Component\String\u;

src/Symfony/Component/Validator/Constraints/Sequentially.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class Sequentially extends Composite
3030
*/
3131
public function __construct(mixed $constraints = null, ?array $groups = null, mixed $payload = null)
3232
{
33-
if (is_array($constraints) && !array_is_list($constraints)) {
33+
if (\is_array($constraints) && !array_is_list($constraints)) {
3434
trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class);
3535
}
3636

src/Symfony/Component/Validator/Constraints/ZeroComparisonConstraintTrait.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ public function __construct(?array $options = null, ?string $message = null, ?ar
2929
trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class);
3030
}
3131

32-
if (is_array($options) && isset($options['propertyPath'])) {
32+
if (\is_array($options) && isset($options['propertyPath'])) {
3333
throw new ConstraintDefinitionException(\sprintf('The "propertyPath" option of the "%s" constraint cannot be set.', static::class));
3434
}
3535

36-
if (is_array($options) && isset($options['value'])) {
36+
if (\is_array($options) && isset($options['value'])) {
3737
throw new ConstraintDefinitionException(\sprintf('The "value" option of the "%s" constraint cannot be set.', static::class));
3838
}
3939

src/Symfony/Component/Validator/Tests/Constraints/CardSchemeValidatorTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function testNullIsValid()
3131

3232
public function testEmptyStringIsValid()
3333
{
34-
$this->validator->validate('', new CardScheme(schemes:[]));
34+
$this->validator->validate('', new CardScheme(schemes: []));
3535

3636
$this->assertNoViolation();
3737
}

src/Symfony/Component/Validator/Tests/Constraints/ChoiceValidatorTest.php

+3
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ public static function provideConstraintsWithChoicesArray(): iterable
9292

9393
/**
9494
* @group legacy
95+
*
9596
* @dataProvider provideLegacyConstraintsWithChoicesArrayDoctrineStyle
9697
*/
9798
public function testValidChoiceArrayDoctrineStyle(Choice $constraint)
@@ -126,6 +127,7 @@ public static function provideConstraintsWithCallbackFunction(): iterable
126127

127128
/**
128129
* @group legacy
130+
*
129131
* @dataProvider provideLegacyConstraintsWithCallbackFunctionDoctrineStyle
130132
*/
131133
public function testValidChoiceCallbackFunctionDoctrineStyle(Choice $constraint)
@@ -262,6 +264,7 @@ public function testInvalidChoiceMultiple()
262264
->setCode(Choice::NO_SUCH_CHOICE_ERROR)
263265
->assertRaised();
264266
}
267+
265268
/**
266269
* @group legacy
267270
*/

0 commit comments

Comments
 (0)