diff --git a/phpstan.neon.dist b/phpstan.neon.dist index e754c34..aed4077 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -1,5 +1,5 @@ parameters: - level: 1 + level: 2 paths: - wp-multi-network/includes - wpmn-loader.php @@ -11,3 +11,7 @@ parameters: ignoreErrors: - '/^Call to static method encode\(\) on an unknown class Requests_IDNAEncoder\.$/' - '/^Constant WP_CONTENT_URL not found\.$/' + # WP_Network::$blog_id is a private property that can be accessed via magic methods. + - '/^Access to an undefined property WP_Network::\$blog_id\.$/' + # WP_CLI\Fetchers\User::get() returns WP_User without root namespace. + - '/^Access to property \$ID on an unknown class WP_CLI\\Fetchers\\WP_User\.$/' diff --git a/wp-multi-network/includes/classes/class-wp-ms-networks-list-table.php b/wp-multi-network/includes/classes/class-wp-ms-networks-list-table.php index 81da553..a64b200 100644 --- a/wp-multi-network/includes/classes/class-wp-ms-networks-list-table.php +++ b/wp-multi-network/includes/classes/class-wp-ms-networks-list-table.php @@ -123,7 +123,7 @@ public function get_bulk_actions() { * * @since 1.3.0 * - * @param type $which Where to display the pagination. Either 'top' or 'bottom'. + * @param string $which Where to display the pagination. Either 'top' or 'bottom'. */ public function pagination( $which ) { // phpcs:ignore Generic.CodeAnalysis.UselessOverridingMethod.Found parent::pagination( $which ); @@ -483,7 +483,7 @@ protected function handle_row_actions( $network, $column_name, $primary ) { * @param int $network_id The current network ID. * @param string $network_sitename The current network name. */ - $actions = apply_filters( 'manage_networks_action_links', array_filter( $actions ), $network->id, $network->sitename ); + $actions = apply_filters( 'manage_networks_action_links', array_filter( $actions ), $network->id, $network->site_name ); // Return all row actions. return $this->row_actions( $actions ); diff --git a/wp-multi-network/includes/compat.php b/wp-multi-network/includes/compat.php index 027ef8e..01892ce 100644 --- a/wp-multi-network/includes/compat.php +++ b/wp-multi-network/includes/compat.php @@ -58,7 +58,7 @@ function wp_sanitize_site_path( $path = '' ) { * @param string $site_id Optional. Site ID, if an existing site. Default 0. * @return bool True if the site URL is valid, false otherwise. */ - function wp_validate_site_url( $domain, $path, $site_id = 0 ) { + function wp_validate_site_url( $domain, $path, $site_id = '0' ) { global $wpdb; // Ensure the domain does not already exist on the current network. diff --git a/wp-multi-network/includes/metaboxes/edit-network.php b/wp-multi-network/includes/metaboxes/edit-network.php index af37975..5f46b1a 100644 --- a/wp-multi-network/includes/metaboxes/edit-network.php +++ b/wp-multi-network/includes/metaboxes/edit-network.php @@ -119,7 +119,7 @@ function wpmn_edit_network_assign_sites_metabox( $network = null ) { network_id !== (int) $network->id ) && ! is_main_site_for_network( $site->id ) ) : ?> @@ -140,7 +140,7 @@ function wpmn_edit_network_assign_sites_metabox( $network = null ) { network_id === (int) $network->id ) : ?>