@@ -68,8 +68,8 @@ |
||
68 | 68 | } |
69 | 69 | |
70 | 70 | /** |
71 | - * @return array<string,mixed> |
|
72 | - */ |
|
71 | + * @return array<string,mixed> |
|
72 | + */ |
|
73 | 73 | public function toArray(): array |
74 | 74 | { |
75 | 75 | $array = []; |
@@ -38,8 +38,8 @@ discard block |
||
38 | 38 | } |
39 | 39 | |
40 | 40 | /** |
41 | - * @return mixed |
|
42 | - */ |
|
41 | + * @return mixed |
|
42 | + */ |
|
43 | 43 | public function getData() |
44 | 44 | { |
45 | 45 | return $this->data; |
@@ -61,8 +61,8 @@ discard block |
||
61 | 61 | } |
62 | 62 | |
63 | 63 | /** |
64 | - * @return mixed |
|
65 | - */ |
|
64 | + * @return mixed |
|
65 | + */ |
|
66 | 66 | protected function processResponseData() |
67 | 67 | { |
68 | 68 | $responseContent = $this->response->getContent(); |
@@ -44,8 +44,8 @@ discard block |
||
44 | 44 | } |
45 | 45 | |
46 | 46 | /** |
47 | - * @return mixed |
|
48 | - */ |
|
47 | + * @return mixed |
|
48 | + */ |
|
49 | 49 | public function getAttribute(string $key) |
50 | 50 | { |
51 | 51 | if (!\array_key_exists($key, $this->attributes)) { |
@@ -60,8 +60,8 @@ discard block |
||
60 | 60 | } |
61 | 61 | |
62 | 62 | /** |
63 | - * @return int|string|null |
|
64 | - */ |
|
63 | + * @return int|string|null |
|
64 | + */ |
|
65 | 65 | public function getMeta(string $key) |
66 | 66 | { |
67 | 67 | if (!\array_key_exists($key, $this->meta)) { |
@@ -71,8 +71,8 @@ discard block |
||
71 | 71 | } |
72 | 72 | |
73 | 73 | /** |
74 | - * @param mixed $value |
|
75 | - */ |
|
74 | + * @param mixed $value |
|
75 | + */ |
|
76 | 76 | public function setAttribute(string $key, $value): bool |
77 | 77 | { |
78 | 78 | $this->attributes[$key] = $value; |
@@ -92,8 +92,8 @@ discard block |
||
92 | 92 | } |
93 | 93 | |
94 | 94 | /** |
95 | - * @param mixed $value |
|
96 | - */ |
|
95 | + * @param mixed $value |
|
96 | + */ |
|
97 | 97 | public function setMeta(string $key, $value): bool |
98 | 98 | { |
99 | 99 | $this->meta[$key] = $value; |
@@ -101,8 +101,8 @@ discard block |
||
101 | 101 | } |
102 | 102 | |
103 | 103 | /** |
104 | - * @return array<string,mixed> |
|
105 | - */ |
|
104 | + * @return array<string,mixed> |
|
105 | + */ |
|
106 | 106 | public function toArray(): array |
107 | 107 | { |
108 | 108 | $array = [ |
@@ -61,16 +61,16 @@ discard block |
||
61 | 61 | } |
62 | 62 | |
63 | 63 | /** |
64 | - * @return array<string,string> |
|
65 | - */ |
|
64 | + * @return array<string,string> |
|
65 | + */ |
|
66 | 66 | public function getClientContentTypes(): array |
67 | 67 | { |
68 | 68 | return $this->acceptContentTypes; |
69 | 69 | } |
70 | 70 | |
71 | 71 | /** |
72 | - * @param array<int,string> $allowedMethods |
|
73 | - */ |
|
72 | + * @param array<int,string> $allowedMethods |
|
73 | + */ |
|
74 | 74 | public function setAllowedMethods(array $allowedMethods): bool |
75 | 75 | { |
76 | 76 | $this->allowedMethods = $allowedMethods; |
@@ -78,8 +78,8 @@ discard block |
||
78 | 78 | } |
79 | 79 | |
80 | 80 | /** |
81 | - * @param array<int,string> $supportedContentTypes |
|
82 | - */ |
|
81 | + * @param array<int,string> $supportedContentTypes |
|
82 | + */ |
|
83 | 83 | public function setSupportedContentTypes(array $supportedContentTypes): bool |
84 | 84 | { |
85 | 85 | $this->supportedContentTypes = $supportedContentTypes; |
@@ -7,34 +7,34 @@ |
||
7 | 7 | interface ResourceObjectInterface |
8 | 8 | { |
9 | 9 | /** |
10 | - * @return array<string,int|string>|string |
|
11 | - */ |
|
10 | + * @return array<string,int|string>|string |
|
11 | + */ |
|
12 | 12 | public function getAttribute(string $key); |
13 | 13 | |
14 | 14 | public function getId(): string; |
15 | 15 | |
16 | 16 | /** |
17 | - * @return int|string |
|
18 | - */ |
|
17 | + * @return int|string |
|
18 | + */ |
|
19 | 19 | public function getMeta(string $key); |
20 | 20 | |
21 | 21 | public function setId(string $id): bool; |
22 | 22 | |
23 | 23 | /** |
24 | - * @param mixed $value |
|
25 | - */ |
|
24 | + * @param mixed $value |
|
25 | + */ |
|
26 | 26 | public function setAttribute(string $key, $value): bool; |
27 | 27 | |
28 | 28 | public function setLink(string $key, string $value): bool; |
29 | 29 | |
30 | 30 | /** |
31 | - * @param mixed $value |
|
32 | - */ |
|
31 | + * @param mixed $value |
|
32 | + */ |
|
33 | 33 | public function setMeta(string $key, $value): bool; |
34 | 34 | |
35 | 35 | /** |
36 | - * @return array<string,mixed> |
|
37 | - */ |
|
36 | + * @return array<string,mixed> |
|
37 | + */ |
|
38 | 38 | public function toArray(): array; |
39 | 39 | |
40 | 40 | public function toJson(int $flags = 0): string; |
@@ -20,10 +20,10 @@ discard block |
||
20 | 20 | protected bool $processRequestData; |
21 | 21 | |
22 | 22 | /** |
23 | - * Request data. |
|
24 | - * |
|
25 | - * @var array<mixed> |
|
26 | - */ |
|
23 | + * Request data. |
|
24 | + * |
|
25 | + * @var array<mixed> |
|
26 | + */ |
|
27 | 27 | protected array $requestData; |
28 | 28 | |
29 | 29 | public function __construct(RequestInterface $request) |
@@ -43,8 +43,8 @@ discard block |
||
43 | 43 | // If not missing, it needs to be valid. |
44 | 44 | try { |
45 | 45 | /** |
46 | - * @throws \JsonException |
|
47 | - */ |
|
46 | + * @throws \JsonException |
|
47 | + */ |
|
48 | 48 | $requestData = \json_decode( |
49 | 49 | $requestBody, |
50 | 50 | true, // associative |
@@ -140,8 +140,8 @@ discard block |
||
140 | 140 | } |
141 | 141 | |
142 | 142 | /** |
143 | - * @param array<string,mixed> $data |
|
144 | - */ |
|
143 | + * @param array<string,mixed> $data |
|
144 | + */ |
|
145 | 145 | protected function verifyData(array $data): bool |
146 | 146 | { |
147 | 147 | foreach (['type', 'attributes'] as $item) { |
@@ -26,17 +26,17 @@ discard block |
||
26 | 26 | protected array $jsonapi; |
27 | 27 | |
28 | 28 | /** |
29 | - * Data. |
|
30 | - * |
|
31 | - * @var array<int,\WebServCo\Api\JsonApi\Interfaces\ResourceObjectInterface> |
|
32 | - */ |
|
29 | + * Data. |
|
30 | + * |
|
31 | + * @var array<int,\WebServCo\Api\JsonApi\Interfaces\ResourceObjectInterface> |
|
32 | + */ |
|
33 | 33 | protected array $data; |
34 | 34 | |
35 | 35 | /** |
36 | - * Errors. |
|
37 | - * |
|
38 | - * @var array<int,\WebServCo\Api\JsonApi\Error> |
|
39 | - */ |
|
36 | + * Errors. |
|
37 | + * |
|
38 | + * @var array<int,\WebServCo\Api\JsonApi\Error> |
|
39 | + */ |
|
40 | 40 | protected array $errors; |
41 | 41 | |
42 | 42 | protected int $statusCode; |
@@ -69,8 +69,8 @@ discard block |
||
69 | 69 | } |
70 | 70 | |
71 | 71 | /** |
72 | - * @param mixed $value |
|
73 | - */ |
|
72 | + * @param mixed $value |
|
73 | + */ |
|
74 | 74 | public function setMeta(string $key, $value): bool |
75 | 75 | { |
76 | 76 | $this->meta[$key] = $value; |
@@ -84,8 +84,8 @@ discard block |
||
84 | 84 | } |
85 | 85 | |
86 | 86 | /** |
87 | - * @return array<string,mixed> |
|
88 | - */ |
|
87 | + * @return array<string,mixed> |
|
88 | + */ |
|
89 | 89 | public function toArray(): array |
90 | 90 | { |
91 | 91 | $array = [ |