1 | <?php |
||
26 | class CommonBody implements Body |
||
27 | { |
||
28 | /** @var string */ |
||
29 | private $method; |
||
30 | /** @var string|null */ |
||
31 | private $methodVersion; |
||
32 | /** @var mixed[] */ |
||
33 | private $arguments; |
||
34 | /** @var \stdClass */ |
||
35 | private $options; |
||
36 | /** @var string|mixed */ |
||
37 | private $id; |
||
38 | |||
39 | /** |
||
40 | * @param mixed $id |
||
41 | */ |
||
42 | public function __construct( |
||
55 | |||
56 | /** |
||
57 | * {@inheritDoc} |
||
58 | */ |
||
59 | public function getMethod(): string |
||
63 | |||
64 | /** |
||
65 | * {@inheritDoc} |
||
66 | */ |
||
67 | public function withMethod(string $method, string $version = null): Body |
||
74 | |||
75 | /** |
||
76 | * {@inheritDoc} |
||
77 | */ |
||
78 | public function getArguments(): array |
||
82 | |||
83 | /** |
||
84 | * {@inheritDoc} |
||
85 | */ |
||
86 | public function withArgument($argument): Body |
||
93 | |||
94 | /** |
||
95 | * {@inheritDoc} |
||
96 | * #TODO assert array is not associative |
||
97 | */ |
||
98 | public function withArguments(array $arguments): Body |
||
105 | |||
106 | /** |
||
107 | * {@inheritDoc} |
||
108 | */ |
||
109 | public function getOptions(): stdClass |
||
113 | |||
114 | /** |
||
115 | * {@inheritDoc} |
||
116 | */ |
||
117 | public function withOption($name, $value): Body |
||
124 | |||
125 | /** |
||
126 | * {@inheritDoc} |
||
127 | */ |
||
128 | public function withOptions(array $options): Body |
||
135 | |||
136 | /** |
||
137 | * {@inheritDoc} |
||
138 | */ |
||
139 | public function withAddedOptions(array $options): Body |
||
146 | |||
147 | /** |
||
148 | * @return string|mixed |
||
149 | */ |
||
150 | public function getId() |
||
154 | |||
155 | /** |
||
156 | * {@inheritDoc} |
||
157 | */ |
||
158 | public function jsonSerialize(): array |
||
166 | } |
||
167 |