@@ 41-53 (lines=13) @@ | ||
38 | * @param mixed ...$args Arguments |
|
39 | * @return boolean |
|
40 | */ |
|
41 | public function executeOne() |
|
42 | { |
|
43 | if ($this->isEmpty()) { |
|
44 | return false; |
|
45 | } |
|
46 | $cb = $this->shift(); |
|
47 | if ($cb) { |
|
48 | $cb(...func_get_args()); |
|
49 | if ($cb instanceof CallbackWrapper) { |
|
50 | $cb->cancel(); |
|
51 | } |
|
52 | } |
|
53 | return true; |
|
54 | } |
|
55 | ||
56 | /** |
|
@@ 61-71 (lines=11) @@ | ||
58 | * @param mixed ...$args Arguments |
|
59 | * @return boolean |
|
60 | */ |
|
61 | public function executeAndKeepOne() |
|
62 | { |
|
63 | if ($this->isEmpty()) { |
|
64 | return false; |
|
65 | } |
|
66 | $cb = $this->shift(); |
|
67 | $this->unshift($cb); |
|
68 | if ($cb) { |
|
69 | $cb(...func_get_args()); |
|
70 | } |
|
71 | return true; |
|
72 | } |
|
73 | ||
74 | /** |