summaryrefslogtreecommitdiffstats
path: root/includes
diff options
context:
space:
mode:
authorHarald Eilertsen <haraldei@anduin.net>2021-05-08 20:50:39 +0200
committerHarald Eilertsen <haraldei@anduin.net>2021-05-08 20:55:59 +0200
commit30f12e61317d9b181efb46382a4db98d73f65954 (patch)
treef98c5695836a8d04367a7a1969b12903402f7d7b /includes
parent88de0f55d7499009f0f316262757e70385d43ce5 (diff)
downloadgigologadmin-30f12e61317d9b181efb46382a4db98d73f65954.tar.gz
gigologadmin-30f12e61317d9b181efb46382a4db98d73f65954.tar.bz2
gigologadmin-30f12e61317d9b181efb46382a4db98d73f65954.zip
Autofixes by Psalm
Diffstat (limited to 'includes')
-rw-r--r--includes/admin/views/giglog_admin_page.php6
-rw-r--r--includes/admin/views/giglog_import_gigs.php4
-rw-r--r--includes/band.php2
-rw-r--r--includes/concert.php2
-rw-r--r--includes/venue.php4
5 files changed, 10 insertions, 8 deletions
diff --git a/includes/admin/views/giglog_admin_page.php b/includes/admin/views/giglog_admin_page.php
index 85c4193..624566f 100644
--- a/includes/admin/views/giglog_admin_page.php
+++ b/includes/admin/views/giglog_admin_page.php
@@ -36,7 +36,7 @@ if ( !class_exists( 'GiglogAdmin_AdminPage' ) ) {
echo(GiglogAdmin_AdminPage::editforms()); //not sure why it doesn't show without the echo?
}
- static function get_allvenues(int $invenue): string
+ static function get_allvenues( ?int $invenue ): string
{
$select = '<select name="selectvenueadmin">';
$select .= '<option value="">Please Select..</option>';
@@ -50,7 +50,7 @@ if ( !class_exists( 'GiglogAdmin_AdminPage' ) ) {
}
- static function get_user( int $cid, int $ctype): string
+ static function get_user( ?int $cid, string $ctype): string
{
$hf_user = wp_get_current_user();
$hf_username = $hf_user->user_login;
@@ -419,7 +419,7 @@ if ( !class_exists( 'GiglogAdmin_AdminPage' ) ) {
wp_mail( $to, $subject, $body, $headers );
}
- static function returnuser($p1, $c): string
+ static function returnuser(string $p1, ?int $c): string
{
global $wpdb;
$hf_user = wp_get_current_user();
diff --git a/includes/admin/views/giglog_import_gigs.php b/includes/admin/views/giglog_import_gigs.php
index badd678..0e7406f 100644
--- a/includes/admin/views/giglog_import_gigs.php
+++ b/includes/admin/views/giglog_import_gigs.php
@@ -50,8 +50,10 @@ if ( !class_exists( 'GiglogAdmin_ImportGigsPage' ) ) {
* Empty lines are ignored.
*
* @return void
+ *
+ * @param ArrayAccess|array $file
*/
- static function process_upload($file): void {
+ static function process_upload(array $file): void {
$newconcert= [];
$fo = new SplFileObject($file['tmp_name']);
diff --git a/includes/band.php b/includes/band.php
index 81b275a..3460acb 100644
--- a/includes/band.php
+++ b/includes/band.php
@@ -25,7 +25,7 @@ if ( !class_exists('GiglogAdmin_Band') ) {
$this->country = isset($attrs->wpgband_country) ? $attrs->wpgband_country : 'NO';
}
- static function create($bandname, $country = 'NO')
+ static function create($bandname, $country = 'NO'): self
{
$band = GiglogAdmin_Band::find($bandname, $country);
diff --git a/includes/concert.php b/includes/concert.php
index f19a614..5c17933 100644
--- a/includes/concert.php
+++ b/includes/concert.php
@@ -54,7 +54,7 @@ if ( !class_exists('GiglogAdmin_Concert') ) {
}
}
- public static function create($name, $venue, $date, $ticketlink, $eventlink): ?self
+ public static function create(string $name, $venue, string $date, string $ticketlink, string $eventlink): ?self
{
if ( GiglogAdmin_Concert::find($name, $venue, $date) ) {
error_log( 'DUPLICATE ROW detected: '
diff --git a/includes/venue.php b/includes/venue.php
index ddd3d4a..0df0a58 100644
--- a/includes/venue.php
+++ b/includes/venue.php
@@ -43,7 +43,7 @@ if ( !class_exists('GiglogAdmin_Venue') ) {
return $venue;
}
- static function find_or_create($name, $city = 'Oslo')
+ static function find_or_create(string $name, string $city = 'Oslo'): self
{
global $wpdb;
$venuesql = 'SELECT * FROM wpg_venues WHERE upper(wpgvenue_name)=upper("' . $name . '")'.' and wpgvenue_city="'.$city.'"';
@@ -89,7 +89,7 @@ if ( !class_exists('GiglogAdmin_Venue') ) {
*
* @psalm-return array<array-key, self>
*/
- static function venues_in_city($city): array
+ static function venues_in_city(bool $city): array
{
global $wpdb;
$q = $wpdb->prepare(