Skip to content

Commit 84ff13d

Browse files
committed
Privacy: Correct type of WP_User_Request::$user_id from int to string/numeric-string.
Also adds `numeric-string` as richer PHPStan type to `WP_Post::$post_author` and `WP_Post::$comment_count`. Developed in WordPress/wordpress-develop#12018. Follow-up to r25086, r43011. Props masteradhoc, desrosj, garrett-eclipse, johnbillion, westonruter, apermo, SergeyBiryukov, TZ-Media, andizer, javorszky. See #22324, #25092, #43443, #43985, #64898. Fixes #44723. Built from https://develop.svn.wordpress.org/trunk@62437 git-svn-id: http://core.svn.wordpress.org/trunk@61718 1a063a9b-81f0-0310-95a4-ce76da25c4cd
1 parent 2712d36 commit 84ff13d

3 files changed

Lines changed: 6 additions & 3 deletions

File tree

wp-includes/class-wp-post.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ final class WP_Post {
3636
*
3737
* @since 3.5.0
3838
* @var string
39+
* @phpstan-var numeric-string
3940
*/
4041
public $post_author = '0';
4142

@@ -206,6 +207,7 @@ final class WP_Post {
206207
*
207208
* @since 3.5.0
208209
* @var string
210+
* @phpstan-var numeric-string
209211
*/
210212
public $comment_count = '0';
211213

wp-includes/class-wp-user-request.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,10 @@ final class WP_User_Request {
2020
* User ID.
2121
*
2222
* @since 4.9.6
23-
* @var int
23+
* @var string
24+
* @phpstan-var numeric-string
2425
*/
25-
public $user_id = 0;
26+
public $user_id = '0';
2627

2728
/**
2829
* User email.

wp-includes/version.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*
1717
* @global string $wp_version
1818
*/
19-
$wp_version = '7.1-alpha-62436';
19+
$wp_version = '7.1-alpha-62437';
2020

2121
/**
2222
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.

0 commit comments

Comments
 (0)