Trait method *** has not been applied, because there are collisions with other trait methods on

文章目录

场景

  • 同一个类中引入的多个trait有重复的名字

参考资料

解决

两种方式

as 起别称

 use  WechatBackendExceptionTrait, FlushOldCrawlerToken, CurlTrait{
        CurlTrait::postKey as postKeyA; 
} 

insteadof 指定具体使用的方法

    use  WechatBackendExceptionTrait, FlushOldCrawlerToken, CurlTrait{
        CurlTrait::postKey insteadof FlushOldCrawlerToken;
    }

猜你喜欢

转载自blog.csdn.net/cominglately/article/details/85247586