diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5859c3a..6026390 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 \ No newline at end of file diff --git a/src/Conditions/HasCap.php b/src/Conditions/HasCap.php index 7b9541f..420883a 100644 --- a/src/Conditions/HasCap.php +++ b/src/Conditions/HasCap.php @@ -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); @@ -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(); } diff --git a/src/Factories/Conditions/HasCapFactory.php b/src/Factories/Conditions/HasCapFactory.php index 6945aea..baa68a0 100644 --- a/src/Factories/Conditions/HasCapFactory.php +++ b/src/Factories/Conditions/HasCapFactory.php @@ -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(); } diff --git a/src/Factories/Middleware/UserHasCapFactory.php b/src/Factories/Middleware/UserHasCapFactory.php index 34a284e..d19973c 100644 --- a/src/Factories/Middleware/UserHasCapFactory.php +++ b/src/Factories/Middleware/UserHasCapFactory.php @@ -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(); } diff --git a/src/Factories/ResponseFactory.php b/src/Factories/ResponseFactory.php index e32365a..1980d42 100644 --- a/src/Factories/ResponseFactory.php +++ b/src/Factories/ResponseFactory.php @@ -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; diff --git a/src/Middleware/Route.php b/src/Middleware/Route.php index c86748e..b8ef704 100644 --- a/src/Middleware/Route.php +++ b/src/Middleware/Route.php @@ -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; diff --git a/src/Middleware/UserHasCap.php b/src/Middleware/UserHasCap.php index 5c7c2e1..46ca79e 100644 --- a/src/Middleware/UserHasCap.php +++ b/src/Middleware/UserHasCap.php @@ -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;