diff --git a/Magento2/Sniffs/PHP/LiteralNamespacesSniff.php b/Magento2/Sniffs/PHP/LiteralNamespacesSniff.php
index 7b9c85ac..705e154b 100644
--- a/Magento2/Sniffs/PHP/LiteralNamespacesSniff.php
+++ b/Magento2/Sniffs/PHP/LiteralNamespacesSniff.php
@@ -52,7 +52,7 @@ public function process(File $sourceFile, $stackPtr)
$content = preg_replace('|\\\{2,}|', '\\', $content);
}
- if (preg_match($this->literalNamespacePattern, $content) === 1 && $this->classExists($content)) {
+ if (preg_match($this->literalNamespacePattern, $content) === 1) {
$sourceFile->addWarning(
"Use ::class notation instead.",
$stackPtr,
@@ -60,20 +60,4 @@ public function process(File $sourceFile, $stackPtr)
);
}
}
-
- /**
- * Checks if class or interface exists.
- *
- * ToDo: get rig of this check https://github.com/magento/magento-coding-standard/issues/9
- *
- * @param string $className
- * @return bool
- */
- private function classExists($className)
- {
- if (!isset($this->classNames[$className])) {
- $this->classNames[$className] = class_exists($className) || interface_exists($className);
- }
- return $this->classNames[$className];
- }
}
diff --git a/Magento2/ruleset.xml b/Magento2/ruleset.xml
index 999b6f20..91aa12fb 100644
--- a/Magento2/ruleset.xml
+++ b/Magento2/ruleset.xml
@@ -245,6 +245,10 @@
7
warning
+ */_files/*
+ */Fixtures/*
+ */Test/*
+ *Test.php
7