Skip to content

Commit f27a39b

Browse files
committed
[CS] Replace easy occurences of ?: with ??
1 parent 9ced5b7 commit f27a39b

File tree

8 files changed

+8
-8
lines changed

8 files changed

+8
-8
lines changed

Extension/Core/CoreExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function __construct(PropertyAccessorInterface $propertyAccessor = null,
4242
throw new \TypeError(sprintf('Argument 3 passed to "%s()" must be an instance of "%s", "%s" given.', __METHOD__, TranslatorInterface::class, \is_object($translator) ? \get_class($translator) : \gettype($translator)));
4343
}
4444
$this->propertyAccessor = $propertyAccessor ?: PropertyAccess::createPropertyAccessor();
45-
$this->choiceListFactory = $choiceListFactory ?: new CachingFactoryDecorator(new PropertyAccessDecorator(new DefaultChoiceListFactory(), $this->propertyAccessor));
45+
$this->choiceListFactory = $choiceListFactory ?? new CachingFactoryDecorator(new PropertyAccessDecorator(new DefaultChoiceListFactory(), $this->propertyAccessor));
4646
$this->translator = $translator;
4747
}
4848

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
/**

Extension/Core/Type/ChoiceType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class ChoiceType extends AbstractType
4949
*/
5050
public function __construct(ChoiceListFactoryInterface $choiceListFactory = null, $translator = null)
5151
{
52-
$this->choiceListFactory = $choiceListFactory ?: new CachingFactoryDecorator(
52+
$this->choiceListFactory = $choiceListFactory ?? new CachingFactoryDecorator(
5353
new PropertyAccessDecorator(
5454
new DefaultChoiceListFactory()
5555
)

Extension/Csrf/EventListener/CsrfValidationListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function __construct(string $fieldName, CsrfTokenManagerInterface $tokenM
5555
$this->errorMessage = $errorMessage;
5656
$this->translator = $translator;
5757
$this->translationDomain = $translationDomain;
58-
$this->serverParams = $serverParams ?: new ServerParams();
58+
$this->serverParams = $serverParams ?? new ServerParams();
5959
}
6060

6161
public function preSubmit(FormEvent $event)

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
/**

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
/**

FormFactoryBuilder.php

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

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

189189
return new FormFactory($registry);
190190
}

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
/**

0 commit comments

Comments
 (0)