33
2
mirror of https://github.com/joomla-extensions/jedchecker.git synced 2025-01-05 23:40:41 +00:00

a few comments

This commit is contained in:
Denis Ryabov 2021-05-17 20:05:45 +03:00
parent 3aa1682131
commit 054e97b5b8

View File

@ -151,12 +151,14 @@ class JedcheckerRulesFramework extends JEDcheckerRule
$result = true; $result = true;
} }
// Clean non-code
$content = JEDCheckerHelper::cleanPhpCode( $content = JEDCheckerHelper::cleanPhpCode(
$content, $content,
JEDCheckerHelper::CLEAN_HTML | JEDCheckerHelper::CLEAN_COMMENTS | JEDCheckerHelper::CLEAN_STRINGS JEDCheckerHelper::CLEAN_HTML | JEDCheckerHelper::CLEAN_COMMENTS | JEDCheckerHelper::CLEAN_STRINGS
); );
$cleanContent = JEDCheckerHelper::splitLines($content); $cleanContent = JEDCheckerHelper::splitLines($content);
// Check short PHP tag
if (preg_match('/<\?\s/', $content, $match, PREG_OFFSET_CAPTURE)) if (preg_match('/<\?\s/', $content, $match, PREG_OFFSET_CAPTURE))
{ {
$lineno = substr_count($content, "\n", 0, $match[0][1]); $lineno = substr_count($content, "\n", 0, $match[0][1]);
@ -164,6 +166,7 @@ class JedcheckerRulesFramework extends JEDcheckerRule
$result = true; $result = true;
} }
// Run other tests
foreach ($this->getTests() as $testObject) foreach ($this->getTests() as $testObject)
{ {
if ($this->runTest($file, $origContent, $cleanContent, $testObject)) if ($this->runTest($file, $origContent, $cleanContent, $testObject))