diff options
author | Harald Eilertsen <haraldei@anduin.net> | 2021-05-08 21:03:29 +0200 |
---|---|---|
committer | Harald Eilertsen <haraldei@anduin.net> | 2021-05-08 21:03:29 +0200 |
commit | 7d17f220e52d683f849a1854278a9bd47af17dd2 (patch) | |
tree | 3fed3ff2c6ab28c397a929a02e56d238ca40ed6d /includes/band.php | |
parent | ee9bef751805ac3f3c9572d1620f2221092b3094 (diff) | |
parent | 30f12e61317d9b181efb46382a4db98d73f65954 (diff) | |
download | gigologadmin-7d17f220e52d683f849a1854278a9bd47af17dd2.tar.gz gigologadmin-7d17f220e52d683f849a1854278a9bd47af17dd2.tar.bz2 gigologadmin-7d17f220e52d683f849a1854278a9bd47af17dd2.zip |
Merge branch 'psalm' into dev
This brings another tool in to help us keep the code in order - Psalm.
(I thought the name was fitting! :)
This will do fairly simple static analysis of the code, and report
problems and suggest fixes. It can help fix some issues itself, but
please double check that it does the right thing.
More info: https://psalm.dev
This merge also brings in fixes that was suggested by Paslm. Mostly this
is typa annotations for functions, but also some bugfixes discovered by
the tool.
Diffstat (limited to 'includes/band.php')
-rw-r--r-- | includes/band.php | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/includes/band.php b/includes/band.php index 14daa18..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); @@ -46,7 +46,7 @@ if ( !class_exists('GiglogAdmin_Band') ) { return $band; } - static function find($name, $country) + static function find($name, $country): ?self { global $wpdb; @@ -83,6 +83,11 @@ if ( !class_exists('GiglogAdmin_Band') ) { return ($results); } + /** + * @return array|string + * + * @psalm-return array{0: mixed, 1: mixed}|string + */ static function get_band($bid) { global $wpdb; @@ -116,7 +121,7 @@ if ( !class_exists('GiglogAdmin_Band') ) { return ($wpdb->last_error); } - public function save() + public function save(): void { global $wpdb; |