1 | <?php |
||
8 | class MethodCollection implements \Iterator |
||
9 | { |
||
10 | /** |
||
11 | * @var array |
||
12 | */ |
||
13 | private $methods = []; |
||
14 | |||
15 | /** |
||
16 | * Constructor. |
||
17 | * |
||
18 | * @param array $methods |
||
19 | */ |
||
20 | public function __construct(array $methods = []) |
||
26 | |||
27 | /** |
||
28 | * @param string $methodName |
||
29 | * @param callable $callable |
||
30 | * |
||
31 | * @return MethodCollection |
||
32 | */ |
||
33 | public function add($methodName, callable $callable) |
||
39 | |||
40 | /** |
||
41 | * @param string $methodName |
||
42 | * |
||
43 | * @return bool |
||
44 | */ |
||
45 | public function has($methodName) |
||
49 | |||
50 | /** |
||
51 | * @param string $methodName |
||
52 | * |
||
53 | * @return callable|null |
||
54 | */ |
||
55 | public function get($methodName) |
||
63 | |||
64 | /** |
||
65 | * @return callable |
||
66 | */ |
||
67 | public function current() |
||
71 | |||
72 | /** |
||
73 | * @return callable |
||
74 | */ |
||
75 | public function next() |
||
79 | |||
80 | /** |
||
81 | * @return string |
||
82 | */ |
||
83 | public function key() |
||
87 | |||
88 | /** |
||
89 | * {@inheritdoc} |
||
90 | */ |
||
91 | public function valid() |
||
97 | |||
98 | /** |
||
99 | * {@inheritdoc} |
||
100 | */ |
||
101 | public function rewind() |
||
105 | } |
||
106 |