8000 chore: PHP CS Fixer fixes by keradus · Pull Request #59972 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

chore: PHP CS Fixer fixes #59972

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Symfony/Bridge/Doctrine/Middleware/Debug/Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function connect(array $params): ConnectionInterface
{
$connection = parent::connect($params);

if ('void' !== (string) (new \ReflectionMethod(DriverInterface\Connection::class, 'commit'))->getReturnType()) {
if ('void' !== (string) (new \ReflectionMethod(ConnectionInterface::class, 'commit'))->getReturnType()) {
return new DBAL3\Connection(
$connection,
$this->debugDataHolder,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ private function createCollector(array $queries): DoctrineDataCollector
->getMock();
$connection->expects($this->any())
->method('getDatabasePlatform')
->willReturn(new MySqlPlatform());
->willReturn(new MySQLPlatform());

$registry = $this->createMock(ManagerRegistry::class);
$registry
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Bridge/PhpUnit/bin/simple-phpunit.php
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ class_exists(\SymfonyExcludeListSimplePhpunit::class, false) && PHPUnit\Util\Bla
}
}
} elseif (!isset($argv[1]) || 'install' !== $argv[1] || file_exists('install')) {
if (!class_exists(\SymfonyExcludeListSimplePhpunit::class, false)) {
if (!class_exists(SymfonyExcludeListSimplePhpunit::class, false)) {
class SymfonyExcludeListSimplePhpunit
{
}
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Bridge/PhpUnit/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
}

// Detect if we're loaded by an actual run of phpunit
if (!defined('PHPUNIT_COMPOSER_INSTALL') && !class_exists(\PHPUnit\TextUI\Command::class, false)) {
if (!defined('PHPUNIT_COMPOSER_INSTALL') && !class_exists(PHPUnit\TextUI\Command::class, false)) {
return;
}

Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/Cache/Traits/RedisTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -692,7 +692,7 @@ private function pipeline(\Closure $generator, ?object $redis = null): \Generato
$ids = [];
$redis ??= $this->redis;

if ($redis instanceof \RedisCluster || $redis instanceof \Relay\Cluster || ($redis instanceof \Predis\ClientInterface && ($redis->getConnection() instanceof RedisCluster || $redis->getConnection() instanceof Predis2RedisCluster))) {
if ($redis instanceof \RedisCluster || $redis instanceof RelayCluster || ($redis instanceof \Predis\ClientInterface && ($redis->getConnection() instanceof RedisCluster || $redis->getConnection() instanceof Predis2RedisCluster))) {
// phpredis & predis don't support pipelining with RedisCluster
// \Relay\Cluster does not support multi with pipeline mode
// see https://github.com/phpredis/phpredis/blob/develop/cluster.markdown#pipelining
Expand Down
314 changes: 157 additions & 157 deletions src/Symfony/Component/Cache/Traits/RelayClusterProxy.php

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/Symfony/Component/Clock/Test/ClockSensitiveTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
use Symfony\Component\Clock\Clock;
use Symfony\Component\Clock\ClockInterface;
use Symfony\Component\Clock\MockClock;

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it intended that this (and the following changes) partially reverts #59939?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be some semi-conflicting rule when all needs to be applied to get final outcome.
Right now there is still lot of conflict between config and actually used style and I need to apply rule one by one. But it's only ~50 remaining issues to get clear state, then we will be able to apply whole config and stabilize the piece of code touched by multiple rules.

use function Symfony\Component\Clock\now;

/**
Expand Down
1 change: 1 addition & 0 deletions src/Symfony/Component/Clock/Tests/ClockTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
use Symfony\Component\Clock\MockClock;
use Symfony\Component\Clock\NativeClock;
use Symfony\Component\Clock\Test\ClockSensitiveTrait;

use function Symfony\Component\Clock\now;

class ClockTest extends TestCase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
namespace Symfony\Component\Console\Formatter;

use Symfony\Component\Console\Exception\InvalidArgumentException;

use function Symfony\Component\String\b;

/**
Expand Down
1 change: 1 addition & 0 deletions src/Symfony/Component/Console/Helper/QuestionHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
use Symfony\Component\Console\Question\ChoiceQuestion;
use Symfony\Component\Console\Question\Question;
use Symfony\Component\Console\Terminal;

use function Symfony\Component\String\s;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function testRenderWithoutNode()
$tree = TreeHelper::createTree($output);

$tree->render();
$this->assertSame(PHP_EOL, $output->fetch());
$this->assertSame(\PHP_EOL, $output->fetch());
}

public function testRenderSingleNode()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ private function checkOutEdges(array $edges): void
continue;
}

$isLeaf = !!$node->getValue();
$isLeaf = (bool) $node->getValue();
$isConcrete = !$edge->isLazy() && !$edge->isWeak();

// Skip already checked lazy services if they are still lazy. Will not gain any new information.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Bundle\TwigBundle\Tests\TestCase;
use Symfony\Component\Console\Tester\CommandTester;
use Symfony\Component\DependencyInjection\Container;
use Symfony\Component\ErrorHandler\Command\ErrorDumpCommand;
use Symfony\Component\ErrorHandler\ErrorRenderer\ErrorRendererInterface;
use Symfony\Component\ErrorHandler\Exception\FlattenException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
use Symfony\Component\HttpClient\Internal\Canary;
use Symfony\Component\HttpClient\Internal\ClientState;
use Symfony\Contracts\HttpClient\ResponseInterface;

use function Amp\delay;
use function Amp\Future\awaitFirst;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
use Symfony\Component\Security\Http\AccessToken\AccessTokenHandlerInterface;
use Symfony\Component\Security\Http\Authenticator\Passport\Badge\UserBadge;
use Symfony\Contracts\HttpClient\HttpClientInterface;

use function Symfony\Component\String\u;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
namespace Symfony\Component\Security\Http\AccessToken\Oidc;

use Symfony\Component\Security\Core\User\OidcUser;

use function Symfony\Component\String\u;

/**
Expand Down
< F438 /div>
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
use Symfony\Component\Security\Http\Authenticator\Passport\Badge\UserBadge;
use Symfony\Component\String\Slugger\AsciiSlugger;
use Symfony\Component\String\UnicodeString;

use function Symfony\Component\String\u;

class UserBadgeTest extends TestCase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ public function testAccessDeniedMessages(string|Expression $attribute, string|ar
$authChecker = new AuthorizationChecker(new TokenStorage(), new AccessDecisionManager((function () use (&$authChecker) {
yield new ExpressionVoter(new ExpressionLanguage(), null, $authChecker);
yield new RoleVoter();
yield new class() extends Voter {
yield new class extends Voter {
protected function supports(string $attribute, mixed $subject): bool
{
return 'POST_VIEW' === $attribute;
Expand Down
1 change: 1 addition & 0 deletions src/Symfony/Component/String/Tests/FunctionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
use Symfony\Component\String\AbstractString;
use Symfony\Component\String\ByteString;
use Symfony\Component\String\UnicodeString;

use function Symfony\Component\String\b;
use function Symfony\Component\String\s;
use function Symfony\Component\String\u;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public function testReflectionCaster()
public function testClosureCaster()
{
$a = $b = 123;
$var = function ($x) use ($a, &$b) {};
$var = function ($x) use ($a, &$b) { var_dump($a, $b); };

$this->assertDumpMatchesFormat(
<<<'EOTXT'
Expand Down
Loading
0