mirror of
https://github.com/joomla-extensions/jedchecker.git
synced 2025-01-03 22:57:21 +00:00
fix issue #164
This commit is contained in:
parent
fa3ba35933
commit
d6e0dbc7d9
@ -116,7 +116,7 @@ class JedcheckerRulesJexec extends JEDcheckerRule
|
|||||||
$content = preg_replace('/^\xEF\xBB\xBF/', '', $content);
|
$content = preg_replace('/^\xEF\xBB\xBF/', '', $content);
|
||||||
|
|
||||||
// Skip empty files
|
// Skip empty files
|
||||||
if ($content === '' || preg_match('#^<\?php\s+$#', $content))
|
if ($content === '' || preg_match('#^\s*<\?php\s+$#', $content))
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -147,7 +147,7 @@ class JedcheckerRulesJexec extends JEDcheckerRule
|
|||||||
}
|
}
|
||||||
|
|
||||||
$this->regex
|
$this->regex
|
||||||
= '#^' // at the beginning of the file
|
= '#^\s*' // at the beginning of the file
|
||||||
. '<\?php\s+' // there is an opening php tag
|
. '<\?php\s+' // there is an opening php tag
|
||||||
. '(?:declare ?\(strict_types ?= ?1 ?\) ?; ?)?' // optionally followed by declare(strict_types=1) directive
|
. '(?:declare ?\(strict_types ?= ?1 ?\) ?; ?)?' // optionally followed by declare(strict_types=1) directive
|
||||||
. '(?:namespace [0-9A-Za-z_\\\\]+ ?; ?)?' // optionally followed by namespace directive
|
. '(?:namespace [0-9A-Za-z_\\\\]+ ?; ?)?' // optionally followed by namespace directive
|
||||||
|
Loading…
Reference in New Issue
Block a user