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
2 changes: 1 addition & 1 deletion functionMap.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@
'mysql2date' => ["(\$format is 'G'|'U' ? int|false : string|false)"],
'newblog_notify_siteadmin' => [null, 'deprecated' => "''"],
'next_posts' => ['($display is true ? void : string)'],
'paginate_links' => ["(\$args is array{total: int<min, 1>, ...} ? void : (\$args is array{type: 'array', ...} ? list<string> : string))"],
'paginate_links' => ["(\$args is array{total: int<min, 1>, ...} ? null : (\$args is array{type: 'array', ...} ? list<string> : string))"],
'path_is_absolute' => ['($path is non-falsy-string ? bool : false)', '@phpstan-assert-if-true =non-falsy-string $path' => ''],
'path_join' => ['non-falsy-string'],
'post_type_archive_title' => ['($display is true ? void : string|void)'],
Expand Down
10 changes: 1 addition & 9 deletions tests/data/return/paginate-links.php
Original file line number Diff line number Diff line change
@@ -1,21 +1,13 @@
<?php

/**
* Note:
* Starting from PHPStan 1.10.49, void types, including void in unions, are
* transformed into null.
*
* @link https://github.com/phpstan/phpstan-src/pull/2778
*/

declare(strict_types=1);

namespace PhpStubs\WordPress\Core\Tests;

use function paginate_links;
use function PHPStan\Testing\assertType;

// Returns void
// Returns null
assertType('null', paginate_links(['total' => Faker::negativeInt(), 'key' => 'value']));
assertType('null', paginate_links(['total' => 0, 'key' => 'value']));
assertType('null', paginate_links(['total' => 1, 'key' => 'value']));
Expand Down
4 changes: 2 additions & 2 deletions wordpress-stubs.php
Original file line number Diff line number Diff line change
Expand Up @@ -120859,7 +120859,7 @@ function has_term($term = '', $taxonomy = '', $post = \null)
* @phpstan-param array{
* taxonomy?: string,
* } $args
* @phpstan-param string|array{taxonomy?:string,...} $args
* @phpstan-param array{taxonomy?:string,...} $args
* @phpstan-return ($args is array{fields: 'count', ...} ? list<numeric-string> : ($args is array{fields: 'names'|'slugs', ...} ? list<string> : ($args is array{fields: 'id=>name'|'id=>slug', ...} ? array<int, string> : ($args is array{fields: 'id=>parent', ...} ? array<int, int> : ($args is array{fields: 'ids'|'tt_ids', ...} ? list<int> : array<int, \WP_Term>)))))
*/
function get_categories($args = '')
Expand Down Expand Up @@ -137494,7 +137494,7 @@ function language_attributes($doctype = 'html')
* before_page_number?: string,
* after_page_number?: string,
* } $args
* @phpstan-return ($args is array{total: int<min, 1>, ...} ? void : ($args is array{type: 'array', ...} ? list<string> : string))
* @phpstan-return ($args is array{total: int<min, 1>, ...} ? null : ($args is array{type: 'array', ...} ? list<string> : string))
*/
function paginate_links($args = '')
{
Expand Down
Loading