Skip to content

Commit 3cfd3a9

Browse files
Fix return statements
1 parent 48aa68c commit 3cfd3a9

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
@@ -431,7 +431,7 @@ protected function getDoctrine()
431431
/**
432432
* Get a user from the Security Token Storage.
433433
*
434-
* @return mixed
434+
* @return object|null
435435
*
436436
* @throws \LogicException If SecurityBundle is not available
437437
*
@@ -446,12 +446,12 @@ protected function getUser()
446446
}
447447

448448
if (null === $token = $this->container->get('security.token_storage')->getToken()) {
449-
return;
449+
return null;
450450
}
451451

452452
if (!\is_object($user = $token->getUser())) {
453453
// e.g. anonymous authentication
454-
return;
454+
return null;
455455
}
456456

457457
return $user;

Templating/GlobalVariables.php

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

4242
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
@@ -120,7 +120,7 @@ public function fileExcerpt($file, $line)
120120

121121
// Check if the file is an application/octet-stream (eg. Phar file) because highlight_file cannot parse these files
122122
if ('application/octet-stream' === $finfo->file($file, FILEINFO_MIME_TYPE)) {
123-
return;
123+
return '';
124124
}
125125
}
126126

0 commit comments

Comments
 (0)