Total Complexity | 9 |
Total Lines | 78 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
11 | class Specification |
||
12 | { |
||
13 | /** |
||
14 | * @var string |
||
15 | */ |
||
16 | private $server = null; |
||
17 | |||
18 | /** |
||
19 | * @var string |
||
20 | */ |
||
21 | private $service = null; |
||
22 | |||
23 | /** |
||
24 | * @var array |
||
25 | */ |
||
26 | private $methodRequests = []; |
||
27 | |||
28 | /** |
||
29 | * @var array |
||
30 | */ |
||
31 | private $methodResponses = []; |
||
32 | |||
33 | /** |
||
34 | * Specification constructor. |
||
35 | * @param string $server |
||
36 | * @param string $service |
||
37 | */ |
||
38 | public function __construct(string $server, string $service) |
||
39 | { |
||
40 | $this->server = $server; |
||
41 | $this->service = $service; |
||
42 | } |
||
43 | |||
44 | /** |
||
45 | * @return string |
||
46 | */ |
||
47 | public function getServer() : string |
||
48 | { |
||
49 | return $this->server; |
||
50 | } |
||
51 | |||
52 | /** |
||
53 | * @return string |
||
54 | */ |
||
55 | public function getService() : string |
||
56 | { |
||
57 | return $this->service; |
||
58 | } |
||
59 | |||
60 | /** |
||
61 | * @param array $methodRRs |
||
62 | * @return static |
||
63 | */ |
||
64 | public function setMethods(array $methodRRs) : self |
||
65 | { |
||
66 | foreach ($methodRRs as $methodName => $rrs) { |
||
67 | isset($rrs['in']) && $this->methodRequests[$methodName] = $rrs['in']; |
||
68 | isset($rrs['out']) && $this->methodResponses[$methodName] = $rrs['out']; |
||
69 | } |
||
70 | return $this; |
||
71 | } |
||
72 | |||
73 | /** |
||
74 | * @param string $method |
||
75 | * @return string |
||
76 | */ |
||
77 | public function getMethodRequest(string $method) : string |
||
80 | } |
||
81 | |||
82 | /** |
||
83 | * @param string $method |
||
84 | * @return string |
||
85 | */ |
||
86 | public function getMethodResponse(string $method) : string |
||
89 | } |
||
90 | } |
||
91 |