Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid trait conflict errors. #154

Closed
Chekote opened this issue Apr 22, 2014 · 1 comment
Closed

Invalid trait conflict errors. #154

Chekote opened this issue Apr 22, 2014 · 1 comment
Assignees
Labels
Milestone

Comments

@Chekote
Copy link

Chekote commented Apr 22, 2014

It is completely valid to mix traits in PHP that have the same methods declared, as long as only one of them is concrete (all the others must be abstract).

pdepend does not allow this however. If you try to setup this scenario:

trait TraitOne {
  function foo() {}
}

trait TraitTwo {
  abstract function foo();
}

class ClassOne {}

class ClassTwo extends ClassOne {
  use TraitOne;
  use TraitTwo;
}

pdepend's Inheritance-Analyzer complains that:

Trait method foo has not been applied, because there are collisions with other trait methods on \global\ClassTwo.

@Chekote Chekote changed the title Invalid Trait conflict errors. Invalid trait conflict errors. Apr 22, 2014
@manuelpichler manuelpichler added this to the 2.1.0 milestone Sep 9, 2014
@manuelpichler manuelpichler self-assigned this Sep 9, 2014
@manuelpichler
Copy link
Contributor

This should be fixed with commit e0108ae

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants