diff --git a/Classes/Authentication/KeyAuthenticationProvider.php b/Classes/Authentication/KeyAuthenticationProvider.php index 3825f0c..274ba95 100644 --- a/Classes/Authentication/KeyAuthenticationProvider.php +++ b/Classes/Authentication/KeyAuthenticationProvider.php @@ -19,11 +19,11 @@ class KeyAuthenticationProvider * @param $key * @return bool */ - public function hasValidKey($key) + public function hasValidKey($key): bool { $config = Configuration::getExtConfiguration(); return trim($config['apiKey']) === trim($key); } -} \ No newline at end of file +} diff --git a/Classes/Middleware/ZabbixClient.php b/Classes/Middleware/ZabbixClient.php index c2f85e3..4f38df4 100644 --- a/Classes/Middleware/ZabbixClient.php +++ b/Classes/Middleware/ZabbixClient.php @@ -69,7 +69,7 @@ private function processRequest(ServerRequestInterface $request) return $response->withStatus(403, 'Not allowed'); } - $key = $request->getParsedBody()['key'] ?? $request->getQueryParams()['key'] ?? null; + $key = $request->getParsedBody()['key'] ?? $request->getQueryParams()['key'] ?? ''; $keyAuthenticationProvider = new KeyAuthenticationProvider(); if (!$keyAuthenticationProvider->hasValidKey($key)) { /** @var Response $response */ @@ -89,7 +89,7 @@ private function processRequest(ServerRequestInterface $request) $GLOBALS['TYPO3_REQUEST'] = (new ServerRequest())->withAttribute( 'applicationType', SystemEnvironmentBuilder::REQUESTTYPE_BE - )->withAttribute('frontend.typoscript',new FrontendTypoScript(new RootNode(),[])); + )->withAttribute('frontend.typoscript',new FrontendTypoScript(new RootNode(),[],[],[])); if ($operation !== null && $operation !== '') { try { diff --git a/Classes/Operation/HasForbiddenUsers.php b/Classes/Operation/HasForbiddenUsers.php index 791d231..66db239 100644 --- a/Classes/Operation/HasForbiddenUsers.php +++ b/Classes/Operation/HasForbiddenUsers.php @@ -9,6 +9,7 @@ * LICENSE.txt file that was distributed with this source code. */ +use Doctrine\DBAL\Exception; use TYPO3\CMS\Core\Database\ConnectionPool; use TYPO3\CMS\Core\Database\Query\QueryBuilder; use TYPO3\CMS\Core\SingletonInterface; @@ -29,6 +30,7 @@ class HasForbiddenUsers implements IOperation, SingletonInterface * * @param array $parameter None * @return OperationResult + * @throws Exception */ public function execute(array $parameter = []): OperationResult {