Skip to content

Commit

Permalink
Adding php 7.4 support.
Browse files Browse the repository at this point in the history
  • Loading branch information
incraigulous committed May 15, 2024
1 parent 7e1f92a commit 593500c
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ jobs:
- name: PHPUnit Tests
uses: php-actions/phpunit@master
with:
php_version: 8.2
php_version: 7.4
bootstrap: tests/bootstrap.php
configuration: phpunit.xml
4 changes: 2 additions & 2 deletions src/Conditions/HasCap.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class HasCap implements Condition
*
* @return void
*/
public function __construct(string|iterable $capabilities, $user = null)
public function __construct($capabilities, $user = null)
{
$this->setUser($user);

Expand All @@ -44,7 +44,7 @@ public function __construct(string|iterable $capabilities, $user = null)
}
}

protected function setUser(WP_User|null $user): void
protected function setUser($user): void
{
$this->user = $user ?? wp_get_current_user();
}
Expand Down
2 changes: 1 addition & 1 deletion src/Factories/Conditions/HasCapFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function make(mixed $value = null, iterable $options = []): Condition
*
* @return WP_User|false The currently logged-in user, or false if no user is logged in.
*/
protected function getCurrentUser(): WP_User|false
protected function getCurrentUser()
{
return wp_get_current_user();
}
Expand Down
2 changes: 1 addition & 1 deletion src/Factories/Middleware/UserHasCapFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public function make(mixed $value = null, iterable $options = [])
*
* @return WP_User|false The currently logged-in user, or false if no user is logged in.
*/
protected function getCurrentUser(): WP_User|false
protected function getCurrentUser()
{
return wp_get_current_user();
}
Expand Down
2 changes: 1 addition & 1 deletion src/Factories/ResponseFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function make(mixed $value = null, iterable $options = []): BaseResponse
* @return Response
* @throws BindingResolutionException
*/
private function mapResponse($value = null, BaseResponse|null $response = null): BaseResponse
private function mapResponse($value = null, $response = null): BaseResponse
{
if ($value instanceof BaseResponse) {
return $value;
Expand Down
2 changes: 1 addition & 1 deletion src/Middleware/Route.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class Route implements Middleware
*
* @return void
*/
public function __construct(callable|null $handler = null)
public function __construct( $handler = null)
{
if ($handler) {
$this->handler = $handler;
Expand Down
2 changes: 1 addition & 1 deletion src/Middleware/UserHasCap.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class UserHasCap implements Middleware
* @param string|null $redirect_to The redirect_to parameter that specifies the target URL to redirect to after
* completing the construction. It is set to null by default.
*/
public function __construct(string|iterable $capabilities, string|null $redirect_to = null)
public function __construct($capabilities, $redirect_to = null)
{
$this->capabilities = is_string($capabilities) ? explode(',', $capabilities) : $capabilities;
$this->redirect_to = $redirect_to;
Expand Down

0 comments on commit 593500c

Please sign in to comment.