1 | <?php |
||
7 | class Link |
||
8 | { |
||
9 | const METHOD_POST = 'post'; |
||
10 | const METHOD_PUT = 'put'; |
||
11 | const METHOD_PATCH = 'patch'; |
||
12 | const METHOD_DELETE = 'delete'; |
||
13 | |||
14 | private $name; |
||
15 | |||
16 | private $url; |
||
17 | |||
18 | private $meta = []; |
||
19 | |||
20 | public function __construct(string $name, string $url) |
||
25 | |||
26 | public static function make(string $name, string $url): self |
||
30 | |||
31 | public function name(): string |
||
35 | |||
36 | public function post() |
||
40 | |||
41 | public function put() |
||
45 | |||
46 | public function patch() |
||
50 | |||
51 | public function delete() |
||
55 | |||
56 | private function setMethod(string $method) |
||
60 | |||
61 | public function meta(string $key, $value) |
||
67 | |||
68 | public function setData(array $data) |
||
72 | |||
73 | public function data() |
||
84 | } |
||
85 |