Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Config_Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -1035,9 +1035,9 @@
*
* @param string $name
* @param string $type
* @param string $type
* @param array $values
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make the type more precise? I think this one is correct

Suggested change
* @param array $values
* @param array<array{name: string, value: string, type: string}> $values

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

value: mixed is more precise since it can be integer, string or boleean. e.g. define( 'WP_DEBUG', true ), define( 'SITE_ID_CURRENT_SITE', 1 ), define( 'DB_NAME', 'wp_cli_test' )

* @param string $wp_config_file_name Config file name
* @return string The value of the requested constant or variable as defined in the wp-config.php file; if the
* @return mixed The value of the requested constant or variable as defined in the wp-config.php file; if the
* requested constant or variable is not defined then the function will print an error and exit.
*/
private function return_value( $name, $type, $values, $wp_config_file_name ) {
Expand Down Expand Up @@ -1196,7 +1196,7 @@
$wp_config_file_name
);

return $value;

Check failure on line 1199 in src/Config_Command.php

View workflow job for this annotation

GitHub Actions / code-quality / PHPStan

Method Config_Command::get_value() should return string but returns mixed.
}

/**
Expand Down
Loading