Excluding directory still gets indexed and show "Multiple definitions exists for class"

PhpStorm 2017.3.4

I have excluded some folders inside my vendor folder, and they are marked yellow in the Project view.  They are however still being indexed and PHPStorm still complains about "Multiple definitions exists for class" even though the other files are in the excluded directories.

When I "Go To" -> "Declaration" a window pops up and lists all the options, with the excluded ones with yellow background.

I have tried to invalidate cache, but it still indexes them.

Extremely frustrating that PHPStorm knows they are excluded, but indexes and shows them anyway.

Is this the right place to ask for help and/or report this bug?

1 comment

Hi there,

>or report this bug

This is quite unlikely to be a bug -- more of a misconfiguration on your end or misunderstanding of how it all works.

Is such folder is part of a composer package? By default, composer packages are excluded and then re-added as PHP Include Paths. This way they are still able to participate in Code Completion etc but will be excluded for TODOs/inspections/refactoring etc.

If so -- you cannot "exclude" some subfolder from already excluded folder (that is included back via Include path).

What you may do here -- mark files with such duplicate classes as "Plain Text" (vi aright click in Project View panel) -- the file will NOT be treated as PHP so no duplicates will be found.


The above -- is most likely the reason and possible solution. If you think otherwise -- provide more info with screenshots that would describe situation in details; ideally -- complete test project.


Please sign in to leave a comment.