Skip to content

Different reports to the same code #115

Closed
@celorodovalho

Description

@celorodovalho

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

  1. The same result in both environments
  2. Actually, how to validate LSD/loop and "direct use of ObjectManager" once there is no Sniff for that in the current version?

Actual result

  1. Different results
  2. How can I have 2 different results for the same command in different computers?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingwaiting for feedbackAdditional explanation needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions