From 8bda064c44ef272a607cb830b1129185d89338bc Mon Sep 17 00:00:00 2001 From: Demis Palma Date: Wed, 25 May 2016 17:10:08 +0100 Subject: [PATCH 1/2] Fixed parameters and return types --- .../libraries/rules/framework.php | 10 ++++---- .../com_jedchecker/libraries/rules/jamss.php | 24 +++++++++---------- .../components/com_jedchecker/models/rule.php | 4 ++-- 3 files changed, 18 insertions(+), 20 deletions(-) diff --git a/source/administrator/components/com_jedchecker/libraries/rules/framework.php b/source/administrator/components/com_jedchecker/libraries/rules/framework.php index 870c8a6..d41430f 100755 --- a/source/administrator/components/com_jedchecker/libraries/rules/framework.php +++ b/source/administrator/components/com_jedchecker/libraries/rules/framework.php @@ -70,7 +70,7 @@ class JedcheckerRulesFramework extends JEDcheckerRule /** * Check if the given resourse is part * - * @param unknown_type $file The file name to test + * @param string $file The file name to test * * @return boolean */ @@ -95,7 +95,7 @@ class JedcheckerRulesFramework extends JEDcheckerRule /** * reads a file and searches for any function defined in the params * - * @param unknown_type $file The file object + * @param string $file The file name * * @return boolean True if the statement was found, otherwise False. */ @@ -118,9 +118,9 @@ class JedcheckerRulesFramework extends JEDcheckerRule /** * runs tests and reports to the appropriate function if strings match. * - * @param unknown_type $file The file object - * @param unknown_type $content The file content - * @param unknown_type $testObject The test object generated by getTests() + * @param string $file The file name + * @param array $content The file content + * @param object $testObject The test object generated by getTests() * * @return boolean */ diff --git a/source/administrator/components/com_jedchecker/libraries/rules/jamss.php b/source/administrator/components/com_jedchecker/libraries/rules/jamss.php index 61931b0..b327727 100755 --- a/source/administrator/components/com_jedchecker/libraries/rules/jamss.php +++ b/source/administrator/components/com_jedchecker/libraries/rules/jamss.php @@ -67,7 +67,7 @@ class JedcheckerRulesJamss extends JEDcheckerRule /** * reads a file and searches for any function defined in the params * - * @param unknown_type $file The file object + * @param string $file The file name * * @return boolean True if the statement was found, otherwise False. */ @@ -86,11 +86,9 @@ class JedcheckerRulesJamss extends JEDcheckerRule * In order to make this easy to update, no syntax changes are applied. Just store the variables in the object * for faster use. * - * @param unknown_type $deepscan Join the $jamssDeepSearchStrings - * - * @return nothing + * @return void */ - private function init_jamss($deepscan = true) + private function init_jamss() { /* * START OF JAMSS CODE (approx line 76) @@ -269,7 +267,7 @@ class JedcheckerRulesJamss extends JEDcheckerRule * * @param string $path path of the scanned file * - * @return nothing + * @return bool */ private function scan_file($path) { @@ -391,7 +389,7 @@ class JedcheckerRulesJamss extends JEDcheckerRule * Calculates the line number where pattern match was found * * @param int $offset The offset position of found pattern match - * @param str $file_content The file content in string format + * @param string $file_content The file content in string format * * @return int Returns line number where the subject code was found */ @@ -408,13 +406,13 @@ class JedcheckerRulesJamss extends JEDcheckerRule * Raise a warning and format it properly. * jamss warnings are very helpful but very verbose; hence we chose to use of tooltips * - * @param unknown_type $path The file name - * @param unknown_type $title The comment's title - * @param unknown_type $info The additional info on the error - * @param unknown_type $code The affected portion of the code - * @param unknown_type $line The line number of the first match + * @param string $path The file name + * @param string $title The comment's title + * @param mixed $info The additional info on the error + * @param string $code The affected portion of the code + * @param int $line The line number of the first match * - * @return unknown_type Returns nothing + * @return void Returns nothing */ private function jamssWarning($path, $title, $info, $code, $line) { diff --git a/source/administrator/components/com_jedchecker/models/rule.php b/source/administrator/components/com_jedchecker/models/rule.php index c869206..13f25ed 100644 --- a/source/administrator/components/com_jedchecker/models/rule.php +++ b/source/administrator/components/com_jedchecker/models/rule.php @@ -99,7 +99,7 @@ class JEDcheckerRule extends JObject /** * Attempts to load a .ini param file of this rule. * - * @return JRegistry + * @return Joomla\Registry\Registry */ protected function loadParams() { @@ -107,7 +107,7 @@ class JEDcheckerRule extends JObject $file_name = str_replace('jedcheckerrules', '', strtolower(get_class($this))); $params_file = JPATH_COMPONENT_ADMINISTRATOR . '/libraries/rules/' . $file_name . '.ini'; - $params = JRegistry::getInstance('jedchecker.rule.' . $file_name); + $params = Joomla\Registry\Registry::getInstance('jedchecker.rule.' . $file_name); // Load the params from the ini file if (file_exists($params_file)) From b71ffdfc7ff7f80cbe14820988ea28f2f12e5996 Mon Sep 17 00:00:00 2001 From: Demis Palma Date: Fri, 27 May 2016 01:15:15 +0100 Subject: [PATCH 2/2] Reverted the deepscan parameter --- .../components/com_jedchecker/libraries/rules/jamss.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/administrator/components/com_jedchecker/libraries/rules/jamss.php b/source/administrator/components/com_jedchecker/libraries/rules/jamss.php index b327727..2644866 100755 --- a/source/administrator/components/com_jedchecker/libraries/rules/jamss.php +++ b/source/administrator/components/com_jedchecker/libraries/rules/jamss.php @@ -86,9 +86,11 @@ class JedcheckerRulesJamss extends JEDcheckerRule * In order to make this easy to update, no syntax changes are applied. Just store the variables in the object * for faster use. * + * @param bool $deepscan Merge the $jamssDeepSearchStrings + * * @return void */ - private function init_jamss() + private function init_jamss($deepscan = true) { /* * START OF JAMSS CODE (approx line 76)