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 . '