Skip to content

Commit

Permalink
Code review feedback from @szepeviktor
Browse files Browse the repository at this point in the history
  • Loading branch information
srtfisher committed May 9, 2023
1 parent adda74e commit 64c0ee7
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 14 deletions.
3 changes: 0 additions & 3 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 4 additions & 6 deletions src/mantle/framework/class-alias-loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down Expand Up @@ -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 );
}

/**
Expand Down
8 changes: 4 additions & 4 deletions src/mantle/framework/manifest/class-model-manifest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/mantle/http-client/class-response.php
Original file line number Diff line number Diff line change
Expand Up @@ -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() )
Expand Down

0 comments on commit 64c0ee7

Please sign in to comment.