8000 chore: CS fixes · symfony/symfony@023ed3e · GitHub
[go: up one dir, main page]

Skip to content

Commit 023ed3e

Browse files
keradusnicolas-grekas
authored andcommitted
chore: CS fixes
1 parent a2fc092 commit 023ed3e

File tree

81 files changed

+176
-197
lines changed

Some content is hidden

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

81 files changed

+176
-197
lines changed

.php-cs-fixer.dist.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@
6262
->notPath('Symfony/Component/Cache/Traits/Redis6Proxy.php')
6363
->notPath('Symfony/Component/Cache/Traits/RedisCluster5Proxy.php')
6464
->notPath('Symfony/Component/Cache/Traits/RedisCluster6Proxy.php')
65+
// svg
66+
->notPath('Symfony/Component/ErrorHandler/Resources/assets/images/symfony-ghost.svg.php')
67+
// HTML templates
68+
->notPath('#Symfony/.*\.html\.php#')
6569
)
6670
->setCacheFile('.php-cs-fixer.cache')
6771
;

src/Symfony/Bridge/Monolog/Tests/RecordFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
namespace Symfony\Bridge\Monolog\Tests;
1313

1414
use Monolog\Level;
15-
use Monolog\LogRecord;
1615
use Monolog\Logger;
16+
use Monolog\LogRecord;
1717

1818
class RecordFactory
1919
{

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ trait DomCrawlerAssertionsTrait
2626
{
2727
public static function assertSelectorExists(string $selector, string $message = ''): void
2828
{
29-
self::assertThat(self::getCrawler(), new DomCrawlerConstraint\CrawlerSelectorExists($selector), $message);
29+
self::assertThat(self::getCrawler(), new CrawlerSelectorExists($selector), $message);
3030
}
3131

3232
public static function assertSelectorNotExists(string $selector, string $message = ''): void
3333
{
34-
self::assertThat(self::getCrawler(), new LogicalNot(new DomCrawlerConstraint\CrawlerSelectorExists($selector)), $message);
34+
self::assertThat(self::getCrawler(), new LogicalNot(new CrawlerSelectorExists($selector)), $message);
3535
}
3636

3737
public static function assertSelectorCount(int $expectedCount, string $selector, string $message = ''): void
@@ -42,47 +42,47 @@ public static function assertSelectorCount(int $expectedCount, string $selector,
4242
public static function assertSelectorTextContains(string $selector, string $text, string $message = ''): void
4343
{
4444
self::assertThat(self::getCrawler(), LogicalAnd::fromConstraints(
45-
new DomCrawlerConstraint\CrawlerSelectorExists($selector),
45+
new CrawlerSelectorExists($selector),
4646
new DomCrawlerConstraint\CrawlerSelectorTextContains($selector, $text)
4747
), $message);
4848
}
4949

5050
public static function assertAnySelectorTextContains(string $selector, string $text, string $message = ''): void
5151
{
5252
self::assertThat(self::getCrawler(), LogicalAnd::fromConstraints(
53-
new DomCrawlerConstraint\CrawlerSelectorExists($selector),
53+
new CrawlerSelectorExists($selector),
5454
new DomCrawlerConstraint\CrawlerAnySelectorTextContains($selector, $text)
5555
), $message);
5656
}
5757

5858
public static function assertSelectorTextSame(string $selector, string $text, string $message = ''): void
5959
{
6060
self::assertThat(self::getCrawler(), LogicalAnd::fromConstraints(
61-
new DomCrawlerConstraint\CrawlerSelectorExists($selector),
61+
new CrawlerSelectorExists($selector),
6262
new DomCrawlerConstraint\CrawlerSelectorTextSame($selector, $text)
6363
), $message);
6464
}
6565

6666
public static function assertAnySelectorTextSame(string $selector, string $text, string $message = ''): void
6767
{
6868
self::assertThat(self::getCrawler(), LogicalAnd::fromConstraints(
69-
new DomCrawlerConstraint\CrawlerSelectorExists($selector),
69+
new CrawlerSelectorExists($selector),
7070
new DomCrawlerConstraint\CrawlerAnySelectorTextSame($selector, $text)
7171
), $message);
7272
}
7373

7474
public static function assertSelectorTextNotContains(string $selector, string $text, string $message = ''): void
7575
{
7676
self::assertThat(self::getCrawler(), LogicalAnd::fromConstraints(
77-
new DomCrawlerConstraint\CrawlerSelectorExists($selector),
77+
new CrawlerSelectorExists($selector),
7878
new LogicalNot(new DomCrawlerConstraint\CrawlerSelectorTextContains($selector, $text))
7979
), $message);
8080
}
8181

8282
public static function assertAnySelectorTextNotContains(string $selector, string $text, string $message = ''): void
8383
{
8484
self::assertThat(self::getCrawler(), LogicalAnd::fromConstraints(
85-
new DomCrawlerConstraint\CrawlerSelectorExists($selector),
85+
new CrawlerSelectorExists($selector),
8686
new LogicalNot(new DomCrawlerConstraint\CrawlerAnySelectorTextContains($selector, $text))
8787
), $message);
8888
}
@@ -100,15 +100,15 @@ public static function assertPageTitleContains(string $expectedTitle, string $me
100100
public static function assertInputValueSame(string $fieldName, string $expectedValue, string $message = ''): void
101101
{
102102
self::assertThat(self::getCrawler(), LogicalAnd::fromConstraints(
103-
new DomCrawlerConstraint\CrawlerSelectorExists("input[name=\"$fieldName\"]"),
103+
new CrawlerSelectorExists("input[name=\"$fieldName\"]"),
104104
new DomCrawlerConstraint\CrawlerSelectorAttributeValueSame("input[name=\"$fieldName\"]", 'value', $expectedValue)
105105
), $message);
106106
}
107107

108108
public static function assertInputValueNotSame(string $fieldName, string $expectedValue, string $message = ''): void
109109
{
110110
self::assertThat(self::getCrawler(), LogicalAnd::fromConstraints(
111-
new DomCrawlerConstraint\CrawlerSelectorExists("input[name=\"$fieldName\"]"),
111+
new CrawlerSelectorExists("input[name=\"$fieldName\"]"),
112112
new LogicalNot(new DomCrawlerConstraint\CrawlerSelectorAttributeValueSame("input[name=\"$fieldName\"]", 'value', $expectedValue))
113113
), $message);
114114
}

src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
use Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\FirewallListenerFactoryInterface;
1717
use Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\StatelessAuthenticatorFactoryInterface;
1818
use Symfony\Bundle\SecurityBundle\DependencyInjection\Security\UserProvider\UserProviderFactoryInterface;
19-
use Symfony\Bundle\SecurityBundle\SecurityBundle;
2019
use Symfony\Component\Config\Definition\ConfigurationInterface;
2120
use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException;
2221
use Symfony\Component\Config\FileLocator;
@@ -35,7 +34,6 @@
3534
use Symfony\Component\EventDispatcher\EventDispatcher;
3635
use Symfony\Component\ExpressionLanguage\Expression;
3736
use Symfony\Component\ExpressionLanguage\ExpressionLanguage;
38-
use Symfony\Flex\Command\InstallRecipesCommand;
3937
use Symfony\Component\Form\Extension\PasswordHasher\PasswordHasherExtension;
4038
use Symfony\Component\HttpFoundation\ChainRequestMatcher;
4139
use Symfony\Component\HttpFoundation\RequestMatcher\AttributesRequestMatcher;
@@ -62,6 +60,7 @@
6260
use Symfony\Component\Security\Core\User\UserProviderInterface;
6361
use Symfony\Component\Security\Http\Authenticator\Debug\TraceableAuthenticatorManagerListener;
6462
use Symfony\Component\Security\Http\Event\CheckPassportEvent;
63+
use Symfony\Flex\Command\InstallRecipesCommand;
6564

6665
/**
6766
* SecurityExtension.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
use PHPUnit\Framework\Attributes\After;
1515
use PHPUnit\Framework\Attributes\Before;
1616
use PHPUnit\Framework\Attributes\BeforeClass;
17-
use Symfony\Component\Clock\ClockInterface;
1817
use Symfony\Component\Clock\Clock;
18+
use Symfony\Component\Clock\ClockInterface;
1919
use Symfony\Component\Clock\MockClock;
2020

2121
use function Symfony\Component\Clock\now;

src/Symfony/Component/DependencyInjection/Tests/LazyProxy/Instantiator/RealServiceInstantiatorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
use Symfony\Component\DependencyInjection\LazyProxy\Instantiator\RealServiceInstantiator;
1818

1919
/**
20-
* Tests for {@see \Symfony\Component\DependencyInjection\LazyProxy\Instantiator\RealServiceInstantiator}.
20+
* Tests for {@see RealServiceInstantiator}.
2121
*
2222
* @author Marco Pivetta <ocramius@gmail.com>
2323
*/

src/Symfony/Component/DependencyInjection/Tests/LazyProxy/PhpDumper/NullDumperTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
use Symfony\Component\DependencyInjection\LazyProxy\PhpDumper\NullDumper;
1717

1818
/**
19-
* Tests for {@see \Symfony\Component\DependencyInjection\LazyProxy\PhpDumper\NullDumper}.
19+
* Tests for {@see NullDumper}.
2020
*
2121
* @author Marco Pivetta <ocramius@gmail.com>
2222
*/

src/Symfony/Component/DomCrawler/Form.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ public function offsetUnset(mixed $name): void
336336
public function disableValidation(): static
337337
{
338338
foreach ($this->fields->all() as $field) {
339-
if ($field instanceof Field\ChoiceFormField) {
339+
if ($field instanceof ChoiceFormField) {
340340
$field->disableValidation();
341341
}
342342
}
@@ -444,14 +444,14 @@ private function addField(\DOMElement $node): void
444444

445445
$nodeName = $node->nodeName;
446446
if ('select' == $nodeName || 'input' == $nodeName && 'checkbox' == strtolower($node->getAttribute('type'))) {
447-
$this->set(new Field\ChoiceFormField($node));
447+
$this->set(new ChoiceFormField($node));
448448
} elseif ('input' == $nodeName && 'radio' == strtolower($node->getAttribute('type'))) {
449449
// there may be other fields with the same name that are no choice
450450
// fields already registered (see https://github.com/symfony/symfony/issues/11689)
451451
if ($this->has($node->getAttribute('name')) && $this->get($node->getAttribute('name')) instanceof ChoiceFormField) {
452452
$this->get($node->getAttribute('name'))->addChoice($node);
453453
} else {
454-
$this->set(new Field\ChoiceFormField($node));
454+
$this->set(new ChoiceFormField($node));
455455
}
456456
} elseif ('input' == $nodeName && 'file' == strtolower($node->getAttribute('type'))) {
457457
$this->set(new Field\FileFormField($node));

src/Symfony/Component/DomCrawler/FormFieldRegistry.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public function has(string $name): bool
106106
public function set(string $name, mixed $value): void
107107
{
108108
$target = &$this->get($name);
109-
if ((!\is_array($value) && $target instanceof Field\FormField) || $target instanceof Field\ChoiceFormField) {
109+
if ((!\is_array($value) && $target instanceof FormField) || $target instanceof Field\ChoiceFormField) {
110110
$target->setValue($value);
111111
} elseif (\is_array($value)) {
112112
$registry = new static();

src/Symfony/Component/Finder/Finder.php

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ public function files(): static
124124
public function depth(string|int|array $levels): static
125125
{
126126
foreach ((array) $levels as $level) {
127-
$this->depths[] = new Comparator\NumberComparator($level);
127+
$this->depths[] = new NumberComparator($level);
128128
}
129129

130130
return $this;
@@ -152,7 +152,7 @@ public function depth(string|int|array $levels): static
152152
public function date(string|array $dates): static
153153
{
154154
foreach ((array) $dates as $date) {
155-
$this->dates[] = new Comparator\DateComparator($date);
155+
$this->dates[] = new DateComparator($date);
156156
}
157157

158158
return $this;
@@ -307,7 +307,7 @@ public function notPath(string|array $patterns): static
307307
public function size(string|int|array $sizes): static
308308
{
309309
foreach ((array) $sizes as $size) {
310-
$this->sizes[] = new Comparator\NumberComparator($size);
310+
$this->sizes[] = new NumberComparator($size);
311311
}
312312

313313
return $this;
@@ -436,7 +436,7 @@ public function sort(\Closure $closure): static
436436
*/
437437
public function sortByExtension(): static
438438
{
439-
$this->sort = Iterator\SortableIterator::SORT_BY_EXTENSION;
439+
$this->sort = SortableIterator::SORT_BY_EXTENSION;
440440

441441
return $this;
442442
}
@@ -452,7 +452,7 @@ public function sortByExtension(): static
452452
*/
453453
public function sortByName(bool $useNaturalSort = false): static
454454
{
455-
$this->sort = $useNaturalSort ? Iterator\SortableIterator::SORT_BY_NAME_NATURAL : Iterator\SortableIterator::SORT_BY_NAME;
455+
$this->sort = $useNaturalSort ? SortableIterator::SORT_BY_NAME_NATURAL : SortableIterator::SORT_BY_NAME;
456456

457457
return $this;
458458
}
@@ -468,7 +468,7 @@ public function sortByName(bool $useNaturalSort = false): static
468468
*/
469469
public function sortByCaseInsensitiveName(bool $useNaturalSort = false): static
470470
{
471-
$this->sort = $useNaturalSort ? Iterator\SortableIterator::SORT_BY_NAME_NATURAL_CASE_INSENSITIVE : Iterator\SortableIterator::SORT_BY_NAME_CASE_INSENSITIVE;
471+
$this->sort = $useNaturalSort ? SortableIterator::SORT_BY_NAME_NATURAL_CASE_INSENSITIVE : SortableIterator::SORT_BY_NAME_CASE_INSENSITIVE;
472472

473473
return $this;
474474
}
@@ -484,7 +484,7 @@ public function sortByCaseInsensitiveName(bool $useNaturalSort = false): static
484484
*/
485485
public function sortBySize(): static
486486
{
487-
$this->sort = Iterator\SortableIterator::SORT_BY_SIZE;
487+
$this->sort = SortableIterator::SORT_BY_SIZE;
488488

489489
return $this;
490490
}
@@ -500,7 +500,7 @@ public function sortBySize(): static
500500
*/
501501
public function sortByType(): static
502502
{
503-
$this->sort = Iterator\SortableIterator::SORT_BY_TYPE;
503+
$this->sort = SortableIterator::SORT_BY_TYPE;
504504

505505
return $this;
506506
}
@@ -518,7 +518,7 @@ public function sortByType(): static
518518
*/
519519
public function sortByAccessedTime(): static
520520
{
521-
$this->sort = Iterator\SortableIterator::SORT_BY_ACCESSED_TIME;
521+
$this->sort = SortableIterator::SORT_BY_ACCESSED_TIME;
522522

523523
return $this;
524524
}
@@ -550,7 +550,7 @@ public function reverseSorting(): static
550550
*/
551551
public function sortByChangedTime(): static
552552
{
553-
$this->sort = Iterator\SortableIterator::SORT_BY_CHANGED_TIME;
553+
$this->sort = SortableIterator::SORT_BY_CHANGED_TIME;
554554

555555
return $this;
556556
}
@@ -568,7 +568,7 @@ public function sortByChangedTime(): static
568568
*/
569569
public function sortByModifiedTime(): static
570570
{
571-
$this->sort = Iterator\SortableIterator::SORT_BY_MODIFIED_TIME;
571+
$this->sort = SortableIterator::SORT_BY_MODIFIED_TIME;
572572

573573
return $this;
574574
}
@@ -671,7 +671,7 @@ public function getIterator(): \Iterator
671671
$iterator = $this->searchInDirectory($this->dirs[0]);
672672

673673
if ($this->sort || $this->reverseSorting) {
674-
$iterator = (new Iterator\SortableIterator($iterator, $this->sort, $this->reverseSorting))->getIterator();
674+
$iterator = (new SortableIterator($iterator, $this->sort, $this->reverseSorting))->getIterator();
675675
}
676676

677677
return $iterator;
@@ -687,7 +687,7 @@ public function getIterator(): \Iterator
687687
}
688688

689689
if ($this->sort || $this->reverseSorting) {
690-
$iterator = (new Iterator\SortableIterator($iterator, $this->sort, $this->reverseSorting))->getIterator();
690+
$iterator = (new SortableIterator($iterator, $this->sort, $this->reverseSorting))->getIterator();
691691
}
692692

693693
return $iterator;
@@ -790,37 +790,37 @@ private function searchInDirectory(string $dir): \Iterator
790790
$iterator = new Iterator\RecursiveDirectoryIterator($dir, $flags, $this->ignoreUnreadableDirs);
791791

792792
if ($exclude) {
793-
$iterator = new Iterator\ExcludeDirectoryFilterIterator($iterator, $exclude);
793+
$iterator = new ExcludeDirectoryFilterIterator($iterator, $exclude);
794794
}
795795

796796
$iterator = new \RecursiveIteratorIterator($iterator, \RecursiveIteratorIterator::SELF_FIRST);
797797

798798
if ($minDepth > 0 || $maxDepth < \PHP_INT_MAX) {
799-
$iterator = new Iterator\DepthRangeFilterIterator($iterator, $minDepth, $maxDepth);
799+
$iterator = new DepthRangeFilterIterator($iterator, $minDepth, $maxDepth);
800800
}
801801

802802
if ($this->mode) {
803803
$iterator = new 10000 Iterator\FileTypeFilterIterator($iterator, $this->mode);
804804
}
805805

806806
if ($this->names || $this->notNames) {
807-
$iterator = new Iterator\FilenameFilterIterator($iterator, $this->names, $this->notNames);
807+
$iterator = new FilenameFilterIterator($iterator, $this->names, $this->notNames);
808808
}
809809

810810
if ($this->contains || $this->notContains) {
811-
$iterator = new Iterator\FilecontentFilterIterator($iterator, $this->contains, $this->notContains);
811+
$iterator = new FilecontentFilterIterator($iterator, $this->contains, $this->notContains);
812812
}
813813

814814
if ($this->sizes) {
815-
$iterator = new Iterator\SizeRangeFilterIterator($iterator, $this->sizes);
815+
$iterator = new SizeRangeFilterIterator($iterator, $this->sizes);
816816
}
817817

818818
if ($this->dates) {
819-
$iterator = new Iterator\DateRangeFilterIterator($iterator, $this->dates);
819+
$iterator = new DateRangeFilterIterator($iterator, $this->dates);
820820
}
821821

822822
if ($this->filters) {
823-
$iterator = new Iterator\CustomFilterIterator($iterator, $this->filters);
823+
$iterator = new CustomFilterIterator($iterator, $this->filters);
824824
}
825825

826826
if ($this->paths || $notPaths) {

src/Symfony/Component/Form/Button.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ public function handleRequest(mixed $request = null): static
311311
*
312312
* @return $this
313313
*
314-
* @throws Exception\AlreadySubmittedException if the button has already been submitted
314+
* @throws AlreadySubmittedException if the button has already been submitted
315315
*/
316316
public function submit(array|string|null $submittedData, bool $clearMissing = true): static
317317
{

src/Symfony/Component/Form/Extension/Core/Type/TimeType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@
1212
namespace Symfony\Component\Form\Extension\Core\Type;
1313

1414
use Symfony\Component\Form\AbstractType;
15+
use Symfony\Component\Form\Event\PreSubmitEvent;
1516
use Symfony\Component\Form\Exception\InvalidConfigurationException;
1617
use Symfony\Component\Form\Exception\LogicException;
1718
use Symfony\Component\Form\Extension\Core\DataTransformer\DateTimeImmutableToDateTimeTransformer;
1819
use Symfony\Component\Form\Extension\Core\DataTransformer\DateTimeToArrayTransformer;
1920
use Symfony\Component\Form\Extension\Core\DataTransformer\DateTimeToStringTransformer;
2021
use Symfony\Component\Form\Extension\Core\DataTransformer\DateTimeToTimestampTransformer;
21-
use Symfony\Component\Form\Event\PreSubmitEvent;
2222
use Symfony\Component\Form\FormBuilderInterface;
2323
use Symfony\Component\Form\FormEvent;
2424
use Symfony\Component\Form\FormEvents;

src/Symfony/Component/Form/Extension/Csrf/EventListener/CsrfValidationListener.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@ public function __construct(
4242
private ?TranslatorInterface $translator = null,
4343
private ?string $translationDomain = null,
4444
?ServerParams $serverParams = null,
45-
)
46-
{
45+
) {
4746
$this->serverParams = $serverParams ?? new ServerParams();
4847
}
4948

0 commit comments

Comments
 (0)
0