2015-05-13 68 views

回答

2

我不知道該怎麼你這個命名空間來了,但OpaqueEncoder類簡單地doesn't have one(因此居住在根命名空間),只需編寫use OpaqueEncoder將其導入非根名稱空間。

更新。 它沒有在所有

任何命名空間
namespace Xyz\Anything; 

use OpaqueEncoder; 

class ABC 
{ 
    public function dunno($key) 
    { 
     $encoder = new OpaqueEncoder($key); 
    } 
} 
+0

顯示您composer.json文件 –

+0

是的,它是「OpaqueEncoder」,錯字的錯誤,但有相同的錯誤,如果我設置文件的路徑Marekweb \不透明-ID \ OpaqueEncoder。我總是得到語法錯誤。 – gormit

+0

@gormit **根本沒有命名空間**,你根本不應該使用'Marekweb \ Opaque-id'部分,請仔細閱讀。我用最簡單的例子更新了答案。 – Etki

0
I don't know the syntax, but the following guesses might help: 
    - the backward slashes, should they be forward slashes? 
    - maybe a missing semi-colon on the previous line. 
    - the '-' might not be the right '-' but rather some other dash. 
    you could try deleting and retyping it. 
    - character encoding mismatch, utf-8 vs Cp???? (or whatever) 
    - character encoding not declared at top of document or in whatever 
    meta placeholder or pragma the language provides. 
    - check the actual encoding of your document. 
You might get lucky. :) 
相關問題