-
Notifications
You must be signed in to change notification settings - Fork 162
Closed
Labels
bugSomething isn't workingSomething isn't workingfalse positiveRule causes false positive findingsRule causes false positive findings
Description
Preconditions
Magento2 CodingStandard is installed.
Steps to reproduce
Run against Magento2 codebase.
vendor/bin/phpcs --standard=Magento2 app/code lib/internal/ --sniffs=Magento2.Exceptions.Namespace -s
Expected result
No false-positive findings.
Actual result
>60
false-positive findings detected. Example:
FILE: app/code/Magento/OfflineShipping/Model/ResourceModel/Carrier/Tablerate/CSV/ColumnResolver.php
--------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
--------------------------------------------------------------------------------------------------------------------------------------------------
60 | WARNING | Namespace for ColumnNotFoundException class is not specified. (Magento2.Exceptions.Namespace.NotFoundNamespace)
65 | WARNING | Namespace for ColumnNotFoundException class is not specified. (Magento2.Exceptions.Namespace.NotFoundNamespace)
--------------------------------------------------------------------------------------------------------------------------------------------------
Solution
Remove this rule from Coding Standard in favor of implementation that can capture class existence (PHPStan).
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingfalse positiveRule causes false positive findingsRule causes false positive findings