Skip to content

Commit e4c9eb3

Browse files
authored
fix PHP: Fixed typing of offsetGet/offsetSet (#21583)
1 parent ac5478e commit e4c9eb3

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

modules/openapi-generator/src/main/resources/php/model_generic.mustache

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -476,24 +476,24 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}}{{/parentSchema}}{{^par
476476
/**
477477
* Returns true if offset exists. False otherwise.
478478
*
479-
* @param integer $offset Offset
479+
* @param integer|string $offset Offset
480480
*
481481
* @return boolean
482482
*/
483-
public function offsetExists($offset): bool
483+
public function offsetExists(mixed $offset): bool
484484
{
485485
return isset($this->container[$offset]);
486486
}
487487

488488
/**
489489
* Gets offset.
490490
*
491-
* @param integer $offset Offset
491+
* @param integer|string $offset Offset
492492
*
493493
* @return mixed|null
494494
*/
495495
#[\ReturnTypeWillChange]
496-
public function offsetGet($offset)
496+
public function offsetGet(mixed $offset)
497497
{
498498
return $this->container[$offset] ?? null;
499499
}
@@ -518,11 +518,11 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}}{{/parentSchema}}{{^par
518518
/**
519519
* Unsets offset.
520520
*
521-
* @param integer $offset Offset
521+
* @param integer|string $offset Offset
522522
*
523523
* @return void
524524
*/
525-
public function offsetUnset($offset): void
525+
public function offsetUnset(mixed $offset): void
526526
{
527527
unset($this->container[$offset]);
528528
}

0 commit comments

Comments
 (0)