Skip to content

Commit d80987b

Browse files
committed
Lowered level to 0 and fixed the errors
1 parent cf4fa9f commit d80987b

File tree

5 files changed

+23
-16
lines changed

5 files changed

+23
-16
lines changed

phpstan.neon.dist

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,18 @@
11
includes:
22
- vendor/szepeviktor/phpstan-wordpress/extension.neon
33
parameters:
4-
level: 5
4+
level: 0
55
paths:
66
- wp-multi-network/includes
77
- wpmn-loader.php
8+
ignoreErrors:
9+
- '/^Call to static method add_command\(\) on an unknown class WP_CLI.$/'
10+
- '/^Call to static method encode\(\) on an unknown class Requests_IDNAEncoder.$/'
11+
- '/^Call to static method error\(\) on an unknown class WP_CLI.$/'
12+
- '/^Call to static method success\(\) on an unknown class WP_CLI.$/'
13+
- '/^Call to static method warning\(\) on an unknown class WP_CLI.$/'
14+
- '/^Function WP_CLI\\Utils\\get_flag_value not found.$/'
15+
- '/^Function WP_CLI\\Utils\\get_plugin_name not found.$/'
16+
- '/^Instantiated class WP_CLI\\Fetchers\\Plugin not found.$/'
17+
- '/^Instantiated class WP_CLI\\Fetchers\\User not found.$/'
18+
- '/^Instantiated class WP_CLI\\Formatter not found.$/'

wp-multi-network/includes/classes/class-wp-ms-network-command.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*
1212
* @since 1.3.0
1313
*/
14-
class WP_MS_Network_Command extends WP_CLI_Command {
14+
class WP_MS_Network_Command {
1515

1616
/**
1717
* Default fields to display for each object.
@@ -260,7 +260,7 @@ public function list_( $args, $assoc_args ) {
260260
* @param array $assoc_args Associative CLI arguments.
261261
*/
262262
public function plugin( $args, $assoc_args ) {
263-
$this->fetcher = new \WP_CLI\Fetchers\Plugin();
263+
$fetchers_plugin = new \WP_CLI\Fetchers\Plugin();
264264
$action = array_shift( $args );
265265
if ( ! in_array( $action, array( 'activate', 'deactivate' ), true ) ) {
266266
WP_CLI::error( sprintf( '%s is not a supported action.', $action ) );
@@ -284,7 +284,7 @@ function ( $file ) {
284284
}, array_keys( get_plugins() )
285285
);
286286
}
287-
foreach ( $this->fetcher->get_many( $args ) as $plugin ) {
287+
foreach ( $fetchers_plugin->get_many( $args ) as $plugin ) {
288288
$status = $this->get_status( $plugin->file );
289289
if ( $all && in_array( $status, array( 'active', 'active-network' ), true ) ) {
290290
--$needing_activation;

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -479,9 +479,9 @@ protected function handle_row_actions( $network, $column_name, $primary ) {
479479
*
480480
* @since 2.0.0
481481
*
482-
* @param array Action links as $slug => $link_markup pairs.
483-
* @param int The current network ID.
484-
* @param string The current network name.
482+
* @param array $filtered_acions Action links as $slug => $link_markup pairs.
483+
* @param int $network_id The current network ID.
484+
* @param string $network_sitename The current network name.
485485
*/
486486
$actions = apply_filters( 'manage_networks_action_links', array_filter( $actions ), $network->id, $network->sitename );
487487

wp-multi-network/includes/classes/class-wp-ms-rest-networks-controller.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -449,10 +449,6 @@ public function update_item( $request ) {
449449
}
450450

451451
if ( ! empty( $prepared_args ) ) {
452-
if ( is_wp_error( $prepared_args ) ) {
453-
return $prepared_args;
454-
}
455-
456452
$domain = $prepared_args['domain'];
457453
$path = $prepared_args['path'];
458454

wp-multi-network/includes/functions.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@ function user_has_networks( $user_id = 0 ) {
7474
*
7575
* @since 2.0.0
7676
*
77-
* @param array|bool|null List of network IDs or false. Anything but null will short-circuit
78-
* the process.
79-
* @param int User ID for which the networks should be returned.
77+
* @param array|bool|null $my_networks List of network IDs or false. Anything but null will short-circuit
78+
* the process.
79+
* @param int $user_id User ID for which the networks should be returned.
8080
*/
8181
$my_networks = apply_filters( 'networks_pre_user_is_network_admin', null, $user_id );
8282
if ( null !== $my_networks ) {
@@ -89,8 +89,8 @@ function user_has_networks( $user_id = 0 ) {
8989
*
9090
* @since 2.0.0
9191
*
92-
* @param array|bool List of network IDs or false if no networks for the user.
93-
* @param int User ID for which the networks should be returned.
92+
* @param array|bool $my_networks List of network IDs or false if no networks for the user.
93+
* @param int $user_id User ID for which the networks should be returned.
9494
*/
9595
return apply_filters( 'networks_user_is_network_admin', $my_networks, $user_id );
9696
}

0 commit comments

Comments
 (0)