Skip to content

Commit

Permalink
Merge pull request #11 from inpsyde/hacktoberfest-make-qa-pass
Browse files Browse the repository at this point in the history
Psalm suppress for RedundantCondition & MixedArgument
  • Loading branch information
lloc authored Oct 16, 2024
2 parents 6dbd993 + 82c4a9a commit 1350ada
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/.idea/
/vendor/
phpunit.xml
.phpunit.result.cache
Expand Down
9 changes: 5 additions & 4 deletions src/WpContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -372,6 +371,7 @@ private function addActionHooks(): void
];

foreach ($this->actionCallbacks as $action => $callback) {
/** @psalm-suppress MixedArgument */
add_action($action, $callback, PHP_INT_MIN);
}
}
Expand All @@ -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 = [];
Expand Down

0 comments on commit 1350ada

Please sign in to comment.