Skip to content

Commit 2a6b6cb

Browse files
authored
Merge pull request #22130 from Yoast/JRF/Docs/fix-incorrect-type-specifications
Docs: fix incorrect types
2 parents 9201abd + 2637642 commit 2a6b6cb

File tree

62 files changed

+112
-110
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+112
-110
lines changed

admin/class-yoast-network-settings-api.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class Yoast_Network_Settings_API {
2727
/**
2828
* The singleton instance of this class.
2929
*
30-
* @var Yoast_Network_Settings_API
30+
* @var Yoast_Network_Settings_API|null
3131
*/
3232
private static $instance = null;
3333

admin/class-yoast-notification-center.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class Yoast_Notification_Center {
2222
/**
2323
* The singleton instance of this object.
2424
*
25-
* @var Yoast_Notification_Center
25+
* @var Yoast_Notification_Center|null
2626
*/
2727
private static $instance = null;
2828

@@ -513,7 +513,7 @@ public function get_resolved_notification_count() {
513513
/**
514514
* Return the notifications sorted on type and priority.
515515
*
516-
* @return array|Yoast_Notification[] Sorted Notifications
516+
* @return Yoast_Notification[] Sorted Notifications
517517
*/
518518
public function get_sorted_notifications() {
519519
$notifications = $this->get_notifications_for_user( get_current_user_id() );
@@ -578,7 +578,7 @@ private static function get_user_id( $user_id ) {
578578
* In other terms, it returns an associative array,
579579
* mapping user ID to a list of notifications for this user.
580580
*
581-
* @param array|Yoast_Notification[] $notifications The notifications to split.
581+
* @param Yoast_Notification[] $notifications The notifications to split.
582582
*
583583
* @return array The notifications, split on user ID.
584584
*/
@@ -650,8 +650,8 @@ public function update_storage() {
650650
/**
651651
* Stores the notifications to its respective user's storage.
652652
*
653-
* @param array|Yoast_Notification[] $notifications The notifications to store.
654-
* @param int $user_id The ID of the user for which to store the notifications.
653+
* @param Yoast_Notification[] $notifications The notifications to store.
654+
* @param int $user_id The ID of the user for which to store the notifications.
655655
*
656656
* @return void
657657
*/
@@ -663,7 +663,7 @@ private function store_notifications_for_user( $notifications, $user_id ) {
663663
/**
664664
* Provide a way to verify present notifications.
665665
*
666-
* @return array|Yoast_Notification[] Registered notifications.
666+
* @return Yoast_Notification[] Registered notifications.
667667
*/
668668
public function get_notifications() {
669669
if ( ! $this->notifications ) {

admin/class-yoast-notification.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ public function get_id() {
115115
* @deprecated 21.6
116116
* @codeCoverageIgnore
117117
*
118-
* @return WP_User The user to show this notification for.
118+
* @return WP_User|null The user to show this notification for.
119119
*/
120120
public function get_user() {
121121
_deprecated_function( __METHOD__, 'Yoast SEO 21.6' );

admin/metabox/class-metabox.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class WPSEO_Metabox extends WPSEO_Meta {
5252
/**
5353
* The Metabox post.
5454
*
55-
* @var WP_Post
55+
* @var WP_Post|null
5656
*/
5757
protected $post = null;
5858

admin/views/class-yoast-feature-toggle.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ class Yoast_Feature_Toggle {
107107
/**
108108
* Value to specify the feature toggle order.
109109
*
110-
* @var string
110+
* @var int
111111
*/
112112
protected $order = 100;
113113

inc/class-upgrade-history.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public function add( $old_version, $new_version, array $option_names ) {
7878
*
7979
* @param array<string> $option_names The option names to retrieve.
8080
*
81-
* @return array<int|string|bool|float,array<string|int|bool|float>> The retrieved data.
81+
* @return array<int|string, array<string|int|bool|float>> The retrieved data.
8282
*/
8383
protected function get_options_data( array $option_names ) {
8484
$wpdb = $this->get_wpdb();

inc/class-wpseo-admin-bar-menu.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,21 +91,21 @@ class WPSEO_Admin_Bar_Menu implements WPSEO_WordPress_Integration {
9191
/**
9292
* Whether SEO Score is enabled.
9393
*
94-
* @var bool
94+
* @var bool|null
9595
*/
9696
protected $is_seo_enabled = null;
9797

9898
/**
9999
* Whether readability is enabled.
100100
*
101-
* @var bool
101+
* @var bool|null
102102
*/
103103
protected $is_readability_enabled = null;
104104

105105
/**
106106
* The indexable for the current WordPress page, if found.
107107
*
108-
* @var bool|Indexable
108+
* @var Indexable|bool|null
109109
*/
110110
protected $current_indexable = null;
111111

inc/class-wpseo-custom-fields.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class WPSEO_Custom_Fields {
1313
/**
1414
* Custom fields cache.
1515
*
16-
* @var array
16+
* @var array|null
1717
*/
1818
protected static $custom_fields = null;
1919

inc/class-wpseo-custom-taxonomies.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class WPSEO_Custom_Taxonomies {
1313
/**
1414
* Custom taxonomies cache.
1515
*
16-
* @var array
16+
* @var array|null
1717
*/
1818
protected static $custom_taxonomies = null;
1919

inc/options/class-wpseo-option-titles.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ class WPSEO_Option_Titles extends WPSEO_Option {
140140
/**
141141
* Used for "caching" during pageload.
142142
*
143-
* @var string[]
143+
* @var string[]|null
144144
*/
145145
protected $enriched_defaults = null;
146146

lib/orm.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ class ORM implements ArrayAccess {
8282
/**
8383
* Holds the alias for the table to be used in SELECT queries.
8484
*
85-
* @var string
85+
* @var string|null
8686
*/
8787
protected $table_alias = null;
8888

@@ -152,14 +152,14 @@ class ORM implements ArrayAccess {
152152
/**
153153
* LIMIT.
154154
*
155-
* @var int
155+
* @var int|null
156156
*/
157157
protected $limit = null;
158158

159159
/**
160160
* OFFSET.
161161
*
162-
* @var int
162+
* @var int|null
163163
*/
164164
protected $offset = null;
165165

@@ -216,7 +216,7 @@ class ORM implements ArrayAccess {
216216
* Name of the column to use as the primary key for
217217
* this instance only. Overrides the config settings.
218218
*
219-
* @var string
219+
* @var string|null
220220
*/
221221
protected $instance_id_column = null;
222222

src/actions/importing/aioseo/aioseo-posts-importing-action.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -423,8 +423,9 @@ public function get_needed_robot_data() {
423423
/**
424424
* Creates a query for gathering AiOSEO data from the database.
425425
*
426-
* @param int $limit The maximum number of unimported objects to be returned.
427-
* @param bool $just_detect Whether we want to just detect if there are unimported objects. If false, we want to actually import them too.
426+
* @param int|false $limit The maximum number of unimported objects to be returned.
427+
* False for "no limit".
428+
* @param bool $just_detect Whether we want to just detect if there are unimported objects. If false, we want to actually import them too.
428429
*
429430
* @return string The query to use for importing or counting the number of items to import.
430431
*/

src/actions/indexing/indexable-post-type-archive-indexation-action.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ public function __construct(
7272
/**
7373
* Returns the total number of unindexed post type archives.
7474
*
75-
* @param int $limit Limit the number of counted objects.
75+
* @param int|false $limit Limit the number of counted objects.
76+
* False for "no limit".
7677
*
7778
* @return int The total number of unindexed post type archives.
7879
*/

src/config/wincher-pkce-provider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class Wincher_PKCE_Provider extends GenericProvider {
2828
/**
2929
* The method to use.
3030
*
31-
* @var string
31+
* @var string|null
3232
*/
3333
protected $pkceMethod = null;
3434

src/context/meta-tags-context.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,7 @@ public function generate_has_image() {
675675
/**
676676
* Strips all nested dependencies from the debug info.
677677
*
678-
* @return array<Indexable,Indexable_Presentation>
678+
* @return array<Indexable|Indexable_Presentation>
679679
*/
680680
public function __debugInfo() {
681681
return [

src/dashboard/domain/score-groups/readability-score-groups/bad-readability-score-group.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function get_position(): int {
3838
/**
3939
* Gets the minimum score of the readability score group.
4040
*
41-
* @return int The minimum score of the readability score group.
41+
* @return int|null The minimum score of the readability score group.
4242
*/
4343
public function get_min_score(): ?int {
4444
return 1;
@@ -47,7 +47,7 @@ public function get_min_score(): ?int {
4747
/**
4848
* Gets the maximum score of the readability score group.
4949
*
50-
* @return int The maximum score of the readability score group.
50+
* @return int|null The maximum score of the readability score group.
5151
*/
5252
public function get_max_score(): ?int {
5353
return 40;

src/dashboard/domain/score-groups/readability-score-groups/good-readability-score-group.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function get_position(): int {
3838
/**
3939
* Gets the minimum score of the readability score group.
4040
*
41-
* @return int The minimum score of the readability score group.
41+
* @return int|null The minimum score of the readability score group.
4242
*/
4343
public function get_min_score(): ?int {
4444
return 71;
@@ -47,7 +47,7 @@ public function get_min_score(): ?int {
4747
/**
4848
* Gets the maximum score of the readability score group.
4949
*
50-
* @return int The maximum score of the readability score group.
50+
* @return int|null The maximum score of the readability score group.
5151
*/
5252
public function get_max_score(): ?int {
5353
return 100;

src/dashboard/domain/score-groups/readability-score-groups/no-readability-score-group.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function get_position(): int {
3838
/**
3939
* Gets the minimum score of the readability score group.
4040
*
41-
* @return null The minimum score of the readability score group.
41+
* @return int|null The minimum score of the readability score group.
4242
*/
4343
public function get_min_score(): ?int {
4444
return null;
@@ -47,7 +47,7 @@ public function get_min_score(): ?int {
4747
/**
4848
* Gets the maximum score of the readability score group.
4949
*
50-
* @return null The maximum score of the readability score group.
50+
* @return int|null The maximum score of the readability score group.
5151
*/
5252
public function get_max_score(): ?int {
5353
return null;

src/dashboard/domain/score-groups/readability-score-groups/ok-readability-score-group.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function get_position(): int {
3838
/**
3939
* Gets the minimum score of the readability score group.
4040
*
41-
* @return int The minimum score of the readability score group.
41+
* @return int|null The minimum score of the readability score group.
4242
*/
4343
public function get_min_score(): ?int {
4444
return 41;
@@ -47,7 +47,7 @@ public function get_min_score(): ?int {
4747
/**
4848
* Gets the maximum score of the readability score group.
4949
*
50-
* @return int The maximum score of the readability score group.
50+
* @return int|null The maximum score of the readability score group.
5151
*/
5252
public function get_max_score(): ?int {
5353
return 70;

src/dashboard/domain/score-groups/score-groups-interface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ public function get_filter_value(): string;
3131
/**
3232
* Gets the minimum score of the score group.
3333
*
34-
* @return int
34+
* @return int|null
3535
*/
3636
public function get_min_score(): ?int;
3737

3838
/**
3939
* Gets the maximum score of the score group.
4040
*
41-
* @return int
41+
* @return int|null
4242
*/
4343
public function get_max_score(): ?int;
4444

src/dashboard/domain/score-groups/seo-score-groups/bad-seo-score-group.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function get_position(): int {
3838
/**
3939
* Gets the minimum score of the SEO score group.
4040
*
41-
* @return int The minimum score of the SEO score group.
41+
* @return int|null The minimum score of the SEO score group.
4242
*/
4343
public function get_min_score(): ?int {
4444
return 1;
@@ -47,7 +47,7 @@ public function get_min_score(): ?int {
4747
/**
4848
* Gets the maximum score of the SEO score group.
4949
*
50-
* @return int The maximum score of the SEO score group.
50+
* @return int|null The maximum score of the SEO score group.
5151
*/
5252
public function get_max_score(): ?int {
5353
return 40;

src/dashboard/domain/score-groups/seo-score-groups/good-seo-score-group.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function get_position(): int {
3838
/**
3939
* Gets the minimum score of the SEO score group.
4040
*
41-
* @return int The minimum score of the SEO score group.
41+
* @return int|null The minimum score of the SEO score group.
4242
*/
4343
public function get_min_score(): ?int {
4444
return 71;
@@ -47,7 +47,7 @@ public function get_min_score(): ?int {
4747
/**
4848
* Gets the maximum score of the SEO score group.
4949
*
50-
* @return int The maximum score of the SEO score group.
50+
* @return int|null The maximum score of the SEO score group.
5151
*/
5252
public function get_max_score(): ?int {
5353
return 100;

src/dashboard/domain/score-groups/seo-score-groups/no-seo-score-group.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function get_position(): int {
3838
/**
3939
* Gets the minimum score of the SEO score group.
4040
*
41-
* @return null The minimum score of the SEO score group.
41+
* @return int|null The minimum score of the SEO score group.
4242
*/
4343
public function get_min_score(): ?int {
4444
return null;
@@ -47,7 +47,7 @@ public function get_min_score(): ?int {
4747
/**
4848
* Gets the maximum score of the SEO score group.
4949
*
50-
* @return null The maximum score of the SEO score group.
50+
* @return int|null The maximum score of the SEO score group.
5151
*/
5252
public function get_max_score(): ?int {
5353
return null;

src/dashboard/domain/score-groups/seo-score-groups/ok-seo-score-group.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function get_position(): int {
3838
/**
3939
* Gets the minimum score of the SEO score group.
4040
*
41-
* @return int The minimum score of the SEO score group.
41+
* @return int|null The minimum score of the SEO score group.
4242
*/
4343
public function get_min_score(): ?int {
4444
return 41;
@@ -47,7 +47,7 @@ public function get_min_score(): ?int {
4747
/**
4848
* Gets the maximum score of the SEO score group.
4949
*
50-
* @return int The maximum score of the SEO score group.
50+
* @return int|null The maximum score of the SEO score group.
5151
*/
5252
public function get_max_score(): ?int {
5353
return 70;

0 commit comments

Comments
 (0)