@@ -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 = []; |
@@ -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 = [ |
@@ -43,8 +43,8 @@ discard block |
||
43 | 43 | } |
44 | 44 | |
45 | 45 | /** |
46 | - * @return mixed |
|
47 | - */ |
|
46 | + * @return mixed |
|
47 | + */ |
|
48 | 48 | public function getAttribute(string $key) |
49 | 49 | { |
50 | 50 | if (!\array_key_exists($key, $this->attributes)) { |
@@ -59,8 +59,8 @@ discard block |
||
59 | 59 | } |
60 | 60 | |
61 | 61 | /** |
62 | - * @return int|string|null |
|
63 | - */ |
|
62 | + * @return int|string|null |
|
63 | + */ |
|
64 | 64 | public function getMeta(string $key) |
65 | 65 | { |
66 | 66 | if (!\array_key_exists($key, $this->meta)) { |
@@ -70,8 +70,8 @@ discard block |
||
70 | 70 | } |
71 | 71 | |
72 | 72 | /** |
73 | - * @param mixed $value |
|
74 | - */ |
|
73 | + * @param mixed $value |
|
74 | + */ |
|
75 | 75 | public function setAttribute(string $key, $value): bool |
76 | 76 | { |
77 | 77 | $this->attributes[$key] = $value; |
@@ -91,8 +91,8 @@ discard block |
||
91 | 91 | } |
92 | 92 | |
93 | 93 | /** |
94 | - * @param mixed $value |
|
95 | - */ |
|
94 | + * @param mixed $value |
|
95 | + */ |
|
96 | 96 | public function setMeta(string $key, $value): bool |
97 | 97 | { |
98 | 98 | $this->meta[$key] = $value; |
@@ -100,8 +100,8 @@ discard block |
||
100 | 100 | } |
101 | 101 | |
102 | 102 | /** |
103 | - * @return array<string,mixed> |
|
104 | - */ |
|
103 | + * @return array<string,mixed> |
|
104 | + */ |
|
105 | 105 | public function toArray(): array |
106 | 106 | { |
107 | 107 | // phpcs:ignore SlevomatCodingStandard.Arrays.AlphabeticallySortedByKeys.IncorrectKeyOrder |