2011-03-31 75 views
3

,當我開始變得奇怪的警告,延伸的延伸但另一 Event_Feed_Item > My_Feed_Item > SimplePie_Item奇怪警告試圖延長

- Cannot extend from interface 
'SimplePie_Item' 
- Implementors of methods in 
'SimplePie_Item' 

上運行時,它工作正常,一下課。此外SimplePie_Item不是一個接口,這是一個簡單的類.. 只需要知道,如果我遇到麻煩,或者如果我可以忽略此警告

編輯我也是這個擴展this class
是我的班級骨架

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() 
    { 
    } 

} 
+0

你能展示一些代碼嗎? – 2011-03-31 08:17:35

+0

確保任何重寫的方法使用相同的定義,並定義所有抽象/接口方法 – chriso 2011-03-31 08:25:11

+0

更新後的代碼 – Moak 2011-03-31 09:07:38

回答

3

我有同樣的問題。確保Zend Studio中項目的構建路徑和/或包含路徑具有父級所在目錄的路徑。在PHP資源管理器中,右鍵單擊該項目並選擇Build Path - > Configure Build Path。或者右鍵單擊該項目並選擇包含路徑 - >配置包含路徑。