diff --git a/phpstan.neon b/phpstan.neon index 04161bca..2fa40512 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -2,7 +2,7 @@ parameters: checkGenericClassInNonGenericObjectType: false checkMissingIterableValueType: false inferPrivatePropertyTypeFromConstructor: true - level: 7 + level: 8 paths: - src - ./console diff --git a/src/AnimeClient/API/Kitsu/Auth.php b/src/AnimeClient/API/Kitsu/Auth.php index 67a1f7f3..0d0b5c5e 100644 --- a/src/AnimeClient/API/Kitsu/Auth.php +++ b/src/AnimeClient/API/Kitsu/Auth.php @@ -26,10 +26,6 @@ use Aviat\Ion\Di\{ContainerAware, ContainerInterface}; use Aviat\Ion\Di\Exception\{ContainerException, NotFoundException}; use Aviat\Ion\Event; -use Psr\SimpleCache\InvalidArgumentException; - -use Throwable; - /** * Kitsu API Authentication */ @@ -55,8 +51,6 @@ final class Auth { * Constructor * * @param ContainerInterface $container - * @throws ContainerException - * @throws NotFoundException */ public function __construct(ContainerInterface $container) { @@ -75,8 +69,6 @@ final class Auth { * * @param string $password * @return boolean - * @throws Throwable - * @throws InvalidArgumentException */ public function authenticate(string $password): bool { @@ -93,8 +85,6 @@ final class Auth { * * @param string|null $refreshToken * @return boolean - * @throws InvalidArgumentException - * @throws Throwable */ public function reAuthenticate(?string $refreshToken = NULL): bool { @@ -114,7 +104,6 @@ final class Auth { * Check whether the current user is authenticated * * @return boolean - * @throws InvalidArgumentException */ public function isAuthenticated(): bool { @@ -135,7 +124,6 @@ final class Auth { * Retrieve the authentication token from the session * * @return string - * @throws InvalidArgumentException */ public function getAuthToken(): ?string { @@ -152,7 +140,6 @@ final class Auth { * Retrieve the refresh token * * @return string|null - * @throws InvalidArgumentException */ private function getRefreshToken(): ?string { @@ -168,11 +155,10 @@ final class Auth { /** * Save the new authentication information * - * @param $auth + * @param array|false $auth * @return bool - * @throws InvalidArgumentException */ - private function storeAuth($auth): bool + private function storeAuth(array|false $auth): bool { if (FALSE !== $auth) { diff --git a/src/Ion/View/HtmlView.php b/src/Ion/View/HtmlView.php index 541089a1..ad24c6e5 100644 --- a/src/Ion/View/HtmlView.php +++ b/src/Ion/View/HtmlView.php @@ -71,7 +71,7 @@ class HtmlView extends HttpView { // Very basic html minify, that won't affect content between html tags - return preg_replace('/>\s+ <', $buffer); + return preg_replace('/>\s+ <', $buffer) ?? $buffer; } } // End of HtmlView.php \ No newline at end of file