diff --git a/Code/Access/AccessControl.php b/Code/Access/AccessControl.php index cb95be4d6..c9e58cf92 100644 --- a/Code/Access/AccessControl.php +++ b/Code/Access/AccessControl.php @@ -164,6 +164,6 @@ class AccessControl */ public function is_private() { - return (($this->allow_cid || $this->allow_gid || $this->deny_cid || $this->deny_gid) ? true : false); + return $this->allow_cid || $this->allow_gid || $this->deny_cid || $this->deny_gid; } } diff --git a/Code/Access/PermissionLimits.php b/Code/Access/PermissionLimits.php index 9fe7d5928..c81f1ce29 100644 --- a/Code/Access/PermissionLimits.php +++ b/Code/Access/PermissionLimits.php @@ -77,7 +77,7 @@ class PermissionLimits * * @param int $channel_id * @param string $perm (optional) - * @return + * @return bool|int|array * * \b false if no perm_limits set for this channel * * \b int if $perm is set, return one of PERMS_* constants for this permission, default 0 * * \b array with all permission limits, if $perm is not set diff --git a/Code/Access/PermissionRoles.php b/Code/Access/PermissionRoles.php index d8db2a634..2307ccfa6 100644 --- a/Code/Access/PermissionRoles.php +++ b/Code/Access/PermissionRoles.php @@ -18,7 +18,7 @@ class PermissionRoles * * This must match the version in Permissions.php before permission updates can run. * - * @return number + * @return int */ public static function version() { diff --git a/Code/Nomad/Receiver.php b/Code/Nomad/Receiver.php index fe7235656..2f4bc580f 100644 --- a/Code/Nomad/Receiver.php +++ b/Code/Nomad/Receiver.php @@ -23,6 +23,10 @@ class Receiver protected $prvkey; protected $rawdata; protected $sigdata; + /** + * @var array|mixed + */ + private mixed $hub; public function __construct($handler, $localdata = null) { @@ -74,7 +78,7 @@ class Receiver logger('received: ' . print_r($this->data, true), LOGGER_DATA); if ($this->data && is_array($this->data)) { - $this->encrypted = ((array_key_exists('encrypted', $this->data) && intval($this->data['encrypted'])) ? true : false); + $this->encrypted = array_key_exists('encrypted', $this->data) && intval($this->data['encrypted']); if ($this->encrypted && $this->prvkey) { $uncrypted = Crypto::unencapsulate($this->data, $this->prvkey); diff --git a/Code/Render/Theme.php b/Code/Render/Theme.php index b023437e4..f6b3dab0d 100644 --- a/Code/Render/Theme.php +++ b/Code/Render/Theme.php @@ -5,7 +5,6 @@ namespace Code\Render; use App; use Code\Lib\Infocon; use Code\Lib\Addon; -use Code\Render\Theme; use Code\Lib\Yaml; @@ -197,7 +196,7 @@ class Theme try { file_put_contents("view/theme/$theme.yml",Yaml::encode($info)); } - catch (Exception $e) { + catch (\Exception $e) { } } diff --git a/boot.php b/boot.php index 9d27cead6..f5fb8c6d7 100755 --- a/boot.php +++ b/boot.php @@ -1240,7 +1240,7 @@ class App { * * @param string $name Template engine name * - * @return void Template Engine instance + * @return mixed */ public static function template_engine($name = '') { if ($name !== '') { @@ -1994,7 +1994,7 @@ function is_site_admin() { return true; } // the system channel is by definition an administrator - if (isset(App::$sys_channel) && array_key_exists('channel_id', App::$sys_channel) && intval(App::$sys_channel['channel_id']) === local_channel()) { + if (isset(App::$sys_channel) && is_array(App::$sys_channel) && array_key_exists('channel_id', (array) App::$sys_channel) && intval(App::$sys_channel['channel_id']) === local_channel()) { return true; } } diff --git a/include/api_zot.php b/include/api_zot.php index 744c149c8..09c0dde89 100644 --- a/include/api_zot.php +++ b/include/api_zot.php @@ -125,7 +125,7 @@ function api_item_export_page($type) } $finish = datetime_convert(date_default_timezone_get(), 'UTC', (($_REQUEST['until']) ? $_REQUEST['until'] : 'now')); - json_return_and_die($Channel::export_items_page(api_user(), $start, $finish, $page, $records)); + json_return_and_die(Channel::export_items_page(api_user(), $start, $finish, $page, $records)); } diff --git a/include/bbcode.php b/include/bbcode.php index 5130972f0..88fb145eb 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -692,9 +692,7 @@ function bb_ShareAttributes($match) $headline .= '' . $fmt . ''; - $text = $headline . '
' . trim($match[2]) . '
'; - - return $text; + return $headline . '
' . trim($match[2]) . '
'; } function bb_location($match) @@ -1415,7 +1413,7 @@ function bbtopoll($s) $pl['poll_id'] = $match[1]; $pl['poll_question'] = $match[2]; - $match = ''; + $match = []; if (preg_match_all("/\[poll\-answer=(.*?)\](.*?)\[\/poll\-answer\]/is", $s, $match, PREG_SET_ORDER)) { $pl['answer'] = []; foreach ($match as $m) { diff --git a/include/connections.php b/include/connections.php index e49088ef4..219a67313 100644 --- a/include/connections.php +++ b/include/connections.php @@ -883,10 +883,7 @@ function vcard_query(&$r) function contact_profile_assign($current) { - - $o = ''; - - $o .= "\r\n"; $r = q( "SELECT profile_guid, profile_name FROM profile WHERE uid = %d", diff --git a/include/datetime.php b/include/datetime.php index c6895381f..252ccf7b0 100644 --- a/include/datetime.php +++ b/include/datetime.php @@ -550,7 +550,7 @@ function z_birthday($dob, $tz, $format = "Y-m-d H:i:s") $t_dob = strtotime($bd); $now = strtotime(datetime_convert($tz, $tz, 'now')); if ($t_dob < $now) { - $bd = $y + 1 . '-' . $tmp_dob . ' 00:00'; + $bd = sprintf("%d-%s 00:00", intval($y) + 1, $tmp_dob); } $birthday = datetime_convert($tz, 'UTC', $bd, $format); diff --git a/include/language.php b/include/language.php index 4adaadcd5..5707299ab 100644 --- a/include/language.php +++ b/include/language.php @@ -202,7 +202,7 @@ function load_translation_table($lang, $install = false) * * @param string $s string that should get translated * @param string $ctx (optional) context to appear in po file - * @return translated string if exists, otherwise return $s + * @return string (translated string if exists, otherwise return $s) * */ function t($s, $ctx = '')