diff --git a/composer.json b/composer.json index c942957..e96ed0d 100644 --- a/composer.json +++ b/composer.json @@ -23,7 +23,7 @@ "phpunit/phpunit": "~7.5.20 || ^8", "inpsyde/php-coding-standards": "^1", "vimeo/psalm": "^4.27.0", - "mockery/mockery": "~1.5.1", + "mockery/mockery": "~1.3.6", "brain/monkey": "^2.6.1", "inpsyde/wp-stubs": "dev-main" }, @@ -41,7 +41,7 @@ "prefer-stable": true, "scripts": { "cs": "@php ./vendor/squizlabs/php_codesniffer/bin/phpcs", - "psalm": "@php ./vendor/vimeo/psalm/psalm", + "psalm": "@php ./vendor/vimeo/psalm/psalm --no-cache --output-format=compact", "tests": "@php ./vendor/phpunit/phpunit/phpunit", "tests:no-cov": "@php ./vendor/phpunit/phpunit/phpunit --no-coverage", "phpcompat": "@php ./vendor/squizlabs/php_codesniffer/bin/phpcs -p . --standard=PHPCompatibility --ignore=*/vendor/* --extensions=php --basepath=./ --runtime-set testVersion 7.1-", diff --git a/src/WpContext.php b/src/WpContext.php index 34b052b..087de20 100644 --- a/src/WpContext.php +++ b/src/WpContext.php @@ -55,7 +55,9 @@ final public static function new(): WpContext */ final public static function determine(): WpContext { + /** @psalm-suppress RedundantCondition */ $installing = defined('WP_INSTALLING') && WP_INSTALLING; + /** @psalm-suppress RedundantCondition */ $xmlRpc = defined('XMLRPC_REQUEST') && XMLRPC_REQUEST; $isCore = defined('ABSPATH'); $isCli = defined('WP_CLI'); @@ -138,7 +140,7 @@ private static function isLoginRequest(): bool { /** TODO: we'll just use is_login_screen() when 6.1 will be the min WP supported version */ if (function_exists('is_login_screen')) { - return is_login_screen(); + return is_login_screen() !== false; } if (!empty($_REQUEST['interim-login'])) { // phpcs:ignore