| @@ -37,13 +37,14 @@ | ||
| 37 | 37 | return array( 'wp-list-table', 'widefat', 'plugins', 'pll-settings' ); // get the style of the plugins list table + one specific class |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | /** |
| 41 | - * Displays a single row | |
| 41 | + * Displays a single row. | |
| 42 | 42 | * |
| 43 | 43 | * @since 1.8 |
| 44 | 44 | * |
| 45 | - * @param object $item PLL_Settings_Module object | |
| 45 | + * @param PLL_Settings_Module $item Settings module item. | |
| 46 | + * @return void | |
| 46 | 47 | */ |
| 47 | 48 | public function single_row( $item ) { |
| 48 | 49 | // Classes to reuse css from the plugins list table |
| 49 | 50 | $classes = $item->is_active() ? 'active' : 'inactive'; |
| @@ -87,13 +88,14 @@ | ||
| 87 | 88 | } |
| 88 | 89 | } |
| 89 | 90 | |
| 90 | 91 | /** |
| 91 | - * Generates the columns for a single row of the table | |
| 92 | + * Generates the columns for a single row of the table. | |
| 92 | 93 | * |
| 93 | 94 | * @since 1.8 |
| 94 | 95 | * |
| 95 | - * @param object $item The current item | |
| 96 | + * @param PLL_Settings_Module $item Settings module item. | |
| 97 | + * @return void | |
| 96 | 98 | */ |
| 97 | 99 | protected function single_row_columns( $item ) { |
| 98 | 100 | $column_info = $this->get_column_info(); |
| 99 | 101 | $columns = $column_info[0]; |
| @@ -117,15 +119,15 @@ | ||
| 117 | 119 | } |
| 118 | 120 | } |
| 119 | 121 | |
| 120 | 122 | /** |
| 121 | - * Displays the item information in a column ( default case ) | |
| 123 | + * Displays the item information in a column (default case). | |
| 122 | 124 | * |
| 123 | 125 | * @since 1.8 |
| 124 | 126 | * |
| 125 | - * @param object $item | |
| 126 | - * @param string $column_name | |
| 127 | - * @return string | |
| 127 | + * @param PLL_Settings_Module $item Settings module item. | |
| 128 | + * @param string $column_name Column name. | |
| 129 | + * @return string The column name. | |
| 128 | 130 | */ |
| 129 | 131 | protected function column_default( $item, $column_name ) { |
| 130 | 132 | if ( 'plugin-title' == $column_name ) { |
| 131 | 133 | return sprintf( '<strong>%s</strong>', esc_html( $item->title ) ) . $this->row_actions( $item->get_action_links(), true /*always visible*/ ); |
| @@ -133,13 +135,13 @@ | ||
| 133 | 135 | return $item->$column_name; |
| 134 | 136 | } |
| 135 | 137 | |
| 136 | 138 | /** |
| 137 | - * Gets the list of columns | |
| 139 | + * Gets the list of columns. | |
| 138 | 140 | * |
| 139 | 141 | * @since 1.8 |
| 140 | 142 | * |
| 141 | - * @return array the list of column titles | |
| 143 | + * @return string[] The list of column titles. | |
| 142 | 144 | */ |
| 143 | 145 | public function get_columns() { |
| 144 | 146 | return array( |
| 145 | 147 | 'cb' => '', // For the 4px border inherited from plugins when the module is activated |
| @@ -163,9 +165,10 @@ | ||
| 163 | 165 | * Prepares the list of items for displaying |
| 164 | 166 | * |
| 165 | 167 | * @since 1.8 |
| 166 | 168 | * |
| 167 | - * @param array $items | |
| 169 | + * @param PLL_Settings_Module[] $items Array of settings module items. | |
| 170 | + * @return void | |
| 168 | 171 | */ |
| 169 | 172 | public function prepare_items( $items = array() ) { |
| 170 | 173 | $this->_column_headers = array( $this->get_columns(), array(), $this->get_sortable_columns(), $this->get_primary_column_name() ); |
| 171 | 174 | |
| @@ -171,9 +174,9 @@ | ||
| 171 | 174 | |
| 172 | 175 | // Sort rows, lowest priority on top. |
| 173 | 176 | usort( |
| 174 | 177 | $items, |
| 175 | - function( $a, $b ) { | |
| 178 | + function ( $a, $b ) { | |
| 176 | 179 | return $a->priority > $b->priority ? 1 : -1; |
| 177 | 180 | } |
| 178 | 181 | ); |
| 179 | 182 | $this->items = $items; |
| @@ -184,7 +187,8 @@ | ||
| 184 | 187 | * |
| 185 | 188 | * @since 2.1 |
| 186 | 189 | * |
| 187 | 190 | * @param string $which 'top' or 'bottom' |
| 191 | + * @return void | |
| 188 | 192 | */ |
| 189 | 193 | protected function display_tablenav( $which ) {} // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable |
| 190 | 194 | } |