Skip to content

Commit

Permalink
Merge pull request #14 from Mansouri-Adel/feature/add-php81-support
Browse files Browse the repository at this point in the history
Feature/add php81 support
  • Loading branch information
tkiehne authored Jan 27, 2023
2 parents cf380da + c98d322 commit f3f0fc2
Show file tree
Hide file tree
Showing 10 changed files with 111 additions and 145 deletions.
3 changes: 3 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
"issues": "https://github.com/deohs/uwauth/issues",
"source": "https://github.com/deohs/uwauth"
},
"require": {
"php": ">=8.1"
},
"license": "GPL-3.0-or-later",
"minimum-stability": "dev"
}
4 changes: 2 additions & 2 deletions src/Controller/LogoutController.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ class LogoutController extends ControllerBase {
/**
* The overridden controller for user.logout.
*
* Do not set the refrehs delay to 0 to avoid having an immediate redirect
* Do not set the refresh delay to 0 to avoid having an immediate redirect
* without page display.
*
* @see https://www.w3.org/TR/WCAG20-TECHS/H76.html
*
* @return array
* A render array.
*/
public function logout() {
public function logout(): array {
$title = $this->t('Logout');
$frontUrl = Url::fromRoute('<front>', [], ['absolute' => TRUE]);
$frontString = $frontUrl->toString();
Expand Down
2 changes: 1 addition & 1 deletion src/Controller/UwAuthLogoutController.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class UwAuthLogoutController extends ControllerBase {
/**
* Log user out of Drupal, and redirect to web login.
*/
public function logout() {
public function logout(): TrustedRedirectResponse {
user_logout();
return new TrustedRedirectResponse('https://weblogin.washington.edu/');
}
Expand Down
8 changes: 4 additions & 4 deletions src/Debug.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ class Debug {
*
* @var bool
*/
protected $verbose;
protected bool $verbose;

/**
* The Messenger service.
*
* @var \Drupal\Core\Messenger\MessengerInterface
*/
protected $messenger;
protected MessengerInterface $messenger;

/**
* Debug constructor.
Expand All @@ -31,7 +31,7 @@ class Debug {
* @param bool $verbose
* Display debug information?
*/
public function __construct(MessengerInterface $messenger, $verbose = FALSE) {
public function __construct(MessengerInterface $messenger, bool $verbose = FALSE) {
$this->messenger = $messenger;
$this->verbose = $verbose;
}
Expand All @@ -44,7 +44,7 @@ public function __construct(MessengerInterface $messenger, $verbose = FALSE) {
* @param string $level
* The message severity level.
*/
public function message($message, $level = MessengerInterface::TYPE_STATUS) {
public function message(string $message, string $level = MessengerInterface::TYPE_STATUS): void {
if (!$this->verbose) {
return;
}
Expand Down
2 changes: 1 addition & 1 deletion src/EventSubscriber/LogoutOverride.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class LogoutOverride extends RouteSubscriberBase {
/**
* {@inheritdoc}
*/
public function alterRoutes(RouteCollection $collection) {
public function alterRoutes(RouteCollection $collection): void {
if (!$route = $collection->get('user.logout')) {
return;
}
Expand Down
Loading

0 comments on commit f3f0fc2

Please sign in to comment.