From 2b3c840c81c1e5c79b94f3645d7d827b8c516291 Mon Sep 17 00:00:00 2001 From: Bogdan BOCIOACA Date: Tue, 12 Nov 2024 14:44:57 +0100 Subject: [PATCH] chore: add compatibility with Laravel 11 --- composer.json | 4 ++-- src/Auth/CasGuard.php | 2 ++ src/Auth/CasUserProvider.php | 2 ++ src/Auth/User/CasUser.php | 2 ++ src/Providers/AppServiceProvider.php | 2 +- 5 files changed, 9 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index d9969cc..a248f7b 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,7 @@ "ext-dom": "*", "ext-simplexml": "*", "ecphp/cas-lib": "^2.0", - "laravel/framework": "^10 || ^11" + "laravel/framework": "^9 || ^10 || ^11" }, "require-dev": { "ecphp/php-conventions": "^1.0", @@ -25,7 +25,7 @@ "phpstan/phpstan-strict-rules": "^1.6", "roave/security-advisories": "dev-latest", "symfony/cache": "^6.4 || ^7.1", - "symfony/psr-http-message-bridge": "^v6.4 || ^7.1" + "symfony/psr-http-message-bridge": "^6.4 || ^7.1" }, "suggest": { "symfony/psr-http-message-bridge": "To bridge between Laravel and PSR HTTP Message" diff --git a/src/Auth/CasGuard.php b/src/Auth/CasGuard.php index 8e4cef7..382715f 100644 --- a/src/Auth/CasGuard.php +++ b/src/Auth/CasGuard.php @@ -17,6 +17,8 @@ use Illuminate\Contracts\Session\Session; use Illuminate\Http\Request; +use function sprintf; + final class CasGuard implements AuthGuard { private bool $loggedOut = false; diff --git a/src/Auth/CasUserProvider.php b/src/Auth/CasUserProvider.php index 92bd93f..82af193 100644 --- a/src/Auth/CasUserProvider.php +++ b/src/Auth/CasUserProvider.php @@ -33,6 +33,8 @@ public function getModel(): ?Authenticatable return $this->model; } + public function rehashPasswordIfRequired(Authenticatable $user, array $credentials, bool $force = false) {} + public function retrieveByCredentials(array $credentials): ?Authenticatable { if ([] === $credentials) { diff --git a/src/Auth/User/CasUser.php b/src/Auth/User/CasUser.php index 15916d8..997d0c6 100644 --- a/src/Auth/User/CasUser.php +++ b/src/Auth/User/CasUser.php @@ -81,6 +81,8 @@ public function getAuthPassword(): ?string return null; } + public function getAuthPasswordName() {} + public function getPassword(): ?string { return null; diff --git a/src/Providers/AppServiceProvider.php b/src/Providers/AppServiceProvider.php index e48d117..610c6a7 100644 --- a/src/Providers/AppServiceProvider.php +++ b/src/Providers/AppServiceProvider.php @@ -45,7 +45,7 @@ public function boot() 'laravel-cas' ); $this->app->router->group( - ['namespace' => 'EcPhp\\LaravelCas\\Controllers'], + ['namespace' => 'EcPhp\LaravelCas\Controllers'], static fn () => require dirname(__DIR__) . '/Config/routes.php' ); Auth::provider(