1 | <?php |
||
32 | abstract class AbstractJoinpoint implements Joinpoint |
||
33 | { |
||
34 | /** |
||
35 | * List of advices |
||
36 | * |
||
37 | * @var array|Advice[]|Interceptor[] |
||
38 | */ |
||
39 | protected $advices = []; |
||
40 | |||
41 | /** |
||
42 | * Current advice index |
||
43 | * |
||
44 | * @var int |
||
45 | */ |
||
46 | protected $current = 0; |
||
47 | |||
48 | /** |
||
49 | * Stack frames to work with recursive calls or with cross-calls inside object |
||
50 | * |
||
51 | * @var array |
||
52 | */ |
||
53 | protected $stackFrames = []; |
||
54 | |||
55 | /** |
||
56 | * Recursion level for invocation |
||
57 | * |
||
58 | * @var int |
||
59 | */ |
||
60 | protected $level = 0; |
||
61 | |||
62 | /** |
||
63 | * Initializes list of advices for current joinpoint |
||
64 | * |
||
65 | * @param array $advices List of advices |
||
66 | */ |
||
67 | 27 | public function __construct(array $advices) |
|
71 | |||
72 | /** |
||
73 | * Sorts advices by priority |
||
74 | * |
||
75 | * @param array|Advice[] $advices |
||
76 | * @return array|Advice[] Sorted list of advices |
||
77 | */ |
||
78 | 14 | public static function sortAdvices(array $advices): array |
|
102 | |||
103 | /** |
||
104 | * Replace concrete advices with list of ids |
||
105 | * |
||
106 | * @param Advice[][][] $advices List of advices |
||
107 | */ |
||
108 | 6 | public static function flatAndSortAdvices(array $advices): array |
|
123 | } |
||
124 |