Skip to content

Commit 454e3d5

Browse files
Merge branch '4.3' into 4.4
* 4.3: cs fix Fix return statements [TwigBridge] add missing dep Add false type to ChoiceListFactoryInterface::createView $label argument Update UPGRADE guide of 4.3 for EventDispatcher [SecurityBundle] display the correct class name on the deprecated notice
2 parents 4b8e9c0 + f9ce6b6 commit 454e3d5

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

Controller/ControllerTrait.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ protected function getDoctrine(): ManagerRegistry
352352
/**
353353
* Get a user from the Security Token Storage.
354354
*
355-
* @return mixed
355+
* @return object|null
356356
*
357357
* @throws \LogicException If SecurityBundle is not available
358358
*
@@ -367,12 +367,12 @@ protected function getUser()
367367
}
368368

369369
if (null === $token = $this->container->get('security.token_storage')->getToken()) {
370-
return;
370+
return null;
371371
}
372372

373373
if (!\is_object($user = $token->getUser())) {
374374
// e.g. anonymous authentication
375-
return;
375+
return null;
376376
}
377377

378378
return $user;

Templating/GlobalVariables.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function __construct(ContainerInterface $container)
4040
public function getToken()
4141
{
4242
if (!$this->container->has('security.token_storage')) {
43-
return;
43+
return null;
4444
}
4545

4646
return $this->container->get('security.token_storage')->getToken();

Templating/Helper/CodeHelper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ public function fileExcerpt($file, $line)
126126

127127
// Check if the file is an application/octet-stream (eg. Phar file) because highlight_file cannot parse these files
128128
if ('application/octet-stream' === $finfo->file($file, FILEINFO_MIME_TYPE)) {
129-
return;
129+
return '';
130130
}
131131
}
132132

0 commit comments

Comments
 (0)