Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/prettier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 .
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -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
Expand Down
10 changes: 4 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand All @@ -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
}
}
}
3 changes: 1 addition & 2 deletions src/Auth/CasGuard.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ public function __construct(
private ?UserProvider $provider,
private Request $request,
private Session $session
) {
}
) {}

public function attempt(array $credentials): ?Authenticatable
{
Expand Down
7 changes: 2 additions & 5 deletions src/Auth/CasUserProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ final class CasUserProvider implements UserProvider

public function __construct(
private Session $session
) {
}
) {}

public function getModel(): ?Authenticatable
{
Expand Down Expand Up @@ -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)
{
Expand Down
8 changes: 1 addition & 7 deletions src/Auth/User/CasUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@ public function getAuthIdentifierName(): string

/**
* Get the password for the user.
*
* @return string
*/
public function getAuthPassword(): ?string
{
Expand All @@ -103,8 +101,6 @@ public function getRememberToken(): string

/**
* Get the column name for the "remember me" token.
*
* @return string
*/
public function getRememberTokenName(): ?string
{
Expand All @@ -121,9 +117,7 @@ public function getRoles(): array
*
* @param mixed $value
*/
public function setRememberToken($value): void
{
}
public function setRememberToken($value): void {}

/**
* Get the storage.
Expand Down
42 changes: 2 additions & 40 deletions src/Config/Laravel.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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<string, mixed>|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();
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Controllers/LoginController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
];
Expand Down
2 changes: 1 addition & 1 deletion src/Controllers/LogoutController.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function __invoke(
Request $request,
CasInterface $cas,
ServerRequestInterface $serverRequest
): RedirectResponse|Redirector|ResponseInterface {
): Redirector|RedirectResponse|ResponseInterface {
$response = $cas
->logout(
$serverRequest->withQueryParams(
Expand Down
2 changes: 1 addition & 1 deletion src/Controllers/ProxyCallbackController.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function __invoke(
Request $request,
CasInterface $cas,
ServerRequestInterface $serverRequest
): ResponseInterface|Response {
): Response|ResponseInterface {
return $cas
->handleProxyCallback(
$serverRequest
Expand Down
3 changes: 1 addition & 2 deletions src/Middleware/CasAuthenticator.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ final class CasAuthenticator
public function __construct(
private CasInterface $cas,
private ServerRequestInterface $serverRequest
) {
}
) {}

public function handle(Request $request, Closure $next): mixed
{
Expand Down