我有界面:
原文链接:https://www.f2er.com/php/134604.htmlinterface AbstractMapper { public function objectToArray(ActiveRecordBase $object); }
和课程:
class ActiveRecordBase { ... } class Product extends ActiveRecordBase { ... }
========
但我不能这样做:
interface ExactMapper implements AbstractMapper { public function objectToArray(Product $object); }
或这个:
interface ExactMapper extends AbstractMapper { public function objectToArray(Product $object); }
我有错误“声明必须兼容”
那么,有没有办法在PHP中执行此操作?