K
K
Konstantin2015-10-04 22:39:24
PHP
Konstantin, 2015-10-04 22:39:24

Phpstorm class conflicts how to be?

There is a main class file in the project, but there are 2 of these files, there is also the same main class file, but it is in a different folder - the admin folder.
Each new class includes this file of the main class, BUT phpstorm for some reason says that there are several classes and suddenly says you mean the class in the admin folder ...
what to do? how to tell him to include the file only in the current folder, so that he does not look somewhere deep for the same classes?
Here's a hint:

Undefined class: Declaration of referenced class is not found in built-in library and project files.
Multiple declarations: this version of IDE *will* have problems with completion, member resolution and inheritance analysis for all classes that have multiple definitions in project files (regardless of includes).

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alexander, 2015-10-04
@kentuck1213

Use namespace

P
Pavel Volintsev, 2015-10-05
@copist

PHPStorm does not include, but typehint body
Well, let him complain, since they are duplicated for you.
And the missing class must be corrected - either create a class, or remove references to it

S
SDKiller, 2015-10-09
@SDKiller

...Use namespace

As if both are not always possible with someone else's code base:
> There is a main class file in the project, but there are 2 of these files, there is also the same main class file, but it is in a different folder - the admin folder.
Typical bullshit for example for Joomla, WordPress and 3 files each can have the same class name.
Konstantin
As a temporary solution - so that, say, the admin class does not interfere while you are working on the frontend - you can try to exclude it from the project.
Go to the admin panel - do the opposite.
Not always acceptable, of course, but sometimes it is useful.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question