1 | <?php |
||
20 | abstract class Contract |
||
21 | { |
||
22 | /** |
||
23 | * @var Reader |
||
24 | */ |
||
25 | protected $reader; |
||
26 | |||
27 | /** |
||
28 | * @param Reader $reader Annotation reader |
||
29 | */ |
||
30 | public function __construct(Reader $reader) |
||
31 | { |
||
32 | $this->reader = $reader; |
||
33 | } |
||
34 | |||
35 | /** |
||
36 | * @param MethodInvocation $invocation |
||
37 | * @return array |
||
38 | */ |
||
39 | 34 | protected function getMethodArguments(MethodInvocation $invocation) |
|
43 | |||
44 | /** |
||
45 | * @param array $allContracts |
||
46 | * @return array |
||
47 | */ |
||
48 | 34 | protected function makeContractsUnique(array $allContracts) |
|
52 | |||
53 | /** |
||
54 | * @param array $allContracts |
||
55 | * @param object|string $instance |
||
56 | * @param string $scope |
||
57 | * @param array $args |
||
58 | * @param MethodInvocation $invocation |
||
59 | */ |
||
60 | 34 | protected function fulfillContracts($allContracts, $instance, $scope, array $args, MethodInvocation $invocation) |
|
70 | |||
71 | /** |
||
72 | * Returns a result of contract verification |
||
73 | * |
||
74 | * @param object|string $instance Invocation instance or string for static class |
||
75 | * @param string $scope Scope of method |
||
76 | * @param array $args List of arguments for the method |
||
77 | * @param Annotation $annotation Contract annotation |
||
78 | * @throws DomainException |
||
79 | */ |
||
80 | 34 | public function ensureContractSatisfied($instance, $scope, array $args, $annotation) |
|
101 | } |
||
102 |