Skip to content

Commit f9ce6b6

Browse files
Merge branch '3.4' into 4.3
* 3.4: Fix return statements [TwigBridge] add missing dep Add false type to ChoiceListFactoryInterface::createView $label argument
2 parents d6cb36f + 3cfd3a9 commit f9ce6b6

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
@@ -351,7 +351,7 @@ protected function getDoctrine(): ManagerRegistry
351351
/**
352352
* Get a user from the Security Token Storage.
353353
*
354-
* @return mixed
354+
* @return object|null
355355
*
356356
* @throws \LogicException If SecurityBundle is not available
357357
*
@@ -366,12 +366,12 @@ protected function getUser()
366366
}
367367

368368
if (null === $token = $this->container->get('security.token_storage')->getToken()) {
369-
return;
369+
return null;
370370
}
371371

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

377377
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)