@@ -30,6 +30,13 @@ class WP_List_Table {
3030 * @since 3.1.0
3131 *
3232 * @var array<string, mixed>
33+ * @phpstan-var array{
34+ * plural: string,
35+ * singular: string,
36+ * ajax: bool,
37+ * screen: string|WP_Screen|null,
38+ * ...
39+ * }
3340 */
3441 protected $ _args ;
3542
@@ -146,6 +153,14 @@ class WP_List_Table {
146153 * screen, or a `WP_Screen` instance. If left null, the current
147154 * screen will be automatically set. Default null.
148155 * }
156+ *
157+ * @phpstan-param array{
158+ * plural?: string,
159+ * singular?: string,
160+ * ajax?: bool,
161+ * screen?: string|WP_Screen|null,
162+ * ...
163+ * }|string $args
149164 */
150165 public function __construct ( $ args = array () ) {
151166 $ args = wp_parse_args (
@@ -438,6 +453,10 @@ public function search_box( $text, $input_id ) {
438453 * }
439454 * }
440455 * @return string[] An array of link markup. Keys match the `$link_data` input array.
456+ *
457+ * @phpstan-template TKey of array-key
458+ * @phpstan-param array<TKey, array{ url: string, label: string, current?: bool }>|string $link_data
459+ * @phpstan-return ($link_data is array ? array<TKey, string> : array{ 0: '' })
441460 */
442461 protected function get_views_links ( $ link_data = array () ) {
443462 if ( ! is_array ( $ link_data ) ) {
@@ -1030,6 +1049,8 @@ protected function get_items_per_page( $option, $default_value = 20 ) {
10301049 * @since 3.1.0
10311050 *
10321051 * @param string $which The location of the pagination: Either 'top' or 'bottom'.
1052+ *
1053+ * @phpstan-param 'top'|'bottom' $which
10331054 */
10341055 protected function pagination ( $ which ) {
10351056 if ( empty ( $ this ->_pagination_args ['total_items ' ] ) ) {
@@ -1665,6 +1686,8 @@ public function display() {
16651686 * @since 3.1.0
16661687 *
16671688 * @return string[] Array of CSS classes for the table tag.
1689+ *
1690+ * @phpstan-return non-empty-list<string>
16681691 */
16691692 protected function get_table_classes () {
16701693 $ mode = get_user_setting ( 'posts_list_mode ' , 'list ' );
@@ -1680,6 +1703,8 @@ protected function get_table_classes() {
16801703 * @since 3.1.0
16811704 *
16821705 * @param string $which The location of the navigation: Either 'top' or 'bottom'.
1706+ *
1707+ * @phpstan-param 'top'|'bottom' $which
16831708 */
16841709 protected function display_tablenav ( $ which ) {
16851710 if ( 'bottom ' === $ which && ! $ this ->has_items () ) {
0 commit comments