假设我有这门课
class Test
{
method_a(){ return $this;}
method_b(){ return $this;}
method_c(){ return $this;}
}
$obj = new Test();
$obj->method_a()->method_b();
$obj->method_a()->method_c();
$obj->method_b()->method_c(); //i want to disallow this
如何禁止 method_b() 与 method_c() 链接
编辑:
调用 $obj->method_b() 并跟随 $obj->method_c() 也不允许,因为我只希望 method_b 与 method_a 和 method_c 与其他方法链接