Trait “%s” not found

Description

This error appears when a trait is mentioned in the conflict resolution expression, but the trait is not part of the class.

PHP takes into consideration all the traits, even if they are added later than the conflict class.

Example

<?php

class X  {
    // C is not a used trait
    use A, B { C::d insteadof E;}

    // E is a used trait, even if is not in the use above.
    use E;
}
?>

Literal Examples

  • Trait “E” not found

Solutions

  • Add the missing trait.

  • Remove the missing trait and its conflict resolution.