Skip to content

Commit 621a733

Browse files
BafSfrantuma
authored andcommitted
Make generic model compatible with PHP 8.1
Add #[\ReturnTypeWillChange] (https://php.watch/versions/8.1/ReturnTypeWillChange) to avoid deprecation notices.
1 parent 1da06be commit 621a733

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

modules/swagger-codegen/src/main/resources/php/model_generic.mustache

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,7 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}{{^pa
353353
*
354354
* @return boolean
355355
*/
356+
#[\ReturnTypeWillChange]
356357
public function offsetExists($offset)
357358
{
358359
return isset($this->container[$offset]);
@@ -365,6 +366,7 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}{{^pa
365366
*
366367
* @return mixed
367368
*/
369+
#[\ReturnTypeWillChange]
368370
public function offsetGet($offset)
369371
{
370372
return isset($this->container[$offset]) ? $this->container[$offset] : null;
@@ -378,6 +380,7 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}{{^pa
378380
*
379381
* @return void
380382
*/
383+
#[\ReturnTypeWillChange]
381384
public function offsetSet($offset, $value)
382385
{
383386
if (is_null($offset)) {
@@ -394,6 +397,7 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}{{^pa
394397
*
395398
* @return void
396399
*/
400+
#[\ReturnTypeWillChange]
397401
public function offsetUnset($offset)
398402
{
399403
unset($this->container[$offset]);

0 commit comments

Comments
 (0)