1 | <?php |
||
11 | class Path extends AbstractModel implements Arrayable { |
||
12 | |||
13 | use ParametersPart; |
||
14 | use ExtensionPart; |
||
15 | |||
16 | private $operations; |
||
17 | |||
18 | /** @var string */ |
||
19 | private $path; |
||
20 | |||
21 | 9 | public function __construct($path, $contents = []) { |
|
26 | |||
27 | 9 | private function parse($contents) { |
|
40 | |||
41 | 8 | public function toArray() { |
|
47 | |||
48 | /** |
||
49 | * Returns this path |
||
50 | * |
||
51 | * @return string |
||
52 | */ |
||
53 | 1 | public function getPath() { |
|
56 | |||
57 | /** |
||
58 | * Gets the operation for the given method, creates one if none exists |
||
59 | * |
||
60 | * @param string $method |
||
61 | * @return Operation |
||
62 | */ |
||
63 | 2 | public function getOperation($method) { |
|
70 | |||
71 | /** |
||
72 | * Sets the operation for a method |
||
73 | * |
||
74 | * @param string $method |
||
75 | * @param Operation $operation |
||
76 | */ |
||
77 | public function setOperation($method, Operation $operation) { |
||
80 | |||
81 | /** |
||
82 | * |
||
83 | * @param string $method |
||
84 | * @return bool |
||
85 | */ |
||
86 | public function hasOperation($method) { |
||
89 | |||
90 | /** |
||
91 | * Removes an operation for the given method |
||
92 | * |
||
93 | * @param string $method |
||
94 | */ |
||
95 | public function removeOperation($method) { |
||
98 | |||
99 | /** |
||
100 | * Returns all methods for this path |
||
101 | * |
||
102 | * @return Set |
||
103 | */ |
||
104 | public function getMethods() { |
||
107 | |||
108 | } |
||
109 |