1 | <?php |
||
17 | class InheritCheckerAspect extends AbstractContractAspect implements Aspect |
||
18 | { |
||
19 | /** |
||
20 | * @var MethodConditionFetcher |
||
21 | */ |
||
22 | private $methodConditionFetcher; |
||
23 | |||
24 | /** @var InvariantFetcher */ |
||
25 | private $invariantFetcher; |
||
26 | |||
27 | public function __construct(Reader $reader) |
||
33 | |||
34 | /** |
||
35 | * Verifies inherit contracts for the method |
||
36 | * |
||
37 | * @Around("@execution(PhpDeal\Annotation\Inherit)") |
||
38 | * @param MethodInvocation $invocation |
||
39 | * |
||
40 | * @throws ContractViolation |
||
41 | * @return mixed |
||
42 | */ |
||
43 | 2 | public function inheritMethodContracts(MethodInvocation $invocation) |
|
60 | |||
61 | /** |
||
62 | * @Around("@within(PhpDeal\Annotation\Inherit) && execution(public **->*(*))") |
||
63 | * @param MethodInvocation $invocation |
||
64 | * @return mixed |
||
65 | */ |
||
66 | public function inheritClassContracts(MethodInvocation $invocation) |
||
83 | |||
84 | /** |
||
85 | * @param MethodInvocation $invocation |
||
86 | * @return array |
||
87 | */ |
||
88 | 2 | private function fetchMethodContracts(MethodInvocation $invocation) |
|
102 | |||
103 | /** |
||
104 | * @param MethodInvocation $invocation |
||
105 | * @return array |
||
106 | */ |
||
107 | 2 | private function fetchParentsMethodContracts(MethodInvocation $invocation) |
|
114 | |||
115 | /** |
||
116 | * @param ReflectionClass $class |
||
117 | * @return array |
||
118 | */ |
||
119 | private function fetchClassContracts(ReflectionClass $class) |
||
130 | } |
||
131 |