尝试延长课程时出现奇怪的警告
在扩展一个扩展另一个类的类后,我开始收到奇怪的警告 Event_Feed_Item>我的 Feed_Item > SimplePie_Item
- Cannot extend from interface
'SimplePie_Item'
- Implementors of methods in
'SimplePie_Item'
然而在运行时它工作正常。另外 SimplePie_Item 不是一个接口,它是一个简单的类.. 只需知道我是否遇到麻烦,或者我是否可以忽略此警告
编辑我正在扩展这个类
这也是我课堂上的骨架
class My_Feed_Item extends SimplePie_Item // error is triggered here
{
protected $_source_id = null;
public function set_source ($source_id)
{
}
public function get_image ()
{
}
public function get_venue_id ()
{
}
public function get_venue_nm ()
{
}
public function cleanString($str)
{
}
}
class Event_Feed_Item extends My_Feed_Item
{
public function get_event_nm ()
{
}
public function get_event_start_dt ()
{
}
public function get_event_end_dt ()
{
}
}
I started getting strange warnings, after extending a class that extends anotherEvent_Feed_Item > My_Feed_Item > SimplePie_Item
- Cannot extend from interface
'SimplePie_Item'
- Implementors of methods in
'SimplePie_Item'
However on runtime it works fine. Also SimplePie_Item is not an interface, it's a simple Class..
Just need to know if I'm running into trouble, or if i can just ignore this warning
EDIT I'm extending this class
Also this is the skeleton from my classes
class My_Feed_Item extends SimplePie_Item // error is triggered here
{
protected $_source_id = null;
public function set_source ($source_id)
{
}
public function get_image ()
{
}
public function get_venue_id ()
{
}
public function get_venue_nm ()
{
}
public function cleanString($str)
{
}
}
class Event_Feed_Item extends My_Feed_Item
{
public function get_event_nm ()
{
}
public function get_event_start_dt ()
{
}
public function get_event_end_dt ()
{
}
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我也有同样的问题。确保 Zend Studio 中项目的构建路径和/或包含路径具有父类所在目录的路径。在 PHP Explorer 中,右键单击项目并选择“构建路径”->“构建路径”。配置构建路径。或者右键单击该项目并选择“包含路径”->“包含路径”配置包含路径。
I was having the same issue. Make sure the Build Path and/or Include Path for the project in Zend Studio have the path to the directory where the parent class is located. In PHP Explorer, right-click the project and choose Build Path -> Configure Build Path. Or right-click the project and choose Include Path -> Configure Include Path.