When using multiple source roots and content roots, phpStorm still complains about implementing interfaces

 Hello,

I have a project which contains 3 Lumen installations (Laravel). I have marked each individual installation as a content root and source root. In each content root I have (with the same namespaces and names) certain interfaces and classes that implement these interfaces. The interfaces however have different methods in each content root.

Now despite the different source roots, I get warnings in the implementation in one root that I have to implement the interfaces from the other roots as well.

Example
source root 1

interface A {
  function X();
}

class B implements A {
  function X(){};
}

source root 2

interface A {
  function Y();
}

class B implements A {
  function Y(){};
}

So I still get errors in the Class B from source root 1 that I should implement method Y and in Class B from source root 2 that I should implement method X. I also get "Multiple definitions exist for class A"

I could of course create multiple projects, but for ease of developing this is not something I'd like to do (I have to copy files and code between projects a lot).

Any idea how to fix this? Or it this a bug?

Regards,
Martijn

0

You can remove those lumen installations from project and add them as library roots in Include Paths settings.

Why do you need 3 similar installations in a project: are you developing multiple apps using single project?

0
Avatar
Permanently deleted user

I need to be able to edit and have code inspections for all three installations, have git functions available and such. Does adding them as library roots still allow this?

They are all components of a single application. An webpage server part, an internal api and an external api. Separated so we can easily move them to different servers if needed at some point. And also for security reasons (the internal api will not be accessible from the internet).

I also have them in a single project to allow me to have them in a single git repository which I can control from phpStorm.

0

请先登录再写评论。