diff --git a/.gitignore b/.gitignore index ea71828..2a3ddc6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +/.idea/ /vendor/ phpunit.xml .phpunit.result.cache diff --git a/src/WpContext.php b/src/WpContext.php index 0962c16..693a39f 100644 --- a/src/WpContext.php +++ b/src/WpContext.php @@ -107,10 +107,9 @@ final public static function determine(): WpContext */ private static function isRestRequest(): bool { - if ( - (defined('REST_REQUEST') && REST_REQUEST) - || !empty($_GET['rest_route']) // phpcs:ignore - ) { + /** @psalm-suppress RedundantCondition */ + $isRestRequest = defined('REST_REQUEST') && REST_REQUEST; + if ($isRestRequest || !empty($_GET['rest_route'])) { // phpcs:ignore return true; } @@ -372,6 +371,7 @@ private function addActionHooks(): void ]; foreach ($this->actionCallbacks as $action => $callback) { + /** @psalm-suppress MixedArgument */ add_action($action, $callback, PHP_INT_MIN); } } @@ -385,6 +385,7 @@ private function addActionHooks(): void private function removeActionHooks(): void { foreach ($this->actionCallbacks as $action => $callback) { + /** @psalm-suppress MixedArgument */ remove_action($action, $callback, PHP_INT_MIN); } $this->actionCallbacks = [];