Closed
Description
Steps to reproduce
I installed the dependency through the command:
composer require --dev magento/magento-coding-standard
Then I executed the command:
./vendor/bin/phpcs --standard=Magento2 /path/to/file/MassDelete.php
And I got the following result:
FILE: /path/to/file/MassDelete.php
--------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------
27 | WARNING | Use ::class notation instead.
--------------------------------------------------------------------------------------------------------------
Time: 1.02 secs; Memory: 8MB
However, on another computer, performing the same procedure, the following result is displayed:
FILE: /path/to/file/MassDelete.php
---------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
---------------------------------------------------------------------------------------------------------------
27 | WARNING | The direct use of ObjectManager is discouraged. Inject necessary dependencies via constructor.
28 | WARNING | Model LSD method load() detected in loop
29 | WARNING | Model LSD method delete() detected in loop
---------------------------------------------------------------------------------------------------------------
Expected result
- The same result in both environments
- Actually, how to validate LSD/loop and "direct use of ObjectManager" once there is no Sniff for that in the current version?
Actual result
- Different results
- How can I have 2 different results for the same command in different computers?