diff --git a/.github/workflows/prettier.yml b/.github/workflows/prettier.yml index c6920b2..4cbf9e8 100644 --- a/.github/workflows/prettier.yml +++ b/.github/workflows/prettier.yml @@ -16,7 +16,7 @@ jobs: uses: actions/checkout@v3 - name: Install the Nix package manager - uses: cachix/install-nix-action@v19 + uses: cachix/install-nix-action@v20 - name: Checks run: nix run nixpkgs#nodePackages.prettier -- --check . diff --git a/LICENSE b/LICENSE index 33ba996..5f3c3e9 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ BSD 3-Clause License -Copyright (c) 2019-2023, European Union. +Copyright (c) 2019-2024, European Union. All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/composer.json b/composer.json index eff7e69..43891bc 100644 --- a/composer.json +++ b/composer.json @@ -11,12 +11,10 @@ ], "homepage": "https://github.com/ecphp/", "require": { - "php": ">= 8.0.2", + "php": ">= 8.1", "ext-dom": "*", - "ext-json": "*", - "ext-libxml": "*", "ext-simplexml": "*", - "ecphp/cas-lib": "^2.0", + "ecphp/cas-lib": "^3.0", "laravel/framework": "^9 || ^10" }, "require-dev": { @@ -37,9 +35,9 @@ }, "config": { "allow-plugins": { - "phpstan/extension-installer": true, + "ergebnis/composer-normalize": true, "phpro/grumphp": true, - "ergebnis/composer-normalize": true + "phpstan/extension-installer": true } } } diff --git a/src/Auth/CasGuard.php b/src/Auth/CasGuard.php index 89413b3..8e4cef7 100644 --- a/src/Auth/CasGuard.php +++ b/src/Auth/CasGuard.php @@ -29,8 +29,7 @@ public function __construct( private ?UserProvider $provider, private Request $request, private Session $session - ) { - } + ) {} public function attempt(array $credentials): ?Authenticatable { diff --git a/src/Auth/CasUserProvider.php b/src/Auth/CasUserProvider.php index ea460d6..92bd93f 100644 --- a/src/Auth/CasUserProvider.php +++ b/src/Auth/CasUserProvider.php @@ -26,8 +26,7 @@ final class CasUserProvider implements UserProvider public function __construct( private Session $session - ) { - } + ) {} public function getModel(): ?Authenticatable { @@ -63,9 +62,7 @@ public function retrieveCasUser(): ?Authenticatable return $this->session->get(auth()->guard($this->guard_name)->getName()); } - public function updateRememberToken(Authenticatable $user, $token) - { - } + public function updateRememberToken(Authenticatable $user, $token) {} public function validateCredentials(Authenticatable $user, array $credentials) { diff --git a/src/Auth/User/CasUser.php b/src/Auth/User/CasUser.php index 64066fb..15916d8 100644 --- a/src/Auth/User/CasUser.php +++ b/src/Auth/User/CasUser.php @@ -75,8 +75,6 @@ public function getAuthIdentifierName(): string /** * Get the password for the user. - * - * @return string */ public function getAuthPassword(): ?string { @@ -103,8 +101,6 @@ public function getRememberToken(): string /** * Get the column name for the "remember me" token. - * - * @return string */ public function getRememberTokenName(): ?string { @@ -121,9 +117,7 @@ public function getRoles(): array * * @param mixed $value */ - public function setRememberToken($value): void - { - } + public function setRememberToken($value): void {} /** * Get the storage. diff --git a/src/Config/Laravel.php b/src/Config/Laravel.php index cf82f0d..e4de8ec 100644 --- a/src/Config/Laravel.php +++ b/src/Config/Laravel.php @@ -15,7 +15,6 @@ use EcPhp\CasLib\Contract\Configuration\PropertiesInterface; use Illuminate\Routing\Router; use Illuminate\Routing\Router as RouterInterface; -use ReturnTypeWillChange; use Symfony\Component\HttpFoundation\ParameterBag; use Symfony\Component\Routing\Generator\UrlGeneratorInterface; @@ -39,46 +38,9 @@ public function __construct( ); } - public function all(): array + public function jsonSerialize(): mixed { - return $this->cas->all(); - } - - /** - * @param mixed $offset - */ - #[ReturnTypeWillChange] - public function offsetExists($offset): bool - { - return $this->cas->offsetExists($offset); - } - - /** - * @param mixed $offset - * - * @return array|mixed - */ - #[ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->cas->offsetGet($offset); - } - - /** - * @param mixed $offset - * @param mixed $value - */ - public function offsetSet($offset, $value): void - { - $this->cas->offsetSet($offset, $value); - } - - /** - * @param mixed $offset - */ - public function offsetUnset($offset): void - { - $this->cas->offsetUnset($offset); + return $this->cas->jsonSerialize(); } /** diff --git a/src/Controllers/LoginController.php b/src/Controllers/LoginController.php index 28bd142..40a1a2b 100644 --- a/src/Controllers/LoginController.php +++ b/src/Controllers/LoginController.php @@ -24,7 +24,7 @@ public function __invoke( Request $request, CasInterface $cas, ServerRequestInterface $serverRequest, - ): Redirector|ResponseInterface|RedirectResponse { + ): Redirector|RedirectResponse|ResponseInterface { $parameters = $request->query->all() + [ 'renew' => null !== auth()->guard()->user(), ]; diff --git a/src/Controllers/LogoutController.php b/src/Controllers/LogoutController.php index 06f6838..209addd 100644 --- a/src/Controllers/LogoutController.php +++ b/src/Controllers/LogoutController.php @@ -24,7 +24,7 @@ public function __invoke( Request $request, CasInterface $cas, ServerRequestInterface $serverRequest - ): RedirectResponse|Redirector|ResponseInterface { + ): Redirector|RedirectResponse|ResponseInterface { $response = $cas ->logout( $serverRequest->withQueryParams( diff --git a/src/Controllers/ProxyCallbackController.php b/src/Controllers/ProxyCallbackController.php index cd6518e..ceadddd 100644 --- a/src/Controllers/ProxyCallbackController.php +++ b/src/Controllers/ProxyCallbackController.php @@ -23,7 +23,7 @@ public function __invoke( Request $request, CasInterface $cas, ServerRequestInterface $serverRequest - ): ResponseInterface|Response { + ): Response|ResponseInterface { return $cas ->handleProxyCallback( $serverRequest diff --git a/src/Middleware/CasAuthenticator.php b/src/Middleware/CasAuthenticator.php index b989a3a..795a1c7 100644 --- a/src/Middleware/CasAuthenticator.php +++ b/src/Middleware/CasAuthenticator.php @@ -22,8 +22,7 @@ final class CasAuthenticator public function __construct( private CasInterface $cas, private ServerRequestInterface $serverRequest - ) { - } + ) {} public function handle(Request $request, Closure $next): mixed {