Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions functionMap.php
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@
'wp_get_archives' => ['($args is array{echo: false|0, ...} ? string|void : void)'],
'wp_get_comment_status' => ["'approved'|'spam'|'trash'|'unapproved'|false"],
'wp_get_elements_class_name' => ['lowercase-string&non-falsy-string'],
'wp_get_environment_type' => ["'development'|'local'|'production'|'staging'"],
'wp_get_http_headers' => [null, 'deprecated' => 'false'],
'wp_get_inline_script_tag' => ['non-falsy-string', 'attributes' => 'array<string, string|true>'],
'wp_get_link_cats' => ['($link_id is empty ? array{} : array<int, int<1, max>>)'],
Expand Down
14 changes: 14 additions & 0 deletions tests/data/return/wp-get-environment-type.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

declare(strict_types=1);

namespace PhpStubs\WordPress\Core\Tests;

use function wp_get_environment_type;
use function PHPStan\Testing\assertType;

assertType("'development'|'local'|'production'|'staging'", wp_get_environment_type());
assertType('false', wp_get_environment_type() === 'dev');
assertType('false', wp_get_environment_type() === 'Production');
assertType('bool', wp_get_environment_type() === 'production');
assertType('bool', wp_get_environment_type() === Faker::string());
1 change: 1 addition & 0 deletions wordpress-stubs.php
Original file line number Diff line number Diff line change
Expand Up @@ -142942,6 +142942,7 @@ function wp_check_php_mysql_versions()
* @since 5.5.1 Removed the ability to alter the list of types.
*
* @return string The current environment type.
* @phpstan-return 'development'|'local'|'production'|'staging'
*/
function wp_get_environment_type()
{
Expand Down
Loading