diff options
author | Harald Eilertsen <haraldei@anduin.net> | 2024-11-14 18:40:15 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2024-11-14 18:40:15 +0000 |
commit | 951800eca6045f6e0dc1e9a12c225c8e55b044e9 (patch) | |
tree | 2eaa48c246725a85b4277db07b72831f088cf5e9 /include | |
parent | d446f171c50b3d74b2f9865ccf17b535aaa38fe1 (diff) | |
download | volse-hubzilla-951800eca6045f6e0dc1e9a12c225c8e55b044e9.tar.gz volse-hubzilla-951800eca6045f6e0dc1e9a12c225c8e55b044e9.tar.bz2 volse-hubzilla-951800eca6045f6e0dc1e9a12c225c8e55b044e9.zip |
Several issues discovered by PHPStan
Diffstat (limited to 'include')
-rw-r--r-- | include/attach.php | 1 | ||||
-rw-r--r-- | include/channel.php | 12 | ||||
-rw-r--r-- | include/config.php | 2 | ||||
-rw-r--r-- | include/datetime.php | 2 | ||||
-rw-r--r-- | include/event.php | 2 | ||||
-rw-r--r-- | include/permissions.php | 4 |
6 files changed, 9 insertions, 14 deletions
diff --git a/include/attach.php b/include/attach.php index 2ee3401f6..97750db4b 100644 --- a/include/attach.php +++ b/include/attach.php @@ -1989,7 +1989,6 @@ function attach_store_item($channel, $observer, $file) { 'type' => $file['filetype'], 'size' => $file['filesize'], 'revision' => $file['revision'], - 'size' => $file['filesize'], 'created' => $file['created'], 'edited' => $file['edited'], 'path' => $path diff --git a/include/channel.php b/include/channel.php index 0ece3be74..a3ba1a765 100644 --- a/include/channel.php +++ b/include/channel.php @@ -96,6 +96,8 @@ function validate_channelname($name) { if (x($arr, 'message')) return $arr['message']; + + return null; } @@ -2428,7 +2430,7 @@ function get_zcard($channel, $observer_hash = '', $args = array()) { $cover = [ 'href' => z_root() . '/images/default_cover_photos/' . $default_cover . '/' . $cover_width . '.png' ]; } - $o .= replace_macros(get_markup_template('zcard.tpl'), array( + return replace_macros(get_markup_template('zcard.tpl'), array( '$maxwidth' => $maxwidth, '$scale' => $scale, '$translate' => $translate, @@ -2437,8 +2439,6 @@ function get_zcard($channel, $observer_hash = '', $args = array()) { '$pphoto' => $pphoto, '$zcard' => $zcard )); - - return $o; } @@ -2505,17 +2505,13 @@ function get_zcard_embed($channel, $observer_hash = '', $args = array()) { $cover = [ 'href' => z_root() . '/images/default_cover_photos/' . $default_cover . '/' . $cover_width . '.png' ]; } - $o .= replace_macros(get_markup_template('zcard_embed.tpl'),array( + return replace_macros(get_markup_template('zcard_embed.tpl'),array( '$maxwidth' => $maxwidth, - '$scale' => $scale, - '$translate' => $translate, '$size' => $size, '$cover' => $cover, '$pphoto' => $pphoto, '$zcard' => $zcard )); - - return $o; } /** diff --git a/include/config.php b/include/config.php index 4dd40eccf..50fe60eb0 100644 --- a/include/config.php +++ b/include/config.php @@ -39,8 +39,6 @@ use Zotlabs\Lib as Zlib; * * @param string $family The category of the configuration value * - * @return Nothing - * * @deprecated * This function is deprecated, use Zotlabs\Lib\Config::Load * instead. diff --git a/include/datetime.php b/include/datetime.php index 4c7105138..9e39fa985 100644 --- a/include/datetime.php +++ b/include/datetime.php @@ -264,6 +264,8 @@ function relative_date($posted_date, $format = null) { return sprintf($format, $r, plural_dates($str,$r)); } } + + return $abs; } function plural_dates($k,$n) { diff --git a/include/event.php b/include/event.php index af27c45b0..2aa9b51f3 100644 --- a/include/event.php +++ b/include/event.php @@ -235,7 +235,7 @@ function ical_wrapper($ev) { if(! ((is_array($ev)) && count($ev))) return ''; - $o .= "BEGIN:VCALENDAR"; + $o = "BEGIN:VCALENDAR"; $o .= "\r\nVERSION:2.0"; $o .= "\r\nMETHOD:PUBLISH"; $o .= "\r\nPRODID:-//" . Config::Get('system','sitename') . "//" . Zotlabs\Lib\System::get_platform_name() . "//" . strtoupper(App::$language). "\r\n"; diff --git a/include/permissions.php b/include/permissions.php index be6fc8594..29d242537 100644 --- a/include/permissions.php +++ b/include/permissions.php @@ -408,7 +408,7 @@ function get_all_api_perms($uid,$api) { $arr = array( 'channel_id' => $uid, - 'observer_hash' => $observer_xchan, + 'observer_hash' => null, //$observer_xchan, 'permissions' => $ret); call_hooks('get_all_api_perms',$arr); @@ -422,7 +422,7 @@ function api_perm_is_allowed($uid,$api,$permission) { $arr = array( 'channel_id' => $uid, - 'observer_hash' => $observer_xchan, + 'observer_hash' => null, //$observer_xchan, 'permission' => $permission, 'result' => false ); |