1 | <?php declare(strict_types = 1); |
||
16 | class Path implements Element |
||
17 | { |
||
18 | use VisiteeMixin; |
||
19 | |||
20 | /** |
||
21 | * @var string |
||
22 | */ |
||
23 | protected $path; |
||
24 | |||
25 | /** |
||
26 | * @var Operation[] |
||
27 | */ |
||
28 | protected $operations = []; |
||
29 | |||
30 | /** |
||
31 | * @var Parameter[] |
||
32 | */ |
||
33 | protected $pathParameters = []; |
||
34 | |||
35 | /** |
||
36 | * @var array |
||
37 | */ |
||
38 | private $extensions; |
||
39 | |||
40 | /** |
||
41 | * Path constructor. |
||
42 | * |
||
43 | * @param string $path |
||
44 | * @param Operation[] $operations |
||
45 | * @param Parameter[] $pathParameters |
||
46 | * @param array $extensions |
||
47 | */ |
||
48 | public function __construct($path, array $operations, array $pathParameters = [], array $extensions = []) |
||
55 | |||
56 | /** |
||
57 | * @param string $name |
||
58 | * |
||
59 | * @return mixed |
||
60 | */ |
||
61 | public function getExtension(string $name) |
||
65 | |||
66 | /** |
||
67 | * @return string |
||
68 | */ |
||
69 | public function getPath(): string |
||
73 | |||
74 | /** |
||
75 | * @return Operation[] |
||
76 | */ |
||
77 | public function getOperations(): array |
||
81 | |||
82 | /** |
||
83 | * @param string $method |
||
84 | * |
||
85 | * @return Operation |
||
86 | */ |
||
87 | public function getOperation(string $method): Operation |
||
98 | |||
99 | /** |
||
100 | * @param string $method |
||
101 | * @return bool |
||
102 | */ |
||
103 | public function hasOperation(string $method): bool |
||
107 | |||
108 | /** |
||
109 | * @return Parameter[] |
||
110 | */ |
||
111 | public function getPathParameters(): array |
||
115 | } |
||
116 |