Alexandre Tranchant
Alexandre Tranchant

Reputation: 4551

How to ignore a specific phar file under a PhpStorm project?

I have a composer.phar under my Symfony project. I shall not delete this file.

PhpStorm analyzes this file to index its contained functions and classes. This file is indexed and I see some troubles like "Multiple declaration".

enter image description here

enter image description here

I know how to ignore a directory, but I'm searching how to ignore a specific pharfile to avoid indexing.

Upvotes: 0

Views: 263

Answers (1)

Cedrix
Cedrix

Reputation: 36

For phar extension file:

Such file is shown as plain text in the editor, and is marked with a special icon Plain text file in the Project Tool Window.

In the context of a PHP project, you can also exclude entire PHP archives (phar files) to prevent multiple declaration conflicts between classes in a phar archive and the corresponding classes in the installed vendors directory. Right-click on file and select "Exclude phar from project"

Contextual menu screenshot

For any file extension:

If you mark the file as plain file then PhpStorm will ignore it.

  1. Select the file from the Project Tool Window

  2. Select Mark as plain text

Upvotes: 2

Related Questions