Skip to content

Commit d98fc27

Browse files
author
Igor Melnikov
committed
MAGETWO-63001: Create static test
- improving regular expressions
1 parent 2759de3 commit d98fc27

File tree

1 file changed

+2
-2
lines changed
  • dev/tests/static/framework/Magento/TestFramework/Utility

1 file changed

+2
-2
lines changed

dev/tests/static/framework/Magento/TestFramework/Utility/CodeCheck.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public static function isClassUsed($className, $content)
2222
{
2323
/* avoid matching namespace instead of class */
2424
$content = preg_replace('/namespace[^;]+;/', '', $content);
25-
return self::_isRegexpMatched('/[^a-z\d_]' . preg_quote($className, '/') . '[^a-z\d_\\\\]/iS', $content);
25+
return self::_isRegexpMatched('/[^a-z\d_\$]' . preg_quote($className, '/') . '[^a-z\d_\\\\]/iS', $content);
2626
}
2727

2828
/**
@@ -126,7 +126,7 @@ public static function isDirectDescendant($content, $name)
126126
{
127127
$name = preg_quote($name, '/');
128128
return self::_isRegexpMatched(
129-
'/\s+extends\s+' . $name . '\b|\s+implements\s+[^{]*\b' . $name . '\b[^{^\\\\]*\{/iS',
129+
'/\s+extends\s+\\\\?' . $name . '\b|\s+implements\s+[^{]*\b' . $name . '\b[^{^\\\\]*\{/iS',
130130
$content
131131
);
132132
}

0 commit comments

Comments
 (0)