1 | <?php |
||
10 | final class NormalizerContext implements NormalizerContextInterface |
||
11 | { |
||
12 | /** |
||
13 | * @deprecated |
||
14 | * |
||
15 | * @var string[] |
||
16 | */ |
||
17 | private $groups = []; |
||
18 | |||
19 | /** |
||
20 | * @var ServerRequestInterface|null |
||
21 | */ |
||
22 | private $request; |
||
23 | |||
24 | /** |
||
25 | * @var array |
||
26 | */ |
||
27 | private $attributes; |
||
28 | |||
29 | /** |
||
30 | * @param string[] $groups |
||
31 | * @param ServerRequestInterface|null $request |
||
32 | * @param array $attributes |
||
33 | */ |
||
34 | 2 | public function __construct(array $groups = [], ServerRequestInterface $request = null, array $attributes = []) |
|
44 | |||
45 | /** |
||
46 | * @deprecated |
||
47 | * |
||
48 | * @return string[] |
||
49 | */ |
||
50 | 2 | public function getGroups(): array |
|
54 | |||
55 | /** |
||
56 | * @return ServerRequestInterface|null |
||
57 | */ |
||
58 | 2 | public function getRequest() |
|
62 | |||
63 | /** |
||
64 | * @return array |
||
65 | */ |
||
66 | public function getAttributes(): array |
||
70 | |||
71 | /** |
||
72 | * @param string $name |
||
73 | * @param mixed $default |
||
74 | * |
||
75 | * @return mixed |
||
76 | */ |
||
77 | public function getAttribute(string $name, $default = null) |
||
85 | |||
86 | /** |
||
87 | * @param string $name |
||
88 | * @param mixed $value |
||
89 | * @return NormalizerContextInterface |
||
90 | */ |
||
91 | public function withAttribute(string $name, $value): NormalizerContextInterface |
||
98 | } |
||
99 |
If you suppress an error, we recommend checking for the error condition explicitly: