1 | <?php |
||||
2 | |||||
3 | namespace Terranet\Administrator; |
||||
4 | |||||
5 | class Chain |
||||
6 | { |
||||
7 | /** |
||||
8 | * Create chain of responsibility. |
||||
9 | * |
||||
10 | * @param array $queue |
||||
11 | */ |
||||
12 | public static function make(array $queue = []) |
||||
13 | { |
||||
14 | foreach ($queue as $i => &$instance) { |
||||
15 | if ($next = array_get($queue, $i + 1)) { |
||||
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||||
16 | $instance->setNext($next); |
||||
17 | } |
||||
18 | } |
||||
19 | |||||
20 | return array_first($queue); |
||||
0 ignored issues
–
show
The function
array_first was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||
21 | } |
||||
22 | } |
||||
23 |