diff options
author | Mario <mario@mariovavti.com> | 2024-11-14 18:40:15 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2024-11-14 18:40:15 +0000 |
commit | 01da60b385edad423396abd0858ead5d65a41801 (patch) | |
tree | b29b7e6413d0e02e97962e7a99004503f75e97f3 /include | |
parent | 72c47cd8db94032bf05a6956f3f15888772051aa (diff) | |
parent | 951800eca6045f6e0dc1e9a12c225c8e55b044e9 (diff) | |
download | volse-hubzilla-01da60b385edad423396abd0858ead5d65a41801.tar.gz volse-hubzilla-01da60b385edad423396abd0858ead5d65a41801.tar.bz2 volse-hubzilla-01da60b385edad423396abd0858ead5d65a41801.zip |
Merge branch 'various-phpstan-issues' into 'dev'
Several issues discovered by PHPStan
See merge request hubzilla/core!2168
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 1d987b473..02b94ddb6 100644 --- a/include/attach.php +++ b/include/attach.php @@ -1997,7 +1997,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 fbb6eeddf..2182d7c43 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 4843cad3d..2fa1cc4f1 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 ); |