From 5af89bca3bd17777fae94e681882d6eabf152303 Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Sat, 12 Jun 2021 18:24:01 +0200 Subject: Fix misc Psalm issues. --- includes/admin/views/giglog_admin_page.php | 2 ++ includes/admin/views/giglog_import_gigs.php | 2 +- includes/concert.php | 2 ++ includes/concertlogs.php | 2 +- includes/venue.php | 4 ++-- 5 files changed, 8 insertions(+), 4 deletions(-) diff --git a/includes/admin/views/giglog_admin_page.php b/includes/admin/views/giglog_admin_page.php index 6f0b2ba..ab71270 100644 --- a/includes/admin/views/giglog_admin_page.php +++ b/includes/admin/views/giglog_admin_page.php @@ -9,6 +9,8 @@ if ( !class_exists( 'GiglogAdmin_AdminPage' ) ) { require_once __DIR__ . '/../../venue.php'; class GiglogAdmin_AdminPage { + private string $username; + public function __construct() { $this->username = wp_get_current_user()->user_login; diff --git a/includes/admin/views/giglog_import_gigs.php b/includes/admin/views/giglog_import_gigs.php index a8daa3f..aeaf974 100644 --- a/includes/admin/views/giglog_import_gigs.php +++ b/includes/admin/views/giglog_import_gigs.php @@ -51,7 +51,7 @@ if ( !class_exists( 'GiglogAdmin_ImportGigsPage' ) ) { * * @return void * - * @param ArrayAccess|array $file + * @param array */ static function process_upload(array $file): void { $newconcert= []; diff --git a/includes/concert.php b/includes/concert.php index 455bc82..56021f5 100644 --- a/includes/concert.php +++ b/includes/concert.php @@ -6,6 +6,8 @@ // SPDX-License-Identifier: AGPL-3.0-or-later if ( !class_exists('GiglogAdmin_Concert') ) { + require_once __DIR__ . '/venue.php'; + class GiglogAdmin_Concert { private $id; diff --git a/includes/concertlogs.php b/includes/concertlogs.php index 8b485ca..cd0a330 100644 --- a/includes/concertlogs.php +++ b/includes/concertlogs.php @@ -82,7 +82,7 @@ if ( !class_exists( 'GiglogAdmin_Concertlogs' ) ) public function get_assigned_role(string $username) : ?string { - return array_search( $username, $this->roles ); + return array_search( $username, $this->roles ) || NULL; } public function assigned_user(string $role) : ?string diff --git a/includes/venue.php b/includes/venue.php index f9f7e4f..aedb6a7 100644 --- a/includes/venue.php +++ b/includes/venue.php @@ -31,8 +31,8 @@ if ( !class_exists('GiglogAdmin_Venue') ) { /** * Get venue by given id. * - * @param int $id. - * @return null|self. + * @param int $id + * @return null|self */ static function get(int $id) : ?self { -- cgit v1.2.3