Cahining pattern
问题 I have a class in php that works with the chainning method, but the problem is that I want to chain the methods in some order. class Chain { public function foo () { return $this; } public function bar () { return $this; } public function some () { return $this; } } So, if I use this class, then I can chain this methods in 9 different ways (all the possible combinations of 3 elements) But what happen if I determine that the method some always must to be chained after foo or bar and not in