diff --git a/e107_admin/image.php b/e107_admin/image.php index 4efe60208..b138a9eaa 100644 --- a/e107_admin/image.php +++ b/e107_admin/image.php @@ -2401,7 +2401,7 @@ class media_admin_ui extends e_admin_ui /** * @param string $parm - * @return mixed|string + * @return string * @see https://www.googleapis.com/youtube/v3/search */ private function youtubeTab($parm='') @@ -2636,8 +2636,8 @@ class media_admin_ui extends e_admin_ui /** - * @deprecated by $prefs. - * @return bool|void + * @return bool|false + *@deprecated by $prefs. */ function settingsPage() { diff --git a/e107_handlers/Shims/AllShims.php b/e107_handlers/Shims/AllShims.php index af08dd8f0..5b01ae7e2 100644 --- a/e107_handlers/Shims/AllShims.php +++ b/e107_handlers/Shims/AllShims.php @@ -11,6 +11,9 @@ namespace e107\Shims; +/** + * + */ class AllShims { use InternalShimsTrait; diff --git a/e107_handlers/Shims/Internal/GetParentClassTrait.php b/e107_handlers/Shims/Internal/GetParentClassTrait.php index 8971259d7..a4101a78f 100644 --- a/e107_handlers/Shims/Internal/GetParentClassTrait.php +++ b/e107_handlers/Shims/Internal/GetParentClassTrait.php @@ -10,6 +10,9 @@ namespace e107\Shims\Internal; +/** + * + */ trait GetParentClassTrait { /** diff --git a/e107_handlers/Shims/Internal/ReadfileTrait.php b/e107_handlers/Shims/Internal/ReadfileTrait.php index 8d1858337..b3b63e704 100644 --- a/e107_handlers/Shims/Internal/ReadfileTrait.php +++ b/e107_handlers/Shims/Internal/ReadfileTrait.php @@ -12,6 +12,9 @@ namespace e107\Shims\Internal; +/** + * + */ trait ReadfileTrait { /** diff --git a/e107_handlers/Shims/Internal/StrftimeTrait.php b/e107_handlers/Shims/Internal/StrftimeTrait.php index 59bc1443d..635d5704a 100644 --- a/e107_handlers/Shims/Internal/StrftimeTrait.php +++ b/e107_handlers/Shims/Internal/StrftimeTrait.php @@ -1,271 +1,280 @@ -setTimezone(new DateTimeZone(date_default_timezone_get())); - - foreach (self::getFormatMap() as $strftime_key => $date_format_key) - { - if (is_callable($date_format_key)) - { - $replacement = self::escapeDateTimePattern($date_format_key($datetime)); - } - else - { - $replacement = $date_format_key; - } - $format = str_replace($strftime_key, $replacement, $format); - } - - return self::date_format($datetime, $format); - } - - /** - * @param DateTimeInterface $datetime - * @param string $format - * @return string - */ - protected static function date_format($datetime, $format) - { - if (!extension_loaded('intl')) - { - return date_format($datetime, $format); - } - - $formatter = new \IntlDateFormatter( - self::getSensibleLocale(), - \IntlDateFormatter::NONE, - \IntlDateFormatter::NONE, - null, - null, - $format - ); - - return $formatter->format($datetime); - } - - /** - * Try to figure out the e107 locale, falling back to the {@see setlocale()} value, and falling back again to "C" - * - * @return string An {@link http://www.faqs.org/rfcs/rfc1766 RFC 1766} language tag such as "en_US" - */ - protected static function getSensibleLocale() - { - if (defined('CORE_LC') && defined('CORE_LC2')) - { - return strtolower(CORE_LC) . "_" . strtoupper(CORE_LC2); - } - - $setlocale = setlocale(LC_ALL, "0"); - return $setlocale ?: 'C'; - } - - /** - * Escape a literal string for use inside a datetime pattern - * - * Implementation differs depending on whether {@link https://www.php.net/manual/en/book.intl.php ext-intl} is - * enabled - * - * @param string $input - * @return string - */ - protected static function escapeDateTimePattern($input) - { - if (extension_loaded('intl')) - { - return "'" . str_replace("'", "''", $input) . "'"; - } - - return chunk_split($input, 1, "\\"); - } - - /** - * Get the {@see strftime()} format to date format pattern mapping depending on if - * {@link https://www.php.net/manual/en/book.intl.php ext-intl} is enabled - * - * @return array - */ - protected static function getFormatMap() - { - if (extension_loaded('intl')) - { - return self::getFormatMapForIntlDateFormatter(); - } - - return self::getFormatMapForDateTime(); - } - - protected static function getFormatMapForIntlDateFormatter() - { - return [ - '%a' => 'eee', - '%A' => 'eeee', - '%d' => 'dd', - '%e' => function($datetime) - { - return str_pad(self::date_format($datetime, 'd'), 2, " ", STR_PAD_LEFT); - }, - '%j' => function($datetime) - { - return str_pad(self::date_format($datetime, 'D'), 3, "0", STR_PAD_LEFT); - }, - '%u' => 'e', - '%w' => function($datetime) - { - return date_format($datetime, 'w'); - }, - '%U' => 'w', - '%V' => 'ww', - '%W' => function($datetime) - { - return date_format($datetime, 'W'); - }, - '%b' => 'MMM', - '%B' => 'MMMM', - '%h' => 'MMM', - '%m' => 'MM', - '%C' => function($datetime) - { - return (string) ((int) self::date_format($datetime, 'y') / 100); - }, - '%g' => 'yy', - '%G' => 'y', - '%y' => 'yy', - '%Y' => 'y', - '%H' => 'HH', - '%k' => function($datetime) - { - return str_pad(self::date_format($datetime, 'H'), 2, " ", STR_PAD_LEFT); - }, - '%I' => 'hh', - '%l' => function($datetime) - { - return str_pad(self::date_format($datetime, 'h'), 2, " ", STR_PAD_LEFT); - }, - '%M' => 'mm', - '%p' => function($datetime) - { - return strtoupper(self::date_format($datetime, 'a')); - }, - '%P' => 'a', - '%r' => 'hh:mm:ss a', - '%R' => 'HH:mm', - '%S' => 'ss', - '%T' => 'HH:mm:ss', - '%X' => 'HH:mm:ss', - '%z' => 'Z', - '%Z' => 'z', - '%c' => function($datetime) - { - /** @noinspection PhpComposerExtensionStubsInspection */ - return \IntlDateFormatter::formatObject($datetime); - }, - '%D' => 'MM/dd/yy', - '%F' => 'y-MM-dd', - '%s' => function($datetime) - { - return date_timestamp_get($datetime); - }, - '%x' => function($datetime) - { - /** @noinspection PhpComposerExtensionStubsInspection */ - return \IntlDateFormatter::formatObject($datetime, \IntlDateFormatter::SHORT); - }, - '%n' => "\n", - '%t' => "\t", - '%%' => "'%'", - ]; - } - - protected static function getFormatMapForDateTime() - { - return [ - '%a' => 'D', - '%A' => 'l', - '%d' => 'd', - '%e' => function($datetime) - { - return str_pad(self::date_format($datetime, 'n'), 2, " ", STR_PAD_LEFT); - }, - '%j' => function($datetime) - { - return str_pad(self::date_format($datetime, 'z'), 3, "0", STR_PAD_LEFT); - }, - '%u' => 'N', - '%w' => 'w', - '%U' => 'W', - '%V' => 'W', - '%W' => 'W', - '%b' => 'M', - '%B' => 'F', - '%h' => 'M', - '%m' => 'm', - '%C' => function($datetime) - { - return (string) ((int) self::date_format($datetime, 'Y') / 100); - }, - '%g' => 'y', - '%G' => 'Y', - '%y' => 'y', - '%Y' => 'Y', - '%H' => 'H', - '%k' => function($datetime) - { - return str_pad(self::date_format($datetime, 'G'), 2, " ", STR_PAD_LEFT); - }, - '%I' => 'h', - '%l' => function($datetime) - { - return str_pad(self::date_format($datetime, 'g'), 2, " ", STR_PAD_LEFT); - }, - '%M' => 'i', - '%p' => 'A', - '%P' => 'a', - '%r' => 'h:i:s A', - '%R' => 'H:i', - '%S' => 's', - '%T' => 'H:i:s', - '%X' => 'H:i:s', - '%z' => 'O', - '%Z' => 'T', - '%c' => 'r', - '%D' => 'm/d/y', - '%F' => 'Y-m-d', - '%s' => 'U', - '%x' => 'Y-m-d', - '%n' => "\n", - '%t' => "\t", - '%%' => '\%', - ]; - } -} +setTimezone(new DateTimeZone(date_default_timezone_get())); + + foreach (self::getFormatMap() as $strftime_key => $date_format_key) + { + if (is_callable($date_format_key)) + { + $replacement = self::escapeDateTimePattern($date_format_key($datetime)); + } + else + { + $replacement = $date_format_key; + } + $format = str_replace($strftime_key, $replacement, $format); + } + + return self::date_format($datetime, $format); + } + + /** + * @param DateTimeInterface $datetime + * @param string $format + * @return string + */ + protected static function date_format($datetime, $format) + { + if (!extension_loaded('intl')) + { + return date_format($datetime, $format); + } + + $formatter = new \IntlDateFormatter( + self::getSensibleLocale(), + \IntlDateFormatter::NONE, + \IntlDateFormatter::NONE, + null, + null, + $format + ); + + return $formatter->format($datetime); + } + + /** + * Try to figure out the e107 locale, falling back to the {@see setlocale()} value, and falling back again to "C" + * + * @return string An {@link http://www.faqs.org/rfcs/rfc1766 RFC 1766} language tag such as "en_US" + */ + protected static function getSensibleLocale() + { + if (defined('CORE_LC') && defined('CORE_LC2')) + { + return strtolower(CORE_LC) . "_" . strtoupper(CORE_LC2); + } + + $setlocale = setlocale(LC_ALL, "0"); + return $setlocale ?: 'C'; + } + + /** + * Escape a literal string for use inside a datetime pattern + * + * Implementation differs depending on whether {@link https://www.php.net/manual/en/book.intl.php ext-intl} is + * enabled + * + * @param string $input + * @return string + */ + protected static function escapeDateTimePattern($input) + { + if (extension_loaded('intl')) + { + return "'" . str_replace("'", "''", $input) . "'"; + } + + return chunk_split($input, 1, "\\"); + } + + /** + * Get the {@see strftime()} format to date format pattern mapping depending on if + * {@link https://www.php.net/manual/en/book.intl.php ext-intl} is enabled + * + * @return array + */ + protected static function getFormatMap() + { + if (extension_loaded('intl')) + { + return self::getFormatMapForIntlDateFormatter(); + } + + return self::getFormatMapForDateTime(); + } + + /** + * @return array + */ + protected static function getFormatMapForIntlDateFormatter() + { + return [ + '%a' => 'eee', + '%A' => 'eeee', + '%d' => 'dd', + '%e' => function($datetime) + { + return str_pad(self::date_format($datetime, 'd'), 2, " ", STR_PAD_LEFT); + }, + '%j' => function($datetime) + { + return str_pad(self::date_format($datetime, 'D'), 3, "0", STR_PAD_LEFT); + }, + '%u' => 'e', + '%w' => function($datetime) + { + return date_format($datetime, 'w'); + }, + '%U' => 'w', + '%V' => 'ww', + '%W' => function($datetime) + { + return date_format($datetime, 'W'); + }, + '%b' => 'MMM', + '%B' => 'MMMM', + '%h' => 'MMM', + '%m' => 'MM', + '%C' => function($datetime) + { + return (string) ((int) self::date_format($datetime, 'y') / 100); + }, + '%g' => 'yy', + '%G' => 'y', + '%y' => 'yy', + '%Y' => 'y', + '%H' => 'HH', + '%k' => function($datetime) + { + return str_pad(self::date_format($datetime, 'H'), 2, " ", STR_PAD_LEFT); + }, + '%I' => 'hh', + '%l' => function($datetime) + { + return str_pad(self::date_format($datetime, 'h'), 2, " ", STR_PAD_LEFT); + }, + '%M' => 'mm', + '%p' => function($datetime) + { + return strtoupper(self::date_format($datetime, 'a')); + }, + '%P' => 'a', + '%r' => 'hh:mm:ss a', + '%R' => 'HH:mm', + '%S' => 'ss', + '%T' => 'HH:mm:ss', + '%X' => 'HH:mm:ss', + '%z' => 'Z', + '%Z' => 'z', + '%c' => function($datetime) + { + /** @noinspection PhpComposerExtensionStubsInspection */ + return \IntlDateFormatter::formatObject($datetime); + }, + '%D' => 'MM/dd/yy', + '%F' => 'y-MM-dd', + '%s' => function($datetime) + { + return date_timestamp_get($datetime); + }, + '%x' => function($datetime) + { + /** @noinspection PhpComposerExtensionStubsInspection */ + return \IntlDateFormatter::formatObject($datetime, \IntlDateFormatter::SHORT); + }, + '%n' => "\n", + '%t' => "\t", + '%%' => "'%'", + ]; + } + + /** + * @return array + */ + protected static function getFormatMapForDateTime() + { + return [ + '%a' => 'D', + '%A' => 'l', + '%d' => 'd', + '%e' => function($datetime) + { + return str_pad(self::date_format($datetime, 'n'), 2, " ", STR_PAD_LEFT); + }, + '%j' => function($datetime) + { + return str_pad(self::date_format($datetime, 'z'), 3, "0", STR_PAD_LEFT); + }, + '%u' => 'N', + '%w' => 'w', + '%U' => 'W', + '%V' => 'W', + '%W' => 'W', + '%b' => 'M', + '%B' => 'F', + '%h' => 'M', + '%m' => 'm', + '%C' => function($datetime) + { + return (string) ((int) self::date_format($datetime, 'Y') / 100); + }, + '%g' => 'y', + '%G' => 'Y', + '%y' => 'y', + '%Y' => 'Y', + '%H' => 'H', + '%k' => function($datetime) + { + return str_pad(self::date_format($datetime, 'G'), 2, " ", STR_PAD_LEFT); + }, + '%I' => 'h', + '%l' => function($datetime) + { + return str_pad(self::date_format($datetime, 'g'), 2, " ", STR_PAD_LEFT); + }, + '%M' => 'i', + '%p' => 'A', + '%P' => 'a', + '%r' => 'h:i:s A', + '%R' => 'H:i', + '%S' => 's', + '%T' => 'H:i:s', + '%X' => 'H:i:s', + '%z' => 'O', + '%Z' => 'T', + '%c' => 'r', + '%D' => 'm/d/y', + '%F' => 'Y-m-d', + '%s' => 'U', + '%x' => 'Y-m-d', + '%n' => "\n", + '%t' => "\t", + '%%' => '\%', + ]; + } +} diff --git a/e107_handlers/Shims/Internal/StrptimeTrait.php b/e107_handlers/Shims/Internal/StrptimeTrait.php index 78b2a97b5..29ab6441b 100644 --- a/e107_handlers/Shims/Internal/StrptimeTrait.php +++ b/e107_handlers/Shims/Internal/StrptimeTrait.php @@ -15,6 +15,9 @@ namespace e107\Shims\Internal; use DateTimeZone; use e_date; +/** + * + */ trait StrptimeTrait { /** diff --git a/e107_handlers/Shims/InternalShims.php b/e107_handlers/Shims/InternalShims.php index 207868a20..7fd838838 100644 --- a/e107_handlers/Shims/InternalShims.php +++ b/e107_handlers/Shims/InternalShims.php @@ -11,6 +11,9 @@ namespace e107\Shims; +/** + * + */ class InternalShims { use InternalShimsTrait; diff --git a/e107_handlers/Shims/InternalShimsTrait.php b/e107_handlers/Shims/InternalShimsTrait.php index 308a890fc..676f0ae30 100644 --- a/e107_handlers/Shims/InternalShimsTrait.php +++ b/e107_handlers/Shims/InternalShimsTrait.php @@ -1,20 +1,23 @@ -flushMessages($logTitle, $logImportance, $logEventCode, $mstack, $target); } - - - + /** - * Add and Save an event into the admin, rolling or user log. + * Add and Save an event into the admin, rolling or user log. * @param string $event_title - * @param mixed $event_details + * @param string|array $event_detail * @param integer $event_type [optional] Log level eg. E_LOG_INFORMATIVE, E_LOG_NOTICE, E_LOG_WARNING, E_LOG_FATAL * @param string $event_code [optional] - eg. 'BOUNCE' * @param integer $target [optional] LOG_TO_ADMIN, LOG_TO_AUDIT, LOG_TO_ROLLING - * @param array $user - user to attribute the log to. array('user_id'=>2, 'user_name'=>'whoever'); + * @param null $userData * @return e_admin_log - * + * * Alternative admin log entry point - compatible with legacy calls, and a bit simpler to use than the generic entry point. * ($eventcode has been added - give it a reference to identify the source module, such as 'NEWS_12' or 'ECAL_03') * We also log everything (unlike 0.7, where admin log and debug stuff were all mixed up together) @@ -176,8 +174,6 @@ class e_admin_log * For generic calls, leave $event_code as empty, and specify a constant string STRING_nn of less than 10 characters for the event title * Typically the 'STRING' part of the name defines the area originating the log event, and the 'nn' is a numeric code * This is stored as 'LAN_AL_STRING_NN', and must be defined in a language file which is loaded during log display. - * - */ public function add($event_title, $event_detail, $event_type = E_LOG_INFORMATIVE , $event_code = '', $target = LOG_TO_ADMIN, $userData=null ) { @@ -436,6 +432,10 @@ class e_admin_log } + /** + * @param $plugdir + * @return $this + */ public function setCurrentPlugin($plugdir) { $this->_current_plugin = $plugdir; @@ -444,17 +444,16 @@ class e_admin_log } /**-------------------------------------- - * USER AUDIT ENTRY + * USER AUDIT ENTRY *-------------------------------------- - * Log user-related events - *@param string $event_type - * @param int $event_code is a defined constant (see above) which specifies the event - * @param array|string $event_data is an array of data fields whose keys and values are logged (usually user data, but doesn't have to be - can add messages here) - * @param int $id - * @param string $u_name - * both $id and $u_name are left blank except for admin edits and user login, where they specify the id and login name of the 'target' user + * Log user-related events + * @param string $event_type + * @param array|string $event_data is an array of data fields whose keys and values are logged (usually user data, but doesn't have to be - can add messages here) + * @param string $id + * @param string $u_name + * both $id and $u_name are left blank except for admin edits and user login, where they specify the id and login name of the 'target' user * - * @return bool + * @return bool */ function user_audit($event_type, $event_data, $id = '', $u_name = '') { diff --git a/e107_handlers/admin_ui.php b/e107_handlers/admin_ui.php index 3374d53af..358408913 100755 --- a/e107_handlers/admin_ui.php +++ b/e107_handlers/admin_ui.php @@ -24,9 +24,12 @@ /** * @todo core request handler (non-admin), core response */ -if (!defined('e107_INIT')){ exit; } - - +if (!defined('e107_INIT')){ exit; } + + +/** + * + */ class e_admin_request { /** @@ -92,7 +95,8 @@ class e_admin_request /** * Constructor * - * @param string|array $qry [optional] + * @param string|null $request_string [optional] + * @param bool $parse * @return void */ public function __construct($request_string = null, $parse = true) @@ -1113,7 +1117,10 @@ class e_admin_dispatcher public function init() { } - + + /** + * @return bool + */ public function checkAccess() { $request = $this->getRequest(); @@ -1144,7 +1151,11 @@ class e_admin_dispatcher return true; } - + + /** + * @param $mode + * @return bool + */ public function hasModeAccess($mode) { // mode userclass (former check_class()) @@ -1166,7 +1177,11 @@ class e_admin_dispatcher return true; } - + + /** + * @param $route + * @return bool + */ public function hasRouteAccess($route) { if(isset($this->access[$route]) && !e107::getUser()->checkClass($this->access[$route], false)) @@ -1353,7 +1368,7 @@ class e_admin_dispatcher * - ajax: force ajax output (and exit) * * @param string|array $return_type expected string values: render|render_out|response|raw|ajax[_text|_json|_xml] - * @return mixed + * @return array|e_admin_response|string|null */ public function runPage($return_type = 'render') { @@ -1726,6 +1741,10 @@ class e_admin_dispatcher } + +/** + * + */ class e_admin_controller { /** @@ -2131,6 +2150,10 @@ class e_admin_controller return $this->getResponse()->getJsHelper(); } + /** + * @param $action + * @return void + */ protected function _preDispatch($action = '') { if(!$action) @@ -2360,34 +2383,52 @@ class e_admin_controller return $response; } + /** + * @return void + */ public function E404Observer() { $this->getResponse()->setTitle(LAN_UI_404_TITLE_ERROR); } + /** + * @return string + */ public function E404Page() { return '
'.LAN_UI_404_BODY_ERROR.'
'; } + /** + * @return void + */ public function E404AjaxPage() { exit; } - + + /** + * @return void + */ public function E403Observer() { $this->getResponse()->setTitle(LAN_UI_403_TITLE_ERROR); } + /** + * @return string + */ public function E403Page() { return '
'.LAN_UI_403_BODY_ERROR.'
'; } + /** + * @return void + */ public function E403AjaxPage() { exit; @@ -2520,7 +2561,9 @@ class e_admin_controller } - + /** + * @return string + */ public function getDefaultTrigger() { return $this->_default_trigger; @@ -2573,6 +2616,11 @@ class e_admin_controller } //FIXME - move everything from e_admin_ui except model auto-create related code + + +/** + * + */ class e_admin_controller_ui extends e_admin_controller { @@ -2789,7 +2837,7 @@ class e_admin_controller_ui extends e_admin_controller protected $_tree_model; /** - * @var e_admin_tree_model + * @var e_admin_form_ui */ protected $_ui; @@ -2809,38 +2857,59 @@ class e_admin_controller_ui extends e_admin_controller */ protected $afterSubmitOptions = true; + /** + * @return bool + */ public function getAfterSubmitOptions() { return $this->afterSubmitOptions; } + /** + * @return bool + */ public function getBatchDelete() { return $this->batchDelete; } - + + /** + * @return bool + */ public function getBatchCopy() { return $this->batchCopy; } - - - public function getBatchLink() + + + /** + * @return bool + */ + public function getBatchLink() { return $this->batchLink; } - public function getBatchFeaturebox() + /** + * @return bool + */ + public function getBatchFeaturebox() { return $this->batchFeaturebox; } + /** + * @return bool + */ public function getBatchExport() { return $this->batchExport; } + /** + * @return array + */ public function getBatchOptions() { return $this->batchOptions; @@ -2910,7 +2979,12 @@ class e_admin_controller_ui extends e_admin_controller return $this->tabs; } - public function addTab($key,$val) + /** + * @param $key + * @param $val + * @return void + */ + public function addTab($key, $val) { $this->tabs[$key] = (string) $val; } @@ -3035,6 +3109,9 @@ class e_admin_controller_ui extends e_admin_controller return $this->prefs; } + /** + * @return array|int|mixed + */ public function getPerPage() { @@ -3052,6 +3129,10 @@ class e_admin_controller_ui extends e_admin_controller return $this->perPage; } + /** + * @param $key + * @return array|mixed + */ public function getGrid($key=null) { if($key !== null) @@ -3063,22 +3144,34 @@ class e_admin_controller_ui extends e_admin_controller } + /** + * @return bool|e_admin_model + */ public function getFormQuery() { return $this->formQuery; } + /** + * @return string + */ public function getPrimaryName() { return $this->getModel()->getFieldIdName(); } + /** + * @return string + */ public function getDefaultOrderField() { return ($this->defaultOrder ? $this->defaultOrderField : $this->getPrimaryName()); } + /** + * @return string + */ public function getDefaultOrder() { return ($this->defaultOrder ? $this->defaultOrder : 'asc'); @@ -3225,6 +3318,11 @@ class e_admin_controller_ui extends e_admin_controller return ($prefix ? '#' : '').$this->getModel()->getModelTable(); } + /** + * @param $prefix + * @param $quote + * @return string + */ public function getIfTableAlias($prefix = false, $quote = false) //XXX May no longer by useful. see joinAlias() { $alias = $this->getTableName(true); @@ -3254,6 +3352,11 @@ class e_admin_controller_ui extends e_admin_controller return (isset($this->tableJoin[$table][$att_name]) ? $this->tableJoin[$table][$att_name] : $default_att); } + /** + * @param $table + * @param $data + * @return $this + */ public function setJoinData($table, $data) //XXX - DEPRECATE? { if($data === null) @@ -3385,6 +3488,10 @@ class e_admin_controller_ui extends e_admin_controller return e107::getRegistry('core/adminUI/currentListModel'); } + /** + * @param $model + * @return $this + */ public function setListModel($model) { e107::setRegistry('core/adminUI/currentListModel', $model); @@ -3403,7 +3510,7 @@ class e_admin_controller_ui extends e_admin_controller /** * Get extended (UI) Form instance * - * @return e_admin_form_ui|mixed + * @return e_admin_form_ui */ public function getUI() { @@ -3491,7 +3598,6 @@ class e_admin_controller_ui extends e_admin_controller /** * Manage column visibility - * @param string $batch_trigger * @return null */ public function manageColumns() @@ -4105,6 +4211,10 @@ class e_admin_controller_ui extends e_admin_controller return vartrue($tmp[$alias]); } + /** + * @param $field + * @return array|false|mixed + */ public function getJoinField($field=null) { if(empty($field)) @@ -4115,6 +4225,9 @@ class e_admin_controller_ui extends e_admin_controller return isset($this->joinField[$field]) ? $this->joinField[$field] : false; // vartrue($this->joinField[$field],false); } + /** + * @return array + */ public function getJoinAlias() { return $this->joinAlias; @@ -4358,6 +4471,15 @@ class e_admin_controller_ui extends e_admin_controller // TODO - abstract, array return type, move to parent? + + /** + * @param $raw + * @param $isfilter + * @param $forceFrom + * @param $forceTo + * @param $listQry + * @return array|Custom|false|string|string[] + */ protected function _modifyListQry($raw = false, $isfilter = false, $forceFrom = false, $forceTo = false, $listQry = '') { $searchQry = array(); @@ -5038,6 +5160,10 @@ class e_admin_controller_ui extends e_admin_controller } } + +/** + * + */ class e_admin_ui extends e_admin_controller_ui { @@ -5147,6 +5273,9 @@ class e_admin_ui extends e_admin_controller_ui } + /** + * @return void + */ private function initAdminAddons() { $tmp = e107::getAddonConfig('e_admin', null, 'config', $this); @@ -5506,7 +5635,11 @@ class e_admin_ui extends e_admin_controller_ui $this->redirect(); } } - + + /** + * @param $selected + * @return false|int + */ protected function _add2nav($selected) { if(empty($selected)) @@ -5582,6 +5715,10 @@ class e_admin_ui extends e_admin_controller_ui } + /** + * @param $selected + * @return false|int + */ protected function _add2featurebox($selected) { // FIX - don't allow if plugin not installed @@ -5720,6 +5857,13 @@ class e_admin_ui extends e_admin_controller_ui $this->getTreeModel()->setMessages(); } + /** + * @param $selected + * @param $field + * @param $value + * @param $type + * @return void + */ public function handleCommaBatch($selected, $field, $value, $type) { $tree = $this->getTreeModel(); @@ -5955,7 +6099,7 @@ class e_admin_ui extends e_admin_controller_ui /** * Catch delete submit - * @param string $batch_trigger + * @param $posted * @return null */ public function ListDeleteTrigger($posted) @@ -6202,6 +6346,11 @@ class e_admin_ui extends e_admin_controller_ui } // Temporary - but useful. :-) + + /** + * @param $message + * @return void + */ public function logajax($message) { if(e_DEBUG !== true) @@ -6409,6 +6558,9 @@ class e_admin_ui extends e_admin_controller_ui } + /** + * @return string + */ public function GridAjaxPage() { return $this->getUI()->getList(true,'grid'); @@ -6610,6 +6762,9 @@ class e_admin_ui extends e_admin_controller_ui return $this->getUI()->getCreate(); } + /** + * @return void + */ public function PrefsSaveTrigger() { $data = $this->getPosted(); @@ -6671,12 +6826,18 @@ class e_admin_ui extends e_admin_controller_ui $this->getConfig()->setMessages(); } - + + /** + * @return void + */ public function PrefsObserver() { $this->addTitle(); } + /** + * @return string + */ public function PrefsPage() { return $this->getUI()->getSettings(); @@ -6703,6 +6864,9 @@ class e_admin_ui extends e_admin_controller_ui return $this; } + /** + * @return false + */ public function getPrimaryName() { // Option for working with tables having no PID @@ -6715,6 +6879,11 @@ class e_admin_ui extends e_admin_controller_ui return $this->pid; } + /** + * @param $alias + * @param $prefix + * @return string + */ public function getTableName($alias = false, $prefix = false) { if($alias) @@ -6936,6 +7105,10 @@ class e_admin_ui extends e_admin_controller_ui } + +/** + * + */ class e_admin_form_ui extends e_form { /** @@ -6962,6 +7135,9 @@ class e_admin_form_ui extends e_form $this->init(); } + /** + * @return void|null + */ protected function preventConflict() { $err = false; @@ -7368,10 +7544,11 @@ class e_admin_form_ui extends e_form } - - - - + /** + * @param $ids + * @param $ajax + * @return string + */ public function getConfirmDelete($ids, $ajax = false) { $controller = $this->getController(); @@ -7460,6 +7637,12 @@ class e_admin_form_ui extends e_form } + /** + * @param $current_query + * @param $location + * @param $input_options + * @return string + */ public function renderFilter($current_query = array(), $location = '', $input_options = array()) { if(!$input_options) @@ -7691,6 +7874,9 @@ class e_admin_form_ui extends e_form } + /** + * @return string|null + */ private function renderLanguageTableInfo() { @@ -8291,6 +8477,9 @@ class e_admin_form_ui extends e_form } + /** + * @return string + */ public function getElementId() { $controller = $this->getController(); diff --git a/e107_handlers/application.php b/e107_handlers/application.php index 8c499351f..59ef6eb56 100644 --- a/e107_handlers/application.php +++ b/e107_handlers/application.php @@ -85,7 +85,9 @@ class e_url } - + /** + * @return void + */ private function setRootNamespace() { @@ -101,6 +103,9 @@ class e_url } + /** + * @return bool|void + */ public function run() { $pref = e107::getPref(); @@ -564,6 +569,12 @@ class eDispatcher { protected static $_configObjects = array(); + /** + * @param eRequest|null $request + * @param eResponse|null $response + * @return void + * @throws eException + */ public function dispatch(eRequest $request = null, eResponse $response = null) { $controllerName = $request->getControllerName(); @@ -1152,7 +1163,10 @@ class eRouter return $this; } - + + /** + * @return void + */ public static function clearCache() { if(file_exists(e_CACHE_URL.'config.php')) @@ -1669,10 +1683,10 @@ class eRouter } return in_array($module, $this->_aliases); } - + /** * Get all available module aliases - * @param string $lan optional language alias check. Example $lan = 'bg' (search for Bulgarian aliases) + * @param string|null $lanCode optional language alias check. Example $lan = 'bg' (search for Bulgarian aliases) * @return array */ public function getAliases($lanCode = null) @@ -1810,7 +1824,13 @@ class eRouter } - private function _debug($label,$val=null, $line=null) + /** + * @param $label + * @param $val + * @param $line + * @return false|void + */ + private function _debug($label, $val=null, $line=null) { if(!deftrue('e_DEBUG_SEF')) { @@ -2473,6 +2493,10 @@ class eRouter } } + +/** + * + */ class eException extends Exception { @@ -2672,6 +2696,9 @@ class eUrlRule if ($this->references !== array()) $this->routePattern = '/^'.strtr($this->route, $tr2).'$/u'; } + /** + * @return array + */ public function getData() { $vars = array_keys(get_class_vars(__CLASS__)); @@ -2683,6 +2710,10 @@ class eUrlRule return $data; } + /** + * @param $data + * @return void + */ protected function setData($data) { if (!is_array($data)) return; @@ -2879,6 +2910,10 @@ class eUrlRule } + +/** + * + */ abstract class eUrlConfig { /** @@ -2912,14 +2947,14 @@ abstract class eUrlConfig * @return array|string numerical of type (routeParts, GET Params)| string route or false on error */ public function create($route, $params = array(), $options = array()) {} - + /** * Parse URL callback, called only when config option selfCreate is set to true - * TODO - register variable eURLConfig::currentConfig while initializing the object, remove from method arguments + * TODO - register variable eURLConfig::currentConfig while initializing the object, remove from method arguments * @param string $pathInfo * @param array $params request parameters - * @param eRequest $request - * @param eRouter $router + * @param eRequest|null $request + * @param eRouter|null $router * @param array $config * @return string route or false on error */ @@ -2994,7 +3029,11 @@ class eController { protected $_request; protected $_response; - + + /** + * @param eRequest $request + * @param eResponse|null $response + */ public function __construct(eRequest $request, eResponse $response = null) { $this->setRequest($request) @@ -3057,13 +3096,21 @@ class eController { return $this->_response; } - + + /** + * @param $content + * @return $this + */ public function addBody($content) { $this->getResponse()->appendBody($content); return $this; } - + + /** + * @param $description + * @return $this + */ public function addMetaDescription($description) { $this->getResponse()->addMetaDescription($description); @@ -3082,14 +3129,23 @@ class eController if($meta) $this->addMetaTitle(strip_tags($title)); return $this; } - - + + + /** + * @param $title + * @return $this + */ public function addMetaTitle($title) { $this->getResponse()->addMetaTitle($title); return $this; } - + + /** + * @param $actionMethodName + * @return void + * @throws eException + */ public function dispatch($actionMethodName) { $request = $this->getRequest(); @@ -3125,7 +3181,13 @@ class eController } $this->shutdown(); } - + + /** + * @param eRequest|null $request + * @param eResponse|null $response + * @return eResponse + * @throws eException + */ public function run(eRequest $request = null, eResponse $response = null) { if(null === $request) $request = $this->getRequest(); @@ -3141,7 +3203,13 @@ class eController return $this->getResponse(); } - + + /** + * @param $url + * @param $createURL + * @param $code + * @return void + */ protected function _redirect($url, $createURL = false, $code = null) { $redirect = e107::getRedirect(); @@ -3342,22 +3410,34 @@ class eControllerFront extends eController } return true; } - + + /** + * @return void + */ public function redirect404() { e107::getRedirect()->redirect(SITEURL.$this->e404); } - + + /** + * @return void + */ public function redirect403() { e107::getRedirect()->redirect(SITEURL.$this->e403); } - + + /** + * @return void + */ public function forward404() { $this->_forward($this->e404route); } - + + /** + * @return void + */ public function forward403() { $this->_forward($this->e403route); @@ -3590,11 +3670,11 @@ class eRequest } return $this->_requestInfo; } - - + + /** * Override request info - * @param string $pathInfo + * @param string $requestInfo * @return eRequest */ public function setRequestInfo($requestInfo) @@ -3745,7 +3825,7 @@ class eRequest /** * Set current route * @param string $route module/controller/action - * @return array|eRequest + * @return eRequest */ public function setRoute($route) { @@ -4005,6 +4085,10 @@ class eRequest } } + +/** + * + */ class eResponse { protected $_body = array('default' => ''); @@ -4044,11 +4128,17 @@ class eResponse 'jsonRender' => false, ); + /** + * @return string[] + */ public function getRobotTypes() { return $this->_meta_robot_types; } + /** + * @return array + */ public function getRobotDescriptions() { $_meta_robot_descriptions = array( @@ -4060,45 +4150,79 @@ class eResponse return $_meta_robot_descriptions; } + /** + * @param $key + * @param $value + * @return $this + */ public function setParam($key, $value) { $this->_params[$key] = $value; return $this; } - + + /** + * @param $params + * @return $this + */ public function setParams($params) { $this->_params = $params; return $this; } - + + /** + * @param $key + * @param $default + * @return mixed|null + */ public function getParam($key, $default = null) { return (isset($this->_params[$key]) ? $this->_params[$key] : $default); } - + + /** + * @param $key + * @return bool + */ public function isParam($key) { return isset($this->_params[$key]); } - + + /** + * @param $typeName + * @param $mediaType + * @return $this + */ public function addContentType($typeName, $mediaType) { $this->_content_type_arr[$typeName] = $mediaType; return $this; } - + + /** + * @return string + */ public function getContentType() { return $this->_content_type; } - + + /** + * @param $typeName + * @return mixed|string|void + */ public function getContentMediaType($typeName) { if(isset($this->_content_type_arr[$typeName])) return $this->_content_type_arr[$typeName]; } - + + /** + * @param $typeName + * @return void + */ public function setContentType($typeName) { $this->_content_type = $typeName; @@ -4530,6 +4654,9 @@ class eResponse return $this->addMetaData('e_PAGETITLE', $title); } + /** + * @return string + */ public function getMetaTitle() { return $this->getMetaData('e_PAGETITLE', $this->_meta_title_separator); @@ -4544,6 +4671,9 @@ class eResponse return $this->addMetaData('META_DESCRIPTION', $description); } + /** + * @return string + */ function getMetaDescription() { return $this->getMetaData('META_DESCRIPTION'); @@ -4558,6 +4688,9 @@ class eResponse return $this->addMetaData('META_KEYWORDS', $keywords); } + /** + * @return string + */ function getMetaKeywords() { return $this->getMetaData('META_KEYWORDS', ','); @@ -4712,45 +4845,77 @@ class eHelper protected static $_classRegEx = '#[^\w\s\-]#'; protected static $_idRegEx = '#[^\w\-]#'; protected static $_styleRegEx = '#[^\w\s\-\.;:!]#'; - + + /** + * @param $string + * @return array|string|string[]|null + */ public static function secureClassAttr($string) { return preg_replace(self::$_classRegEx, '', $string); } - + + /** + * @param $string + * @return array|string|string[]|null + */ public static function secureIdAttr($string) { $string = str_replace(array('/','_'),'-',$string); return preg_replace(self::$_idRegEx, '', $string); } - + + /** + * @param $string + * @return array|string|string[]|null + */ public static function secureStyleAttr($string) { return preg_replace(self::$_styleRegEx, '', $string); } - + + /** + * @param $safeArray + * @return string + */ public static function buildAttr($safeArray) { return http_build_query($safeArray, null, '&'); } - + + /** + * @param $title + * @return string + */ public static function formatMetaTitle($title) { $title = trim(str_replace(array('"', "'"), '', strip_tags(e107::getParser()->toHTML($title, TRUE)))); return trim(preg_replace('/[\s,]+/', ' ', str_replace('_', ' ', $title))); } - + + /** + * @param $sef + * @return string + */ public static function secureSef($sef) { return trim(preg_replace('/[^\w\pL\s\-+.,]+/u', '', strip_tags(e107::getParser()->toHTML($sef, TRUE)))); } - + + /** + * @param $keywordString + * @return string + */ public static function formatMetaKeys($keywordString) { $keywordString = preg_replace('/[^\w\pL\s\-.,+]/u', '', strip_tags(e107::getParser()->toHTML($keywordString, TRUE))); return trim(preg_replace('/[\s]?,[\s]?/', ',', str_replace('_', ' ', $keywordString))); } - + + /** + * @param $descrString + * @return string + */ public static function formatMetaDescription($descrString) { $descrString = preg_replace('/[\r]*\n[\r]*/', ' ', trim(str_replace(array('"', "'"), '', strip_tags(e107::getParser()->toHTML($descrString, TRUE))))); @@ -4961,7 +5126,13 @@ class eHelper return (null !== $separator ? implode($separator, $ret) : $ret); } - + + /** + * @param $str + * @param $all + * @param $space + * @return string + */ public static function camelize($str, $all = false, $space = '') { // clever recursion o.O @@ -4970,28 +5141,41 @@ class eHelper $tmp = explode('-', str_replace(array('_', ' '), '-', e107::getParser()->ustrtolower($str))); return trim(implode($space, array_map('ucfirst', $tmp)), $space); } - + + /** + * @param $str + * @param $space + * @return string + */ public static function labelize($str, $space = ' ') { return self::camelize($str, true, ' '); } - + + /** + * @param $str + * @return array|string|string[] + */ public static function dasherize($str) { return str_replace(array('_', ' '), '-', $str); } + /** + * @param $str + * @return array|string|string[] + */ public static function underscore($str) { return str_replace(array('-', ' '), '_', $str); } - + /** * Parse generic shortcode parameter string * Format expected: {SC=key=val&key1=val1...} * Escape strings: \& => & * - * @param string $parmstr + * @param string $parm * @return array associative param array */ public static function scParams($parm) diff --git a/e107_handlers/bbcode_handler.php b/e107_handlers/bbcode_handler.php index ab9abf503..4114f2124 100644 --- a/e107_handlers/bbcode_handler.php +++ b/e107_handlers/bbcode_handler.php @@ -24,6 +24,10 @@ if (!defined('e107_INIT')) { exit; } + +/** + * + */ class e_bbcode { private $bbList; // Caches the file contents for each bbcode processed @@ -486,18 +490,30 @@ class e_bbcode } //Set the class type for a bbcode eg. news | page | user | {plugin-folder} + + /** + * @param $mode + * @return void + */ function setClass($mode=false) { $this->class = $mode; } // return the Mode used by the class. eg. news | page | user | {plugin-folder} + + /** + * @return bool + */ function getMode() { return $this->class; } - - + + + /** + * @return false|int + */ function resizeWidth() { if($this->class && !empty($this->resizePrefs[$this->class.'-bbcode']['w'])) @@ -507,7 +523,10 @@ class e_bbcode return false; } - + + /** + * @return false|int + */ function resizeHeight() { if($this->class && !empty($this->resizePrefs[$this->class.'-bbcode']['h'])) @@ -519,6 +538,11 @@ class e_bbcode } // return the class for a bbcode + + /** + * @param $type + * @return string + */ function getClass($type='') { @@ -528,9 +552,12 @@ class e_bbcode $ret .= " bbcode-".$type."-".$this->class; } return $ret; - } - - + } + + + /** + * @return void + */ function clearClass() { $this->setClass(); @@ -651,10 +678,14 @@ class e_bbcode return "
".$tp->parseTemplate($BBCODE_TEMPLATE,TRUE, $bbcode_shortcodes)."
"; } - - - function processTag($tag, $html) + + /** + * @param $tag + * @param $html + * @return array|string|string[] + */ + function processTag($tag, $html) { $html = "".$html.""; $doc = new DOMDocument(); diff --git a/e107_handlers/bounce_handler.php b/e107_handlers/bounce_handler.php index 7f8bd81b9..270e69213 100644 --- a/e107_handlers/bounce_handler.php +++ b/e107_handlers/bounce_handler.php @@ -28,7 +28,10 @@ } - class e107Bounce +/** + * + */ +class e107Bounce { private $debug = false; @@ -44,6 +47,10 @@ }*/ } + /** + * @param $source + * @return void + */ public function setSource($source) { $this->source = $source; @@ -196,6 +203,11 @@ } + /** + * @param $message + * @param $id + * @return array|string|string[]|null + */ function getHeader($message, $id = 'X-e107-id') { @@ -212,6 +224,11 @@ } + /** + * @param $bounceString + * @param $email + * @return array|bool + */ function setUser_Bounced($bounceString = '', $email = '') { @@ -324,13 +341,20 @@ */ - class BounceHandler +/** + * + */ +class BounceHandler { // this is the most commonly used public method // quick and dirty // useage: $multiArray = BounceHandler::get_the_facts($strEmail); + /** + * @param $eml + * @return array + */ static function get_the_facts($eml) { @@ -418,6 +442,12 @@ // general purpose recursive heuristic function // to try to extract useful info from the bounces produced by busted MTAs + /** + * @param $recipient + * @param $arrBody + * @param $index + * @return string + */ static function get_status_code_from_text($recipient, $arrBody, $index) { @@ -564,6 +594,11 @@ return ''; } + /** + * @param $blob + * @param $format + * @return array|string|string[] + */ static function init_bouncehandler($blob, $format = 'string') { $strEmail = ""; @@ -599,6 +634,10 @@ return $strEmail; } + /** + * @param $head_hash + * @return bool + */ static function is_RFC1892_multipart_report($head_hash) { @@ -607,6 +646,10 @@ && $head_hash['Content-type']['boundary'] !== ''; } + /** + * @param $headers + * @return array + */ static function parse_head($headers) { @@ -638,6 +681,11 @@ return $hash; } + /** + * @param $body + * @param $boundary + * @return array + */ static function parse_body_into_mime_sections($body, $boundary) { @@ -658,6 +706,10 @@ } + /** + * @param $content + * @return array + */ static function standard_parser($content) { // associative array orstr // receives email head as array of lines @@ -702,6 +754,10 @@ return $hash; } + /** + * @param $str + * @return array + */ static function parse_machine_parsable_body_part($str) { @@ -762,6 +818,10 @@ return $hash; } + /** + * @param $mime_sections + * @return array + */ static function get_head_from_returned_message_body_part($mime_sections) { @@ -773,6 +833,10 @@ return $head; } + /** + * @param $str + * @return mixed|string + */ static function extract_address($str) { @@ -790,6 +854,10 @@ return $from; } + /** + * @param $per_rcpt + * @return array|string|string[] + */ static function get_recipient($per_rcpt) { @@ -809,6 +877,10 @@ return $recipient; } + /** + * @param $dsn_fields + * @return array + */ static function parse_dsn_fields($dsn_fields) { @@ -849,6 +921,10 @@ return $hash; } + /** + * @param $code + * @return array + */ static function format_status_code($code) { @@ -869,6 +945,10 @@ return $ret; } + /** + * @param $code + * @return string + */ static function fetch_status_messages($code) { @@ -1040,6 +1120,10 @@ return $str; } + /** + * @param $code + * @return string + */ static function get_action_from_status_code($code) { @@ -1066,6 +1150,10 @@ } } + /** + * @param $dcode + * @return mixed|null + */ static function decode_diagnostic_code($dcode) { @@ -1081,6 +1169,10 @@ return null; } + /** + * @param $head_hash + * @return bool + */ static function is_a_bounce($head_hash) { @@ -1102,6 +1194,10 @@ return false; } + /** + * @param $first_body_part + * @return array + */ static function find_email_addresses($first_body_part) { diff --git a/e107_handlers/cache_handler.php b/e107_handlers/cache_handler.php index 4fa2084e2..2a43ce14e 100644 --- a/e107_handlers/cache_handler.php +++ b/e107_handlers/cache_handler.php @@ -58,6 +58,9 @@ class ecache { } + /** + * @return mixed + */ public function getMD5() { return $this->CachePageMD5; @@ -200,13 +203,13 @@ class ecache { } /** - * @return string - * @param string $CacheTag - * @param int $MaximumAge the time in minutes before the cache file 'expires' - * @param boolean $force - * @desc Returns the data from the cache file associated with $query, else it returns false if there is no cache for $query. - * @scope public - */ + * @param string $CacheTag + * @param bool $MaximumAge the time in minutes before the cache file 'expires' + * @param bool $ForcedCheck + * @return string + * @desc Returns the data from the cache file associated with $query, else it returns false if there is no cache for $query. + * @scope public + */ function retrieve_sys($CacheTag, $MaximumAge = false, $ForcedCheck = false) { if(isset($this) && $this instanceof ecache) diff --git a/e107_handlers/chart_class.php b/e107_handlers/chart_class.php index d8f99bbe3..8d83ba4da 100644 --- a/e107_handlers/chart_class.php +++ b/e107_handlers/chart_class.php @@ -182,8 +182,12 @@ class e_chart // e107::css('inline','canvas.e-graph { width: 100% !important; max-width: 800px; height: auto !important; }'); - } - + } + + /** + * @param $type + * @return $this + */ public function setProvider($type = null) { if(!empty($type)) @@ -193,23 +197,36 @@ class e_chart return $this; } - + + /** + * @return null + */ public function getProvider() { return $this->provider; } - - + + + /** + * @return false|string + */ private function getData() { return json_encode($this->data); } - + + /** + * @return false|string + */ private function getOptions() { return json_encode($this->options); } + /** + * @param $flag + * @return $this + */ public function debug($flag=false) { if($flag === true) @@ -220,6 +237,9 @@ class e_chart return $this; } + /** + * @return string + */ public function renderTable() { @@ -298,7 +318,6 @@ class e_chart /** * Set the data values * @param array $data - * @param string $id of canvas element * @return $this */ public function setData($data) @@ -315,7 +334,10 @@ class e_chart return $this; } - + + /** + * @return array + */ private function getDemoData() { $data = array(); @@ -363,6 +385,10 @@ class e_chart } + /** + * @param $data + * @return $this + */ public function setOptions($data) { diff --git a/e107_handlers/cli_class.php b/e107_handlers/cli_class.php index 149bee9b7..1316a04d4 100644 --- a/e107_handlers/cli_class.php +++ b/e107_handlers/cli_class.php @@ -18,6 +18,10 @@ if (!defined('e107_INIT')) { exit; } + +/** + * + */ class eCLI { diff --git a/e107_handlers/comment_class.php b/e107_handlers/comment_class.php index 50e9c9a08..578859fdd 100644 --- a/e107_handlers/comment_class.php +++ b/e107_handlers/comment_class.php @@ -19,6 +19,10 @@ e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE."/lan_comment.php"); global $comment_shortcodes; require_once (e_CORE."shortcodes/batch/comment_shortcodes.php"); + +/** + * + */ class comment { public $known_types = array( @@ -130,8 +134,11 @@ class comment } - - function replyComment($id) // Ajax Reply. + /** + * @param $id + * @return string|void|null + */ + function replyComment($id) // Ajax Reply. { if($this->engine != 'e107') { @@ -588,8 +595,12 @@ class comment return $status; } - - function approveComment($id) // appropve a single comment by comment id. + + /** + * @param $id + * @return int|void + */ + function approveComment($id) // appropve a single comment by comment id. { if(!getperms('0') && !getperms("B")) { @@ -599,8 +610,13 @@ class comment return e107::getDb()->update("comments","comment_blocked=0 WHERE comment_id = ".intval($id).""); } - - function updateComment($id,$comment) + + /** + * @param $id + * @param $comment + * @return string|void|null + */ + function updateComment($id, $comment) { if($this->engine != 'e107') { @@ -621,8 +637,12 @@ class comment return "Update Failed"; // trigger ajax error message. } } - - + + + /** + * @param $var + * @return bool + */ function moderateComment($var) { if ($var == e_UC_MEMBER) // different behavior to check_class(); @@ -1211,8 +1231,14 @@ class comment } - - public function getComments($table,$id,$from=0,$att=null) + /** + * @param $table + * @param $id + * @param $from + * @param $att + * @return array + */ + public function getComments($table, $id, $from=0, $att=null) { $sql = e107::getDb(); $tp = e107::getParser(); @@ -1285,8 +1311,13 @@ class comment } - - function nextprev($table,$id,$from=0) + /** + * @param $table + * @param $id + * @param $from + * @return string|void + */ + function nextprev($table, $id, $from=0) { //return "table=".$table." id=".$id." from=".$from; //$from = $from + $this->commentsPerPage; @@ -1308,11 +1339,10 @@ class comment } - - - - - + /** + * @param $id + * @return void + */ function recalc_user_comments($id) { $sql = e107::getDb(); @@ -1338,7 +1368,12 @@ class comment } - function get_author_list($id, $comment_type) + /** + * @param $id + * @param $comment_type + * @return array + */ + function get_author_list($id, $comment_type) { $sql = e107::getDb(); @@ -1360,7 +1395,12 @@ class comment } - function delete_comments($table, $id) + /** + * @param $table + * @param $id + * @return int + */ + function delete_comments($table, $id) { $sql = e107::getDb(); $tp = e107::getParser(); @@ -1386,7 +1426,10 @@ class comment //get all e_comment.php files and collect the variables - function get_e_comment() + /** + * @return array|false|mixed|void|null + */ + function get_e_comment() { if($this->engine != 'e107') @@ -1453,7 +1496,15 @@ class comment */ - function getCommentData($amount = '', $from = 0, $qry = '', $cdvalid = FALSE, $cdreta = FALSE) + /** + * @param $amount + * @param $from + * @param $qry + * @param $cdvalid + * @param $cdreta + * @return array|mixed|null + */ + function getCommentData($amount = '', $from = 0, $qry = '', $cdvalid = FALSE, $cdreta = FALSE) { if($this->engine != 'e107') diff --git a/e107_handlers/core_functions.php b/e107_handlers/core_functions.php index e8bf5ab3c..9c14515df 100644 --- a/e107_handlers/core_functions.php +++ b/e107_handlers/core_functions.php @@ -113,6 +113,10 @@ function deftrue($str, $default='') return $default; } +/** + * @param $fname + * @return mixed + */ function e107_include($fname) { global $_E107; @@ -120,6 +124,10 @@ function e107_include($fname) return $ret; } +/** + * @param $fname + * @return mixed|string + */ function e107_include_once($fname) { global $_E107; @@ -130,6 +138,10 @@ function e107_include_once($fname) return (isset($ret)) ? $ret : ''; } +/** + * @param $fname + * @return mixed + */ function e107_require_once($fname) { global $_E107; @@ -139,6 +151,10 @@ function e107_require_once($fname) return $ret; } +/** + * @param $fname + * @return mixed + */ function e107_require($fname) { global $_E107; @@ -147,6 +163,11 @@ function e107_require($fname) } +/** + * @param $var + * @param $return + * @return bool|string + */ function print_a($var, $return = FALSE) { if( ! $return) @@ -159,6 +180,10 @@ function print_a($var, $return = FALSE) } +/** + * @param $expr + * @return void + */ function e_print($expr = null) { $args = func_get_args(); @@ -169,6 +194,10 @@ function e_print($expr = null) } } +/** + * @param $expr + * @return void + */ function e_dump($expr = null) { $args = func_get_args(); @@ -231,18 +260,13 @@ function array_diff_recursive($array1, $array2) } return $ret; -} - - - - - +} /** * Strips slashes from a string or an array * - * @param mixed $value + * @param $data * @return array|string */ function array_stripslashes($data) @@ -250,6 +274,9 @@ function array_stripslashes($data) return is_array($data) ? array_map('array_stripslashes', $data) : stripslashes($data); } +/** + * @return void + */ function echo_gzipped_page() { @@ -393,7 +420,12 @@ function table_exists($check) // Better Array-sort by key function by acecream (22-Apr-2003 11:02) http://php.net/manual/en/function.asort.php if (!function_exists('asortbyindex')) { - function asortbyindex($array, $key) + /** + * @param $array + * @param $key + * @return array + */ + function asortbyindex($array, $key) { foreach ($array as $i => $k) { @@ -721,7 +753,12 @@ class e_array { return $this->serialize($ArrayData, $AddSlashes); } - + + /** + * @param $ArrayData + * @param $AddSlashes + * @return string|null + */ function write($ArrayData, $AddSlashes = true) { return $this->serialize($ArrayData, $AddSlashes); @@ -739,8 +776,12 @@ class e_array { trigger_error(''.__METHOD__.' is deprecated. Use e107::unserialize() instead.', E_USER_DEPRECATED); // NO LAN return $this->unserialize($ArrayData); } - - function read($ArrayData) + + /** + * @param $ArrayData + * @return array|bool|string|null + */ + function read($ArrayData) { return $this->unserialize($ArrayData); } diff --git a/e107_handlers/cron_class.php b/e107_handlers/cron_class.php index 415b6e243..445efd87a 100644 --- a/e107_handlers/cron_class.php +++ b/e107_handlers/cron_class.php @@ -20,7 +20,11 @@ if (!defined('e107_INIT')) { exit; } define ('CRON_MAIL_DEBUG', false); define ('CRON_RETRIGGER_DEBUG', false); -class _system_cron + +/** + * + */ +class _system_cron { function __construct() { @@ -29,9 +33,12 @@ class _system_cron } // See admin/cron.php to configure more core cron function to be added below. - - - function myfunction() + + + /** + * @return void + */ + function myfunction() { // Whatever code you wish. } @@ -142,9 +149,12 @@ class _system_cron return null; } - - - function sendEmail() // Test Email. + + + /** + * @return void + */ + function sendEmail() // Test Email. { global $pref, $_E107; if($_E107['debug']) { echo "
sendEmail() executed"; } @@ -200,6 +210,10 @@ class _system_cron // sendemail($pref['siteadminemail'], "e107 - TEST Email Sent by cron.".date("r"), $message, $pref['siteadmin'],SITEEMAIL, $pref['siteadmin']); } + /** + * @param $array + * @return string + */ private function renderTable($array) { $text = ""; @@ -252,7 +266,10 @@ class _system_cron e107::getLog()->addEvent(10,debug_backtrace(),'DEBUG','CRON Email','Email run completed',FALSE,LOG_TO_ROLLING); } } - + + /** + * @return void + */ function procEmailBounce() { //global $pref; @@ -269,7 +286,10 @@ class _system_cron $e107->admin_log->addEvent(10,debug_backtrace(),'DEBUG','CRON Bounce','Bounce processing completed',FALSE,LOG_TO_ROLLING); } } - + + /** + * @return void + */ function procBanRetrigger() { //global $pref; @@ -389,21 +409,34 @@ class CronParser var $hours_arr = array(); //hours array based on cron string var $months_arr = array(); //months array based on cron string + /** + * @return string[] + */ function getLastRan() { return explode(",", eShims::strftime("%M,%H,%d,%m,%w,%Y", $this->lastRan)); //Get the values for now in a format we can use } + /** + * @return mixed + */ function getLastRanUnix() { return $this->lastRan; } + /** + * @return mixed + */ function getDebug() { return $this->debug; } + /** + * @param $str + * @return void + */ function debug($str) { if (is_array($str)) @@ -464,6 +497,11 @@ class CronParser return $ret; } + /** + * @param $month + * @param $year + * @return string + */ function daysinmonth($month, $year) { return date('t', mktime(0, 0, 0, $month, 1, $year)); @@ -624,6 +662,11 @@ class CronParser } //get the due time before current month + + /** + * @param $arMonths + * @return void + */ function _prevMonth($arMonths) { $this->month = array_pop($arMonths); @@ -661,6 +704,12 @@ class CronParser } //get the due time before current day + + /** + * @param $arDays + * @param $arMonths + * @return void + */ function _prevDay($arDays, $arMonths) { $this->debug("Go for the previous day"); @@ -678,6 +727,13 @@ class CronParser } //get the due time before current hour + + /** + * @param $arHours + * @param $arDays + * @param $arMonths + * @return void + */ function _prevHour($arHours, $arDays, $arMonths) { $this->debug("Going for previous hour"); @@ -694,6 +750,10 @@ class CronParser } //not used at the moment + + /** + * @return mixed|null + */ function _getLastMonth() { $months = $this->_getMonthsArray(); @@ -701,6 +761,11 @@ class CronParser return array_pop($months); } + /** + * @param $month + * @param $year + * @return mixed|null + */ function _getLastDay($month, $year) { //put the available days for that month into an array @@ -709,6 +774,9 @@ class CronParser return array_pop($days); } + /** + * @return mixed|null + */ function _getLastHour() { $hours = $this->_getHoursArray(); @@ -716,6 +784,9 @@ class CronParser return array_pop($hours); } + /** + * @return mixed|null + */ function _getLastMinute() { $minutes = $this->_getMinutesArray(); @@ -724,6 +795,13 @@ class CronParser } //remove the out of range array elements. $arr should be sorted already and does not contain duplicates + + /** + * @param $arr + * @param $low + * @param $high + * @return mixed + */ function _sanitize ($arr, $low, $high) { $count = count($arr); @@ -759,6 +837,12 @@ class CronParser } //given a month/year, list all the days within that month fell into the week days list. + + /** + * @param $month + * @param $year + * @return array + */ function _getDaysArray($month, $year = 0) { if ($year == 0) @@ -834,6 +918,12 @@ class CronParser } //given a month/year, return an array containing all the days in that month + + /** + * @param $month + * @param $year + * @return array + */ function getDays($month, $year) { $daysinmonth = $this->daysinmonth($month, $year); @@ -846,6 +936,9 @@ class CronParser return $days; } + /** + * @return array|mixed + */ function _getHoursArray() { if (empty($this->hours_arr)) @@ -872,6 +965,9 @@ class CronParser return $this->hours_arr; } + /** + * @return array|mixed + */ function _getMinutesArray() { if (empty($this->minutes_arr)) @@ -897,6 +993,9 @@ class CronParser return $this->minutes_arr; } + /** + * @return array|mixed + */ function _getMonthsArray() { if (empty($this->months_arr)) diff --git a/e107_handlers/date_handler.php b/e107_handlers/date_handler.php index 3a52a244f..0d0d51e8f 100644 --- a/e107_handlers/date_handler.php +++ b/e107_handlers/date_handler.php @@ -11,8 +11,12 @@ if (!defined('e107_INIT')) { exit; } //e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE."/lan_date.php"); -e107::coreLan('date'); +e107::coreLan('date'); + +/** + * + */ class e_date { @@ -797,9 +801,10 @@ class e_date } - - - + /** + * @param $mode + * @return bool + */ function supported($mode = FALSE) { $strftimeFormats = array( @@ -912,6 +917,10 @@ class e_date return in_array($timezone, timezone_identifiers_list()); } + /** + * @param $datestamp + * @return array + */ public function dateFormats($datestamp = null) { if(empty($datestamp)) @@ -953,6 +962,10 @@ class e_date return $ret; } + /** + * @param $datestamp + * @return array + */ function timeFormats($datestamp=null) { if(empty($datestamp)) diff --git a/e107_handlers/db_debug_class.php b/e107_handlers/db_debug_class.php index 59e6ea4fc..bf0f9ddaf 100644 --- a/e107_handlers/db_debug_class.php +++ b/e107_handlers/db_debug_class.php @@ -23,7 +23,10 @@ } - class e107_db_debug +/** + * + */ +class e107_db_debug { private $active = false; // true when debug is active. var $aSQLdetails = array(); // DB query analysis (in pieces for further analysis) @@ -77,7 +80,10 @@ } - function e107_db_debug() + /** + * @return void + */ + function e107_db_debug() { global $eTimingStart; @@ -100,7 +106,10 @@ // // Add your new Show function here so it will display in debug output! // - function Show_All() + /** + * @return void + */ + function Show_All() { $this->ShowIf('Debug Log', $this->Show_Log()); @@ -119,7 +128,12 @@ $this->ShowIf('Included Files: ' . count($this->aIncList), $this->Show_Includes()); } - function ShowIf($title, $str) + /** + * @param $title + * @param $str + * @return void + */ + function ShowIf($title, $str) { if(!empty($str)) @@ -131,7 +145,11 @@ } } - function Mark_Time($sMarker) + /** + * @param $sMarker + * @return void + */ + function Mark_Time($sMarker) { $this->logTime($sMarker); } @@ -282,7 +300,11 @@ } - function Show_SQL_Details($force = false) + /** + * @param $force + * @return false|string + */ + function Show_SQL_Details($force = false) { global $sql; @@ -412,7 +434,11 @@ return $text; } - function countLabel($amount) + /** + * @param $amount + * @return string + */ + function countLabel($amount) { $inc = ''; @@ -433,7 +459,11 @@ } - function save($log) + /** + * @param $log + * @return void + */ + function save($log) { e107::getMessage()->addDebug("Saving a log"); @@ -453,7 +483,13 @@ } - private function highlight($label, $value = 0, $thresholdHigh = 0) + /** + * @param $label + * @param $value + * @param $thresholdHigh + * @return mixed|string + */ + private function highlight($label, $value = 0, $thresholdHigh = 0) { if($value > $thresholdHigh) @@ -471,7 +507,10 @@ } - function Show_Performance() + /** + * @return string + */ + function Show_Performance() { // @@ -730,7 +769,13 @@ return $text; } - function logDeprecated($message=null, $file=null, $line=null) + /** + * @param $message + * @param $file + * @param $line + * @return void|null + */ + function logDeprecated($message=null, $file=null, $line=null) { if(!empty($message) || !empty($file)) { @@ -757,7 +802,14 @@ } - function logCode($type, $code, $parm, $details) + /** + * @param $type + * @param $code + * @param $parm + * @param $details + * @return false|null + */ + function logCode($type, $code, $parm, $details) { if(!E107_DBG_BBSC || !$this->active) @@ -774,7 +826,11 @@ return null; } - function Show_SC_BB($force = false) + /** + * @param $force + * @return false|string + */ + function Show_SC_BB($force = false) { if(!E107_DBG_BBSC && ($force === false)) @@ -814,7 +870,11 @@ return $text; } - private function includeVar($value) + /** + * @param $value + * @return bool + */ + private function includeVar($value) { $prefix = array('ADMIN', 'E_', 'e_', 'E107', 'SITE', 'USER', 'CORE'); @@ -829,7 +889,11 @@ return false; } - function Show_PATH($force = false) + /** + * @param $force + * @return false|string + */ + function Show_PATH($force = false) { if(!E107_DBG_PATH && ($force === false)) @@ -964,7 +1028,11 @@ } - function Show_DEPRECATED($force = false) + /** + * @param $force + * @return false|string + */ + function Show_DEPRECATED($force = false) { if(!E107_DBG_DEPRECATED && ($force === false)) { @@ -1119,7 +1187,11 @@ return $text; } - function Show_Includes($force = false) + /** + * @param $force + * @return false|string + */ + function Show_Includes($force = false) { if(!E107_DBG_INCLUDES && ($force === false)) @@ -1142,7 +1214,10 @@ // // Helper functions (not part of the class) // - function e107_debug_shutdown() +/** + * @return void + */ +function e107_debug_shutdown() { if(e_AJAX_REQUEST) // extra output will break json ajax returns ie. comments diff --git a/e107_handlers/db_table_admin_class.php b/e107_handlers/db_table_admin_class.php index 1cce540f6..65eed218c 100644 --- a/e107_handlers/db_table_admin_class.php +++ b/e107_handlers/db_table_admin_class.php @@ -21,9 +21,10 @@ Note: there are some uncommented 'echo' statements which are intentional to highlight that something's gone wrong! (not that it should, of course) */ - - +/** + * + */ class db_table_admin { protected $file_buffer = ''; // Contents of a file @@ -32,6 +33,11 @@ class db_table_admin // Get list of fields and keys for a table - return FALSE if unsuccessful // Return as for get_table_def + /** + * @param $table_name + * @param $prefix + * @return false|mixed|string + */ function get_current_table($table_name, $prefix = "") { $sql = e107::getDb(); @@ -126,6 +132,10 @@ class db_table_admin // Parses the block of lines which make up the field and index definitions // Returns an array where each entry is the definitions of a field or index + /** + * @param $text + * @return array|false + */ function parse_field_defs($text) { $text = (string) $text; @@ -273,7 +283,12 @@ class db_table_admin } // Utility routine - given our array-based definition, create a string MySQL field definition - function make_def($list) + + /** + * @param $list + * @return mixed|string + */ + function make_def($list) { switch ($list['type']) { @@ -317,7 +332,13 @@ class db_table_admin // Return a text list of differences, plus an array of MySQL queries to fix // List1 is the reference, List 2 is the actual // This version looks ahead on a failed match, and moves a field up in the table if already defined - should retain as much as possible - function compare_field_lists($list1, $list2, $stop_on_error = FALSE) + /** + * @param $list1 + * @param $list2 + * @param $stop_on_error + * @return array[]|bool + */ + function compare_field_lists($list1, $list2, $stop_on_error = FALSE) { $i = 0; // Counts records in list1 (required format) $j = 0; // Counts records in $created_list (our 'table so far' list) @@ -515,8 +536,12 @@ class db_table_admin $error_list, $change_list ); } - - function make_changes_list($result) + + /** + * @param $result + * @return string + */ + function make_changes_list($result) { if (!is_array($result)) { @@ -534,7 +559,12 @@ class db_table_admin } // Return a table of info from the output of get_table_def - function make_table_list($result) + + /** + * @param $result + * @return string + */ + function make_table_list($result) { if (!is_array($result)) { @@ -553,7 +583,12 @@ class db_table_admin } // Return a table of info from the output of parse_field_defs() - function make_field_list($fields) + + /** + * @param $fields + * @return string + */ + function make_field_list($fields) { $text = "
"; foreach ($fields as $f) @@ -619,7 +654,14 @@ class db_table_admin // Return text string if $justCheck is TRUE and changes needed // Return text string on most failures // Return FALSE on certain failures (generally indicative of code/system problems) - function update_table_structure($newStructure, $justCheck = FALSE, $makeNewifNotExist = TRUE, $mlUpdate = FALSE) + /** + * @param $newStructure + * @param $justCheck + * @param $makeNewifNotExist + * @param $mlUpdate + * @return bool|string + */ + function update_table_structure($newStructure, $justCheck = FALSE, $makeNewifNotExist = TRUE, $mlUpdate = FALSE) { global $sql; // Pull out table name @@ -691,8 +733,15 @@ class db_table_admin } } - - function createTable($pathToSqlFile = '', $tableName = '', $addPrefix = true, $renameTable = '') + + /** + * @param $pathToSqlFile + * @param $tableName + * @param $addPrefix + * @param $renameTable + * @return bool|int + */ + function createTable($pathToSqlFile = '', $tableName = '', $addPrefix = true, $renameTable = '') { // $e107 = e107::getInstance(); $tmp = $this->get_table_def($tableName, $pathToSqlFile); diff --git a/e107_handlers/db_verify_class.php b/e107_handlers/db_verify_class.php index 2e26a43a3..77b4daec3 100755 --- a/e107_handlers/db_verify_class.php +++ b/e107_handlers/db_verify_class.php @@ -19,6 +19,10 @@ if (!defined('e107_INIT')) { exit; } e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_db_verify.php'); + +/** + * + */ class db_verify { var $backUrl = ""; @@ -81,6 +85,9 @@ class db_verify } + /** + * @return bool + */ public function clearCache() { @@ -88,6 +95,9 @@ class db_verify } + /** + * @return array + */ private function load() { $mes = e107::getMessage(); @@ -194,8 +204,12 @@ class db_verify } } - - + + + /** + * @param $fileArray + * @return void + */ function runComparison($fileArray) { $mes = e107::getMessage(); @@ -276,13 +290,14 @@ class db_verify } } - - - - - - public function compare($selection,$language='') + + /** + * @param $selection + * @param $language + * @return false|void + */ + public function compare($selection, $language='') { $this->currentTable = $selection; @@ -508,8 +523,11 @@ class db_verify return count($this->errors); } - + /** + * @param $fileArray + * @return void + */ function renderResults($fileArray=array()) { @@ -649,6 +667,10 @@ class db_verify } + /** + * @param $tabs + * @return mixed|string + */ function renderTableName($tabs) { @@ -661,16 +683,30 @@ class db_verify } - function fixForm($file,$table,$field, $newvalue,$mode,$after ='') + /** + * @param $file + * @param $table + * @param $field + * @param $newvalue + * @param $mode + * @param $after + * @return string + */ + function fixForm($file, $table, $field, $newvalue, $mode, $after ='') { $frm = e107::getForm(); $text = $frm->checkbox("fix[$file][$table][$field][]", $mode, false, array('id'=>false)); return $text; } - - - function renderNotes($data,$mode='field') + + + /** + * @param $data + * @param $mode + * @return string + */ + function renderNotes($data, $mode='field') { // return "
".print_r($data,TRUE)."
"; @@ -692,10 +728,14 @@ class db_verify return $text; } - - - - public function toMysql($data,$mode = 'field') + + + /** + * @param $data + * @param $mode + * @return string|void + */ + public function toMysql($data, $mode = 'field') { if(!$data) return; @@ -735,7 +775,13 @@ class db_verify } // returns the previous Field - function getPrevious($array,$cur) + + /** + * @param $array + * @param $cur + * @return int|mixed|string + */ + function getPrevious($array, $cur) { $fkeys = array_keys($array); $cur_key = array_search($cur, $fkeys); @@ -884,11 +930,13 @@ class db_verify $log->flushMessages("Database Table(s) Modified"); - } - - - - + } + + + /** + * @param $sql_data + * @return array|false + */ function getSqlFileTables($sql_data) { if(!$sql_data) @@ -950,8 +998,11 @@ class db_verify } - - + /** + * @param $data + * @param $print + * @return array + */ function getFields($data, $print = false) { @@ -1005,8 +1056,13 @@ class db_verify return $ret; } - - + + + /** + * @param $data + * @param $print + * @return array + */ function getIndex($data, $print = false) { // $regex = "/(?:(PRIMARY|UNIQUE|FULLTEXT))?[\s]*?KEY (?: ?`?([\w]*)`?)[\s]* ?(?:\([\s]?`?([\w,]*[\s]?)`?\))?,?/i"; @@ -1070,10 +1126,14 @@ class db_verify return $ret; } - - - - function getSqlData($tbl,$language='') + + + /** + * @param $tbl + * @param $language + * @return false|string + */ + function getSqlData($tbl, $language='') { $mes = e107::getMessage(); @@ -1125,7 +1185,10 @@ class db_verify } } - + + /** + * @return array + */ function getSqlLanguages() { $sql = e107::getDb(); @@ -1142,8 +1205,11 @@ class db_verify return $array; } - - + + + /** + * @return void + */ function renderTableSelect() { $frm = e107::getForm(); diff --git a/e107_handlers/debug_handler.php b/e107_handlers/debug_handler.php index ddec7e35d..b52030516 100644 --- a/e107_handlers/debug_handler.php +++ b/e107_handlers/debug_handler.php @@ -35,7 +35,9 @@ if (!defined('e107_INIT')) { exit; } - +/** + * + */ class e107_debug { private static $debug_level = 0; @@ -69,6 +71,9 @@ class e107_debug { } + /** + * @return string[] + */ public static function getAliases() { return array( @@ -120,7 +125,10 @@ class e107_debug { return isset($keys[$level]) ? $keys[$level] : null; } - public static function activated() + /** + * @return bool + */ + public static function activated() { if (isset($_COOKIE['e107_debug_level']) || deftrue('e_DEBUG') || (strpos(e_MENU, "debug") === 0)) // ADMIN and getperms('0') are not available at this point. { @@ -131,7 +139,9 @@ class e107_debug { } - + /** + * @return bool + */ public static function init() { if(!self::activated()) @@ -242,18 +252,28 @@ class e107_debug { } - public static function getLevel() + /** + * @return int + */ + public static function getLevel() { return self::$debug_level; } - public static function setLevel($level = 0) + /** + * @param $level + * @return void + */ + public static function setLevel($level = 0) { self::$debug_level = $level; } - function set_error_reporting() + /** + * @return void + */ + function set_error_reporting() { } } diff --git a/e107_handlers/e107Url.php b/e107_handlers/e107Url.php index bba0be698..cd78cb685 100755 --- a/e107_handlers/e107Url.php +++ b/e107_handlers/e107Url.php @@ -15,6 +15,10 @@ if (!defined('e107_INIT')) { exit; } + +/** + * + */ class eUrl { protected $_front; @@ -40,12 +44,24 @@ class eUrl } $this->_front = $front; } - + + /** + * @param $route + * @param $params + * @param $options + * @return string + */ public function create($route, $params = array(), $options = array()) { return $this->router()->assemble($route, $params, $options); } - + + /** + * @param $route + * @param $params + * @param $options + * @return string + */ public function sc($route, $params = array(), $options = array()) { return $this->router()->assembleSc($route, $params, $options); diff --git a/e107_handlers/e107_class.php b/e107_handlers/e107_class.php index 9aff2358e..33e8ec757 100644 --- a/e107_handlers/e107_class.php +++ b/e107_handlers/e107_class.php @@ -296,6 +296,9 @@ class e107 //register_shutdown_function(array($this, 'destruct')); } + /** + * @return void + */ private static function die_http_400() { header('HTTP/1.0 400 Bad Request', true, 400); @@ -1442,6 +1445,9 @@ class e107 } + /** + * @return array + */ public static function getThemeGlyphs() { @@ -2128,7 +2134,6 @@ class e107 /** * Retrieve user model object. * - * @param integer $user_id target user * @return e_user_extended_structure_tree */ public static function getUserStructure() @@ -2439,6 +2444,11 @@ class e107 } + /** + * @param $type + * @param $val + * @return void + */ public static function set($type=null, $val=true) { if($type === 'js_enabled') @@ -2839,11 +2849,10 @@ class e107 /** * Retrieves class Object for specific plugin's addon such as e_url.php, e_cron.php, e_sitelink.php - * * + * * * @param string $pluginName e.g. faq, page * @param string $addonName eg. e_cron, e_url, e_module * @param mixed $className [optional] true - use default name, false - no object is returned (include only), any string will be used as class name - * @param mixed $param [optional] construct() param * @return object */ public static function getAddon($pluginName, $addonName, $className = true) @@ -3748,7 +3757,7 @@ class e107 * @param string $plugin plugin name * @param string|bool|null $fname filename without the extension part (e.g. 'common') * @param boolean $flat false (default, preferred) Language folder structure; true - prepend Language to file name - * @param boolean $return When true, returns the path, but does not include the file or set the registry. + * @param boolean $returnPath When true, returns the path, but does not include the file or set the registry. * @return bool|null */ public static function plugLan($plugin, $fname = '', $flat = false, $returnPath = false) @@ -4065,7 +4074,9 @@ class e107 /** * Reverse lookup of current URI against legacy e_url entry for the specified plugin. * Useful for when SEF (e_SINGLE_ENTRY) is not in use. - * @param string $route eg. forum/index (must match SEF route ) + * @param string|null $plugin + * @param string|null $uri + * @return string|null */ public static function detectRoute($plugin=null, $uri=null) { @@ -4454,7 +4465,12 @@ class e107 } - public static function minify($js,$options=array()) + /** + * @param $js + * @param $options + * @return mixed|string|null + */ + public static function minify($js, $options=array()) { if(empty($js)) { @@ -5891,6 +5907,10 @@ class e107 } } + /** + * @param $name + * @return array|e107_event|e_admin_log|e_array|e_db|e_online|e_parse|e_render|ecache|eIPHandler|eURL|mixed|notify|user_class|null + */ public function __get($name) { switch ($name) @@ -6107,18 +6127,18 @@ interface e_admin_addon_interface /** - * Extend Admin-ui Parameters - * @param $ui admin-ui object - * @return array - */ + * Extend Admin-ui Parameters + * @param e_admin_ui $ui admin-ui object + * @return array + */ public function config(e_admin_ui $ui); /** - * Process Posted Data. - * @param $ui admin-ui object - * @param int $id - */ + * Process Posted Data. + * @param e_admin_ui $ui admin-ui object + * @param int $id + */ public function process(e_admin_ui $ui, $id=0); diff --git a/e107_handlers/e_customfields_class.php b/e107_handlers/e_customfields_class.php index fd7a531aa..cec33a39d 100644 --- a/e107_handlers/e_customfields_class.php +++ b/e107_handlers/e_customfields_class.php @@ -36,17 +36,26 @@ } + /** + * @return string[] + */ public function getFieldTypes() { return $this->_fieldTypes; } + /** + * @return string + */ public function getTabId() { return $this->_tab_default; } + /** + * @return mixed|string + */ public function getTabLabel() { return $this->_tab[$this->_tab_default]; @@ -115,18 +124,29 @@ } + /** + * @return array + */ public function getConfig() { return $this->_config; } + /** + * @return array + */ public function getData() { return $this->_data; } + /** + * @param $key + * @param $label + * @return $this + */ public function setTab($key, $label) { $this->_tab = array((string) $key => (string) $label); @@ -135,6 +155,11 @@ } + /** + * @param $key + * @param $parm + * @return array|bool|mixed|string|null + */ public function getFieldValue($key, $parm=array()) { $tp = e107::getParser(); @@ -271,6 +296,9 @@ } + /** + * @return string + */ public function renderTest() { @@ -292,7 +320,10 @@ } - + /** + * @param $key + * @return mixed|null + */ public function getFieldTitle($key) { @@ -305,8 +336,10 @@ } - - + /** + * @param $name + * @return string + */ public function renderConfigForm($name) { diff --git a/e107_handlers/e_db_interface.php b/e107_handlers/e_db_interface.php index 01ebd58ec..0b1e029f6 100644 --- a/e107_handlers/e_db_interface.php +++ b/e107_handlers/e_db_interface.php @@ -234,6 +234,10 @@ // Return error number for last operation + + /** + * @return mixed + */ function getLastErrorNumber(); diff --git a/e107_handlers/e_db_legacy_trait.php b/e107_handlers/e_db_legacy_trait.php index 31a6212fd..550bbc9db 100644 --- a/e107_handlers/e_db_legacy_trait.php +++ b/e107_handlers/e_db_legacy_trait.php @@ -13,6 +13,16 @@ trait e_db_legacy { + /** + * @param $table + * @param $fields + * @param $arg + * @param $mode + * @param $debug + * @param $log_type + * @param $log_remark + * @return false|int + */ public function db_Select($table, $fields = '*', $arg = '', $mode = 'default', $debug = false, $log_type = '', $log_remark = '') { trigger_error('$sql->db_Select() is deprecated. Use $sql->select() or $sql->retrieve() instead.', E_USER_DEPRECATED); @@ -20,6 +30,14 @@ } + /** + * @param $tableName + * @param $arg + * @param $debug + * @param $log_type + * @param $log_remark + * @return bool|int|PDOStatement + */ public function db_Insert($tableName, $arg, $debug = false, $log_type = '', $log_remark = '') { trigger_error('$sql->db_Insert() is deprecated. Use $sql->insert() instead.', E_USER_DEPRECATED); @@ -27,6 +45,14 @@ return $this->insert($tableName, $arg, $debug, $log_type, $log_remark); } + /** + * @param $tableName + * @param $arg + * @param $debug + * @param $log_type + * @param $log_remark + * @return bool|int|PDOStatement + */ function db_Update($tableName, $arg, $debug = false, $log_type = '', $log_remark = '') { trigger_error('$sql->db_Update() is deprecated. Use $sql->update() instead.', E_USER_DEPRECATED); @@ -35,12 +61,19 @@ } + /** + * @return void + */ public function db_Close() { $this->close(); } + /** + * @param $type + * @return array|bool + */ public function db_Fetch($type = null) { trigger_error('$sql->db_Fetch() is deprecated. Use $sql->fetch() instead.', E_USER_DEPRECATED); @@ -49,6 +82,14 @@ } + /** + * @param $table + * @param $arg + * @param $debug + * @param $log_type + * @param $log_remark + * @return false|int + */ public function db_Delete($table, $arg = '', $debug = false, $log_type = '', $log_remark = '') { trigger_error('$sql->db_Delete() is deprecated. Use $sql->delete() instead.', E_USER_DEPRECATED); @@ -57,6 +98,14 @@ } + /** + * @param $table + * @param $arg + * @param $debug + * @param $log_type + * @param $log_remark + * @return bool|int|PDOStatement + */ function db_Replace($table, $arg, $debug = false, $log_type = '', $log_remark = '') { trigger_error('$sql->db_Replace() is deprecated. Use $sql->replace() instead.', E_USER_DEPRECATED); @@ -65,6 +114,15 @@ } + /** + * @param $table + * @param $fields + * @param $arg + * @param $debug + * @param $log_type + * @param $log_remark + * @return false|int + */ function db_Count($table, $fields = '(*)', $arg = '', $debug = false, $log_type = '', $log_remark = '') { trigger_error('$sql->db_Count is deprecated. Use $sql->count() instead.', E_USER_DEPRECATED); @@ -72,13 +130,22 @@ } + /** + * @return int + */ function db_Rows() { return $this->rowCount(); } - + /** + * @param $query + * @param $debug + * @param $log_type + * @param $log_remark + * @return bool|int + */ public function db_Select_gen($query, $debug = false, $log_type = '', $log_remark = '') { trigger_error('$sql->db_Select_gen() is deprecated. Use $sql->gen() instead.', E_USER_DEPRECATED); @@ -86,30 +153,58 @@ } - public function db_Table_exists($table,$language='') + /** + * @param $table + * @param $language + * @return bool + */ + public function db_Table_exists($table, $language='') { return $this->isTable($table, $language); } + /** + * @param $mode + * @return array|array[] + */ public function db_TableList($mode='all') { return $this->tables($mode); } + /** + * @param $table + * @param $fieldid + * @param $key + * @param $retinfo + * @return array|bool + */ function db_Field($table, $fieldid = "", $key = "", $retinfo = false) { return $this->field($table, $fieldid, $key, $retinfo); } + /** + * @param $fields + * @param $amount + * @param $maximum + * @param $ordermode + * @return array + */ function db_getList($fields = 'ALL', $amount = false, $maximum = false, $ordermode=false) { return $this->rows($fields, $amount, $maximum, $ordermode); } + /** + * @param $table + * @param $multiple + * @return array|false|string + */ function db_IsLang($table, $multiple=false) { trigger_error('$sql->db_IsLang() is deprecated. Use $sql->hasLanguage() instead.', E_USER_DEPRECATED); @@ -118,6 +213,15 @@ } + /** + * @param $mySQLserver + * @param $mySQLuser + * @param $mySQLpassword + * @param $mySQLdefaultdb + * @param $newLink + * @param $mySQLPrefix + * @return bool|string + */ public function db_Connect($mySQLserver, $mySQLuser, $mySQLpassword, $mySQLdefaultdb, $newLink = false, $mySQLPrefix = MPREFIX) { if(!$this->connect($mySQLserver, $mySQLuser, $mySQLpassword, $newLink)) @@ -133,6 +237,15 @@ return true; } + /** + * @param $table + * @param $vars + * @param $arg + * @param $debug + * @param $log_type + * @param $log_remark + * @return bool|int|PDOStatement + */ public function db_UpdateArray($table, $vars=array(), $arg='', $debug = false, $log_type = '', $log_remark = '') { trigger_error('$sql->db_UpdateArray() is deprecated. Use $sql->update() with "WHERE" instead.', E_USER_DEPRECATED); @@ -156,39 +269,72 @@ return $this->copyRow($table,$fields,$args); } + /** + * @param $oldtable + * @param $newtable + * @param $drop + * @param $data + * @return bool + */ public function db_CopyTable($oldtable, $newtable, $drop = false, $data = false) { return $this->copyTable($oldtable, $newtable, $drop, $data); } + /** + * @param $table + * @param $prefix + * @param $retinfo + * @return array|bool + */ public function db_FieldList($table, $prefix = '', $retinfo = FALSE) { return $this->fields($table, $prefix, $retinfo); } + /** + * @return void + */ public function db_ResetTableList() { return $this->resetTableList(); } + /** + * @return int + */ public function db_QueryCount() { return $this->queryCount(); } + /** + * @param $log_type + * @param $log_remark + * @param $log_query + * @return void + */ public function db_Write_log($log_type = '', $log_remark = '', $log_query = '') { $this->log($log_type, $log_remark, $log_query); } + /** + * @param $mode + * @return void + */ public function db_SetErrorReporting($mode) { $this->setErrorReporting($mode); } + /** + * @param $sMarker + * @return bool|true|null + */ public function db_Mark_Time($sMarker) { return $this->markTime($sMarker); diff --git a/e107_handlers/e_db_pdo_class.php b/e107_handlers/e_db_pdo_class.php index 09f488a7b..5f3a9c3d9 100644 --- a/e107_handlers/e_db_pdo_class.php +++ b/e107_handlers/e_db_pdo_class.php @@ -118,17 +118,27 @@ class e_db_pdo implements e_db } + /** + * @return bool + */ function getPDO() { return true; } + /** + * @param $bool + * @return void + */ function debugMode($bool) { $this->debugMode = (bool) $bool; } + /** + * @return mixed + */ function getMode() { $this->gen('SELECT @@sql_mode'); @@ -204,7 +214,7 @@ class e_db_pdo implements e_db /** * Select the database to use. * @param string $database name - * @param string $table prefix . eg. e107_ + * @param string $prefix prefix . eg. e107_ * @param boolean $multiple set to maintain connection to a secondary database. * @return boolean true when database selection was successful otherwise false. */ @@ -906,6 +916,9 @@ class e_db_pdo implements e_db } + /** + * @return bool|int + */ public function lastInsertId() { $tmp = (int) $this->mySQLaccess->lastInsertId(); @@ -923,6 +936,10 @@ class e_db_pdo implements e_db } + /** + * @param $result + * @return int + */ public function rowCount($result=null) { @@ -967,8 +984,11 @@ class e_db_pdo implements e_db } - - + /** + * @param $tableName + * @param $arg + * @return false|mixed|string + */ private function _prepareUpdateArg($tableName, $arg) { $this->pdoBind = array(); @@ -1091,7 +1111,10 @@ class e_db_pdo implements e_db } - + /** + * @param $arg + * @return array|mixed + */ private function _getTypes(&$arg) { if(isset($arg['_FIELD_TYPES'])) @@ -1556,7 +1579,10 @@ class e_db_pdo implements e_db } - + /** + * @param $matches + * @return string + */ function ml_check($matches) { $table = $this->hasLanguage($matches[1]); @@ -1926,7 +1952,9 @@ class e_db_pdo implements e_db } - + /** + * @return int + */ function columnCount() { /** @var PDOStatement $resource */ @@ -2363,7 +2391,7 @@ class e_db_pdo implements e_db * @param string $newtable * @param bool $drop * @param bool $data - * @return bool|int|PDOStatement|resource + * @return bool|int */ public function copyTable($oldtable, $newtable, $drop = false, $data = false) { @@ -2528,17 +2556,28 @@ class e_db_pdo implements e_db // Return error number for last operation + + /** + * @return int + */ function getLastErrorNumber() { return $this->mySQLlastErrNum; // Number of last error } // Return error text for last operation + + /** + * @return string + */ function getLastErrorText() { return $this->mySQLlastErrText; // Text of last error (empty string if no error) } + /** + * @return void + */ function resetLastError() { $this->mySQLlastErrNum = 0; @@ -2555,7 +2594,9 @@ class e_db_pdo implements e_db } - + /** + * @return void + */ private function setSQLMode() { $this->db_Query("SET SESSION sql_mode='NO_ENGINE_SUBSTITUTION';"); @@ -2581,6 +2622,9 @@ class e_db_pdo implements e_db } + /** + * @return mixed + */ public function getCharset() { return $this->mySQLcharset; diff --git a/e107_handlers/e_emote_class.php b/e107_handlers/e_emote_class.php index 21e70216f..de26a1cf2 100644 --- a/e107_handlers/e_emote_class.php +++ b/e107_handlers/e_emote_class.php @@ -1,6 +1,9 @@ customDirsCache)) $this->populateDirsCache(); foreach ($this->customDirsCache as $dirType => $customDir) @@ -362,7 +366,10 @@ abstract class e_file_inspector implements e_file_inspector_interface return $path; } - private function getValidatedBitmask() + /** + * @return int + */ + private function getValidatedBitmask() { if ($this->validatedBitmask !== null) return $this->validatedBitmask; $constants = (new ReflectionClass(self::class))->getConstants(); @@ -385,7 +392,10 @@ abstract class e_file_inspector implements e_file_inspector_interface return is_file($absolutePath) && is_readable($absolutePath) && !in_array($absolutePath, $this->undeterminable); } - protected function populateDirsCache() + /** + * @return void + */ + protected function populateDirsCache() { $this->defaultDirsCache = e107::getInstance()->defaultDirs(); $customDirs = e107::getInstance()->e107_dirs ? e107::getInstance()->e107_dirs : []; diff --git a/e107_handlers/e_file_inspector_json.php b/e107_handlers/e_file_inspector_json.php index 278bd63b9..c8851428e 100644 --- a/e107_handlers/e_file_inspector_json.php +++ b/e107_handlers/e_file_inspector_json.php @@ -9,6 +9,10 @@ require_once("e_file_inspector.php"); + +/** + * + */ class e_file_inspector_json extends e_file_inspector { protected $coreImage; diff --git a/e107_handlers/e_file_inspector_json_phar.php b/e107_handlers/e_file_inspector_json_phar.php index 2dfe218b7..3aeca8be9 100644 --- a/e107_handlers/e_file_inspector_json_phar.php +++ b/e107_handlers/e_file_inspector_json_phar.php @@ -9,6 +9,10 @@ require_once("e_file_inspector_json.php"); + +/** + * + */ class e_file_inspector_json_phar extends e_file_inspector_json { /** diff --git a/e107_handlers/e_file_inspector_sqlphar.php b/e107_handlers/e_file_inspector_sqlphar.php index 3e6c19678..f4fdf65ef 100644 --- a/e107_handlers/e_file_inspector_sqlphar.php +++ b/e107_handlers/e_file_inspector_sqlphar.php @@ -9,6 +9,10 @@ require_once("e_file_inspector.php"); + +/** + * + */ class e_file_inspector_sqlphar extends e_file_inspector { private $coreImage; diff --git a/e107_handlers/e_marketplace.php b/e107_handlers/e_marketplace.php index c267d87ce..00b7769c6 100644 --- a/e107_handlers/e_marketplace.php +++ b/e107_handlers/e_marketplace.php @@ -11,7 +11,11 @@ */ e107::coreLan('theme', true); - + + +/** + * + */ class e_marketplace { /** @@ -67,7 +71,10 @@ class e_marketplace $this->adapter->setAuthKey($authkey); return $this; } - + + /** + * @return bool + */ public function hasAuthKey() { return $this->adapter->hasAuthKey(); @@ -221,8 +228,11 @@ class e_marketplace } throw new Exception("Error Processing Request", 10); } - + + /** + * + */ public function __destruct() { $this->adapter = null; @@ -292,9 +302,10 @@ class e_marketplace } - - - + /** + * @param $type + * @return array|string[] + */ public function getVersionList($type='plugin') { $cache = e107::getCache(); @@ -346,6 +357,10 @@ class e_marketplace } + +/** + * + */ abstract class e_marketplace_adapter_abstract { /** @@ -378,10 +393,27 @@ abstract class e_marketplace_adapter_abstract * @var string */ protected $authKey = null; - + + /** + * @param $input + * @return mixed + */ abstract public function test($input); //abstract public function call($method, $data, $apply); + + /** + * @param $method + * @param $data + * @param $apply + * @return mixed + */ abstract public function call($method, $data, $apply = true); // Fix issue #490 + + /** + * @param $method + * @param $result + * @return mixed + */ abstract public function fetch($method, &$result); /** @@ -424,16 +456,18 @@ abstract class e_marketplace_adapter_abstract { return $this->authKey; } - - + + /** - * Download a Plugin or Theme to Temp, then test and move to plugin/theme folder and backup to system backup folder. + * Download a Plugin or Theme to Temp, then test and move to plugin/theme folder and backup to system backup folder. * XXX better way to return status (e.g. getError(), getStatus() service call before download) * XXX temp is not well cleaned * XXX themes/plugins not well tested after unzip (example - Headline 1.0, non-default structure, same applies to most FS net free themes) * This method is direct outputting the status. If not needed - use buffer - * @param string $remotefile URL + * @param $id + * @param $mode * @param string $type plugin or theme + * @return bool */ public function download($id, $mode, $type) { @@ -499,6 +533,13 @@ abstract class e_marketplace_adapter_abstract // Grab a remote file and save it in the /temp directory. requires CURL + + /** + * @param $remote_url + * @param $local_file + * @param $type + * @return bool + */ function getRemoteFile($remote_url, $local_file, $type='temp') { // FIXME - different methods (see xml handler getRemoteFile()), error handling, appropriate error messages, @@ -541,6 +582,10 @@ abstract class e_marketplace_adapter_abstract } } + +/** + * + */ class e_marketplace_adapter_wsdl extends e_marketplace_adapter_abstract { /** @@ -594,7 +639,11 @@ class e_marketplace_adapter_wsdl extends e_marketplace_adapter_abstract xdebug_disable(); } } - + + /** + * @param $input + * @return string + */ public function test($input) { try @@ -707,6 +756,9 @@ class e_marketplace_adapter_wsdl extends e_marketplace_adapter_abstract return $result; } + /** + * + */ public function __destruct() { $this->client = null; @@ -714,6 +766,10 @@ class e_marketplace_adapter_wsdl extends e_marketplace_adapter_abstract } } + +/** + * + */ class e_marketplace_adapter_xmlrpc extends e_marketplace_adapter_abstract { /** @@ -734,12 +790,22 @@ class e_marketplace_adapter_xmlrpc extends e_marketplace_adapter_abstract public function __construct() { } - + + /** + * @param $input + * @return void + */ public function test($input) { } - + + /** + * @param $method + * @param $data + * @param $apply + * @return array|string + */ public function call($method, $data, $apply = true) { $client = $this->client(); @@ -785,7 +851,12 @@ class e_marketplace_adapter_xmlrpc extends e_marketplace_adapter_abstract } return $result; } - + + /** + * @param $method + * @param $result + * @return array|string + */ public function fetch($method, &$result) { $ret = $this->parse($result); @@ -961,6 +1032,10 @@ class e_marketplace_adapter_xmlrpc extends e_marketplace_adapter_abstract } } + +/** + * + */ class eAuth { @@ -1029,25 +1104,40 @@ class eAuth * @var string */ public $requestMethod = null; - + + /** + * @return bool + */ public function isClient() { $this->loadSysCredentials(); return (!empty($this->eauthConsumerKey) && !empty($this->eauthConsumerSecret)); } - + + /** + * @return bool + */ public function isInitialized() { $this->loadSysCredentials(); return ($this->isClient() && !empty($this->eauthRequestKey) && !empty($this->eauthRequestSecret)); } - + + /** + * @return bool + */ public function hasAccess() { $this->loadSysCredentials(); return ($this->isClient() && !empty($this->eauthAccessToken) && !empty($this->eauthAccessSecret)); } + /** + * @param $method + * @param $args + * @param $toObject + * @return array|stdClass + */ public function serviceAuthData($method, $args, $toObject = true) { // The client has previously registered with the server and obtained the client identifier dpf43f3p2l4k3l03 and client secret kd94hf93k423kf44. @@ -1094,6 +1184,10 @@ class eAuth } + /** + * @param $array + * @return stdClass + */ public static function toObject($array) { $obj = new stdClass; @@ -1122,7 +1216,11 @@ class eAuth } return $this; } - + + /** + * @param $credentials + * @return bool + */ public function storeSysCredentials($credentials = null) { if(null === $credentials) @@ -1174,7 +1272,12 @@ class eAuth if(null !== $key) return varset($credentials[$key], null); return $credentials; } - + + /** + * @param $params + * @return string + * @throws Exception + */ public function toAuthHeader($params) { $first = true; @@ -1201,14 +1304,21 @@ class eAuth } return $out; } - + + /** + * @return string + */ public function cryptMethod() { return function_exists('hash_hmac') ? 'HMAC-SHA1' : 'SHA1'; } - - function random($bits = 256) + + /** + * @param $bits + * @return string + */ + function random($bits = 256) { $bytes = ceil($bits / 8); $ret = ''; @@ -1218,7 +1328,12 @@ class eAuth } return $ret; } - + + /** + * @param $string + * @param $secretKey + * @return false|string + */ public function crypt($string, $secretKey) { $cMethod = $this->cryptMethod(); @@ -1230,12 +1345,20 @@ class eAuth // use secret key if HMAC-SHA1 return hash_hmac('sha1', $string, $secretKey); } - + + /** + * @param $timestamp + * @return false|string + */ public function nonce($timestamp) { return $this->crypt($this->random().$timestamp, $this->eauthAccessSecret.$this->eauthConsumerSecret); } + /** + * @param $string + * @return false|int + */ public function gmtTime($string) { $ret = false; @@ -1247,6 +1370,11 @@ class eAuth return $ret; } + /** + * @param $array + * @param $order + * @return void + */ public static function array_kmultisort(&$array, $order = 'asc') { $func = $order == 'asc' ? 'ksort' : 'krsort'; diff --git a/e107_handlers/e_parse_class.php b/e107_handlers/e_parse_class.php index 0e7176e43..9c261d5e0 100644 --- a/e107_handlers/e_parse_class.php +++ b/e107_handlers/e_parse_class.php @@ -19,6 +19,9 @@ if (!defined('e107_INIT')) define('E_NL', chr(2)); +/** + * + */ class e_parse { @@ -288,6 +291,10 @@ class e_parse } + /** + * @param string $type + * @return array + */ public function getModifierList($type = '') { if ($type === 'super') @@ -704,6 +711,11 @@ class e_parse return $ret; } + /** + * @param array $array + * @param string $prefix + * @return string + */ private function _processRoute($array, $prefix = '') { $text = []; @@ -730,6 +742,10 @@ class e_parse } + /** + * @param string $text + * @return array|string|string[] + */ public function toForm($text) { @@ -799,6 +815,13 @@ class e_parse } + /** + * @param string $text + * @param $original_author + * @param string $extra + * @param bool $mod + * @return string + */ public function post_toHTML($text, $original_author = false, $extra = '', $mod = false) { @@ -864,6 +887,10 @@ class e_parse } + /** + * @param $tmp + * @return mixed|string|null + */ protected function simpleReplace($tmp) { @@ -1288,6 +1315,11 @@ class e_parse } + /** + * @param $text + * @param $wrap + * @return array|string|string[] + */ public function textclean($text, $wrap = 100) { @@ -1301,8 +1333,10 @@ class e_parse } - // Test for text highlighting, and determine the text highlighting transformation - // Returns TRUE if highlighting is active for this page display + /** + * Test for text highlighting, and determine the text highlighting transformation + * @return bool Returns TRUE if highlighting is active for this page display + */ public function checkHighlighting() { @@ -1338,9 +1372,11 @@ class e_parse * * @param string $text * @param string $type email|url - * @param array $opts options. (see below) - * @param string $opts ['sub'] substitute text within links - * @param bool $opts ['ext'] load link in new window (not for email) + * @param array $opts options. + * $opts = [ + * 'sub' => (string) substitute text within links + * 'ext' => (bool) load link in new window (not for email) + * ] * @return string */ public function makeClickable($text = '', $type = 'email', $opts = array()) @@ -1400,6 +1436,11 @@ class e_parse } + /** + * @param string $text + * @param $postID + * @return string + */ public function parseBBCodes($text, $postID) { @@ -1410,7 +1451,7 @@ class e_parse * Strips block tags from html. * ie.

etc are removed. * - * @param string $text + * @param string $html * @return string */ public function stripBlockTags($html) @@ -1426,6 +1467,11 @@ class e_parse return strip_tags($html, $parm); } + /** + * @param $s + * @param $allowedattr + * @return array|mixed|string|string[] + */ public function stripAttributes($s, $allowedattr = array()) { @@ -1653,11 +1699,6 @@ class e_parse elseif (strpos($sub_blk, '"; - } - $ret_parser .= $sub_blk; } else @@ -1764,6 +1805,10 @@ class e_parse } + /** + * @param string $text + * @return string + */ public function toASCII($text) { @@ -2071,10 +2116,10 @@ class e_parse if (!$sep) { - return preg_replace('/[^-0-9]/', '', $value); + return (int) preg_replace('/[^-0-9]/', '', $value); } - return ( + return (float) ( preg_replace('/[^-0-9]/', '', substr($value, 0, $sep)) . '.' . preg_replace('/[^0-9]/', '', substr($value, $sep + 1, strlen($value))) ); @@ -2152,6 +2197,10 @@ class e_parse } + /** + * @param $val + * @return int|null + */ public function thumbEncode($val = null) { @@ -2325,6 +2374,10 @@ class e_parse } + /** + * @param bool|int $val + * @return int + */ private function staticCount($val = false) { @@ -2440,15 +2493,17 @@ class e_parse * Generate an auto-sized Image URL. * * @param $url - path to image or leave blank for a placeholder. eg. {e_MEDIA}folder/my-image.jpg - * @param array $options - width and height, but leaving this empty and using $this->thumbWidth() and $this->thumbHeight() is preferred. ie. {SETWIDTH: w=x&y=x} - * @param int $options ['w'] width (optional) - * @param int $options ['h'] height (optional) - * @param bool|string $options ['crop'] true/false or A(auto) or T(op) or B(ottom) or C(enter) or L(eft) or R(right) - * @param string $options ['scale'] '2x' (optional) - * @param bool $options ['x'] encode/mask the url parms (optional) - * @param bool $options ['nosef'] when set to true disabled SEF Url being returned (optional) + * @param array $options = [ width and height, but leaving this empty and using $this->thumbWidth() and $this->thumbHeight() is preferred. ie. {SETWIDTH: w=x&y=x} + * 'w' => int width (optional) + * 'h' => int height (optional) + * 'crop' => bool|string true/false or A(auto) or T(op) or B(ottom) or C(enter) or L(eft) or R(right) + * 'scale' => string '2x' (optional) + * 'x' => bool encode/mask the url parms (optional) + * 'nosef' => bool when set to true disabled SEF Url being returned (optional) + * ] * @param bool $raw set to true when the $url does not being with an e107 variable ie. "{e_XXXX}" eg. {e_MEDIA} (optional) * @param bool $full when true returns full http:// url. (optional) + * ] * @return string */ public function thumbUrl($url = null, $options = array(), $raw = false, $full = false) @@ -2712,8 +2767,8 @@ class e_parse $parm['h'] = 0; } - $width = !empty($parm['w']) ? (intval($parm['w']) * $multiInt) : (intval($this->thumbWidth) * $multiInt); - $height = isset($parm['h']) ? (intval($parm['h']) * $multiInt) : (intval($this->thumbHeight) * $multiInt); + $width = !empty($parm['w']) ? (intval($parm['w']) * $multiInt) : ($this->thumbWidth * $multiInt); + $height = isset($parm['h']) ? (intval($parm['h']) * $multiInt) : ($this->thumbHeight * $multiInt); } else @@ -2767,11 +2822,6 @@ class e_parse } - public function thumbUrlScale($src, $parm) - { - - - } /** * Used by thumbUrl when SEF Image URLS is active. @param $url @@ -2927,6 +2977,9 @@ class e_parse } + /** + * @return array + */ public function getEmotes() { @@ -3155,6 +3208,10 @@ class e_parse } + /** + * @param array $matches + * @return mixed|string + */ private function doReplace($matches) { @@ -3346,6 +3403,12 @@ class e_parse //FIXME - $match not used? + + /** + * @param $text + * @param $match + * @return array|string|string[]|null + */ public function e_highlight($text, $match) { @@ -3476,6 +3539,10 @@ class e_parse } + /** + * @param $name + * @return array|e_parse_shortcode|null + */ public function __get($name) { @@ -3642,33 +3709,45 @@ class e_parse $this->scriptAccess = $val; } + /** + * @param array $arr + * @return void + */ public function setScriptAttibutes($arr) { $this->scriptAttributes = (array) $arr; } + /** + * @return array + */ public function getAllowedTags() { - return $this->allowedTags; } + /** + * @return array + */ public function getAllowedAttributes() { - return $this->allowedAttributes; } + /** + * @return bool + */ public function getScriptAccess() { - return $this->scriptAccess; } + /** + * @return array + */ public function getRemoved() { - return $this->removedList; } @@ -3825,7 +3904,7 @@ class e_parse * @param string $cat far|fab|fas * @param string $id eg. fa-search * @param array $parm eg. ['fw'=>true] - * @return array|false|string|string[]|void + * @return string|false */ private function toGlyphEmbed($cat, $id, $parm = array()) { @@ -3853,11 +3932,12 @@ class e_parse * Parse xxxxx.glyph file to bootstrap glyph format. * * @param string $text ie. fa-xxxx, fab-xxx, fas-xxxx - * @param array|string $options - * @param bool $options ['size'] 2x, 3x, 4x, or 5x - * @param bool $options ['fw'] Fixed-Width - * @param bool $options ['spin'] Spin - * @param int $options ['rotate'] Rotate in Degrees. + * @param array|string $options = [ + * 'size' => (string) 2x, 3x, 4x, or 5x + * 'fw' => (bool) Fixed-Width + * 'spin' => (bool) Spin + * 'rotate'=> (int) Rotate in Degrees. + * ] * @example $tp->toGlyph('fab-mailchimp'); * @example $tp->toGlyph('fas-camera'); * @example $tp->toGlyph('fa-spinner', 'spin=1'); @@ -4141,19 +4221,20 @@ class e_parse * Render an avatar based on supplied user data or current user when missing. * * @param array $userData - user data from e107_user. ie. user_image, user_id etc. - * @param array $options - * @param int $options ['w'] - image width in px - * @param int $options ['h'] - image height in px - * @param int|bool $options ['crop'] = enables cropping when true - * @param string $options ['shape'] - (optional) rounded|circle|thumbnail - * @param string $options ['id'] - 'id' attribute will be added to tag. - * @param string $options ['class'] - override default 'class' attribute in tag. - * @param string $options ['alt'] - override default 'alt' attribute in tag. - * @param bool $options ['base64'] - use embedded base64 for image src. - * @param bool $options ['hd'] - double the resolution of the image. Useful for retina displays. - * @param string $options ['type'] - when set to 'url' returns the URL value instead of the tag. - * @param string $options ['style'] - sets the style attribute. - * @param string $options ['mode'] - 'full' url mode. + * @param array $options = [ + * 'w' => (int) image width in px + * 'h' => (int) image height in px + * 'crop' => *int|bool) enables cropping when true + * 'shape' => (string) (optional) rounded|circle|thumbnail + * 'id' => (string) 'id' attribute will be added to tag. + * 'class' => (string) override default 'class' attribute in tag. + * 'alt' => (string) override default 'alt' attribute in tag. + * 'base64' => (bool) use embedded base64 for image src. + * 'hd' => (bool) double the resolution of the image. Useful for retina displays. + * 'type' => (string) when set to 'url' returns the URL value instead of the tag. + * 'style' => (string) sets the style attribute. + * 'mode' => (string) 'full' url mode. + * ] * @return string tag of avatar. */ public function toAvatar($userData = null, $options = array()) @@ -4392,15 +4473,21 @@ class e_parse * Render an img tag. * * @param string $file - * @param array $parm keys: legacy|w|h|alt|class|id|crop|loading - * @param array $parm ['legacy'] Usually a legacy path like {e_FILE} - * @param array $parm ['type'] Force the returned image to be a jpg, webp etc. + * @param array $parm = [ + * 'w' => (int) Width in px + * 'h' => (int) Height in px + * 'alt' => (string) Alt text. + * 'class' => (string) + * 'id' => (string) + * 'loading' => (string) + * 'legacy' => (array) Usually a legacy path like {e_FILE} + * 'type' => (array) Force the returned image to be a jpg, webp etc. + * ] * @return string * @example $tp->toImage('welcome.png', array('legacy'=>{e_IMAGE}newspost_images/','w'=>200)); */ public function toImage($file, $parm = array()) { - if (strpos($file, 'e_AVATAR') !== false) { return "
Use \$tp->toAvatar() instead of toImage() for " . $file . '
'; // debug info only. @@ -4427,7 +4514,6 @@ class e_parse } } - /** @var e_parse $tp */ $tp = $this; // e107::getDebug()->log($file); @@ -4779,7 +4865,7 @@ class e_parse * Display a Video file. * * @param string $file - format: id.type eg. x123dkax.youtube - * @param boolean $thumbnail - set to 'tag' to return an image thumbnail and 'src' to return the src url or 'video' for a small video thumbnail. + * @param array $parm - set to 'tag' to return an image thumbnail and 'src' to return the src url or 'video' for a small video thumbnail. */ public function toVideo($file, $parm = array()) { @@ -5018,6 +5104,8 @@ class e_parse 'version' => '/[^\d_\.]/', ); + $ret = ''; + switch ($type) { case 'w': @@ -5103,6 +5191,9 @@ class e_parse } + /** + * @return void + */ private function grantScriptAccess() { @@ -5124,8 +5215,6 @@ class e_parse } } - - return null; } @@ -5376,6 +5465,11 @@ class e_parse return trim($cleaned); } + /** + * @param $attribute + * @param $value + * @return array|mixed|string|string[] + */ public function secureAttributeValue($attribute, $value) { diff --git a/e107_handlers/e_profanity_class.php b/e107_handlers/e_profanity_class.php index 62ab5ed78..258e02c1a 100644 --- a/e107_handlers/e_profanity_class.php +++ b/e107_handlers/e_profanity_class.php @@ -1,6 +1,9 @@ ranks = array(); @@ -65,6 +72,9 @@ class e_ranks } } + /** + * @return void + */ protected function setDefaultRankData() { e107::coreLan('userclass'); @@ -165,11 +175,18 @@ class e_ranks } + /** + * @return array + */ public function getRankData() { return $this->ranks; } + /** + * @param $info + * @return string + */ private function _getImage(&$info) { $img = $info['image']; @@ -182,6 +199,10 @@ class e_ranks } + /** + * @param $info + * @return mixed|string + */ private function _getName(&$info) { if(!isset($info['name_parsed'])) $info['name_parsed'] = e107::getParser()->toHTML($info['name'], FALSE, 'defs'); @@ -189,6 +210,12 @@ class e_ranks } // TODO - custom ranks (e.g. forum moderator) + + /** + * @param $userId + * @param $moderator + * @return array|mixed + */ function getRanks($userId, $moderator = false) { $e107 = e107::getInstance(); @@ -272,6 +299,11 @@ class e_ranks } // TODO - custom ranking by array key - e.g. user_comments only + + /** + * @param $userData + * @return float + */ private function _calcLevel(&$userData) { $forumCount = varset($userData['user_plugin_forum_posts'], 0) * 5; diff --git a/e107_handlers/e_render_class.php b/e107_handlers/e_render_class.php index 2b1ae6dcb..a0547cad1 100644 --- a/e107_handlers/e_render_class.php +++ b/e107_handlers/e_render_class.php @@ -25,6 +25,10 @@ private $thm; + /** + * @param $adminarea + * @return void + */ public function _init($adminarea=false) { $this->adminarea = (bool) $adminarea; @@ -36,6 +40,10 @@ } // Called in header_default.php. + + /** + * @return void|null + */ public function init() { @@ -345,6 +353,9 @@ } + /** + * @return bool + */ private function hasLegacyCode() { diff --git a/e107_handlers/e_signup_class.php b/e107_handlers/e_signup_class.php index a28fb3f36..311a369aa 100644 --- a/e107_handlers/e_signup_class.php +++ b/e107_handlers/e_signup_class.php @@ -37,6 +37,10 @@ class e_signup } + /** + * @param $query + * @return void|null + */ public function run($query='') { $ns = e107::getRender(); @@ -116,6 +120,9 @@ class e_signup } */ + /** + * @return bool|int|string + */ private function resendEmail() { global $userMethods; @@ -235,8 +242,9 @@ class e_signup } - - + /** + * @return void + */ private function renderResendForm() { $ns = e107::getRender(); @@ -282,8 +290,9 @@ class e_signup } - - + /** + * @return void + */ private function sendEmailPreview() { $temp = array(); @@ -302,6 +311,9 @@ class e_signup } + /** + * @return void + */ function renderEmailPreview() { $ns = e107::getRender(); @@ -314,6 +326,9 @@ class e_signup } + /** + * @return void + */ private function renderAfterSignupPreview() { global $allData; @@ -460,7 +475,10 @@ class e_signup } - + /** + * @param $error_message + * @return array + */ static function renderAfterSignup($error_message='') { diff --git a/e107_handlers/e_thumbnail_class.php b/e107_handlers/e_thumbnail_class.php index 833568469..c9b5a7eb3 100644 --- a/e107_handlers/e_thumbnail_class.php +++ b/e107_handlers/e_thumbnail_class.php @@ -12,6 +12,9 @@ use Intervention\Image\ImageManagerStatic as Image; +/** + * + */ class e_thumbnail { private $_debug = false; @@ -122,6 +125,9 @@ class e_thumbnail $this->_cache = (bool) $val; } + /** + * @return $this + */ private function parseRequest() { @@ -155,6 +161,9 @@ class e_thumbnail $this->_request = (array) $array; } + /** + * @return array|string|string[] + */ private function getImageInfo() { $thumbnfo = pathinfo($this->_src_path); @@ -217,6 +226,9 @@ class e_thumbnail } + /** + * @return $this|false|string|void + */ public function sendImage() { if($this->_placeholder == true) @@ -478,6 +490,9 @@ class e_thumbnail } + /** + * @return array + */ private function getRequestOptions() { $ret = array(); @@ -505,6 +520,10 @@ class e_thumbnail return $ret; } + /** + * @param $thumbnfo + * @return void + */ private function sendHeaders($thumbnfo) { @@ -551,7 +570,10 @@ class e_thumbnail } - + /** + * @param $ftype + * @return mixed|string|null + */ private function ctype($ftype) { static $known_types = array( @@ -573,6 +595,11 @@ class e_thumbnail // Display a placeholder image. + + /** + * @param $parm + * @return void|null + */ private function placeholder($parm) { if($this->_debug === true) diff --git a/e107_handlers/e_upgrade_class.php b/e107_handlers/e_upgrade_class.php index f39f6474c..b66a72783 100644 --- a/e107_handlers/e_upgrade_class.php +++ b/e107_handlers/e_upgrade_class.php @@ -32,24 +32,30 @@ class e_upgrade /** * - * @param string $curFolder - folder name of the plugin or theme to check - * @param string $curVersions - installed version of the plugin or theme. - * @param string $releaseUrl - url of the XML file in the above format. - * @param boolean $cache + * @param $dataArray * @return $this */ - public function setOptions($dataArray) { $this->_options = $dataArray; return $this; } + /** + * @param $key + * @param $default + * @return mixed + */ public function getOption($key, $default = '') { return varset($this->_options[$key], $default); } + /** + * @param $mode + * @param $cache + * @return void + */ public function releaseCheck($mode='plugin', $cache=TRUE) { global $e107cache; @@ -117,10 +123,12 @@ class e_upgrade } - - - function checkAllPlugins() + + /** + * @return void + */ + function checkAllPlugins() { $pref = e107::getPref(); $sql = e107::getDB(); @@ -136,6 +144,9 @@ class e_upgrade } } + /** + * @return void + */ function checkSiteTheme() { $curTheme = e107::getPref('sitetheme'); @@ -146,7 +157,10 @@ class e_upgrade $this->setOptions($options); $this->releaseCheck('theme',FALSE); } - + + /** + * @return void + */ function listLangPacks() { diff --git a/e107_handlers/emailprint_class.php b/e107_handlers/emailprint_class.php index 0a6ea40c2..b3e769201 100644 --- a/e107_handlers/emailprint_class.php +++ b/e107_handlers/emailprint_class.php @@ -19,9 +19,21 @@ if (!defined('e107_INIT')) { exit; } e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE."/lan_print.php"); e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE."/lan_email.php"); -class emailprint + +/** + * + */ +class emailprint { - static function render_emailprint($mode, $id, $look = 0,$parm=array()) + + /** + * @param $mode + * @param $id + * @param $look + * @param $parm + * @return string + */ + static function render_emailprint($mode, $id, $look = 0, $parm=array()) { // $look = 0 --->display all icons // $look = 1 --->display email icon only diff --git a/e107_handlers/event_class.php b/e107_handlers/event_class.php index 1130c5737..91d7b2659 100644 --- a/e107_handlers/event_class.php +++ b/e107_handlers/event_class.php @@ -12,7 +12,9 @@ if (!defined('e107_INIT')) { exit; } - +/** + * + */ class e107_event { var $functions = array(); @@ -42,6 +44,9 @@ class e107_event } + /** + * @return void + */ public function init() { @@ -68,8 +73,11 @@ class e107_event } - + + /** + * @return array[] + */ function coreList() { @@ -123,7 +131,10 @@ class e107_event return $this->coreEvents; } - + + /** + * @return string[] + */ function oldCoreList() { return $this->oldCoreEvents; @@ -154,7 +165,9 @@ class e107_event } - + /** + * @return string + */ function debug() { $text = "

Event Functions

"; @@ -300,6 +313,10 @@ class e107_event * @param string $function identifier for the calling function * @return string $text string of rendered html, or message from db handler */ + /** + * @param $data + * @return array|string + */ function triggerHook($data=array()) { $text = null; diff --git a/e107_handlers/file_class.php b/e107_handlers/file_class.php index d18b9d202..4d4858fe9 100644 --- a/e107_handlers/file_class.php +++ b/e107_handlers/file_class.php @@ -76,7 +76,10 @@ define('FILE_MODIFY_PERMISSIONS', 2); - class e_file +/** + * + */ +class e_file { /** @@ -159,7 +162,11 @@ } - public function setFileFilter($filter) + /** + * @param $filter + * @return $this + */ + public function setFileFilter($filter) { $this->fileFilter = $filter; @@ -195,21 +202,31 @@ return $f; } - function setMode($mode) + /** + * @param $mode + * @return void + */ + function setMode($mode) { $this->mode = $mode; } - public function getErrorMessage() + /** + * @return null + */ + public function getErrorMessage() { return $this->error; } - public function getErrorCode() + /** + * @return null + */ + public function getErrorCode() { return $this->errornum; @@ -1394,36 +1411,36 @@ * * @param string $fileinfo Determines any special handling of file name (combines previous $fileinfo and $avatar parameters): * FALSE - default option; no processing - * @param string $fileinfo = 'attachment+extra_text' Indicates an attachment (related to forum post or PM), and specifies some optional text which is + * = 'attachment+extra_text' Indicates an attachment (related to forum post or PM), and specifies some optional text which is * incorporated into the final file name (the original $fileinfo parameter). - * @param string $fileinfo = 'prefix+extra_text' - indicates an attachment or file, and specifies some optional text which is prefixed to the file name - * @param string $fileinfo = 'unique' + * = 'prefix+extra_text' - indicates an attachment or file, and specifies some optional text which is prefixed to the file name + * = 'unique' * - if the proposed destination file doesn't exist, saved under given name * - if the proposed destination file does exist, prepends time() to the file name to make it unique - * @param string $fileinfo = 'avatar' + * = 'avatar' * - indicates an avatar is being uploaded (not used - options must be set elsewhere) * - * @param array $options An array of supplementary options, all of which will be given appropriate defaults if not defined: - * @param $options ['filetypes'] Name of file containing list of valid file types + * @param array $options = [ An array of supplementary options, all of which will be given appropriate defaults if not defined: + * 'filetypes' => (string) Name of file containing list of valid file types * - Always looks in the admin directory * - defaults to e_ADMIN.filetypes.xml, else e_ADMIN.admin_filetypes.php for admins (if file exists), otherwise e_ADMIN.filetypes.php for users. * - FALSE disables this option (which implies that 'extra_file_types' is used) - * @param string $options ['file_mask'] Comma-separated list of file types which if defined limits the allowed file types to those which are in both this list and the + * 'file_mask' => (string) Comma-separated list of file types which if defined limits the allowed file types to those which are in both this list and the * file specified by the 'filetypes' option. Enables restriction to, for example, image files. - * @param bool $options ['extra_file_types'] - if is FALSE or undefined, rejects totally unknown file extensions (even if in $options['filetypes'] file). + * 'filetypes' => (bool) file). * if TRUE, accepts totally unknown file extensions which are in $options['filetypes'] file. * otherwise specifies a comma-separated list of additional permitted file extensions - * @param int $options ['final_chmod'] - chmod() to be applied to uploaded files (0644 default) (This routine expects an integer value, so watch formatting/decoding - its normally + * 'final_chmod' => (int) - chmod() to be applied to uploaded files (0644 default) (This routine expects an integer value, so watch formatting/decoding - its normally * specified in octal. Typically use intval($permissions,8) to convert) - * @param int $options ['max_upload_size'] - maximum size of uploaded files in bytes, or as a string with a 'multiplier' letter (e.g. 16M) at the end. + * 'max_upload_size' => (int) - maximum size of uploaded files in bytes, or as a string with a 'multiplier' letter (e.g. 16M) at the end. * - otherwise uses $pref['upload_maxfilesize'] if set * - overriding limit of the smaller of 'post_max_size' and 'upload_max_size' if set in php.ini * (Note: other parts of E107 don't understand strings with a multiplier letter yet) - * @param string $options ['file_array_name'] - the name of the 'input' array - defaults to file_userfile[] - otherwise as set. - * @param int $options ['max_file_count'] - maximum number of files which can be uploaded - default is 'unlimited' if this is zero or not set. - * @param bool $options ['overwrite'] - if TRUE, existing file of the same name is overwritten; otherwise returns 'duplicate file' error (default FALSE) - * @param int $options ['save_to_db'] - [obsolete] storage type - if set and TRUE, uploaded files were saved in the database (rather than as flat files) - * + * 'file_array_name' => (string) - the name of the 'input' array - defaults to file_userfile[] - otherwise as set. + * 'max_file_count' => (int) - maximum number of files which can be uploaded - default is 'unlimited' if this is zero or not set. + * 'overwrite' => (bool) - if TRUE, existing file of the same name is overwritten; otherwise returns 'duplicate file' error (default FALSE) + * 'save_to_db' => (int) - [obsolete] storage type - if set and TRUE, uploaded files were saved in the database (rather than as flat files) + * ] * @return boolean|array * Returns FALSE if the upload directory doesn't exist, or various other errors occurred which restrict the amount of meaningful information. * Returns an array, with one set of entries per uploaded file, regardless of whether saved or @@ -1873,7 +1890,12 @@ } - private function matchFound($file, $array) + /** + * @param $file + * @param $array + * @return bool + */ + private function matchFound($file, $array) { if(empty($array)) @@ -2227,7 +2249,10 @@ } - private function getMimeTypes() + /** + * @return string[] + */ + private function getMimeTypes() { return array( 'asc' => 'text/plain', diff --git a/e107_handlers/form_handler.php b/e107_handlers/form_handler.php index d75ee6bc3..0aad12489 100644 --- a/e107_handlers/form_handler.php +++ b/e107_handlers/form_handler.php @@ -84,6 +84,9 @@ class e_form */ protected $tp; + /** + * @param $enable_tabindex + */ public function __construct($enable_tabindex = false) { e107::loadAdminIcons(); // required below. @@ -129,6 +132,10 @@ class e_form } + /** + * @param $field + * @return void + */ public function addWarning($field) { $this->_field_warnings[] = $field; @@ -1003,7 +1010,13 @@ class e_form } - + /** + * @param string $name + * @param string $value + * @param int $maxlength + * @param array $options + * @return string + */ public function email($name, $value, $maxlength = 200, $options = array()) { $options['type'] = 'email'; @@ -1011,7 +1024,13 @@ class e_form } - + /** + * @param $id + * @param $default + * @param $width + * @param $height + * @return string + */ public function iconpreview($id, $default, $width='', $height='') // FIXME { unset($width,$height); // quick fix @@ -2056,7 +2075,13 @@ class e_form return e107::getRate()->render($table, $id, $options); } - + + /** + * @param $table + * @param $id + * @param $options + * @return string + */ public function like($table, $id, $options=null) { $table = preg_replace('/\W/', '', $table); @@ -2561,6 +2586,13 @@ class e_form } + /** + * @param string $snippet + * @param array $options + * @param string $name + * @param int|string $value + * @return string + */ private function renderSnippet($snippet, $options, $name, $value) { $snip = (array) $options; @@ -2733,18 +2765,40 @@ class e_form return $text; } - + + /** + * @param string $label_title + * @param string $name + * @param $value + * @param mixed $checked + * @param array $options + * @return string + */ public function checkbox_label($label_title, $name, $value, $checked = false, $options = array()) { return $this->checkbox($name, $value, $checked, $options).$this->label($label_title, $name, $value); } + /** + * @param $name + * @param $value + * @param $checked + * @param $label + * @return string + */ public function checkbox_switch($name, $value, $checked = false, $label = '') { return $this->checkbox($name, $value, $checked).$this->label($label ?: LAN_ENABLED, $name, $value); } + /** + * @param $name + * @param $selector + * @param $id + * @param $label + * @return string + */ public function checkbox_toggle($name, $selector = 'multitoggle', $id = false, $label='') //TODO Fixme - labels will break this. Don't use checkbox, use html. { $selector = 'jstarget:'.$selector; @@ -2756,6 +2810,13 @@ class e_form return $this->checkbox($name, $selector, false, array('id' => $id,'class' => 'checkbox checkbox-inline toggle-all','label'=>$label)); } + /** + * @param $name + * @param $current_value + * @param $uc_options + * @param $field_options + * @return string + */ public function uc_checkbox($name, $current_value, $uc_options, $field_options = array()) { if(!is_array($field_options)) @@ -2806,6 +2867,14 @@ class e_form } + /** + * @param string $classnum Class Number + * @return string + */ + /** + * @param $classnum + * @return string + */ public function uc_label($classnum) { return $this->_uc->getName($classnum); @@ -2817,7 +2886,7 @@ class e_form * @param $value * @param $checked boolean * @param null $options - * @return array|string|string[] + * @return string */ public function radio($name, $value, $checked = false, $options = null) { @@ -3115,7 +3184,12 @@ class e_form $for_id = $this->_format_id('', $name, $value, 'for'); return "{$text}"; } - + + + /** + * @param $text + * @return string|null + */ public function help($text) { if(empty($text) || $this->_helptip === 0) @@ -3130,6 +3204,11 @@ class e_form return $ret; } + /** + * @param $name + * @param $options + * @return string + */ public function select_open($name, $options = array()) { @@ -3182,9 +3261,10 @@ class e_form * @param string $name * @param array|string $option_array * @param boolean $selected [optional] - * @param string|array $options [optional] - * @param bool $options['useValues'] when true uses array values as the key. - * @param array $options['disabled'] list of $option_array keys which should be disabled. eg. array('key_1', 'key_2'); + * @param string|array $options = [ + * 'useValues' => (bool) when true uses array values as the key. + * 'disabled' => (array) list of $option_array keys which should be disabled. eg. array('key_1', 'key_2'); + * ] * @param bool|string $defaultBlank [optional] set to TRUE if the first entry should be blank, or to a string to use it for the blank description. * @return string HTML text for display */ @@ -3250,9 +3330,9 @@ class e_form * @param string $name - form element name * @param int $curval - current userclass value(s) as array or comma separated. * @param string $type - checkbox|dropdown default is dropdown. - * @param string|array $options - classlist or query string or key=value pair. - * @param string $options['options'] comma-separated list of display options. 'options=admin,mainadmin,classes&vetted=1&exclusions=0' etc. - * + * @param string|array $options = [ classlist or query string or key=value pair. + * 'options' => (string) comma-separated list of display options. 'options=admin,mainadmin,classes&vetted=1&exclusions=0' etc. + * ] * @example $frm->userclass('name', 0, 'dropdown', 'classes'); // display all userclasses * @example $frm->userclass('name', 0, 'dropdown', 'classes,matchclass'); // display only classes to which the user belongs. * @return string form element(s) @@ -3408,6 +3488,14 @@ var_dump($select_options);*/ } // Callback for vetted_tree - Creates the option list for a selection box + + /** + * @param $treename + * @param $classnum + * @param $current_value + * @param $nest_level + * @return string + */ public function _uc_select_cb($treename, $classnum, $current_value, $nest_level) { $classIndex = abs($classnum); // Handle negative class values @@ -3439,6 +3527,12 @@ var_dump($select_options);*/ } + /** + * @param $label + * @param $disabled + * @param $options + * @return string + */ public function optgroup_open($label, $disabled = false, $options = null) { return "\n"; @@ -3579,19 +3673,28 @@ var_dump($select_options);*/ } - - - + /** + * @return string + */ public function optgroup_close() { return "\n"; } + /** + * @return string + */ public function select_close() { return ''; } + /** + * @param $name + * @param $value + * @param $options + * @return string + */ public function hidden($name, $value, $options = array()) { $options = $this->format_options('hidden', $name, $options); @@ -3616,6 +3719,12 @@ var_dump($select_options);*/ ]) . " />"; } + /** + * @param $name + * @param $value + * @param $options + * @return string + */ public function submit($name, $value, $options = array()) { $options = $this->format_options('submit', $name, $options); @@ -3627,6 +3736,14 @@ var_dump($select_options);*/ ]) . $this->get_attributes($options, $name, $value) . ' />'; } + /** + * @param $name + * @param $value + * @param $image + * @param $title + * @param $options + * @return string + */ public function submit_image($name, $value, $image, $title='', $options = array()) { $tp = $this->tp; @@ -3735,9 +3852,10 @@ var_dump($select_options);*/ /** * Render a Breadcrumb in Bootstrap format. - * @param array $array - * @param $array[url] - * @param $array[text] + * @param array $array =[ + * 'url' => (string) + * 'text' => (string) + * ] * @param bool $force - used internally to prevent duplicate {--BREADCUMB---} and template breadcrumbs from both displaying at once. */ public function breadcrumb($array, $force = false) @@ -4009,6 +4127,9 @@ var_dump($select_options);*/ return $class; } + /** + * @return int + */ public function getNext() { if(!$this->_tabindex_enabled) @@ -4019,6 +4140,9 @@ var_dump($select_options);*/ return $this->_tabindex_counter; } + /** + * @return int + */ public function getCurrent() { if(!$this->_tabindex_enabled) @@ -4028,6 +4152,10 @@ var_dump($select_options);*/ return $this->_tabindex_counter; } + /** + * @param $reset + * @return void + */ public function resetTabindex($reset = 0) { $this->_tabindex_counter = $reset; @@ -4046,6 +4174,12 @@ var_dump($select_options);*/ return $this->tp->toAttributes($attributes, true); } + /** + * @param $options + * @param $name + * @param $value + * @return string + */ public function get_attributes($options, $name = '', $value = '') { $ret = ''; @@ -4196,6 +4330,10 @@ var_dump($select_options);*/ return " $return_attribute='" . htmlentities($ret, ENT_QUOTES) . "'"; } + /** + * @param $name + * @return string + */ public function name2id($name) { $name = strtolower($name); @@ -4344,6 +4482,12 @@ var_dump($select_options);*/ return $def_options; } + /** + * @param $columnsArray + * @param $columnsDefault + * @param $id + * @return string + */ public function columnSelector($columnsArray, $columnsDefault = array(), $id = 'column_options') { $columnsArray = array_filter($columnsArray); @@ -4409,17 +4553,13 @@ var_dump($select_options);*/ */ return $text; } - - - - - - - - - - + + /** + * @param $fieldarray + * @param $columnPref + * @return string + */ public function colGroup($fieldarray, $columnPref = '') { $text = ''; @@ -4443,6 +4583,13 @@ var_dump($select_options);*/ '; } + /** + * @param $fieldarray + * @param $columnPref + * @param $querypattern + * @param $requeststr + * @return string + */ public function thead($fieldarray, $columnPref = array(), $querypattern = '', $requeststr = '') { $text = ''; @@ -4581,9 +4728,10 @@ var_dump($select_options);*/ /** * Render Related Items for the current page/news-item etc. - * @param string $type : comma separated list. ie. plugin folder names. + * @param array $parm : comma separated list. ie. plugin folder names. * @param string $tags : comma separated list of keywords to return related items of. - * @param array $curVal. eg. array('page'=> current-page-id-value); + * @param array $curVal. eg. array('page'=> current-page-id-value); + * @param string $template */ public function renderRelated($parm, $tags, $curVal, $template=null) //XXX TODO Cache! { @@ -4982,6 +5130,12 @@ var_dump($select_options);*/ } + /** + * @param $parms + * @param $id + * @param $attributes + * @return string + */ private function renderOptions($parms, $id, $attributes) { $tp = $this->tp; @@ -6252,11 +6406,12 @@ var_dump($select_options);*/ * Auto-render Form Element * @param string $key * @param mixed $value - * @param array $attributes field attributes including render parameters, element options - see e_admin_ui::$fields for required format - * #param array (under construction) $required_data required array as defined in e_model/validator - * @param mixed $attributes['writeParms']['default'] default value when empty (or default option when type='dropdown') - * @param mixed $attributes['writeParms']['defaultValue'] default option value when type='dropdown' - * @param mixed $attributes['writeParms']['empty'] default value when value is empty (dropdown and hidden only right now) + * @param array $attributes = [ field attributes including render parameters, element options - see e_admin_ui::$fields for required format + * #param array (under construction) $required_data required array as defined in e_model/validator + * 'default' => (mixed) default value when empty (or default option when type='dropdown') + * 'defaultValue' => (mixed) default option value when type='dropdown' + * 'empty' => (mixed) default value when value is empty (dropdown and hidden only right now) + * ] * @return string */ public function renderElement($key, $value, $attributes, $required_data = array(), $id = 0) @@ -7043,7 +7198,13 @@ var_dump($select_options);*/ return $text; } - private function imageradio($name,$value,$parms) + /** + * @param $name + * @param $value + * @param $parms + * @return string + */ + private function imageradio($name, $value, $parms) { if(!empty($parms['path'])) @@ -7117,7 +7278,7 @@ var_dump($select_options);*/ * TODO - move fieldset & table generation in separate methods, needed for ajax calls * @todo {@see htmlspecialchars()} at the template, not in the client code * @param array $form_options - * @param e_admin_tree_model $tree_model + * @param e_admin_tree_model $tree_models * @param boolean $nocontainer don't enclose form in div container * @return string */ @@ -8066,6 +8227,16 @@ var_dump($select_options);*/ */ class form { + + /** + * @param $form_method + * @param $form_action + * @param $form_name + * @param $form_target + * @param $form_enctype + * @param $form_js + * @return string + */ public function form_open($form_method, $form_action, $form_name = '', $form_target = '', $form_enctype = '', $form_js = '') { $method = ($form_method ? "method='".$form_method."'" : ''); @@ -8074,6 +8245,17 @@ class form return "\n
' .e107::getForm()->token(). '
'; } + /** + * @param $form_name + * @param $form_size + * @param $form_value + * @param $form_maxlength + * @param $form_class + * @param $form_readonly + * @param $form_tooltip + * @param $form_js + * @return string + */ public function form_text($form_name, $form_size, $form_value, $form_maxlength = FALSE, $form_class = 'tbox form-control', $form_readonly = '', $form_tooltip = '', $form_js = '') { $name = ($form_name ? " id='".$form_name."' name='".$form_name."'" : ''); $value = (isset($form_value) ? " value='".$form_value."'" : ''); @@ -8084,6 +8266,17 @@ class form return "\n'; } + /** + * @param $form_name + * @param $form_size + * @param $form_value + * @param $form_maxlength + * @param $form_class + * @param $form_readonly + * @param $form_tooltip + * @param $form_js + * @return string + */ public function form_password($form_name, $form_size, $form_value, $form_maxlength = FALSE, $form_class = 'tbox form-control', $form_readonly = '', $form_tooltip = '', $form_js = '') { $name = ($form_name ? " id='".$form_name."' name='".$form_name."'" : ''); $value = (isset($form_value) ? " value='".$form_value."'" : ''); @@ -8094,6 +8287,15 @@ class form return "\n'; } + /** + * @param $form_type + * @param $form_name + * @param $form_value + * @param $form_js + * @param $form_image + * @param $form_tooltip + * @return string + */ public function form_button($form_type, $form_name, $form_value, $form_js = '', $form_image = '', $form_tooltip = '') { $name = ($form_name ? " id='".$form_name."' name='".$form_name."'" : ''); $image = ($form_image ? " src='".$form_image."' " : ''); @@ -8101,6 +8303,18 @@ class form return "\n'; } + /** + * @param $form_name + * @param $form_columns + * @param $form_rows + * @param $form_value + * @param $form_js + * @param $form_style + * @param $form_wrap + * @param $form_readonly + * @param $form_tooltip + * @return string + */ public function form_textarea($form_name, $form_columns, $form_rows, $form_value, $form_js = '', $form_style = '', $form_wrap = '', $form_readonly = '', $form_tooltip = '') { $name = ($form_name ? " id='".$form_name."' name='".$form_name."'" : ''); $readonly = ($form_readonly ? " readonly='readonly'" : ''); @@ -8110,6 +8324,14 @@ class form return "\n'; } + /** + * @param $form_name + * @param $form_value + * @param $form_checked + * @param $form_tooltip + * @param $form_js + * @return string + */ public function form_checkbox($form_name, $form_value, $form_checked = 0, $form_tooltip = '', $form_js = '') { $name = ($form_name ? " id='".$form_name.$form_value."' name='".$form_name."'" : ''); $checked = ($form_checked ? " checked='checked'" : ''); @@ -8118,6 +8340,14 @@ class form } + /** + * @param $form_name + * @param $form_value + * @param $form_checked + * @param $form_tooltip + * @param $form_js + * @return string + */ public function form_radio($form_name, $form_value, $form_checked = 0, $form_tooltip = '', $form_js = '') { $name = ($form_name ? " id='".$form_name.$form_value."' name='".$form_name."'" : ''); $checked = ($form_checked ? " checked='checked'" : ''); @@ -8126,30 +8356,60 @@ class form } + /** + * @param $form_name + * @param $form_size + * @param $form_tooltip + * @param $form_js + * @return string + */ public function form_file($form_name, $form_size, $form_tooltip = '', $form_js = '') { $name = ($form_name ? " id='".$form_name."' name='".$form_name."'" : ''); $tooltip = ($form_tooltip ? " title='".$form_tooltip."'" : ''); return "'; } + /** + * @param $form_name + * @param $form_js + * @return string + */ public function form_select_open($form_name, $form_js = '') { return "\n"; } + /** + * @param $form_option + * @param $form_selected + * @param $form_value + * @param $form_js + * @return string + */ public function form_option($form_option, $form_selected = '', $form_value = '', $form_js = '') { $value = ($form_value !== FALSE ? " value='".$form_value."'" : ''); $selected = ($form_selected ? " selected='selected'" : ''); return "\n' .$form_option. ''; } + /** + * @param $form_name + * @param $form_value + * @return string + */ public function form_hidden($form_name, $form_value) { return "\n"; } + /** + * @return string + */ public function form_close() { return "\n"; } diff --git a/e107_handlers/iphandler_class.php b/e107_handlers/iphandler_class.php index d60ce0685..811fb84e9 100644 --- a/e107_handlers/iphandler_class.php +++ b/e107_handlers/iphandler_class.php @@ -189,6 +189,10 @@ class eIPHandler // Continue here - user not banned (so far) } + /** + * @param $ip + * @return void + */ public function setIP($ip) { $this->ourIP = $this->ipEncode($ip); @@ -196,6 +200,10 @@ class eIPHandler } + /** + * @param $value + * @return void + */ public function debug($value) { $this->debug = $value === true; @@ -1116,7 +1124,9 @@ class eIPHandler } - + /** + * @return false|string + */ public function getConfigDir() { return $this->ourConfigDir; diff --git a/e107_handlers/js_helper.php b/e107_handlers/js_helper.php index f0b404ece..32e9dd88a 100644 --- a/e107_handlers/js_helper.php +++ b/e107_handlers/js_helper.php @@ -15,6 +15,10 @@ * */ + +/** + * + */ class e_jshelper { /** @@ -77,7 +81,8 @@ class e_jshelper * will add array('category-clear','update-category') to ['element-invoke-by-id']['show'] stack * * @param string $action - * @param array $data_array item data for the action + * @param string $subaction + * @param array $data item data for the action * @return e_jshelper */ public function addResponseItem($action, $subaction, $data) @@ -261,13 +266,12 @@ class e_jshelper } return implode('', $content['text']['body']); } - - /** - * Add content (optional) and send text response - * - * @param string $action optional - * @param array $data_array optional - */ + + /** + * Add content (optional) and send text response + * + * @param string $data_text + */ public function sendTextResponse($data_text = '') { header('Content-type: text/html; charset='.CHARSET); @@ -278,15 +282,15 @@ class e_jshelper } exit; } - - /** - * Send Server Response - * Sends the response based on $response_type or the system - * prefered response type (could be system preference in the future) - * - * @param string $action optional Action - * @return boolean success - */ + + /** + * Send Server Response + * Sends the response based on $response_type or the system + * prefered response type (could be system preference in the future) + * + * @param string $response_type + * @return boolean success + */ public function sendResponse($response_type = '') { if(!$response_type) diff --git a/e107_handlers/js_manager.php b/e107_handlers/js_manager.php index 9455e4591..fa7082492 100644 --- a/e107_handlers/js_manager.php +++ b/e107_handlers/js_manager.php @@ -422,7 +422,7 @@ class e_jsmanager /** * Add CSS code to site header * - * @param string|array $js_content + * @param string|array $css_content * @param string $media (not implemented yet) any valid media attribute string - http://www.w3schools.com/TAGS/att_link_media.asp * @return e_jsmanager */ @@ -595,7 +595,8 @@ class e_jsmanager * * @param string $plugname * @param string $file_path relative to plugin root folder - * @param integer $zone 1-5 (see header.php) - REMOVED, actually we need to prevent zone change + * @param string $pre + * @param string $post * @return e_jsmanager */ public function headerPlugin($plugname, $file_path, $pre, $post) @@ -704,18 +705,30 @@ class e_jsmanager $this->addJs('settings', $js_settings); return $this; } - - + + + /** + * @param $dep + * @return void + */ function setDependency($dep) { $this->_dependence = $dep; } - + + /** + * @return void + */ public function resetDependency() { $this->_dependence = null; } + /** + * @param $name + * @param $value + * @return void + */ public function set($name, $value) { $this->$name = $value; @@ -761,7 +774,12 @@ class e_jsmanager return false; } - + + /** + * @param $rlocation + * @param $libs + * @return $this|void + */ public function checkLibDependence($rlocation, $libs = null) { $opts = [ @@ -2101,6 +2119,11 @@ class e_jsmanager return (isset($this->_lastModified[$what]) ? $this->_lastModified[$what] : 0); } + /** + * @param $mod + * @param $array_newlib + * @return $this + */ public function addLibPref($mod, $array_newlib) { @@ -2149,6 +2172,11 @@ class e_jsmanager return $this; } + /** + * @param $mod + * @param $array_removelib + * @return $this + */ public function removeLibPref($mod, $array_removelib) { diff --git a/e107_handlers/jslib_handler.php b/e107_handlers/jslib_handler.php index 43823df72..74ea93cff 100644 --- a/e107_handlers/jslib_handler.php +++ b/e107_handlers/jslib_handler.php @@ -14,6 +14,10 @@ */ global $pref, $eplug_admin; + +/** + * + */ class e_jslib { diff --git a/e107_handlers/language_class.php b/e107_handlers/language_class.php index f7eb8c3de..3910bbdae 100644 --- a/e107_handlers/language_class.php +++ b/e107_handlers/language_class.php @@ -674,13 +674,11 @@ class language{ } - /** * Set Language-specific Constants * FIXME - language detection is a mess - db handler, mysql handler, session handler and language handler + constants invlolved, * SIMPLIFY, test, get feedback - * @param string $language - * @return + * @return void */ function setDefs() { @@ -715,7 +713,11 @@ class language{ define("e_LANQRY", false); } } - + + /** + * @param $force + * @return array + */ public function getLanSelectArray($force = false) { if($force ||null === $this->_select_array) diff --git a/e107_handlers/library_manager.php b/e107_handlers/library_manager.php index 28d8fa4d0..d3a7e214f 100755 --- a/e107_handlers/library_manager.php +++ b/e107_handlers/library_manager.php @@ -1116,6 +1116,9 @@ class e_library_manager { } + /** + * @return array + */ public function getCallbackLog() { return $this->callbacks; diff --git a/e107_handlers/login.php b/e107_handlers/login.php index 185c2dad4..e7a0882de 100644 --- a/e107_handlers/login.php +++ b/e107_handlers/login.php @@ -54,6 +54,10 @@ class userlogin $this->userMethods = e107::getUserSession(); } + /** + * @param $area + * @return void + */ public function setSecureImageMode($area) { $modes = array( @@ -345,6 +349,9 @@ class userlogin } + /** + * @return array + */ public function getUserData() { return $this->userData; @@ -513,6 +520,9 @@ class userlogin } + /** + * @return array + */ public function test() { diff --git a/e107_handlers/magpie_rss.php b/e107_handlers/magpie_rss.php index f492c9f46..45c2ec3d1 100644 --- a/e107_handlers/magpie_rss.php +++ b/e107_handlers/magpie_rss.php @@ -142,8 +142,14 @@ class MagpieRSS { $this->normalize(); } - - function feed_start_element($p, $element, $attrs) { + + /** + * @param $p + * @param $element + * @param $attrs + * @return void + */ + function feed_start_element($p, $element, $attrs) { $el = $element = strtolower($element); $attrs = array_change_key_case($attrs, CASE_LOWER); @@ -254,10 +260,14 @@ class MagpieRSS { array_unshift($this->stack, $el); } } - - - function feed_cdata ($p, $text) { + + /** + * @param $p + * @param $text + * @return void + */ + function feed_cdata ($p, $text) { if ($this->feed_type == ATOM and $this->incontent) { @@ -268,8 +278,13 @@ class MagpieRSS { $this->append($current_el, $text); } } - - function feed_end_element ($p, $el) { + + /** + * @param $p + * @param $el + * @return void + */ + function feed_end_element ($p, $el) { $el = strtolower($el); if ( $el == 'item' or $el == 'entry' ) @@ -313,17 +328,25 @@ class MagpieRSS { $this->current_namespace = false; } - - function concat (&$str1, $str2 = "") { + + /** + * @param $str1 + * @param $str2 + * @return void + */ + function concat (&$str1, $str2 = "") { if (!isset($str1) ) { $str1 = ""; } $str1 .= $str2; } - - - - function append_content($text) { + + + /** + * @param $text + * @return void + */ + function append_content($text) { if ( $this->initem ) { $this->concat( $this->current_item[ $this->incontent ], $text ); } @@ -333,7 +356,13 @@ class MagpieRSS { } // smart append - field and namespace aware - function append($el, $text) { + + /** + * @param $el + * @param $text + * @return void + */ + function append($el, $text) { if (!$el) { return; } @@ -376,8 +405,11 @@ class MagpieRSS { } } - - function normalize () { + + /** + * @return void + */ + function normalize () { // if atom populate rss fields if ( $this->is_atom() ) { $this->channel['description'] = $this->channel['tagline']; @@ -425,9 +457,12 @@ class MagpieRSS { } } } - - - function is_rss () { + + + /** + * @return false + */ + function is_rss () { if ( $this->feed_type == RSS ) { return $this->feed_version; } @@ -435,8 +470,11 @@ class MagpieRSS { return false; } } - - function is_atom() { + + /** + * @return false + */ + function is_atom() { if ( $this->feed_type == ATOM ) { return $this->feed_version; } @@ -546,8 +584,12 @@ class MagpieRSS { return array(xml_parser_create(), $source); } - - function known_encoding($enc) { + + /** + * @param $enc + * @return false|string + */ + function known_encoding($enc) { $enc = strtoupper($enc); if ( in_array($enc, $this->_KNOWN_ENCODINGS) ) { return $enc; @@ -557,7 +599,12 @@ class MagpieRSS { } } - function error ($errormsg, $lvl=E_USER_WARNING) { + /** + * @param $errormsg + * @param $lvl + * @return void + */ + function error ($errormsg, $lvl=E_USER_WARNING) { // append PHP's error message if track_errors enabled /* if ( $php_errormsg ) { $errormsg .= " ({$php_errormsg})"; @@ -580,11 +627,20 @@ class MagpieRSS { } // end class RSS +/** + * @param $k + * @param $v + * @return string + */ function map_attrs($k, $v) { return "$k=\"$v\""; } -function parse_w3cdtf ( $date_str ) { +/** + * @param $date_str + * @return false|float|int + */ +function parse_w3cdtf ($date_str ) { # regex to match wc3dtf $pat = "/(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(:(\d{2}))?(?:([-+])(\d{2}):?(\d{2})|(Z))?/"; diff --git a/e107_handlers/mail.php b/e107_handlers/mail.php index c8bd99dec..42067d520 100644 --- a/e107_handlers/mail.php +++ b/e107_handlers/mail.php @@ -146,6 +146,10 @@ require_once(e_HANDLER.'vendor/autoload.php'); // Directory for log (if enabled) define('MAIL_LOG_PATH',e_LOG); + +/** + * + */ class e107Email extends PHPMailer { private $general_opts = array(); @@ -806,6 +810,10 @@ class e107Email extends PHPMailer } + /** + * @param $eml + * @return mixed + */ function processShortcodes($eml) { $tp = e107::getParser(); @@ -1191,6 +1199,10 @@ class e107Email extends PHPMailer } + /** + * @param $val + * @return void + */ function setDebug($val) { $this->debug = $val; @@ -1396,9 +1408,19 @@ function handlePHPMailerDebug($str) // Generic e107 Exception handler //-------------------------------------- // Overrides the default handler - start of a more general handler -class e107Exception extends Exception + + +/** + * + */ +class e107Exception extends Exception { - public function __construct($message = '', $code = 0) + + /** + * @param $message + * @param $code + */ + public function __construct($message = '', $code = 0) { parent::__construct($message, $code); diff --git a/e107_handlers/mail_manager_class.php b/e107_handlers/mail_manager_class.php index b15dfd1e4..b2fa47191 100644 --- a/e107_handlers/mail_manager_class.php +++ b/e107_handlers/mail_manager_class.php @@ -116,6 +116,9 @@ define('MAIL_STATUS_HELD', 21); // Held pending release define('MAIL_STATUS_TEMP', 22); // Tags entries which aren't yet in any list +/** + * + */ class e107MailManager { @@ -1316,6 +1319,12 @@ class e107MailManager } + /** + * @param $id + * @param $type + * @param $count + * @return false|mixed + */ public function updateCounter($id, $type, $count) { diff --git a/e107_handlers/mail_validation_class.php b/e107_handlers/mail_validation_class.php index b147fa25e..ae31cb92f 100644 --- a/e107_handlers/mail_validation_class.php +++ b/e107_handlers/mail_validation_class.php @@ -10,6 +10,10 @@ if (!defined('e107_INIT')) { exit; } * */ + +/** + * + */ class email_validation_class { var $email_regular_expression="^([-!#\$%&'*+./0-9=?A-Z^_`a-z{|}~])+@([-!#\$%&'*+/0-9=?A-Z^_`a-z{|}~]+\\.)+[a-zA-Z]{2,6}\$"; @@ -26,7 +30,12 @@ class email_validation_class var $preg; var $last_code=""; - Function Tokenize($string,$separator="") + /** + * @param $string + * @param $separator + * @return mixed|string + */ + Function Tokenize($string, $separator="") { if(!strcmp($separator,"")) { @@ -50,6 +59,10 @@ class email_validation_class } } + /** + * @param $message + * @return void + */ Function OutputDebug($message) { $message.="\n"; @@ -59,6 +72,10 @@ class email_validation_class flush(); } + /** + * @param $connection + * @return int|string + */ Function GetLine($connection) { for($line="";;) @@ -78,13 +95,22 @@ class email_validation_class } } - Function PutLine($connection,$line) + /** + * @param $connection + * @param $line + * @return false|int + */ + Function PutLine($connection, $line) { if($this->debug) $this->OutputDebug("C $line"); return(fwrite($connection,"$line\r\n")); } + /** + * @param $email + * @return false|int + */ Function ValidateEmailAddress($email) { if(IsSet($this->preg)) @@ -100,7 +126,12 @@ class email_validation_class return(preg_match("/".str_replace("/", "\\/", $this->email_regular_expression)."/i", $email)/*!=0*/); } - Function ValidateEmailHost($email,&$hosts) + /** + * @param $email + * @param $hosts + * @return bool|int + */ + Function ValidateEmailHost($email, &$hosts) { if(!$this->ValidateEmailAddress($email)) return(0); @@ -128,7 +159,12 @@ class email_validation_class return(count($hosts)!=0); } - Function VerifyResultLines($connection,$code) + /** + * @param $connection + * @param $code + * @return int + */ + Function VerifyResultLines($connection, $code) { while(($line=$this->GetLine($connection))) { @@ -141,6 +177,10 @@ class email_validation_class return(-1); } + /** + * @param $email + * @return bool|int + */ Function ValidateEmailBox($email) { if(!$this->ValidateEmailHost($email,$hosts)) diff --git a/e107_handlers/mailout_admin_class.php b/e107_handlers/mailout_admin_class.php index 7856efc92..f3c42ec7f 100644 --- a/e107_handlers/mailout_admin_class.php +++ b/e107_handlers/mailout_admin_class.php @@ -36,6 +36,9 @@ define('MAIL_ADMIN_DEBUG', true); require_once(e_HANDLER . 'mail_manager_class.php'); +/** + * + */ class mailoutAdminClass extends e107MailManager { @@ -524,8 +527,8 @@ class mailoutAdminClass extends e107MailManager * Generate the HTML for displaying actions box for emails * * Options given depend on $mode, and also values in the email data. - * - * @param $mailData - array of email-related info + * @param string $mode + * @param $targetData - array of email-related info * @return string HTML for display */ public function makeTargetOptions($mode, $targetData) @@ -1338,7 +1341,7 @@ class mailoutAdminClass extends e107MailManager /** * Show a screen to confirm deletion of an email * - * @param $mailid - number of email + * @param $mailID - number of email * @param $nextPage - 'mode' specification for page to return to following delete * @return void for display */ @@ -2185,6 +2188,11 @@ class mailoutAdminClass extends e107MailManager } + /** + * @param $pref + * @param $id + * @return string + */ public static function mailerPrefsTable($pref, $id = 'mailer') { diff --git a/e107_handlers/mailout_class.php b/e107_handlers/mailout_class.php index 9e8f6c36d..7d90ce268 100644 --- a/e107_handlers/mailout_class.php +++ b/e107_handlers/mailout_class.php @@ -35,6 +35,10 @@ It is the responsibility of each class to manager permission restrictions where $mailerIncludeWithDefault = TRUE; // Mandatory - if false, show only when mailout for this specific plugin is enabled $mailerExcludeDefault = TRUE; // Mandatory - if TRUE, when this plugin's mailout is active, the default (core) isn't loaded + +/** + * + */ class core_mailout { protected $mailCount = 0; diff --git a/e107_handlers/media_class.php b/e107_handlers/media_class.php index 9527b162e..3de716ebc 100644 --- a/e107_handlers/media_class.php +++ b/e107_handlers/media_class.php @@ -16,6 +16,9 @@ if (!defined('e107_INIT')) { exit; } use Intervention\Image\ImageManagerStatic as Intervension; +/** + * Media class. + */ class e_media { protected $imagelist = array(); @@ -55,6 +58,10 @@ class e_media } + /** + * @param $val + * @return void + */ public function debug($val) { @@ -365,7 +372,11 @@ class e_media { // TODO }*/ - + + /** + * @param (string) $owner + * @return bool|null + */ public function deleteAllCategories($owner='') { if($owner == '') @@ -663,6 +674,12 @@ class e_media } + /** + * @param $category + * @param $tagid + * @param $option + * @return string + */ private function mediaSelectNav($category, $tagid='', $option=null) { if(is_string($option)) @@ -1134,8 +1151,11 @@ class e_media } - - + /** + * @param (string) $mime + * @param (string) $path (optional) + * @return false|string + */ public function getPath($mime, $path=null) { $mes = e107::getMessage(); @@ -1262,8 +1282,10 @@ class e_media } - - + /** + * @param (string) $sc_path + * @return array|false + */ public function mediaData($sc_path) { if(!$sc_path) return array(); @@ -1293,17 +1315,12 @@ class e_media 'media_dimensions' => (isset($info['img-width']) && isset($info['img-height'])) ? $info['img-width']." x ".$info['img-height'] : '' ); } - - - - - - - - - - + + /** + * @param $message + * @return void + */ public function log($message) { if($this->logging == false) return; @@ -1474,6 +1491,14 @@ class e_media } + /** + * @param (array) $data = [ + * 'close' => (int) + * 'style' => (string) + * 'class' => (string) + * ] + * @return string + */ private function browserCarouselItemSelector($data) { // $close = (E107_DEBUG_LEVEL > 0) ? "" : " data-close='true' "; // @@ -1497,7 +1522,11 @@ class e_media } - + + /** + * @param array $row + * @return string + */ function browserCarouselItem($row = array()) { $tp = e107::getParser(); @@ -2368,7 +2397,15 @@ class e_media } - private function ajaxUploadLog($filePath,$fileName,$fileSize,$result, $msg='') + /** + * @param string $filePath + * @param string $fileName + * @param int $fileSize + * @param bool $result + * @param string $msg + * @return void + */ + private function ajaxUploadLog($filePath, $fileName, $fileSize, $result, $msg='') { $log = e107::getParser()->filter($_GET); diff --git a/e107_handlers/menu_class.php b/e107_handlers/menu_class.php index cdb6febf4..4d54a775c 100644 --- a/e107_handlers/menu_class.php +++ b/e107_handlers/menu_class.php @@ -443,6 +443,9 @@ class e_menu } + /** + * @return bool + */ protected function isFrontPage() { return e_REQUEST_SELF == SITEURL; diff --git a/e107_handlers/menumanager_class.php b/e107_handlers/menumanager_class.php index 85ecd94ba..7d950dd43 100644 --- a/e107_handlers/menumanager_class.php +++ b/e107_handlers/menumanager_class.php @@ -13,6 +13,10 @@ if (!defined('e107_INIT')) { exit; } $frm = e107::getForm(); e107::coreLan('menus', true); + +/** + * + */ class e_menuManager { @@ -30,7 +34,10 @@ class e_menuManager public $dbLayout = ''; private $menuData = array(); - function __construct($dragdrop=FALSE) + /** + * @param $dragdrop + */ + function __construct($dragdrop=FALSE) { global $HEADER,$FOOTER, $NEWSHEADER; $pref = e107::getPref(); @@ -197,6 +204,10 @@ class e_menuManager // ------------------------------------------------------------------------- + /** + * @param $url + * @return string + */ function menuRenderIframe($url='') { $ns = e107::getRender(); @@ -216,6 +227,9 @@ class e_menuManager } + /** + * @return array|string + */ function menuRenderMessage() { // return $this->menuMessage; @@ -225,6 +239,12 @@ class e_menuManager } + /** + * @param $message + * @param $type + * @param $session + * @return void + */ function menuAddMessage($message, $type = E_MESSAGE_INFO, $session = false) { e107::getMessage()->add(array($message, 'menuUi'), $type, $session); @@ -232,7 +252,10 @@ class e_menuManager // ------------------------------------------------------------------------- - function menuGrabLayout() + /** + * @return void + */ + function menuGrabLayout() { global $HEADER,$FOOTER,$CUSTOMHEADER,$CUSTOMFOOTER,$LAYOUT; @@ -300,7 +323,10 @@ class e_menuManager } - function menuGoConfig() + /** + * @return void + */ + function menuGoConfig() { if(!$_GET['path'] || ($_GET['mode'] != "conf")) { @@ -325,7 +351,10 @@ class e_menuManager // ----------------------------------------------------------------------------- - function menuModify() + /** + * @return void + */ + function menuModify() { $sql = e107::getDb(); $tp = e107::getParser(); @@ -393,6 +422,9 @@ class e_menuManager // ---------------------------------------------------------------------------- + /** + * @return false|mixed + */ function menuSetPreset() { global $location; @@ -440,6 +472,9 @@ class e_menuManager // ---------------------------------------------------------------------------- + /** + * @return void + */ function menuScanMenus() { global $sql2; @@ -593,7 +628,11 @@ class e_menuManager // --------------------------------------------------------------------------- - function menuPresetPerms($val) + /** + * @param $val + * @return int|mixed + */ + function menuPresetPerms($val) { $link_class = strtolower(trim((string) $val)); $menu_perm['everyone'] = e_UC_PUBLIC; @@ -607,7 +646,15 @@ class e_menuManager return $link_class; } - private function menuParamForm($id, $fields,$tabs, e_form $ui, $values=array()) + /** + * @param $id + * @param $fields + * @param $tabs + * @param e_form $ui + * @param $values + * @return string + */ + private function menuParamForm($id, $fields, $tabs, e_form $ui, $values=array()) { $fields['menu_id'] = array('type'=>'hidden', 'writeParms'=>array('value'=>$id)); $fields['mode'] = array('type'=>'hidden', 'writeParms'=>array('value'=>'parms')); @@ -787,6 +834,9 @@ class e_menuManager } + /** + * @return string|void + */ function menuVisibilityOptions() { if(!vartrue($_GET['vis'])) return; @@ -875,6 +925,9 @@ class e_menuManager // ----------------------------------------------------------------------------- + /** + * @return void + */ function menuActivate() // Activate Multiple Menus. { $sql = e107::getDb(); @@ -921,6 +974,10 @@ class e_menuManager // ----------------------------------------------------------------------------- + /** + * @param $array + * @return void + */ function menuSetCustomPages($array) { $pref = e107::getPref(); @@ -932,6 +989,9 @@ class e_menuManager // ------------------------------------------------------------------------------ + /** + * @return false|mixed + */ function getMenuPreset() { $pref = e107::getPref(); @@ -971,7 +1031,12 @@ class e_menuManager // ------------------------------------------------------------------------------ - function checkMenuPreset($array,$name) + /** + * @param $array + * @param $name + * @return false|mixed|void + */ + function checkMenuPreset($array, $name) { if(!is_array($array)) { @@ -989,7 +1054,10 @@ class e_menuManager } // -------------------------------------------------------------------------- - + + /** + * @return array + */ function menuSaveParameters() { $sql = e107::getDb(); @@ -1051,6 +1119,9 @@ class e_menuManager // -------------------------------------------------------------------------- + /** + * @return array + */ function menuSaveVisibility() // Used by Ajax { $tp = e107::getParser(); @@ -1085,6 +1156,10 @@ class e_menuManager } + /** + * @param $id + * @return void + */ function setMenuId($id) { $this->menuId = intval($id); @@ -1092,6 +1167,9 @@ class e_menuManager // ----------------------------------------------------------------------- + /** + * @return array + */ function menuDeactivate() { @@ -1171,7 +1249,11 @@ class e_menuManager // =----------------------------------------------------------------------------- - + + /** + * @param $row + * @return string + */ function renderOptionRow($row) { $frm = e107::getForm(); @@ -1221,12 +1303,11 @@ class e_menuManager return $text; } - - - - - + + /** + * @return void + */ function menuRenderPage() { global $HEADER, $FOOTER, $rs; @@ -1413,6 +1494,11 @@ class e_menuManager } */ //------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------// + /** + * @param $LAYOUT + * @param $check + * @return array|void + */ function parseheader($LAYOUT, $check = FALSE) { @@ -1461,7 +1547,12 @@ class e_menuManager return $str; } } - + + /** + * @param $matches + * @param $ret + * @return void + */ function menuSetCode($matches, &$ret) { if(!$matches || !vartrue($matches[1])) @@ -1474,8 +1565,13 @@ class e_menuManager $ret[] = $match; } } - - function renderPanel($caption,$text) + + /** + * @param $caption + * @param $text + * @return string + */ + function renderPanel($caption, $text) { $plugtext = "