Fix CS
This commit is contained in:
parent
bb4e394949
commit
f64f59a9c0
@ -247,7 +247,7 @@ class Deprecation
|
||||
foreach (get_declared_classes() as $class) {
|
||||
if ('C' === $class[0] && 0 === strpos($class, 'ComposerAutoloaderInit')) {
|
||||
$r = new \ReflectionClass($class);
|
||||
$v = \dirname(\dirname($r->getFileName()));
|
||||
$v = \dirname($r->getFileName(), 2);
|
||||
if (file_exists($v.'/composer/installed.json')) {
|
||||
self::$vendors[] = $v;
|
||||
$loader = require $v.'/autoload.php';
|
||||
|
@ -32,9 +32,6 @@ final class DumpNode extends Node
|
||||
$this->varPrefix = $varPrefix;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function compile(Compiler $compiler): void
|
||||
{
|
||||
$compiler
|
||||
|
@ -107,8 +107,6 @@ final class TranslationDefaultDomainNodeVisitor extends AbstractNodeVisitor
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getPriority(): int
|
||||
{
|
||||
|
@ -97,8 +97,6 @@ final class TranslationNodeVisitor extends AbstractNodeVisitor
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getPriority(): int
|
||||
{
|
||||
|
@ -15,7 +15,6 @@ use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpKernel\Event\RequestEvent;
|
||||
use Symfony\Component\Security\Core\Exception\LazyResponseException;
|
||||
use Symfony\Component\Security\Http\Firewall\AbstractListener;
|
||||
use Symfony\Component\VarDumper\Caster\ClassStub;
|
||||
|
||||
/**
|
||||
* Wraps a lazy security listener.
|
||||
|
@ -12,7 +12,6 @@
|
||||
namespace Symfony\Bundle\SecurityBundle\Tests\Functional\Bundle;
|
||||
|
||||
use Symfony\Component\DependencyInjection\Compiler\CheckTypeDeclarationsPass;
|
||||
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
|
||||
use Symfony\Component\DependencyInjection\Compiler\PassConfig;
|
||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
use Symfony\Component\HttpKernel\Bundle\Bundle;
|
||||
|
@ -11,7 +11,6 @@
|
||||
|
||||
namespace Symfony\Bundle\TwigBundle\DependencyInjection\Compiler;
|
||||
|
||||
use Symfony\Bridge\Twig\Extension\AssetExtension;
|
||||
use Symfony\Component\DependencyInjection\Alias;
|
||||
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
|
||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
|
@ -427,7 +427,7 @@ class PdoAdapter extends AbstractAdapter implements PruneableInterface
|
||||
} else {
|
||||
switch ($this->driver = $this->conn->getDriver()->getName()) {
|
||||
case 'mysqli':
|
||||
throw new \LogicException(sprintf('The adapter "%s" does not support the mysqli driver, use pdo_mysql instead.', \get_class($this)));
|
||||
throw new \LogicException(sprintf('The adapter "%s" does not support the mysqli driver, use pdo_mysql instead.', static::class));
|
||||
case 'pdo_mysql':
|
||||
case 'drizzle_pdo_mysql':
|
||||
$this->driver = 'mysql';
|
||||
|
@ -255,7 +255,7 @@ class Command
|
||||
$statusCode = $this->execute($input, $output);
|
||||
|
||||
if (!\is_int($statusCode)) {
|
||||
throw new \TypeError(sprintf('Return value of "%s::execute()" must be of the type int, %s returned.', \get_class($this), \gettype($statusCode)));
|
||||
throw new \TypeError(sprintf('Return value of "%s::execute()" must be of the type int, %s returned.', static::class, \gettype($statusCode)));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -57,7 +57,7 @@ abstract class FileLoader extends BaseFileLoader
|
||||
if ($ignoreNotFound = 'not_found' === $ignoreErrors) {
|
||||
$args[2] = false;
|
||||
} elseif (!\is_bool($ignoreErrors)) {
|
||||
throw new \TypeError(sprintf('Invalid argument $ignoreErrors provided to %s::import(): boolean or "not_found" expected, %s given.', \get_class($this), \gettype($ignoreErrors)));
|
||||
throw new \TypeError(sprintf('Invalid argument $ignoreErrors provided to %s::import(): boolean or "not_found" expected, %s given.', static::class, \gettype($ignoreErrors)));
|
||||
}
|
||||
|
||||
try {
|
||||
|
@ -49,7 +49,7 @@ class IniFileLoader extends FileLoader
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function supports($resource, string $type = null)
|
||||
public function supports($resource, string $type = null)
|
||||
{
|
||||
if (!\is_string($resource)) {
|
||||
return false;
|
||||
|
@ -16,9 +16,6 @@ use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\HttpKernel\Controller\ControllerReference;
|
||||
use Symfony\Component\HttpKernel\UriSigner;
|
||||
use Twig\Environment;
|
||||
use Twig\Error\LoaderError;
|
||||
use Twig\Loader\ExistsLoaderInterface;
|
||||
use Twig\Loader\SourceContextLoaderInterface;
|
||||
|
||||
/**
|
||||
* Implements the Hinclude rendering strategy.
|
||||
|
@ -18,7 +18,6 @@ use Symfony\Contracts\HttpClient\HttpClientInterface;
|
||||
|
||||
/**
|
||||
* @author Konstantin Myakshin <molodchick@gmail.com>
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* @experimental in 5.0
|
||||
|
@ -15,7 +15,6 @@ use Symfony\Component\EventDispatcher\EventSubscriberInterface;
|
||||
use Symfony\Component\HttpKernel\Event\FinishRequestEvent;
|
||||
use Symfony\Component\HttpKernel\Event\RequestEvent;
|
||||
use Symfony\Component\HttpKernel\KernelEvents;
|
||||
use Symfony\Component\Security\Http\Firewall\AbstractListener;
|
||||
use Symfony\Component\Security\Http\Firewall\AccessListener;
|
||||
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
|
||||
|
||||
|
@ -399,8 +399,9 @@ class ContextListenerTest extends TestCase
|
||||
|
||||
$tokenStorage = new TokenStorage();
|
||||
$usageIndex = $session->getUsageIndex();
|
||||
$tokenStorage = new UsageTrackingTokenStorage($tokenStorage, new class([
|
||||
'session' => function () use ($session) { return $session; }
|
||||
$tokenStorage = new UsageTrackingTokenStorage($tokenStorage, new class(['session' => function () use ($session) {
|
||||
return $session;
|
||||
},
|
||||
]) implements ContainerInterface {
|
||||
use ServiceLocatorTrait;
|
||||
});
|
||||
|
@ -31,15 +31,15 @@ use Symfony\Component\String\Exception\RuntimeException;
|
||||
*/
|
||||
abstract class AbstractString implements \JsonSerializable
|
||||
{
|
||||
public const PREG_PATTERN_ORDER = \PREG_PATTERN_ORDER;
|
||||
public const PREG_SET_ORDER = \PREG_SET_ORDER;
|
||||
public const PREG_OFFSET_CAPTURE = \PREG_OFFSET_CAPTURE;
|
||||
public const PREG_UNMATCHED_AS_NULL = \PREG_UNMATCHED_AS_NULL;
|
||||
public const PREG_PATTERN_ORDER = PREG_PATTERN_ORDER;
|
||||
public const PREG_SET_ORDER = PREG_SET_ORDER;
|
||||
public const PREG_OFFSET_CAPTURE = PREG_OFFSET_CAPTURE;
|
||||
public const PREG_UNMATCHED_AS_NULL = PREG_UNMATCHED_AS_NULL;
|
||||
|
||||
public const PREG_SPLIT = 0;
|
||||
public const PREG_SPLIT_NO_EMPTY = \PREG_SPLIT_NO_EMPTY;
|
||||
public const PREG_SPLIT_DELIM_CAPTURE = \PREG_SPLIT_DELIM_CAPTURE;
|
||||
public const PREG_SPLIT_OFFSET_CAPTURE = \PREG_SPLIT_OFFSET_CAPTURE;
|
||||
public const PREG_SPLIT_NO_EMPTY = PREG_SPLIT_NO_EMPTY;
|
||||
public const PREG_SPLIT_DELIM_CAPTURE = PREG_SPLIT_DELIM_CAPTURE;
|
||||
public const PREG_SPLIT_OFFSET_CAPTURE = PREG_SPLIT_OFFSET_CAPTURE;
|
||||
|
||||
protected $string = '';
|
||||
protected $ignoreCase = false;
|
||||
@ -262,7 +262,7 @@ abstract class AbstractString implements \JsonSerializable
|
||||
public function endsWith($suffix): bool
|
||||
{
|
||||
if (!\is_array($suffix) && !$suffix instanceof \Traversable) {
|
||||
throw new \TypeError(sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, \get_class($this)));
|
||||
throw new \TypeError(sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, static::class));
|
||||
}
|
||||
|
||||
foreach ($suffix as $s) {
|
||||
@ -317,7 +317,7 @@ abstract class AbstractString implements \JsonSerializable
|
||||
public function equalsTo($string): bool
|
||||
{
|
||||
if (!\is_array($string) && !$string instanceof \Traversable) {
|
||||
throw new \TypeError(sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, \get_class($this)));
|
||||
throw new \TypeError(sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, static::class));
|
||||
}
|
||||
|
||||
foreach ($string as $s) {
|
||||
@ -351,7 +351,7 @@ abstract class AbstractString implements \JsonSerializable
|
||||
public function indexOf($needle, int $offset = 0): ?int
|
||||
{
|
||||
if (!\is_array($needle) && !$needle instanceof \Traversable) {
|
||||
throw new \TypeError(sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, \get_class($this)));
|
||||
throw new \TypeError(sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, static::class));
|
||||
}
|
||||
|
||||
$i = \PHP_INT_MAX;
|
||||
@ -373,7 +373,7 @@ abstract class AbstractString implements \JsonSerializable
|
||||
public function indexOfLast($needle, int $offset = 0): ?int
|
||||
{
|
||||
if (!\is_array($needle) && !$needle instanceof \Traversable) {
|
||||
throw new \TypeError(sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, \get_class($this)));
|
||||
throw new \TypeError(sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, static::class));
|
||||
}
|
||||
|
||||
$i = null;
|
||||
@ -536,7 +536,7 @@ abstract class AbstractString implements \JsonSerializable
|
||||
public function startsWith($prefix): bool
|
||||
{
|
||||
if (!\is_array($prefix) && !$prefix instanceof \Traversable) {
|
||||
throw new \TypeError(sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, \get_class($this)));
|
||||
throw new \TypeError(sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, static::class));
|
||||
}
|
||||
|
||||
foreach ($prefix as $prefix) {
|
||||
|
@ -139,7 +139,7 @@ abstract class AbstractUnicodeString extends AbstractString
|
||||
}
|
||||
} elseif (!\function_exists('iconv')) {
|
||||
$s = preg_replace('/[^\x00-\x7F]/u', '?', $s);
|
||||
} elseif (\ICONV_IMPL === 'glibc') {
|
||||
} elseif (ICONV_IMPL === 'glibc') {
|
||||
$s = iconv('UTF-8', 'ASCII//TRANSLIT', $s);
|
||||
} else {
|
||||
$s = preg_replace_callback('/[^\x00-\x7F]/u', static function ($c) {
|
||||
@ -223,7 +223,7 @@ abstract class AbstractUnicodeString extends AbstractString
|
||||
|
||||
public function match(string $regexp, int $flags = 0, int $offset = 0): array
|
||||
{
|
||||
$match = ((\PREG_PATTERN_ORDER | \PREG_SET_ORDER) & $flags) ? 'preg_match_all' : 'preg_match';
|
||||
$match = ((PREG_PATTERN_ORDER | PREG_SET_ORDER) & $flags) ? 'preg_match_all' : 'preg_match';
|
||||
|
||||
if ($this->ignoreCase) {
|
||||
$regexp .= 'i';
|
||||
@ -309,7 +309,7 @@ abstract class AbstractUnicodeString extends AbstractString
|
||||
|
||||
if (\is_array($to) || $to instanceof \Closure) {
|
||||
if (!\is_callable($to)) {
|
||||
throw new \TypeError(sprintf('Argument 2 passed to %s::replaceMatches() must be callable, array given.', \get_class($this)));
|
||||
throw new \TypeError(sprintf('Argument 2 passed to %s::replaceMatches() must be callable, array given.', static::class));
|
||||
}
|
||||
|
||||
$replace = 'preg_replace_callback';
|
||||
|
@ -193,7 +193,7 @@ class ByteString extends AbstractString
|
||||
|
||||
public function match(string $regexp, int $flags = 0, int $offset = 0): array
|
||||
{
|
||||
$match = ((\PREG_PATTERN_ORDER | \PREG_SET_ORDER) & $flags) ? 'preg_match_all' : 'preg_match';
|
||||
$match = ((PREG_PATTERN_ORDER | PREG_SET_ORDER) & $flags) ? 'preg_match_all' : 'preg_match';
|
||||
|
||||
if ($this->ignoreCase) {
|
||||
$regexp .= 'i';
|
||||
@ -271,7 +271,7 @@ class ByteString extends AbstractString
|
||||
|
||||
if (\is_array($to)) {
|
||||
if (!\is_callable($to)) {
|
||||
throw new \TypeError(sprintf('Argument 2 passed to %s::replaceMatches() must be callable, array given.', \get_class($this)));
|
||||
throw new \TypeError(sprintf('Argument 2 passed to %s::replaceMatches() must be callable, array given.', static::class));
|
||||
}
|
||||
|
||||
$replace = 'preg_replace_callback';
|
||||
|
@ -12,7 +12,6 @@
|
||||
namespace Symfony\Component\Validator\Tests\Constraints;
|
||||
|
||||
use Symfony\Component\ExpressionLanguage\ExpressionLanguage;
|
||||
use Symfony\Component\PropertyAccess\PropertyAccess;
|
||||
use Symfony\Component\Validator\Constraints\Expression;
|
||||
use Symfony\Component\Validator\Constraints\ExpressionValidator;
|
||||
use Symfony\Component\Validator\Test\ConstraintValidatorTestCase;
|
||||
|
@ -15,7 +15,6 @@ use PHPUnit\Framework\TestCase;
|
||||
use Psr\Cache\CacheItemPoolInterface;
|
||||
use Symfony\Component\Cache\Adapter\ArrayAdapter;
|
||||
use Symfony\Component\Validator\Constraints\Callback;
|
||||
use Symfony\Component\Validator\Mapping\Cache\Psr6Cache;
|
||||
use Symfony\Component\Validator\Mapping\ClassMetadata;
|
||||
use Symfony\Component\Validator\Mapping\Factory\LazyLoadingMetadataFactory;
|
||||
use Symfony\Component\Validator\Mapping\Loader\LoaderInterface;
|
||||
|
@ -52,9 +52,6 @@ trait VarDumperTestTrait
|
||||
$this->assertStringMatchesFormat($this->prepareExpectation($expected, $filter), $this->getDump($data, null, $filter), $message);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
protected function getDump($data, $key = null, int $filter = 0): ?string
|
||||
{
|
||||
if (null === $flags = $this->varDumperConfig['flags']) {
|
||||
|
@ -31,8 +31,6 @@ class Exporter
|
||||
* @param int &$objectsCount
|
||||
* @param bool &$valuesAreStatic
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @throws NotInstantiableTypeException When a value cannot be serialized
|
||||
*/
|
||||
public static function prepare($values, $objectsPool, &$refsPool, &$objectsCount, &$valuesAreStatic): array
|
||||
|
Reference in New Issue
Block a user