Skip to content
Snippets Groups Projects
Commit caa3a215 authored by Tim van Dijen's avatar Tim van Dijen
Browse files

Fix PossiblyNullArgument (3x)

parent 31f7c784
No related branches found
No related tags found
No related merge requests found
...@@ -24,6 +24,7 @@ use Symfony\Component\HttpFoundation\Request; ...@@ -24,6 +24,7 @@ use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\ResponseHeaderBag; use Symfony\Component\HttpFoundation\ResponseHeaderBag;
use Symfony\Component\VarExporter\VarExporter; use Symfony\Component\VarExporter\VarExporter;
use Webmozart\Assert\Assert;
/** /**
* Controller class for the admin module. * Controller class for the admin module.
...@@ -147,6 +148,8 @@ class Federation ...@@ -147,6 +148,8 @@ class Federation
]; ];
Module::callHooks('federationpage', $t); Module::callHooks('federationpage', $t);
Assert::isInstanceOf($t, Template::class);
$this->menu->addOption('logout', $t->data['logouturl'], Translate::noop('Log out')); $this->menu->addOption('logout', $t->data['logouturl'], Translate::noop('Log out'));
return $this->menu->insert($t); return $this->menu->insert($t);
} }
......
...@@ -89,9 +89,7 @@ class Test ...@@ -89,9 +89,7 @@ class Test
$attributes = $authsource->getAttributes(); $attributes = $authsource->getAttributes();
$authData = $authsource->getAuthDataArray(); $authData = $authsource->getAuthDataArray();
$nameId = !is_null($authsource->getAuthData('saml:sp:NameID')) $nameId = $authsource->getAuthData('saml:sp:NameID') ?? false;
? $authsource->getAuthData('saml:sp:NameID')
: false;
$t = new Template($this->config, 'admin:status.twig', 'attributes'); $t = new Template($this->config, 'admin:status.twig', 'attributes');
$t->data = [ $t->data = [
...@@ -108,6 +106,8 @@ class Test ...@@ -108,6 +106,8 @@ class Test
} }
Module::callHooks('configpage', $t); Module::callHooks('configpage', $t);
Assert::isInstanceOf($t, Template::class);
$this->menu->addOption('logout', Utils\Auth::getAdminLogoutURL(), Translate::noop('Log out')); $this->menu->addOption('logout', Utils\Auth::getAdminLogoutURL(), Translate::noop('Log out'));
return $this->menu->insert($t); return $this->menu->insert($t);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment