Skip to content

Commit afefa62

Browse files
More short closures + isset instead of null checks + etc.
1 parent 37ea807 commit afefa62

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

Controller/AbstractController.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
use Symfony\Component\WebLink\EventListener\AddLinkHeaderListener;
4545
use Symfony\Component\WebLink\GenericLinkProvider;
4646
use Symfony\Component\WebLink\HttpHeaderSerializer;
47-
use Symfony\Component\WebLink\Link;
4847
use Symfony\Contracts\Service\Attribute\Required;
4948
use Symfony\Contracts\Service\ServiceSubscriberInterface;
5049
use Twig\Environment;
@@ -64,7 +63,7 @@ abstract class AbstractController implements ServiceSubscriberInterface
6463
#[Required]
6564
public function setContainer(ContainerInterface $container): ?ContainerInterface
6665
{
67-
$previous = $this->container;
66+
$previous = $this->container ?? null;
6867
$this->container = $container;
6968

7069
return $previous;

Routing/Router.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public function __construct(ContainerInterface $container, mixed $resource, arra
6161

6262
public function getRouteCollection(): RouteCollection
6363
{
64-
if (null === $this->collection) {
64+
if (!isset($this->collection)) {
6565
$this->collection = $this->container->get('routing.loader')->load($this->resource, $this->options['resource_type']);
6666
$this->resolveParameters($this->collection);
6767
$this->collection->addResource(new ContainerParametersResource($this->collectedParameters));

0 commit comments

Comments
 (0)