1 | <?php |
||
10 | class Directory extends Dictionary |
||
11 | { |
||
12 | use StructureWithDataAlias; |
||
13 | |||
14 | const GET = 'GET'; |
||
15 | const POST = 'POST'; |
||
16 | const PUT = 'PUT'; |
||
17 | const PATCH = 'PATCH'; |
||
18 | const HEAD = 'HEAD'; |
||
19 | const DELETE = 'DELETE'; |
||
20 | const OPTIONS = 'OPTIONS'; |
||
21 | |||
22 | /** |
||
23 | * @param string $path |
||
24 | * @param string|Action $domainOrAction |
||
25 | * |
||
26 | * @return static |
||
27 | */ |
||
28 | 3 | public function get($path, $domainOrAction) |
|
32 | |||
33 | /** |
||
34 | * @param string $path |
||
35 | * @param string|Action $domainOrAction |
||
36 | * |
||
37 | * @return static |
||
38 | */ |
||
39 | 1 | public function post($path, $domainOrAction) |
|
43 | |||
44 | /** |
||
45 | * @param string $path |
||
46 | * @param string|Action $domainOrAction |
||
47 | * |
||
48 | * @return static |
||
49 | */ |
||
50 | 1 | public function put($path, $domainOrAction) |
|
54 | |||
55 | /** |
||
56 | * @param string $path |
||
57 | * @param string|Action $domainOrAction |
||
58 | * |
||
59 | * @return static |
||
60 | */ |
||
61 | 1 | public function patch($path, $domainOrAction) |
|
65 | |||
66 | /** |
||
67 | * @param string $path |
||
68 | * @param string|Action $domainOrAction |
||
69 | * |
||
70 | * @return static |
||
71 | */ |
||
72 | 1 | public function head($path, $domainOrAction) |
|
76 | |||
77 | /** |
||
78 | * @param string $path |
||
79 | * @param string|Action $domainOrAction |
||
80 | * |
||
81 | * @return static |
||
82 | */ |
||
83 | 1 | public function delete($path, $domainOrAction) |
|
87 | |||
88 | /** |
||
89 | * @param string $path |
||
90 | * @param string|Action $domainOrAction |
||
91 | * |
||
92 | * @return static |
||
93 | */ |
||
94 | 1 | public function options($path, $domainOrAction) |
|
98 | |||
99 | /** |
||
100 | * @param string $method |
||
101 | * @param string $path |
||
102 | * @param string|Action $domainOrAction |
||
103 | * |
||
104 | * @return static |
||
105 | */ |
||
106 | 11 | public function action($method, $path, $domainOrAction) |
|
116 | |||
117 | /** |
||
118 | * @inheritDoc |
||
119 | * |
||
120 | * @throws DirectoryException If a value is not an Action instance |
||
121 | */ |
||
122 | 14 | protected function assertValid(array $data) |
|
132 | } |
||
133 |
It is generally a best practice as it is often more readable to use concatenation instead of interpolation for variables inside strings.