magento/magento-coding-standard

False Positive: Magento2.Legacy.InstallUpgrade.ObsoleteInstallDataScript

dfelton opened this issue · 1 comments

Preconditions

  1. Package contains data patch \VendorName\ModuleName\Setup\Patch\Data\InstallData (exact nature of data patch irrelevant)

Steps to reproduce

  1. Run the coding standard against the file Setup/Patch/Data/InstallData.php

Expected result

  1. Sniff Magento2.Legacy.InstallUpgrade.ObsoleteInstallDataScript to not be triggered by the presence of a data patch named InstallData, as it is not a Setup/InstallData.php script.

Actual result

  1. Data patch fails due to Magento2.Legacy.InstallUpgrade.ObsoleteInstallDataScript sniff.

Misc Notes:

  • Possible to disable failure with phpcs:ignore Magento2.Legacy.InstallUpgrade.ObsoleteInstallDataScript annotation within the file. Line must be present on line 1, after the opening PHP tag.

Hi @dfelton. 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