diff --git a/phpstan.neon b/phpstan.neon index f5ef75b2f..1782b81bb 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -41,10 +41,7 @@ parameters: - "#PHPDoc tag @param references unknown parameter#" scanFiles: - - %rootDir%/../../php-stubs/wordpress-stubs/wordpress-stubs.php - %rootDir%/../../php-stubs/wp-cli-stubs/wp-cli-stubs.php - - %rootDir%/../../php-stubs/wp-cli-stubs/wp-cli-commands-stubs.php - - %rootDir%/../../php-stubs/wp-cli-stubs/wp-cli-i18n-stubs.php # excludePaths: # - ./*/*/FileToBeExcluded.php diff --git a/src/mantle/framework/class-alias-loader.php b/src/mantle/framework/class-alias-loader.php index bbe5da17f..94d2ed654 100644 --- a/src/mantle/framework/class-alias-loader.php +++ b/src/mantle/framework/class-alias-loader.php @@ -66,14 +66,12 @@ public static function get_instance( array $aliases = [] ): Alias_Loader { * Load a class alias if it is registered. * * @param string $alias Alias to load. - * @return bool|null + * @return void */ - public function load( $alias ) { + public function load( $alias ): void { if ( isset( $this->aliases[ $alias ] ) ) { - return class_alias( $this->aliases[ $alias ], $alias ); + class_alias( $this->aliases[ $alias ], $alias ); } - - return null; } /** @@ -105,7 +103,7 @@ public function register() { * @return void */ protected function prepend_to_loader_stack() { - spl_autoload_register( [ $this, 'load' ], true, true ); // @phpstan-ignore-line Parameter #1 $callback of function spl_autoload_register + spl_autoload_register( [ $this, 'load' ], true, true ); } /** diff --git a/src/mantle/framework/manifest/class-model-manifest.php b/src/mantle/framework/manifest/class-model-manifest.php index c3981b846..6f5a83f84 100644 --- a/src/mantle/framework/manifest/class-model-manifest.php +++ b/src/mantle/framework/manifest/class-model-manifest.php @@ -26,28 +26,28 @@ class Model_Manifest { * * @var array|null */ - protected $manifest; + protected ?array $manifest = null; /** * Base folder path. * * @var string */ - protected $base_path; + protected string $base_path; /** * Vendor folder path. * * @var string */ - protected $vendor_path; + protected string $vendor_path; /** * Package Manifest file path. * * @var string */ - protected $manifest_path; + protected string $manifest_path; /** * Constructor. diff --git a/src/mantle/http-client/class-response.php b/src/mantle/http-client/class-response.php index cf8a54dfb..d44de517a 100644 --- a/src/mantle/http-client/class-response.php +++ b/src/mantle/http-client/class-response.php @@ -351,7 +351,7 @@ public function cookies(): array { * Retrieve a specific cookie by name. * * @param string $name Cookie name. - * @return WP_Http_Cookie + * @return WP_Http_Cookie|null */ public function cookie( string $name ): ?WP_Http_Cookie { return collect( $this->cookies() )