magento / magento/magento2-phpstorm-plugin

False Positives When Using Path Repositories - Observers & Plugins

Open
#1,597 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Advanced bug good first issue Priority: P3
Dominant language
Java
Stars
463
Forks
98
Avg merge
1h 6m
Merged PRs (30d)
3

Description

**Describe the bug** (*)

When using a path repository for development, you'll often have two directories containing the same code. One in your path (and project), and one in the vendor directory. When this happens, the plugin will flag false positives.

**To Reproduce** (*)

Steps to reproduce the behavior:
1. Include a Magento module with a Composer local path repository.
2. Add a plugin to any class.
3. Add an observer to any class.

**Expected behavior** (*)

No issues are reported for the plugin and for the observer.

**Screenshots**

Shamelessly taken from https://github.com/magento/magento2-phpstorm-plugin/issues/372:

![image](https://github.com/magento/magento2-phpstorm-plugin/assets/930199/f0ffe8bb-ed0c-4fae-a159-cdce09a815b5)

**Please complete the following information:** (*)

- OS: Ubuntu Linux 22.04
- PhpStorm/Intellij version: 2023.1.2
- Plugin Version: 5.1.1

**Additional context**

The issue has already been reported in https://github.com/magento/magento2-phpstorm-plugin/issues/372 and closed, but it is not solved yet / was introduced again.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the false positives with a Magento module loaded through a Composer local path repository, then trace how the plugin handles observers and plugins when the same code exists in the project and vendor directories. Done means the reproduced observer and plugin report no issues in the stated PhpStorm and plugin versions.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, php
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.