Commit e611c249 authored by Matthias Adrowski's avatar Matthias Adrowski
Browse files

[TASK] Alot of phpstan issues fixed

parent f70626a7
......@@ -58,7 +58,7 @@ abstract class AbstractRestController extends ActionController {
protected $defaultViewObjectName = JsonView::class;
/**
* @var string
* @var array
*/
protected $viewFormatToObjectNameMap = [
'json' => JsonView::class
......
......@@ -50,7 +50,7 @@ class FrontendUser extends ExtbaseFrontendUser {
/**
* Setter for auth token
*
* @param $token
* @param string $token
* @return void
*/
public function setAuthToken($token): void {
......
......@@ -157,7 +157,7 @@ abstract class AbstractRestMiddleware implements LoggerAwareInterface, Middlewar
/**
* Method returns the requested action for the rest controller. If no
*
* @param $method
* @param string $method
* @return string
*/
protected function getCallableActionName($method): string {
......@@ -183,7 +183,7 @@ abstract class AbstractRestMiddleware implements LoggerAwareInterface, Middlewar
}
/**
* @param $data
* @param mixed $data
* @param int $statusCode
* @return Response
*/
......
......@@ -60,7 +60,7 @@ abstract class AbstractAuthenticationService implements AuthenticationServiceInt
/**
* Verify if the authenticated user has access to the given apikey.
*
* @param $apiKey
* @param string $apiKey
* @return bool
*/
public function verifyUserAccess($apiKey): bool {
......
......@@ -43,7 +43,7 @@ interface AuthenticationServiceInterface {
/**
* Verify if the authenticated user has access to the given apikey.
*
* @param $apiKey
* @param string $apiKey
* @return bool
*/
public function verifyUserAccess(string $apiKey): bool;
......
......@@ -69,7 +69,7 @@ class BasicAuthenticationService extends AbstractAuthenticationService implement
)
)
->execute()
->fetchAll()[0];
->fetchAllAssociative()[0];
if (!empty($user)) {
$this->authenticatedUser = $user;
......@@ -103,7 +103,7 @@ class BasicAuthenticationService extends AbstractAuthenticationService implement
)
)
->execute()
->fetchAll()[0];
->fetchAllAssociative()[0];
if (!$frontendUser) {
throw new \Exception('The requested user does not exist or is invalid', 500);
......
......@@ -64,7 +64,7 @@ class BearerAuthenticationService extends AbstractAuthenticationService implemen
}
/**
* @param $bearerToken
* @param string $bearerToken
* @return bool
* @throws Exception
*/
......@@ -93,7 +93,7 @@ class BearerAuthenticationService extends AbstractAuthenticationService implemen
)
)
->execute()
->fetchAll()[0];
->fetchAllAssociative()[0];
if (!empty($user)) {
$this->authenticatedUser = $user;
......
......@@ -65,7 +65,7 @@ class BearerTokenService implements SingletonInterface {
* Will default to PHP time() value if null.
* @var int
*/
public $timestamp = NULL;
public $timestamp;
/**
* @var array
......
<?php
$EM_CONF[$_EXTKEY] = [
$EM_CONF['sg_rest'] = [
'title' => 'REST API basis',
'description' => 'The extension provieds a basis REST environment. New endpoints provides a REST environment, so that other extensions only need to register them.',
'category' => 'misc',
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment