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

Skip to content

Commit f64f59a

Browse files
committed
Fix CS
1 parent bb4e394 commit f64f59a

File tree

22 files changed

+25
-46
lines changed

22 files changed

+25
-46
lines changed

src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler/Deprecation.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ private static function getVendors()
247247
foreach (get_declared_classes() as $class) {
248248
if ('C' === $class[0] && 0 === strpos($class, 'ComposerAutoloaderInit')) {
249249
$r = new \ReflectionClass($class);
250-
$v = \dirname(\dirname($r->getFileName()));
250+
$v = \dirname($r->getFileName(), 2);
251251
if (file_exists($v.'/composer/installed.json')) {
252252
self::$vendors[] = $v;
253253
$loader = require $v.'/autoload.php';

src/Symfony/Bridge/Twig/Node/DumpNode.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,6 @@ public function __construct($varPrefix, ?Node $values, int $lineno, string $tag
3232
$this->varPrefix = $varPrefix;
3333
}
3434

35-
/**
36-
* @return void
37-
*/
3835
public function compile(Compiler $compiler): void
3936
{
4037
$compiler

src/Symfony/Bridge/Twig/NodeVisitor/TranslationDefaultDomainNodeVisitor.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,6 @@ protected function doLeaveNode(Node $node, Environment $env): ?Node
107107

108108
/**
109109
* {@inheritdoc}
110-
*
111-
* @return int
112110
*/
113111
public function getPriority(): int
114112
{

src/Symfony/Bridge/Twig/NodeVisitor/TranslationNodeVisitor.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,6 @@ protected function doLeaveNode(Node $node, Environment $env): ?Node
9797

9898
/**
9999
* {@inheritdoc}
100-
*
101-
* @return int
102100
*/
103101
public function getPriority(): int
104102
{

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
use Symfony\Component\HttpKernel\Event\RequestEvent;
1616
use Symfony\Component\Security\Core\Exception\LazyResponseException;
1717
use Symfony\Component\Security\Http\Firewall\AbstractListener;
18-
use Symfony\Component\VarDumper\Caster\ClassStub;
1918

2019
/**
2120
* Wraps a lazy security listener.

src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/TestBundle.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespace Symfony\Bundle\SecurityBundle\Tests\Functional\Bundle;
1313

1414
use Symfony\Component\DependencyInjection\Compiler\CheckTypeDeclarationsPass;
15-
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
1615
use Symfony\Component\DependencyInjection\Compiler\PassConfig;
1716
use Symfony\Component\DependencyInjection\ContainerBuilder;
1817
use Symfony\Component\HttpKernel\Bundle\Bundle;

src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/ExtensionPass.php

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

1212
namespace Symfony\Bundle\TwigBundle\DependencyInjection\Compiler;
1313

14-
use Symfony\Bridge\Twig\Extension\AssetExtension;
1514
use Symfony\Component\DependencyInjection\Alias;
1615
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
1716
use Symfony\Component\DependencyInjection\ContainerBuilder;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ private function getConnection(): object
427427
} else {
428428
switch ($this->driver = $this->conn->getDriver()->getName()) {
429429
case 'mysqli':
430-
throw new \LogicException(sprintf('The adapter "%s" does not support the mysqli driver, use pdo_mysql instead.', \get_class($this)));
430+
throw new \LogicException(sprintf('The adapter "%s" does not support the mysqli driver, use pdo_mysql instead.', static::class));
431431
case 'pdo_mysql':
432432
case 'drizzle_pdo_mysql':
433433
$this->driver = 'mysql';

src/Symfony/Component/Console/Command/Command.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ public function run(InputInterface $input, OutputInterface $output)
255255
$statusCode = $this->execute($input, $output);
256256

257257
if (!\is_int($statusCode)) {
258-
throw new \TypeError(sprintf('Return value of "%s::execute()" must be of the type int, %s returned.', \get_class($this), \gettype($statusCode)));
258+
throw new \TypeError(sprintf('Return value of "%s::execute()" must be of the type int, %s returned.', static::class, \gettype($statusCode)));
259259
}
260260
}
261261

src/Symfony/Component/DependencyInjection/Loader/FileLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function import($resource, $type = null, $ignoreErrors = false, $sourceRe
5757
if ($ignoreNotFound = 'not_found' === $ignoreErrors) {
5858
$args[2] = false;
5959
} elseif (!\is_bool($ignoreErrors)) {
60-
throw new \TypeError(sprintf('Invalid argument $ignoreErrors provided to %s::import(): boolean or "not_found" expected, %s given.', \get_class($this), \gettype($ignoreErrors)));
60+
throw new \TypeError(sprintf('Invalid argument $ignoreErrors provided to %s::import(): boolean or "not_found" expected, %s given.', static::class, \gettype($ignoreErrors)));
6161
}
6262

6363
try {

src/Symfony/Component/DependencyInjection/Loader/IniFileLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function load($resource, string $type = null)
4949
/**
5050
* {@inheritdoc}
5151
*/
52-
public function supports($resource, string $type = null)
52+
public function supports($resource, string $type = null)
5353
{
5454
if (!\is_string($resource)) {
5555
return false;

src/Symfony/Component/HttpKernel/Fragment/HIncludeFragmentRenderer.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@
1616
use Symfony\Component\HttpKernel\Controller\ControllerReference;
1717
use Symfony\Component\HttpKernel\UriSigner;
1818
use Twig\Environment;
19-
use Twig\Error\LoaderError;
20-
use Twig\Loader\ExistsLoaderInterface;
21-
use Twig\Loader\SourceContextLoaderInterface;
2219

2320
/**
2421
* Implements the Hinclude rendering strategy.

src/Symfony/Component/Notifier/Transport/AbstractTransportFactory.php

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

1919
/**
2020
* @author Konstantin Myakshin <molodchick@gmail.com>
21-
*
2221
* @author Fabien Potencier <fabien@symfony.com>
2322
*
2423
* @experimental in 5.0

src/Symfony/Component/Security/Http/Firewall.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
use Symfony\Component\HttpKernel\Event\FinishRequestEvent;
1616
use Symfony\Component\HttpKernel\Event\RequestEvent;
1717
use Symfony\Component\HttpKernel\KernelEvents;
18-
use Symfony\Component\Security\Http\Firewall\AbstractListener;
1918
use Symfony\Component\Security\Http\Firewall\AccessListener;
2019
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
2120

src/Symfony/Component/Security/Http/Tests/Firewall/ContextListenerTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -399,8 +399,9 @@ private function handleEventWithPreviousSession($userProviders, UserInterface $u
399399

400400
$tokenStorage = new TokenStorage();
401401
$usageIndex = $session->getUsageIndex();
402-
$tokenStorage = new UsageTrackingTokenStorage($tokenStorage, new class([
403-
'session' => function () use ($session) { return $session; }
402+
$tokenStorage = new UsageTrackingTokenStorage($tokenStorage, new class(['session' => function () use ($session) {
403+
return $session;
404+
},
404405
]) implements ContainerInterface {
405406
use ServiceLocatorTrait;
406407
});

src/Symfony/Component/String/AbstractString.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@
3131
*/
3232
abstract class AbstractString implements \JsonSerializable
3333
{
34-
public const PREG_PATTERN_ORDER = \PREG_PATTERN_ORDER;
35-
public const PREG_SET_ORDER = \PREG_SET_ORDER;
36-
public const PREG_OFFSET_CAPTURE = \PREG_OFFSET_CAPTURE;
37-
public const PREG_UNMATCHED_AS_NULL = \PREG_UNMATCHED_AS_NULL;
34+
public const PREG_PATTERN_ORDER = PREG_PATTERN_ORDER;
35+
public const PREG_SET_ORDER = PREG_SET_ORDER;
36+
public const PREG_OFFSET_CAPTURE = PREG_OFFSET_CAPTURE;
37+
public const PREG_UNMATCHED_AS_NULL = PREG_UNMATCHED_AS_NULL;
3838

3939
public const PREG_SPLIT = 0;
40-
public const PREG_SPLIT_NO_EMPTY = \PREG_SPLIT_NO_EMPTY;
41-
public const PREG_SPLIT_DELIM_CAPTURE = \PREG_SPLIT_DELIM_CAPTURE;
42-
public const PREG_SPLIT_OFFSET_CAPTURE = \PREG_SPLIT_OFFSET_CAPTURE;
40+
public const PREG_SPLIT_NO_EMPTY = PREG_SPLIT_NO_EMPTY;
41+
public const PREG_SPLIT_DELIM_CAPTURE = PREG_SPLIT_DELIM_CAPTURE;
42+
public const PREG_SPLIT_OFFSET_CAPTURE = PREG_SPLIT_OFFSET_CAPTURE;
4343

4444
protected $string = '';
4545
protected $ignoreCase = false;
@@ -262,7 +262,7 @@ public function collapseWhitespace(): self
262262
public function endsWith($suffix): bool
263263
{
264264
if (!\is_array($suffix) && !$suffix instanceof \Traversable) {
265-
throw new \TypeError(sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, \get_class($this)));
265+
throw new \TypeError(sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, static::class));
266266
}
267267

268268
foreach ($suffix as $s) {
@@ -317,7 +317,7 @@ public function ensureStart(string $prefix): self
317317
public function equalsTo($string): bool
318318
{
319319
if (!\is_array($string) && !$string instanceof \Traversable) {
320-
throw new \TypeError(sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, \get_class($this)));
320+
throw new \TypeError(sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, static::class));
321321
}
322322

323323
foreach ($string as $s) {
@@ -351,7 +351,7 @@ public function ignoreCase(): self
351351
public function indexOf($needle, int $offset = 0): ?int
352352
{
353353
if (!\is_array($needle) && !$needle instanceof \Traversable) {
354-
throw new \TypeError(sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, \get_class($this)));
354+
throw new \TypeError(sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, static::class));
355355
}
356356

357357
$i = \PHP_INT_MAX;
@@ -373,7 +373,7 @@ public function indexOf($needle, int $offset = 0): ?int
373373
public function indexOfLast($needle, int $offset = 0): ?int
374374
{
375375
if (!\is_array($needle) && !$needle instanceof \Traversable) {
376-
throw new \TypeError(sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, \get_class($this)));
376+
throw new \TypeError(sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, static::class));
377377
}
378378

379379
$i = null;
@@ -536,7 +536,7 @@ public function split(string $delimiter, int $limit = null, int $flags = null):
536536
public function startsWith($prefix): bool
537537
{
538538
if (!\is_array($prefix) && !$prefix instanceof \Traversable) {
539-
throw new \TypeError(sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, \get_class($this)));
539+
throw new \TypeError(sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, static::class));
540540
}
541541

542542
foreach ($prefix as $prefix) {

src/Symfony/Component/String/AbstractUnicodeString.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ public function ascii(array $rules = []): self
139139
}
140140
} elseif (!\function_exists('iconv')) {
141141
$s = preg_replace('/[^\x00-\x7F]/u', '?', $s);
142-
} elseif (\ICONV_IMPL === 'glibc') {
142+
} elseif (ICONV_IMPL === 'glibc') {
143143
$s = iconv('UTF-8', 'ASCII//TRANSLIT', $s);
144144
} else {
145145
$s = preg_replace_callback('/[^\x00-\x7F]/u', static function ($c) {
@@ -223,7 +223,7 @@ public function lower(): parent
223223

224224
public function match(string $regexp, int $flags = 0, int $offset = 0): array
225225
{
226-
$match = ((\PREG_PATTERN_ORDER | \PREG_SET_ORDER) & $flags) ? 'preg_match_all' : 'preg_match';
226+
$match = ((PREG_PATTERN_ORDER | PREG_SET_ORDER) & $flags) ? 'preg_match_all' : 'preg_match';
227227

228228
if ($this->ignoreCase) {
229229
$regexp .= 'i';
@@ -309,7 +309,7 @@ public function replaceMatches(string $fromRegexp, $to): parent
309309

310310
if (\is_array($to) || $to instanceof \Closure) {
311311
if (!\is_callable($to)) {
312-
throw new \TypeError(sprintf('Argument 2 passed to %s::replaceMatches() must be callable, array given.', \get_class($this)));
312+
throw new \TypeError(sprintf('Argument 2 passed to %s::replaceMatches() must be callable, array given.', static::class));
313313
}
314314

315315
$replace = 'preg_replace_callback';

src/Symfony/Component/String/ByteString.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ public function lower(): parent
193193

194194
public function match(string $regexp, int $flags = 0, int $offset = 0): array
195195
{
196-
$match = ((\PREG_PATTERN_ORDER | \PREG_SET_ORDER) & $flags) ? 'preg_match_all' : 'preg_match';
196+
$match = ((PREG_PATTERN_ORDER | PREG_SET_ORDER) & $flags) ? 'preg_match_all' : 'preg_match';
197197

198198
if ($this->ignoreCase) {
199199
$regexp .= 'i';
@@ -271,7 +271,7 @@ public function replaceMatches(string $fromRegexp, $to): parent
271271

272272
if (\is_array($to)) {
273273
if (!\is_callable($to)) {
274-
throw new \TypeError(sprintf('Argument 2 passed to %s::replaceMatches() must be callable, array given.', \get_class($this)));
274+
throw new \TypeError(sprintf('Argument 2 passed to %s::replaceMatches() must be callable, array given.', static::class));
275275
}
276276

277277
$replace = 'preg_replace_callback';

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespace Symfony\Component\Validator\Tests\Constraints;
1313

1414
use Symfony\Component\ExpressionLanguage\ExpressionLanguage;
15-
use Symfony\Component\PropertyAccess\PropertyAccess;
1615
use Symfony\Component\Validator\Constraints\Expression;
1716
use Symfony\Component\Validator\Constraints\ExpressionValidator;
1817
use Symfony\Component\Validator\Test\ConstraintValidatorTestCase;

src/Symfony/Component/Validator/Tests/Mapping/Factory/LazyLoadingMetadataFactoryTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
use Psr\Cache\CacheItemPoolInterface;
1616
use Symfony\Component\Cache\Adapter\ArrayAdapter;
1717
use Symfony\Component\Validator\Constraints\Callback;
18-
use Symfony\Component\Validator\Mapping\Cache\Psr6Cache;
1918
use Symfony\Component\Validator\Mapping\ClassMetadata;
2019
use Symfony\Component\Validator\Mapping\Factory\LazyLoadingMetadataFactory;
2120
use Symfony\Component\Validator\Mapping\Loader\LoaderInterface;

src/Symfony/Component/VarDumper/Test/VarDumperTestTrait.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,6 @@ public function assertDumpMatchesFormat($expected, $data, int $filter = 0, strin
5252
$this->assertStringMatchesFormat($this->prepareExpectation($expected, $filter), $this->getDump($data, null, $filter), $message);
5353
}
5454

55-
/**
56-
* @return string|null
57-
*/
5855
protected function getDump($data, $key = null, int $filter = 0): ?string
5956
{
6057
if (null === $flags = $this->varDumperConfig['flags']) {

src/Symfony/Component/VarExporter/Internal/Exporter.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ class Exporter
3131
* @param int &$objectsCount
3232
* @param bool &$valuesAreStatic
3333
*
34-
* @return array
35-
*
3634
* @throws NotInstantiableTypeException When a value cannot be serialized
3735
*/
3836
public static function prepare($values, $objectsPool, &$refsPool, &$objectsCount, &$valuesAreStatic): array

0 commit comments

Comments
 (0)
0