mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-10-13 16:03:43 +00:00
fix PHP: Fixed typing of offsetGet/offsetSet (#21583)
This commit is contained in:
parent
ac5478e909
commit
e4c9eb36e9
@ -476,11 +476,11 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}}{{/parentSchema}}{{^par
|
||||
/**
|
||||
* Returns true if offset exists. False otherwise.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
* @param integer|string $offset Offset
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function offsetExists($offset): bool
|
||||
public function offsetExists(mixed $offset): bool
|
||||
{
|
||||
return isset($this->container[$offset]);
|
||||
}
|
||||
@ -488,12 +488,12 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}}{{/parentSchema}}{{^par
|
||||
/**
|
||||
* Gets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
* @param integer|string $offset Offset
|
||||
*
|
||||
* @return mixed|null
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function offsetGet($offset)
|
||||
public function offsetGet(mixed $offset)
|
||||
{
|
||||
return $this->container[$offset] ?? null;
|
||||
}
|
||||
@ -518,11 +518,11 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}}{{/parentSchema}}{{^par
|
||||
/**
|
||||
* Unsets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
* @param integer|string $offset Offset
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function offsetUnset($offset): void
|
||||
public function offsetUnset(mixed $offset): void
|
||||
{
|
||||
unset($this->container[$offset]);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user