magento / magento-coding-standard

Magento Coding Standard
Open Software License 3.0
337 stars 154 forks source link

False positive Magento2.Legacy.ObsoleteResponse #352

Open DmitryFurs opened 2 years ago

DmitryFurs commented 2 years ago

Preconditions

  1. a class that uses property (not method) _redirect or loadLayout
  2. magento-coding-standard v16

Steps to reproduce

  1. a class that uses properties (not methods) that are listed in the list of methods
    
    <?php

declare(strict_types=1);

namespace Vendor\Module\Model;

class MyModel { /**

2. run `phpcs`

### Expected result
<!--- Tell us what do you expect to happen. -->
1. No `Magento2.Legacy.ObsoleteResponse` triggered

### Actual result
<!--- Tell us what happened instead. Include error messages and issues. -->

FILE: /Model/MyModel.php

FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES

24 | WARNING | renderLayout method is deprecated. Please use \Magento\Framework\Controller\ResultInterface::renderResult instead. 27 | WARNING | _redirect method is deprecated. Please use \Magento\Backend\Model\View\Result\Redirect::render instead.

m2-assistant[bot] commented 2 years ago

Hi @DmitryFurs. Thank you for your report. To speed up processing of this issue, make sure that you provided sufficient information.

Add a comment to assign the issue: @magento I am working on this