Skip to content

Commit e31fa54

Browse files
committed
Add ReturnTypeWillChange attributes to prevent PHP Deprecation warnings
1 parent 04e275f commit e31fa54

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

Diff for: src/spec/Paths.php

+4
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ public function getErrors(): array
183183
* @return boolean true on success or false on failure.
184184
* The return value will be casted to boolean if non-boolean was returned.
185185
*/
186+
#[\ReturnTypeWillChange]
186187
public function offsetExists($offset)
187188
{
188189
return $this->hasPath($offset);
@@ -194,6 +195,7 @@ public function offsetExists($offset)
194195
* @param mixed $offset The offset to retrieve.
195196
* @return PathItem Can return all value types.
196197
*/
198+
#[\ReturnTypeWillChange]
197199
public function offsetGet($offset)
198200
{
199201
return $this->getPath($offset);
@@ -205,6 +207,7 @@ public function offsetGet($offset)
205207
* @param mixed $offset The offset to assign the value to.
206208
* @param mixed $value The value to set.
207209
*/
210+
#[\ReturnTypeWillChange]
208211
public function offsetSet($offset, $value)
209212
{
210213
$this->addPath($offset, $value);
@@ -215,6 +218,7 @@ public function offsetSet($offset, $value)
215218
* @link http://php.net/manual/en/arrayaccess.offsetunset.php
216219
* @param mixed $offset The offset to unset.
217220
*/
221+
#[\ReturnTypeWillChange]
218222
public function offsetUnset($offset)
219223
{
220224
$this->removePath($offset);

Diff for: src/spec/Responses.php

+4
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ public function getErrors(): array
173173
* @return boolean true on success or false on failure.
174174
* The return value will be casted to boolean if non-boolean was returned.
175175
*/
176+
#[\ReturnTypeWillChange]
176177
public function offsetExists($offset)
177178
{
178179
return $this->hasResponse($offset);
@@ -184,6 +185,7 @@ public function offsetExists($offset)
184185
* @param mixed $offset The offset to retrieve.
185186
* @return mixed Can return all value types.
186187
*/
188+
#[\ReturnTypeWillChange]
187189
public function offsetGet($offset)
188190
{
189191
return $this->getResponse($offset);
@@ -195,6 +197,7 @@ public function offsetGet($offset)
195197
* @param mixed $offset The offset to assign the value to.
196198
* @param mixed $value The value to set.
197199
*/
200+
#[\ReturnTypeWillChange]
198201
public function offsetSet($offset, $value)
199202
{
200203
$this->addResponse($offset, $value);
@@ -205,6 +208,7 @@ public function offsetSet($offset, $value)
205208
* @link http://php.net/manual/en/arrayaccess.offsetunset.php
206209
* @param mixed $offset The offset to unset.
207210
*/
211+
#[\ReturnTypeWillChange]
208212
public function offsetUnset($offset)
209213
{
210214
$this->removeResponse($offset);

0 commit comments

Comments
 (0)