diff --git a/classes/context/Context.class.php b/classes/context/Context.class.php index 06d766fec..ef96466d0 100644 --- a/classes/context/Context.class.php +++ b/classes/context/Context.class.php @@ -719,10 +719,9 @@ class Context * Append string to browser title * * @param string $title Browser title to be appended - * @param string $delimiter * @return void */ - public static function addBrowserTitle($title, $delimiter = ' - ') + public static function addBrowserTitle($title) { if(!$title) { @@ -730,7 +729,7 @@ class Context } if(self::$_instance->browser_title) { - self::$_instance->browser_title .= $delimiter . $title; + self::$_instance->browser_title .= ' - ' . $title; } else { @@ -742,10 +741,9 @@ class Context * Prepend string to browser title * * @param string $title Browser title to be prepended - * @param string $delimiter * @return void */ - public static function prependBrowserTitle($title, $delimiter = ' - ') + public static function prependBrowserTitle($title) { if(!$title) { @@ -753,7 +751,7 @@ class Context } if(self::$_instance->browser_title) { - self::$_instance->browser_title = $title . $delimiter . self::$_instance->browser_title; + self::$_instance->browser_title = $title . ' - ' . self::$_instance->browser_title; } else { @@ -905,7 +903,7 @@ class Context * Return string accoring to the inputed code * * @param string $code Language variable name - * @return mixed + * @return string If string for the code exists returns it, otherwise returns original code */ public static function getLang($code) { @@ -1022,7 +1020,7 @@ class Context * @param string $key * @param mixed $charset charset * @see arrayConvWalkCallback will replaced array_walk_recursive in >=PHP5 - * @return ?bool + * @return void */ public static function checkConvertFlag(&$val, $key = null, $charset = null) { @@ -1051,7 +1049,7 @@ class Context * @param string $key * @param string $charset character set * @see arrayConvWalkCallback will replaced array_walk_recursive in >=PHP5 - * @return void + * @return object converted object */ public static function doConvertEncoding(&$val, $key = null, $charset = 'CP949') { @@ -1317,7 +1315,7 @@ class Context * * @return void */ - public static function setUploadInfo() + private static function setUploadInfo() { if (!isset($_SERVER['REQUEST_METHOD']) || $_SERVER['REQUEST_METHOD'] !== 'POST' || !$_FILES) { @@ -1619,12 +1617,10 @@ class Context } /** - * Display a generic error page. + * Display a generic error page and exit. * * @param string $title * @param string $message - * @param int $status - * @param string $location * @return void */ public static function displayErrorPage($title = 'Error', $message = '', $status = 500, $location = '') @@ -1967,7 +1963,7 @@ class Context * * @param string $key Key * @param mixed $val Value - * @param bool $replace_request_arg + * @param mixed $replace_request_arg * @return void */ public static function set($key, $val, $replace_request_arg = false) @@ -2024,20 +2020,17 @@ class Context /** * Get one more vars in object vars with given arguments(key1, key2, key3,...) * - * @return ?object + * @return object */ public static function gets() { - $args_list = func_get_args(); - if (count($args_list) < 1) + $num_args = func_num_args(); + if($num_args < 1) { return; } - if (count($args_list) === 1 && is_array($args_list[0])) - { - $args_list = $args_list[0]; - } + $args_list = func_get_args(); $output = new stdClass; self::$_user_vars = self::$_user_vars !== null ? self::$_user_vars : new stdClass; foreach($args_list as $key) @@ -3010,7 +3003,7 @@ class Context * Add OpenGraph metadata * * @param string $name - * @param array $content + * @param mixed $content * @return void */ public static function addOpenGraphData($name, $content) @@ -3047,6 +3040,6 @@ class Context */ public static function getCanonicalURL() { - return self::$_instance->canonical_url ?? ''; + return self::$_instance->canonical_url; } } diff --git a/classes/frontendfile/FrontEndFileHandler.class.php b/classes/frontendfile/FrontEndFileHandler.class.php index a530ee3ce..f98958256 100644 --- a/classes/frontendfile/FrontEndFileHandler.class.php +++ b/classes/frontendfile/FrontEndFileHandler.class.php @@ -205,13 +205,13 @@ class FrontEndFileHandler extends Handler * Get file information * * @param string $fileName The file name - * @param string $unused Formerly targetIe + * @param string $targetIe Target IE of file * @param string $media Media of file * @param array $vars Variables for LESS and SCSS * @param bool $forceMinify Whether this file should be minified * @return stdClass The file information */ - protected function getFileInfo($fileName, $unused = '', $media = 'all', $vars = array(), $isCommon = false) + protected function getFileInfo($fileName, $targetIe = '', $media = 'all', $vars = array(), $isCommon = false) { $pathInfo = pathinfo($fileName); @@ -423,13 +423,13 @@ class FrontEndFileHandler extends Handler * Unload front end file * * @param string $fileName The file name to unload - * @param string $unused Formerly targetIe + * @param string $targetIe Target IE of file to unload * @param string $media Media of file to unload. Only use when file is css. * @return void */ - public function unloadFile($fileName, $unused = '', $media = 'all') + public function unloadFile($fileName, $targetIe = '', $media = 'all') { - $file = $this->getFileInfo($fileName, $unused, $media); + $file = $this->getFileInfo($fileName, $targetIe, $media); if($file->fileExtension == 'css') { diff --git a/classes/module/ModuleHandler.class.php b/classes/module/ModuleHandler.class.php index b23d108f5..0a00ad038 100644 --- a/classes/module/ModuleHandler.class.php +++ b/classes/module/ModuleHandler.class.php @@ -49,7 +49,7 @@ class ModuleHandler extends Handler * prepares variables to use in moduleHandler * @param string $module name of module * @param string $act name of action - * @param string $mid + * @param int $mid * @param int $document_srl * @param int $module_srl * @return void diff --git a/classes/module/ModuleObject.class.php b/classes/module/ModuleObject.class.php index a736136f4..f77996e99 100644 --- a/classes/module/ModuleObject.class.php +++ b/classes/module/ModuleObject.class.php @@ -128,7 +128,7 @@ class ModuleObject extends BaseObject * setter to set an url for redirection * * @param string|array $url url for redirection - * @return object + * @return $this */ public function setRedirectUrl($url = './', $output = NULL) { @@ -151,7 +151,7 @@ class ModuleObject extends BaseObject /** * get url for redirection * - * @return ?string + * @return string */ public function getRedirectUrl() { @@ -546,7 +546,7 @@ class ModuleObject extends BaseObject /** * retrieve the directory path of the template directory * - * @return ?string + * @return string */ public function getTemplateFile() { @@ -577,7 +577,7 @@ class ModuleObject extends BaseObject /** * retrieve the directory path of the template directory * - * @return ?string + * @return string */ public function getTemplatePath() { @@ -600,7 +600,7 @@ class ModuleObject extends BaseObject /** * retreived the file name of edited_layout_file * - * @return ?string + * @return string */ public function getEditedLayoutFile() { @@ -622,7 +622,7 @@ class ModuleObject extends BaseObject /** * get the file name of the layout file * - * @return ?string + * @return string */ public function getLayoutFile() { @@ -653,9 +653,9 @@ class ModuleObject extends BaseObject /** * set the directory path of the layout directory * - * @return ?string + * @return string */ - public function getLayoutPath() + public function getLayoutPath($layout_name = "", $layout_type = "P") { return $this->layout_path; } diff --git a/common/functions.php b/common/functions.php index 72b3e9e5b..7ddb59b59 100644 --- a/common/functions.php +++ b/common/functions.php @@ -11,7 +11,7 @@ * * @param string $key * @param string $value (optional) - * @return string|array|null + * @return mixed */ function config(string $key, $value = null) { @@ -256,7 +256,7 @@ function escape_dqstr(string $str): string * @param string $escape_char The escape character (default: backslash) * @return array */ -function explode_with_escape(string $delimiter, string $str, int $limit = 0, string $escape_char = '\\'): array +function explode_with_escape(string $delimiter, string $str, $limit = 0, $escape_char = '\\'): array { if ($limit < 1) $limit = 0; $str = (string)$str; @@ -417,7 +417,7 @@ function base64_decode_urlsafe(string $str): string /** * This function shortens a number using common suffixes. * - * @param int|float $number The number to shorten + * @param int $number The number to shorten * @param int $significant_digits The number of significant digits to retain * @return string */ diff --git a/common/js/common.js b/common/js/common.js index 4c30996d7..e4c9602f4 100644 --- a/common/js/common.js +++ b/common/js/common.js @@ -279,7 +279,6 @@ Rhymix.redirectToUrl = function(url) { * @param string url * @param string target * @param string features - * @return void */ Rhymix.openWindow = function(url, target, features) { diff --git a/common/legacy.php b/common/legacy.php index d1499de9d..f236ae67b 100644 --- a/common/legacy.php +++ b/common/legacy.php @@ -232,7 +232,6 @@ function getNextSequence(): int /** * Set Sequence number to session * - * @deprecated * @param int $seq sequence number * @return void */ @@ -249,7 +248,6 @@ function setUserSequence($seq): void /** * Check Sequence number grant * - * @deprecated * @param int $seq sequence number * @return bool */ @@ -315,7 +313,6 @@ function getNotEncodedUrl(): string /** * Get a encoded url. If url is encoded, not encode. Otherwise html encode the url. * - * @deprecated * @see getUrl() * @return string */ @@ -389,7 +386,6 @@ function getNotEncodedFullUrl(): string * getSiteUrl() returns the URL by transforming the given argument value of domain * The first argument should consist of domain("http://" not included) and path * - * @deprecated * @return string */ function getSiteUrl(): string @@ -412,7 +408,6 @@ function getSiteUrl(): string * getSiteUrl() returns the not encoded URL by transforming the given argument value of domain * The first argument should consist of domain("http://" not included) and path * - * @deprecated * @return string */ function getNotEncodedSiteUrl(): string @@ -434,7 +429,6 @@ function getNotEncodedSiteUrl(): string /** * Return the value adding request uri to the getSiteUrl() To get the full url * - * @deprecated * @return string */ function getFullSiteUrl(): string @@ -474,7 +468,6 @@ function getCurrentPageUrl($escape = true): string /** * Return if domain of the virtual site is url type or id type * - * @deprecated * @param string $domain * @return bool */ @@ -547,7 +540,6 @@ function cut_str($string, $cut_size = 0, $tail = '...'): string /** * Convert XE legacy time zone format into UTC offset. * - * @deprecated * @param string $time_zone Time zone in '+0900' format * @return int */ @@ -559,7 +551,6 @@ function get_time_zone_offset($timezone): int /** * Get the offset between the current user's time zone and Rhymix's internal time zone. * - * @param ?int $timestamp (optional) * @return int */ function zgap($timestamp = null): int @@ -780,7 +771,6 @@ function getMonthName(int $month, bool $short = true): string /** * Returns encoded value of given email address for email scraping * - * @deprecated * @param string $email The email * @return string */ @@ -814,7 +804,6 @@ function debugPrint($value, ...$values): void /** * Delete the second object vars from the first argument * - * @deprecated * @param object $target_obj An original object * @param object $del_obj Object vars to delete from the original object * @return object @@ -837,7 +826,6 @@ function delObjectVars($target_obj, $del_obj): object /** * Delete variables that are commonly submitted but don't need to be saved. * - * @deprecated * @param array|object $vars * @return array|object */ @@ -883,7 +871,6 @@ function getNumberingPath($no, int $size = 3): string /** * Sanitize HTML content. * - * @deprecated * @param string $content Target content * @return string */ @@ -895,7 +882,6 @@ function removeHackTag($content): string /** * Get whether utf8 or not given string * - * @deprecated * @param string $string * @param bool $return_convert If set, returns converted string * @param bool $urldecode @@ -923,18 +909,17 @@ function detectUTF8($string, $return_convert = FALSE, $urldecode = TRUE) /** * Get is current user crawler * - * @param ?string $user_agent if set, use this value instead HTTP_USER_AGENT + * @param string $agent if set, use this value instead HTTP_USER_AGENT * @return bool */ -function isCrawler($user_agent = null): bool +function isCrawler($agent = null): bool { - return Rhymix\Framework\UA::isRobot($user_agent); + return Rhymix\Framework\UA::isRobot($agent); } /** * Remove embed media for admin * - * @deprecated * @param string $content * @param int $writer_member_srl * @return void @@ -975,9 +960,6 @@ function stripEmbedTagForAdmin(&$content, $writer_member_srl): void /** * Check for CSRF attacks * - * Use Rhymix\Framework\Security::checkCSRF() instead. - * - * @deprecated * @return bool */ function checkCSRF(): bool @@ -987,8 +969,6 @@ function checkCSRF(): bool /** * menu exposure check by isShow column - * - * @deprecated * @param array $menu * @return void */ @@ -1014,7 +994,6 @@ function recurciveExposureCheck(&$menu): void /** * Alias to hex2rgb() * - * @deprecated * @param string $hexstr * @return array */ @@ -1122,7 +1101,7 @@ if(!function_exists('mb_strlen')) */ if(!function_exists('mb_strpos')) { - function mb_strpos($haystack, $needle, $offset = 0, $charset = null) + function mb_strpos($haystack, $needle, $offset, $charset = null) { if(function_exists('iconv_strpos')) { @@ -1260,7 +1239,6 @@ function reload($isOpener = FALSE): void * @param string $errstr * @param string $file * @param int $line - * @param array $context * @return void */ function handleError($errno, $errstr, $file, $line, $context): void diff --git a/tests/unit/functions/FunctionsTest.php b/tests/unit/functions/FunctionsTest.php index 410221fa7..000fe451f 100644 --- a/tests/unit/functions/FunctionsTest.php +++ b/tests/unit/functions/FunctionsTest.php @@ -75,7 +75,7 @@ class FunctionsTest extends \Codeception\Test\Unit $this->assertEquals(array('foo', 'bar,baz'), explode_with_escape(',', 'foo,bar\\,baz')); $this->assertEquals(array('foo', 'bar\\', 'baz'), explode_with_escape(',', 'foo,bar\\ , baz')); $this->assertEquals(array('foo', 'bar,baz', 'rhymix'), explode_with_escape(',', 'foo,bar\\,baz,rhymix')); - $this->assertEquals(array('foo', 'bar,baz'), explode_with_escape(',', 'foo,bar!,baz', 0, '!')); + $this->assertEquals(array('foo', 'bar,baz'), explode_with_escape(',', 'foo,bar!,baz', null, '!')); } public function testStartsEndsContains()