Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b64ae4d

Browse files
committed
Merge branch '4.4' into 5.2
* 4.4: [CS] Replace easy occurences of ?: with ??
2 parents 9459420 + b946077 commit b64ae4d

File tree

51 files changed

+62
-62
lines changed

Some content is hidden

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

51 files changed

+62
-62
lines changed

src/Symfony/Bridge/Monolog/Formatter/VarDumperFormatter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class VarDumperFormatter implements FormatterInterface
2323

2424
public function __construct(VarCloner $cloner = null)
2525
{
26-
$this->cloner = $cloner ?: new VarCloner();
26+
$this->cloner = $cloner ?? new VarCloner();
2727
}
2828

2929
/**

src/Symfony/Bridge/Twig/Extension/DumpExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public function dump(Environment $env, array $context): ?string
7474
}
7575

7676
$dump = fopen('php://memory', 'r+');
77-
$this->dumper = $this->dumper ?: new HtmlDumper();
77+
$this->dumper = $this->dumper ?? new HtmlDumper();
7878
$this->dumper->setCharset($env->getCharset());
7979

8080
foreach ($vars as $value) {

src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function __construct(CacheClearerInterface $cacheClearer, Filesystem $fil
4545
parent::__construct();
4646

4747
$this->cacheClearer = $cacheClearer;
48-
$this->filesystem = $filesystem ?: new Filesystem();
48+
$this->filesystem = $filesystem ?? new Filesystem();
4949
}
5050

5151
/**

src/Symfony/Bundle/FrameworkBundle/Routing/Router.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function __construct(ContainerInterface $container, $resource, array $opt
4444
{
4545
$this->container = $container;
4646
$this->resource = $resource;
47-
$this->context = $context ?: new RequestContext();
47+
$this->context = $context ?? new RequestContext();
4848
$this->logger = $logger;
4949
$this->setOptions($options);
5050

src/Symfony/Bundle/WebProfilerBundle/Twig/WebProfilerExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class WebProfilerExtension extends ProfilerExtension
4444

4545
public function __construct(HtmlDumper $dumper = null)
4646
{
47-
$this->dumper = $dumper ?: new HtmlDumper();
47+
$this->dumper = $dumper ?? new HtmlDumper();
4848
$this->dumper->setOutput($this->output = fopen('php://memory', 'r+'));
4949
}
5050

src/Symfony/Component/Asset/Package.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class Package implements PackageInterface
2929
public function __construct(VersionStrategyInterface $versionStrategy, ContextInterface $context = null)
3030
{
3131
$this->versionStrategy = $versionStrategy;
32-
$this->context = $context ?: new NullContext();
32+
$this->context = $context ?? new NullContext();
3333
}
3434

3535
/**

src/Symfony/Component/Config/Definition/Builder/TreeBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class TreeBuilder implements NodeParentInterface
2525

2626
public function __construct(string $name, string $type = 'array', NodeBuilder $builder = null)
2727
{
28-
$builder = $builder ?: new NodeBuilder();
28+
$builder = $builder ?? new NodeBuilder();
2929
$this->root = $builder->node($name, $type)->setParent($this);
3030
}
3131

src/Symfony/Component/Console/Formatter/OutputFormatterStyleStack.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class OutputFormatterStyleStack implements ResetInterface
2828

2929
public function __construct(OutputFormatterStyleInterface $emptyStyle = null)
3030
{
31-
$this->emptyStyle = $emptyStyle ?: new OutputFormatterStyle();
31+
$this->emptyStyle = $emptyStyle ?? new OutputFormatterStyle();
3232
$this->reset();
3333
}
3434

src/Symfony/Component/Console/Output/Output.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ abstract class Output implements OutputInterface
4040
public function __construct(?int $verbosity = self::VERBOSITY_NORMAL, bool $decorated = false, OutputFormatterInterface $formatter = null)
4141
{
4242
$this->verbosity = null === $verbosity ? self::VERBOSITY_NORMAL : $verbosity;
43-
$this->formatter = $formatter ?: new OutputFormatter();
43+
$this->formatter = $formatter ?? new OutputFormatter();
4444
$this->formatter->setDecorated($decorated);
4545
}
4646

src/Symfony/Component/CssSelector/Parser/Parser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class Parser implements ParserInterface
3131

3232
public function __construct(Tokenizer $tokenizer = null)
3333
{
34-
$this->tokenizer = $tokenizer ?: new Tokenizer();
34+
$this->tokenizer = $tokenizer ?? new Tokenizer();
3535
}
3636

3737
/**

src/Symfony/Component/CssSelector/XPath/Translator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class Translator implements TranslatorInterface
5050

5151
public function __construct(ParserInterface $parser = null)
5252
{
53-
$this->mainParser = $parser ?: new Parser();
53+
$this->mainParser = $parser ?? new Parser();
5454

5555
$this
5656
->registerExtension(new Extension\NodeExtension())

src/Symfony/Component/DependencyInjection/Container.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class Container implements ContainerInterface, ResetInterface
6464

6565
public function __construct(ParameterBagInterface $parameterBag = null)
6666
{
67-
$this->parameterBag = $parameterBag ?: new EnvPlaceholderParameterBag();
67+
$this->parameterBag = $parameterBag ?? new EnvPlaceholderParameterBag();
6868
}
6969

7070
/**

src/Symfony/Component/DependencyInjection/ContainerBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ public function getReflectionClass(?string $class, bool $throw = true): ?\Reflec
357357

358358
if ($this->trackResources) {
359359
if (!$classReflector) {
360-
$this->addResource($resource ?: new ClassExistenceResource($class, false));
360+
$this->addResource($resource ?? new ClassExistenceResource($class, false));
361361
} elseif (!$classReflector->isInternal()) {
362362
$path = $classReflector->getFileName();
363363

src/Symfony/Component/DependencyInjection/Tests/Compiler/IntegrationTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ public function testCanDecorateServiceLocator()
168168
public function testYamlContainerCompiles($directory, $actualServiceId, $expectedServiceId, ContainerBuilder $mainContainer = null)
169169
{
170170
// allow a container to be passed in, which might have autoconfigure settings
171-
$container = $mainContainer ?: new ContainerBuilder();
171+
$container = $mainContainer ?? new ContainerBuilder();
172172
$container->setResourceTracking(false);
173173
$loader = new YamlFileLoader($container, new FileLocator(__DIR__.'/../Fixtures/yaml/integration/'.$directory));
174174
$loader->load('main.yml');

src/Symfony/Component/ExpressionLanguage/ExpressionLanguage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class ExpressionLanguage
3636
*/
3737
public function __construct(CacheItemPoolInterface $cache = null, array $providers = [])
3838
{
39-
$this->cache = $cache ?: new ArrayAdapter();
39+
$this->cache = $cache ?? new ArrayAdapter();
4040
$this->registerFunctions();
4141
foreach ($providers as $provider) {
4242
$this->registerProvider($provider);

src/Symfony/Component/Form/Extension/Core/CoreExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class CoreExtension extends AbstractExtension
3535
public function __construct(PropertyAccessorInterface $propertyAccessor = null, ChoiceListFactoryInterface $choiceListFactory = null, TranslatorInterface $translator = null)
3636
{
3737
$this->propertyAccessor = $propertyAccessor ?: PropertyAccess::createPropertyAccessor();
38-
$this->choiceListFactory = $choiceListFactory ?: new CachingFactoryDecorator(new PropertyAccessDecorator(new DefaultChoiceListFactory(), $this->propertyAccessor));
38+
$this->choiceListFactory = $choiceListFactory ?? new CachingFactoryDecorator(new PropertyAccessDecorator(new DefaultChoiceListFactory(), $this->propertyAccessor));
3939
$this->translator = $translator;
4040
}
4141

src/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToArrayTransformer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function __construct(string $inputTimezone = null, string $outputTimezone
4242

4343
$this->fields = $fields;
4444
$this->pad = $pad;
45-
$this->referenceDate = $referenceDate ?: new \DateTimeImmutable('1970-01-01 00:00:00');
45+
$this->referenceDate = $referenceDate ?? new \DateTimeImmutable('1970-01-01 00:00:00');
4646
}
4747

4848
/**

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class ChoiceType extends AbstractType
5656
*/
5757
public function __construct(ChoiceListFactoryInterface $choiceListFactory = null, $translator = null)
5858
{
59-
$this->choiceListFactory = $choiceListFactory ?: new CachingFactoryDecorator(
59+
$this->choiceListFactory = $choiceListFactory ?? new CachingFactoryDecorator(
6060
new PropertyAccessDecorator(
6161
new DefaultChoiceListFactory()
6262
)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function __construct(string $fieldName, CsrfTokenManagerInterface $tokenM
4848
$this->errorMessage = $errorMessage;
4949
$this->translator = $translator;
5050
$this->translationDomain = $translationDomain;
51-
$this->serverParams = $serverParams ?: new ServerParams();
51+
$this->serverParams = $serverParams ?? new ServerParams();
5252
}
5353

5454
public function preSubmit(FormEvent $event)

src/Symfony/Component/Form/Extension/HttpFoundation/HttpFoundationRequestHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class HttpFoundationRequestHandler implements RequestHandlerInterface
3232

3333
public function __construct(ServerParams $serverParams = null)
3434
{
35-
$this->serverParams = $serverParams ?: new ServerParams();
35+
$this->serverParams = $serverParams ?? new ServerParams();
3636
}
3737

3838
/**

src/Symfony/Component/Form/Extension/HttpFoundation/Type/FormTypeHttpFoundationExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class FormTypeHttpFoundationExtension extends AbstractTypeExtension
2626

2727
public function __construct(RequestHandlerInterface $requestHandler = null)
2828
{
29-
$this->requestHandler = $requestHandler ?: new HttpFoundationRequestHandler();
29+
$this->requestHandler = $requestHandler ?? new HttpFoundationRequestHandler();
3030
}
3131

3232
/**

src/Symfony/Component/Form/FormFactoryBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ public function getFormFactory()
180180
$extensions[] = new PreloadedExtension($this->types, $this->typeExtensions, $typeGuesser);
181181
}
182182

183-
$registry = new FormRegistry($extensions, $this->resolvedTypeFactory ?: new ResolvedFormTypeFactory());
183+
$registry = new FormRegistry($extensions, $this->resolvedTypeFactory ?? new ResolvedFormTypeFactory());
184184

185185
return new FormFactory($registry);
186186
}

src/Symfony/Component/Form/NativeRequestHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class NativeRequestHandler implements RequestHandlerInterface
3636

3737
public function __construct(ServerParams $params = null)
3838
{
39-
$this->serverParams = $params ?: new ServerParams();
39+
$this->serverParams = $params ?? new ServerParams();
4040
}
4141

4242
/**

src/Symfony/Component/HttpFoundation/Session/Session.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@ class Session implements SessionInterface, \IteratorAggregate, \Countable
3939

4040
public function __construct(SessionStorageInterface $storage = null, AttributeBagInterface $attributes = null, FlashBagInterface $flashes = null, callable $usageReporter = null)
4141
{
42-
$this->storage = $storage ?: new NativeSessionStorage();
42+
$this->storage = $storage ?? new NativeSessionStorage();
4343
$this->usageReporter = $usageReporter;
4444

45-
$attributes = $attributes ?: new AttributeBag();
45+
$attributes = $attributes ?? new AttributeBag();
4646
$this->attributeName = $attributes->getName();
4747
$this->registerBag($attributes);
4848

49-
$flashes = $flashes ?: new FlashBag();
49+
$flashes = $flashes ?? new FlashBag();
5050
$this->flashName = $flashes->getName();
5151
$this->registerBag($flashes);
5252
}

src/Symfony/Component/HttpKernel/Controller/ArgumentResolver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ final class ArgumentResolver implements ArgumentResolverInterface
3636

3737
public function __construct(ArgumentMetadataFactoryInterface $argumentMetadataFactory = null, iterable $argumentValueResolvers = [])
3838
{
39-
$this->argumentMetadataFactory = $argumentMetadataFactory ?: new ArgumentMetadataFactory();
39+
$this->argumentMetadataFactory = $argumentMetadataFactory ?? new ArgumentMetadataFactory();
4040
$this->argumentValueResolvers = $argumentValueResolvers ?: self::getDefaultArgumentValueResolvers();
4141
}
4242

src/Symfony/Component/HttpKernel/HttpKernel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function __construct(EventDispatcherInterface $dispatcher, ControllerReso
6060
{
6161
$this->dispatcher = $dispatcher;
6262
$this->resolver = $resolver;
63-
$this->requestStack = $requestStack ?: new RequestStack();
63+
$this->requestStack = $requestStack ?? new RequestStack();
6464
$this->argumentResolver = $argumentResolver;
6565

6666
if (null === $this->argumentResolver) {

src/Symfony/Component/HttpKernel/Tests/EventListener/TestSessionListenerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ public function testDoesNotThrowIfRequestDoesNotHaveASession()
158158
private function filterResponse(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, Response $response = null)
159159
{
160160
$request->setSession($this->session);
161-
$response = $response ?: new Response();
161+
$response = $response ?? new Response();
162162
$kernel = $this->createMock(HttpKernelInterface::class);
163163
$event = new ResponseEvent($kernel, $request, $type, $response);
164164

src/Symfony/Component/Mailer/Transport/AbstractTransport.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ abstract class AbstractTransport implements TransportInterface
3535
public function __construct(EventDispatcherInterface $dispatcher = null, LoggerInterface $logger = null)
3636
{
3737
$this->dispatcher = class_exists(Event::class) ? LegacyEventDispatcherProxy::decorate($dispatcher) : $dispatcher;
38-
$this->logger = $logger ?: new NullLogger();
38+
$this->logger = $logger ?? new NullLogger();
3939
}
4040

4141
/**

src/Symfony/Component/Mailer/Transport/Smtp/SmtpTransport.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function __construct(AbstractStream $stream = null, EventDispatcherInterf
4444
{
4545
parent::__construct($dispatcher, $logger);
4646

47-
$this->stream = $stream ?: new SocketStream();
47+
$this->stream = $stream ?? new SocketStream();
4848
}
4949

5050
public function getStream(): AbstractStream

src/Symfony/Component/Messenger/Bridge/Amqp/Tests/Transport/AmqpTransportTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ public function testReceivesMessages()
5454

5555
private function getTransport(SerializerInterface $serializer = null, Connection $connection = null): AmqpTransport
5656
{
57-
$serializer = $serializer ?: $this->createMock(SerializerInterface::class);
58-
$connection = $connection ?: $this->createMock(Connection::class);
57+
$serializer = $serializer ?? $this->createMock(SerializerInterface::class);
58+
$connection = $connection ?? $this->createMock(Connection::class);
5959

6060
return new AmqpTransport($connection, $serializer);
6161
}

src/Symfony/Component/Messenger/Bridge/Beanstalkd/Tests/Transport/BeanstalkdTransportTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ public function testReceivesMessages()
5252

5353
private function getTransport(SerializerInterface $serializer = null, Connection $connection = null): BeanstalkdTransport
5454
{
55-
$serializer = $serializer ?: $this->createMock(SerializerInterface::class);
56-
$connection = $connection ?: $this->createMock(Connection::class);
55+
$serializer = $serializer ?? $this->createMock(SerializerInterface::class);
56+
$connection = $connection ?? $this->createMock(Connection::class);
5757

5858
return new BeanstalkdTransport($connection, $serializer);
5959
}

src/Symfony/Component/Messenger/Bridge/Redis/Tests/Transport/RedisTransportTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ public function testReceivesMessages()
5252

5353
private function getTransport(SerializerInterface $serializer = null, Connection $connection = null): RedisTransport
5454
{
55-
$serializer = $serializer ?: $this->createMock(SerializerInterface::class);
56-
$connection = $connection ?: $this->createMock(Connection::class);
55+
$serializer = $serializer ?? $this->createMock(SerializerInterface::class);
56+
$connection = $connection ?? $this->createMock(Connection::class);
5757

5858
return new RedisTransport($connection, $serializer);
5959
}

src/Symfony/Component/Routing/Router.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public function __construct(LoaderInterface $loader, $resource, array $options =
102102
$this->loader = $loader;
103103
$this->resource = $resource;
104104
$this->logger = $logger;
105-
$this->context = $context ?: new RequestContext();
105+
$this->context = $context ?? new RequestContext();
106106
$this->setOptions($options);
107107
$this->defaultLocale = $defaultLocale;
108108
}

src/Symfony/Component/Routing/Tests/Matcher/CompiledRedirectableUrlMatcherTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ protected function getUrlMatcher(RouteCollection $routes, RequestContext $contex
2525
$compiledRoutes = $dumper->getCompiledRoutes();
2626

2727
return $this->getMockBuilder(TestCompiledRedirectableUrlMatcher::class)
28-
->setConstructorArgs([$compiledRoutes, $context ?: new RequestContext()])
28+
->setConstructorArgs([$compiledRoutes, $context ?? new RequestContext()])
2929
->setMethods(['redirect'])
3030
->getMock();
3131
}

src/Symfony/Component/Routing/Tests/Matcher/CompiledUrlMatcherTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ protected function getUrlMatcher(RouteCollection $routes, RequestContext $contex
2222
{
2323
$dumper = new CompiledUrlMatcherDumper($routes);
2424

25-
return new CompiledUrlMatcher($dumper->getCompiledRoutes(), $context ?: new RequestContext());
25+
return new CompiledUrlMatcher($dumper->getCompiledRoutes(), $context ?? new RequestContext());
2626
}
2727
}

src/Symfony/Component/Routing/Tests/Matcher/RedirectableUrlMatcherTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,6 @@ public function testTrailingRequirementWithDefault_A()
211211

212212
protected function getUrlMatcher(RouteCollection $routes, RequestContext $context = null)
213213
{
214-
return $this->getMockForAbstractClass(RedirectableUrlMatcher::class, [$routes, $context ?: new RequestContext()]);
214+
return $this->getMockForAbstractClass(RedirectableUrlMatcher::class, [$routes, $context ?? new RequestContext()]);
215215
}
216216
}

src/Symfony/Component/Routing/Tests/Matcher/TraceableUrlMatcherTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,6 @@ public function testRoutesWithConditions()
121121

122122
protected function getUrlMatcher(RouteCollection $routes, RequestContext $context = null)
123123
{
124-
return new TraceableUrlMatcher($routes, $context ?: new RequestContext());
124+
return new TraceableUrlMatcher($routes, $context ?? new RequestContext());
125125
}
126126
}

src/Symfony/Component/Routing/Tests/Matcher/UrlMatcherTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -943,6 +943,6 @@ public function testRestrictiveTrailingRequirementWithStaticRouteAfter()
943943

944944
protected function getUrlMatcher(RouteCollection $routes, RequestContext $context = null)
945945
{
946-
return new UrlMatcher($routes, $context ?: new RequestContext());
946+
return new UrlMatcher($routes, $context ?? new RequestContext());
947947
}
948948
}

src/Symfony/Component/Security/Csrf/CsrfTokenManager.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ class CsrfTokenManager implements CsrfTokenManagerInterface
3939
*/
4040
public function __construct(TokenGeneratorInterface $generator = null, TokenStorageInterface $storage = null, $namespace = null)
4141
{
42-
$this->generator = $generator ?: new UriSafeTokenGenerator();
43-
$this->storage = $storage ?: new NativeSessionTokenStorage();
42+
$this->generator = $generator ?? new UriSafeTokenGenerator();
43+
$this->storage = $storage ?? new NativeSessionTokenStorage();
4444

4545
$superGlobalNamespaceGenerator = function () {
4646
return !empty($_SERVER['HTTPS']) && 'off' !== strtolower($_SERVER['HTTPS']) ? 'https-' : '';

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public function __construct(TokenStorageInterface $tokenStorage, iterable $userP
6969
$this->logger = $logger;
7070
$this->dispatcher = class_exists(Event::class) ? LegacyEventDispatcherProxy::decorate($dispatcher) : $dispatcher;
7171

72-
$this->trustResolver = $trustResolver ?: new AuthenticationTrustResolver(AnonymousToken::class, RememberMeToken::class);
72+
$this->trustResolver = $trustResolver ?? new AuthenticationTrustResolver(AnonymousToken::class, RememberMeToken::class);
7373
$this->sessionTrackerEnabler = $sessionTrackerEnabler;
7474
}
7575

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ protected function runSessionOnKernelResponse($newToken, $original = null)
417417

418418
private function handleEventWithPreviousSession($userProviders, UserInterface $user = null, RememberMeServicesInterface $rememberMeServices = null)
419419
{
420-
$tokenUser = $user ?: new User('foo', 'bar');
420+
$tokenUser = $user ?? new User('foo', 'bar');
421421
$session = new Session(new MockArraySessionStorage());
422422
$session->set('_security_context_key', serialize(new UsernamePasswordToken($tokenUser, '', 'context_key', ['ROLE_USER'])));
423423

0 commit comments

Comments
 (0)