From 82a3901a6d68f088aff335a1bc88b9878e17e990 Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Wed, 9 Mar 2022 21:26:46 +0100 Subject: Fix various psalm errors. --- includes/admin/views/_concerts_table.php | 2 ++ includes/admin/views/_edit_concert_form.php | 2 +- includes/admin/views/giglog_admin_page.php | 2 +- includes/admin/views/giglog_import_gigs.php | 2 +- includes/concert.php | 4 ++-- 5 files changed, 7 insertions(+), 5 deletions(-) (limited to 'includes') diff --git a/includes/admin/views/_concerts_table.php b/includes/admin/views/_concerts_table.php index e9598e1..7b4338c 100644 --- a/includes/admin/views/_concerts_table.php +++ b/includes/admin/views/_concerts_table.php @@ -25,6 +25,8 @@ if (!class_exists("GiglogAdmin_ConcertsTable")) ]; private string $username; + private array $filter; + private int $page_no; public function __construct() { $this->username = wp_get_current_user()->user_login; diff --git a/includes/admin/views/_edit_concert_form.php b/includes/admin/views/_edit_concert_form.php index 6e4f5e5..c7b8780 100644 --- a/includes/admin/views/_edit_concert_form.php +++ b/includes/admin/views/_edit_concert_form.php @@ -20,7 +20,7 @@ if (!class_exists("GiglogAdmin_EditConcertForm")) private function user_dropdown_for_role( GiglogAdmin_Concert $concert, string $role): string { $users = array_map( - fn($usr) => $usr->user_login, + fn($usr): string => $usr->user_login, get_users( array( 'fields' => array( 'user_login' ) ) ) ); $roles = $concert->roles(); diff --git a/includes/admin/views/giglog_admin_page.php b/includes/admin/views/giglog_admin_page.php index 13c08b9..b0b018c 100644 --- a/includes/admin/views/giglog_admin_page.php +++ b/includes/admin/views/giglog_admin_page.php @@ -158,7 +158,7 @@ if ( !class_exists( 'GiglogAdmin_AdminPage' ) ) { ]; $concert = GiglogAdmin_Concert::get(intval($_POST['pid'])); - if ($concert->update((object) $attributes)) { + if ($concert && $concert->update((object) $attributes)) { // let user know the concert was updated. // Look into admin_notices } diff --git a/includes/admin/views/giglog_import_gigs.php b/includes/admin/views/giglog_import_gigs.php index 1a72fe1..62717c6 100644 --- a/includes/admin/views/giglog_import_gigs.php +++ b/includes/admin/views/giglog_import_gigs.php @@ -53,7 +53,7 @@ if ( !class_exists( 'GiglogAdmin_ImportGigsPage' ) ) { * * @return void * - * @param array + * @param array */ static function process_upload(array $file): void { $newconcert= []; diff --git a/includes/concert.php b/includes/concert.php index 91fbe57..a8c71db 100644 --- a/includes/concert.php +++ b/includes/concert.php @@ -78,8 +78,8 @@ if ( !class_exists('GiglogAdmin_Concert') ) { /** * Return the concert with the given id. * - * @param int $id. - * @return null|self. + * @param int $id + * @return null|self */ static function get( int $id ) : ?self { -- cgit v1.2.3