Skip to content

Commit

Permalink
Fix styling
Browse files Browse the repository at this point in the history
  • Loading branch information
omar-haris authored and github-actions[bot] committed Oct 22, 2024
1 parent 2ddcffc commit 1444227
Show file tree
Hide file tree
Showing 25 changed files with 330 additions and 385 deletions.
10 changes: 5 additions & 5 deletions config/keycloak.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
| Keycloak instance is accessible.
|
*/
'base_url' => env('KEYCLOAK_BASE_URL','http://localhost:8080'),
'base_url' => env('KEYCLOAK_BASE_URL', 'http://localhost:8080'),

/*
|--------------------------------------------------------------------------
Expand All @@ -25,7 +25,7 @@
| the Keycloak API.
|
*/
'username' => env('KEYCLOAK_USERNAME','admin'),
'username' => env('KEYCLOAK_USERNAME', 'admin'),

/*
|--------------------------------------------------------------------------
Expand All @@ -48,7 +48,7 @@
| application will communicate with.
|
*/
'realm' => env('KEYCLOAK_REALM','master'),
'realm' => env('KEYCLOAK_REALM', 'master'),

/*
|--------------------------------------------------------------------------
Expand All @@ -60,7 +60,7 @@
| realm to allow API interactions.
|
*/
'client_id' => env('KEYCLOAK_CLIENT_ID','admin-cli'),
'client_id' => env('KEYCLOAK_CLIENT_ID', 'admin-cli'),

/*
|--------------------------------------------------------------------------
Expand All @@ -84,5 +84,5 @@
| method. Other grant types are available, such as 'client_credentials'.
|
*/
'grant_type' => env('KEYCLOAK_GRANT_TYPE','password'),
'grant_type' => env('KEYCLOAK_GRANT_TYPE', 'password'),
];
1 change: 0 additions & 1 deletion src/Enums/CredentialType.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
/**
* CredentialType enum class.
*
* @package OpenSeaWave\Keycloak\Enums
* @author Omar Haris
*/
enum CredentialType: string
Expand Down
1 change: 0 additions & 1 deletion src/Enums/GrantType.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
/**
* Class GrantType
*
* @package OpenSeaWave\Keycloak\Enums
* @author Omar Haris
*/
enum GrantType: string
Expand Down
1 change: 0 additions & 1 deletion src/Enums/UserActionType.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
/**
* UserActionType enum class.
*
* @package OpenSeaWave\Keycloak\Enums
* @author Omar Haris
*/
enum UserActionType: string
Expand Down
24 changes: 10 additions & 14 deletions src/Exceptions/KeycloakException.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
*
* This exception is thrown when an error occurs while interacting with the Keycloak API.
*
* @package OpenSeaWave\Keycloak
* @author Omar Haris
*/
class KeycloakException extends Exception
Expand All @@ -33,16 +32,16 @@ class KeycloakException extends Exception
/**
* KeycloakException constructor.
*
* @param string $message The exception message.
* @param int|null $statusCode The HTTP status code from Keycloak, if available.
* @param Exception|null $previous The previous exception.
* @param ResponseInterface|null $response The HTTP response object, if available.
* @param string $message The exception message.
* @param int|null $statusCode The HTTP status code from Keycloak, if available.
* @param Exception|null $previous The previous exception.
* @param ResponseInterface|null $response The HTTP response object, if available.
*/
public function __construct(
string $message = "",
int $statusCode = null,
Exception $previous = null,
ResponseInterface $response = null
string $message = '',
?int $statusCode = null,
?Exception $previous = null,
?ResponseInterface $response = null
) {
parent::__construct($message, $statusCode, $previous);
$this->statusCode = $statusCode;
Expand All @@ -51,8 +50,6 @@ public function __construct(

/**
* Get the HTTP status code from Keycloak.
*
* @return int|null
*/
public function getStatusCode(): ?int
{
Expand All @@ -71,22 +68,21 @@ public function getResponse()

/**
* Get the body of the HTTP response as an associative array.
*
* @return array|null
*/
public function getResponseBody(): ?array
{
if ($this->response) {
$body = (string) $this->response->getBody();

return json_decode($body, true);
}

return null;
}

/**
* Static method to create an exception from a Guzzle RequestException.
*
* @param RequestException $exception
* @return static
*/
public static function fromRequestException(RequestException $exception): self
Expand Down
6 changes: 2 additions & 4 deletions src/Facades/Keycloak.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
use Illuminate\Support\Facades\Facade;
use OpenSeaWave\Keycloak\Enums\GrantType;
use OpenSeaWave\Keycloak\Representation\AddUserRolesRequest;
use OpenSeaWave\Keycloak\Representation\CountUsersRequest;
use OpenSeaWave\Keycloak\Representation\CreateRoleRequest;
use OpenSeaWave\Keycloak\Representation\DeleteUserRolesRequest;
use OpenSeaWave\Keycloak\Representation\GetRolesRequest;
use OpenSeaWave\Keycloak\Representation\GetUsersRequest;
use OpenSeaWave\Keycloak\Representation\RoleRepresentation;
use OpenSeaWave\Keycloak\Representation\UserRepresentation;
use OpenSeaWave\Keycloak\Representation\CountUsersRequest;

/**
* Class Keycloak
Expand Down Expand Up @@ -42,15 +42,13 @@
* @method static void changeUserActivationStatus(string $userId, bool $enabled,?string $realm) Change a user's activation status.
*
* @see \OpenSeaWave\Keycloak\Keycloak
* @package OpenSeaWave\Keycloak
*
* @author Omar Haris
*/
class Keycloak extends Facade
{
/**
* Get the registered name of the component.
*
* @return string
*/
protected static function getFacadeAccessor(): string
{
Expand Down
Loading

0 comments on commit 1444227

Please sign in to comment.