A precedence rule was defined for %s::%s but this method does not exist

Description

When importing the trait, a rule was set up to resolve a method conflict between two methods, while one of them does not exist. This conflict resolution may be removed.

Example

<?php

trait A {}

trait B {
    public function bar() {}
}

class MyClass {
    use A, B {
        A::bar insteadof B;  // No bar in A
        A::bar as C;         // No bar in A too
    }
}
?>

Literal Examples

  • A precedence rule was defined for A::bar but this method does not exist

Solutions

  • Remove the conflicting rule.

  • Create the missing method in the original trait.

Changed Behavior

This error may appear following an evolution in behavior, in previous versions. See ` <https://php-changed-behaviors.readthedocs.io/en/latest/behavior/.html>`_.