1
abstract class MyClass
{
private static makeMePublic()
{
}
}
我想讓MyClass :: makeMePublic方法可以從外部調用。我在這裏看到了一個解決方案:Best practices to test protected methods with PHPUnit但這需要該類被實例化。在這種情況下它是不可能的。那麼,如何讓「公開」這個方法呢?PHP:如何使私有靜態方法公開,並且類不能被瘋狂?