magento / magento/magento-coding-standard

False Positive: Magento2.Legacy.InstallUpgrade.ObsoleteInstallDataScript

Open
#411 1 comment 0 reactions 0 assignees View on GitHub
bug Progress: ready for grooming
Dominant language
PHP
Stars
375
Forks
165
PR merge metrics
No merged PRs in 30d

Description

### 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.

Contributor guide

Open the contributing guide

Research direction

Locate the implementation and tests for Magento2.Legacy.InstallUpgrade.ObsoleteInstallDataScript, then reproduce the sniff against Setup/Patch/Data/InstallData.php. Confirm that a data patch with this name is not flagged while the intended Setup/InstallData.php case remains detected.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.