Skip to content

Commit c367f0d

Browse files
authored
PHPStan Level 3 (#218)
* handle_row_actions should return the row actions HTML, or an empty string if the current column is not the primary column. * Fixes: Function get_main_site_for_network() should return int but returns false. * Fixes: Property WPMN_Loader\:\:$asset_version (string) does not accept default value of type int.
1 parent 63fae1f commit c367f0d

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

phpstan.neon.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
parameters:
2-
level: 2
2+
level: 3
33
paths:
44
- wp-multi-network/includes
55
- wpmn-loader.php

wp-multi-network/includes/classes/class-wp-ms-networks-list-table.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ protected function handle_row_actions( $network, $column_name, $primary ) {
414414

415415
// Bail if not primary column.
416416
if ( $primary !== $column_name ) {
417-
return;
417+
return '';
418418
}
419419

420420
switch_to_network( $network->id );

wp-multi-network/includes/functions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ function user_has_networks( $user_id = 0 ) {
120120
* @since 1.3.0
121121
*
122122
* @param int|WP_Network $network Optional. Network ID or object. Default is the current network.
123-
* @return int Main site ID for the network.
123+
* @return int|bool Main site ID for the network or false if network not found.
124124
*/
125125
function get_main_site_for_network( $network = null ) {
126126
$network = get_network( $network );

wpmn-loader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ class WPMN_Loader {
6969
* @since 1.3.0
7070
* @var string
7171
*/
72-
public $asset_version = 202108250001;
72+
public $asset_version = '202108250001';
7373

7474
/**
7575
* Network admin class instance.

0 commit comments

Comments
 (0)