magento / marketplace-eqp

Magento 1.x Coding Standard
http://docs.magento.com/marketplace/user_guide/Resources/pdf/Extension_Quality_Program_Overview.pdf
MIT License
224 stars 68 forks source link

False positive reaction to *Request classes #93

Closed SerhiyShkolyarenko closed 5 years ago

SerhiyShkolyarenko commented 6 years ago

Steps to reproduce:

  1. Create class like \Bla\Bla\Model\Request
  2. Require it as dependency anywhere for example in \Bla\Bla\Model\NiceModel;

Expected result: Code sniffer doesn't return any error for Request class

Actual result: Code sniffer returns an error that Request is injected to constructor.

lenaorobei commented 5 years ago

@SerhiyShkolyarenko could you please provide exact piece of code that causes the issue? I don't fully understand the use case. According to Magento Technical guidelines:

The Request, Session, and Cookie objects MUST NOT be injected in an object constructor. They MUST be passed only as method arguments.

lenaorobei commented 5 years ago

Closing the issue due to no activity over 14 days.

@SerhiyShkolyarenko feel free to crate a new issue with detailed description and steps to reproduce.