8000 Fix CS · symfony/symfony@85090fc · GitHub
[go: up one dir, main page]

Skip to content

Commit 85090fc

Browse files
committed
Fix CS
1 parent c9cdac1 commit 85090fc

File tree

18 files changed

+19
-26
lines changed

18 files changed

+19
-26
lines changed

src/Symfony/Bridge/Doctrine/Form/DoctrineOrmTypeGuesser.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ public function guessType($class, $property)
6060

6161
switch ($metadata->getTypeOfField($property)) {
6262
case self::$useDeprecatedConstants ? Type::TARRAY : Types::ARRAY:
63+
// no break
6364
case self::$useDeprecatedConstants ? Type::SIMPLE_ARRAY : Types::SIMPLE_ARRAY:
6465
return new TypeGuess('Symfony\Component\Form\Extension\Core\Type\CollectionType', [], Guess::MEDIUM_CONFIDENCE);
6566
case self::$useDeprecatedConstants ? Type::BOOLEAN : Types::BOOLEAN:

src/Symfony/Bridge/Monolog/Handler/ElasticsearchLogstashHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@
4141
*/
4242
class ElasticsearchLogstashHandler extends AbstractHandler
4343
{
44-
use ProcessableHandlerTrait;
4544
use FormattableHandlerTrait;
45+
use ProcessableHandlerTrait;
4646

4747
private $endpoint;
4848
private $index;

src/Symfony/Bridge/ProxyManager/LazyProxy/PhpDumper/LazyLoadingValueHolderGenerator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public function generate(\ReflectionClass $originalClass, ClassGenerator $classG
6666
if (null !== $docBlock = $method->getDocBlock()) {
6767
$code = substr($code, \strlen($docBlock->generate()));
6868
}
69-
$refAmp = (strpos($code, '&') ?: \PHP_INT_MAX) <= strpos($code, '(') ? '&' : '';
69+
$refAmp = (strpos($code, '&') ?: PHP_INT_MAX) <= strpos($code, '(') ? '&' : '';
7070
$body = preg_replace(
7171
'/\nreturn (\$this->valueHolder[0-9a-f]++)(->[^;]++);$/',
7272
"\nif ($1 === \$returnValue = {$refAmp}$1$2) {\n \$returnValue = \$this;\n}\n\nreturn \$returnValue;",

src/Symfony/Bundle/FrameworkBundle/Test/WebTestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
abstract class WebTestCase extends KernelTestCase
2323
{
2424
use ForwardCompatTestTrait;
25-
use WebTestAssertionsTrait;
2625
use MailerAssertionsTrait;
26+
use WebTestAssertionsTrait;
2727

2828
private function doTearDown()
2929
{

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
use Symfony\Bundle\FrameworkBundle\Controller\TemplateController;
1515
use Symfony\Bundle\FrameworkBundle\Templating\EngineInterface;
1616
use Symfony\Bundle\FrameworkBundle\Tests\TestCase;
17-
use Symfony\Component\DependencyInjection\ContainerBuilder;
1817

1918
/**
2019
* @author Kévin Dunglas <dunglas@gmail.com>

src/Symfony/Component/Cache/Adapter/PhpArrayAdapter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030
*/
3131
class PhpArrayAdapter implements AdapterInterface, CacheInterface, PruneableInterface, ResettableInterface
3232
{
33-
use PhpArrayTrait;
3433
use ContractsTrait;
34+
use PhpArrayTrait;
3535

3636
private $createCacheItem;
3737

src/Symfony/Component/Cache/Adapter/ProxyAdapter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
*/
2626
class ProxyAdapter implements AdapterInterface, CacheInterface, PruneableInterface, ResettableInterface
2727
{
28-
use ProxyTrait;
2928
use ContractsTrait;
29+
use ProxyTrait;
3030

3131
private $namespace;
3232
private $namespaceLen;

src/Symfony/Component/Cache/Adapter/TagAwareAdapter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ class TagAwareAdapter implements TagAwareAdapterInterface, TagAwareCacheInterfac
2727
{
2828
const TAGS_PREFIX = "\0tags\0";
2929

30-
use ProxyTrait;
3130
use ContractsTrait;
31+
use ProxyTrait;
3232

3333
private $deferred = [];
3434
private $createCacheItem;

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,6 @@ private function getConnection()
427427
switch (true) {
428428
case $driver instanceof \Doctrine\DBAL\Driver\Mysqli\Driver:
429429
throw new \LogicException(sprintf('The adapter "%s" does not support the mysqli driver, use pdo_mysql instead.', static::class));
430-
431430
case $driver instanceof \Doctrine\DBAL\Driver\AbstractMySQLDriver:
432431
$this->driver = 'mysql';
433432
break;

src/Symfony/Component/Console/Tests/ApplicationTest.php

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -897,8 +897,7 @@ public function testRenderAnonymousException()
897897
$application = new Application();
898898
$application->setAutoExit(false);
899899
$application->register('foo')->setCode(function () {
900-
throw new class('') extends \InvalidArgumentException {
901-
};
900+
throw new class('') extends \InvalidArgumentException { };
902901
});
903902
$tester = new ApplicationTester($application);
904903

@@ -908,8 +907,7 @@ public function testRenderAnonymousException()
908907
$application = new Application();
909908
$application->setAutoExit(false);
910909
$application->register('foo')->setCode(function () {
911-
throw new \InvalidArgumentException(sprintf('Dummy type "%s" is invalid.', \get_class(new class() {
912-
})));
910+
throw new \InvalidArgumentException(sprintf('Dummy type "%s" is invalid.', \get_class(new class() { })));
913911
});
914912
$tester = new ApplicationTester($application);
915913

@@ -922,8 +920,7 @@ public function testRenderExceptionStackTraceContainsRootException()
922920
$application = new Application();
923921
$application->setAutoExit(false);
924922
$application->register('foo')->setCode(function () {
925-
throw new class('') extends \InvalidArgumentException {
926-
};
923+
throw new class('') extends \InvalidArgumentException { };
927924
});
928925
$tester = new ApplicationTester($application);
929926

@@ -933,8 +930,7 @@ public function testRenderExceptionStackTraceContainsRootException()
933930
$application = new Application();
934931
$application->setAutoExit(false);
935932
$application->register('foo')->setCode(function () {
936-
throw new \InvalidArgumentException(sprintf('Dummy type "%s" is invalid.', \get_class(new class() {
937-
})));
933+
throw new \InvalidArgumentException(sprintf('Dummy type "%s" is invalid.', \get_class(new class() { })));
938934
});
939935
$tester = new ApplicationTester($application);
940936

src/Symfony/Component/DependencyInjection/Loader/Configurator/InstanceofConfigurator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ class InstanceofConfigurator extends AbstractServiceConfigurator
2121
const FACTORY = 'instanceof';
2222

2323
use Traits\AutowireTrait;
24+
use Traits\BindTrait;
2425
use Traits\CallTrait;
2526
use Traits\ConfiguratorTrait;
2627
use Traits\LazyTrait;
2728
use Traits\PropertyTrait;
2829
use Traits\PublicTrait;
2930
use Traits\ShareTrait;
3031
use Traits\TagTrait;
31-
use Traits\BindTrait;
3232

3333
private $path;
3434

src/Symfony/Component/Finder/Gitignore.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public static function toRegex(string $gitignoreFileContent): string
5454
}
5555

5656
$negativesAfter = array_filter(\array_slice($negatives, ++$index));
57-
if ($negativesAfter !== []) {
57+
if ([] !== $negativesAfter) {
5858
$pattern .= sprintf('(?<!%s)', implode('|', $negativesAfter));
5959
}
6060

src/Symfony/Component/Form/Command/DebugCommand.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,18 +70,18 @@ protected function configure()
7070
7171
<info>php %command.full_name%</info>
7272
73-
The command lists all built-in types, services types, type extensions and
73+
The command lists all built-in types, services types, type extensions and
7474
guessers currently available.
7575
7676
<info>php %command.full_name% Symfony\Component\Form\Extension\Core\Type\ChoiceType</info>
7777
<info>php %command.full_name% ChoiceType</info>
7878
79-
The command lists all defined options that contains the given form type,
79+
The command lists all defined options that contains the given form type,
8080
as well as their parents and type extensions.
8181
8282
<info>php %command.full_name% ChoiceType choice_value</info>
8383
84-
Use the <info>--show-deprecated</info> option to display form types with
84+
Use the <info>--show-deprecated</info> option to display form types with
8585
deprecated options or the deprecated options of the given form type:
8686
8787
<info>php %command.full_name% --show-deprecated</info>

src/Symfony/Component/HttpFoundation/Request.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1589,7 +1589,7 @@ public function isNoCache()
15891589
/**
15901590
* Gets the preferred format for the response by inspecting, in the following order:
15911591
* * the request format set using setRequestFormat
1592-
* * the values of the Accept HTTP header
1592+
* * the values of the Accept HTTP header.
15931593
*
15941594
* Note that if you use this method, you should send the "Vary: Accept" header
15951595
* in the response to prevent any issues with intermediary HTTP caches.

src/Symfony/Component/HttpKernel/Tests/Controller/ContainerControllerResolverTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
use Psr\Container\ContainerInterface;
1515
use Psr\Log\LoggerInterface;
1616
use Symfony\Component\DependencyInjection\Container;
17-
use Symfony\Component\DependencyInjection\ContainerBuilder;
1817
use Symfony\Component\HttpFoundation\Request;
1918
use Symfony\Component\HttpKernel\Controller\ContainerControllerResolver;
2019

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,6 @@ private function getDriver(): string
334334
switch (true) {
335335
case $driver instanceof \Doctrine\DBAL\Driver\Mysqli\Driver:
336336
throw new \LogicException(sprintf('The adapter "%s" does not support the mysqli driver, use pdo_mysql instead.', static::class));
337-
338337
case $driver instanceof \Doctrine\DBAL\Driver\AbstractMySQLDriver:
339338
$this->driver = 'mysql';
340339
break;

src/Symfony/Component/Mime/Part/DataPart.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public static function fromPath(string $path, string $name = null, string $conte
5959
if (false === is_readable($path)) {
6060
throw new InvalidArgumentException(sprintf('Path "%s" is not readable.', $path));
6161
}
62-
62+
6363
if (false === $handle = @fopen($path, 'r', false)) {
6464
throw new InvalidArgumentException(sprintf('Unable to open path "%s".', $path));
6565
}

src/Symfony/Component/Translation/Dumper/PoFileDumper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public function formatCatalogue(MessageCatalogue $messages, $domain, array $opti
5353

5454
$sourceRules = $this->getStandardRules($source);
5555
$targetRules = $this->getStandardRules($target);
56-
if (2 == \count($sourceRules) && $targetRules !== []) {
56+
if (2 == \count($sourceRules) && [] !== $targetRules) {
5757
$output .= sprintf('msgid "%s"'."\n", $this->escape($sourceRules[0]));
5858
$output .= sprintf('msgid_plural "%s"'."\n", $this->escape($sourceRules[1]));
5959
foreach ($targetRules as $i => $targetRule) {

0 commit comments

Comments
 (0)
0