1 | <?php |
||
20 | class InvariantContract extends Contract |
||
21 | { |
||
22 | /** |
||
23 | * @var InvariantFetcher |
||
24 | */ |
||
25 | private $invariantFetcher; |
||
26 | |||
27 | public function __construct(Reader $reader) |
||
32 | |||
33 | /** |
||
34 | * Verifies invariants for contract class |
||
35 | * |
||
36 | * @Around("@within(PhpDeal\Annotation\Invariant) && execution(public **->*(*))") |
||
37 | * @param MethodInvocation $invocation |
||
38 | * @throws ContractViolation |
||
39 | * @return mixed |
||
40 | */ |
||
41 | 7 | public function check(MethodInvocation $invocation) |
|
58 | |||
59 | /** |
||
60 | * @param ReflectionClass $class |
||
61 | * @return array |
||
62 | */ |
||
63 | 7 | private function fetchAllContracts(ReflectionClass $class) |
|
74 | |||
75 | /** |
||
76 | * @param ReflectionClass $class |
||
77 | * @return array |
||
78 | */ |
||
79 | 7 | private function fetchParentsContracts(ReflectionClass $class) |
|
86 | } |
||
87 |