mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-10-14 00:13:50 +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.
|
* Returns true if offset exists. False otherwise.
|
||||||
*
|
*
|
||||||
* @param integer $offset Offset
|
* @param integer|string $offset Offset
|
||||||
*
|
*
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
public function offsetExists($offset): bool
|
public function offsetExists(mixed $offset): bool
|
||||||
{
|
{
|
||||||
return isset($this->container[$offset]);
|
return isset($this->container[$offset]);
|
||||||
}
|
}
|
||||||
@ -488,12 +488,12 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}}{{/parentSchema}}{{^par
|
|||||||
/**
|
/**
|
||||||
* Gets offset.
|
* Gets offset.
|
||||||
*
|
*
|
||||||
* @param integer $offset Offset
|
* @param integer|string $offset Offset
|
||||||
*
|
*
|
||||||
* @return mixed|null
|
* @return mixed|null
|
||||||
*/
|
*/
|
||||||
#[\ReturnTypeWillChange]
|
#[\ReturnTypeWillChange]
|
||||||
public function offsetGet($offset)
|
public function offsetGet(mixed $offset)
|
||||||
{
|
{
|
||||||
return $this->container[$offset] ?? null;
|
return $this->container[$offset] ?? null;
|
||||||
}
|
}
|
||||||
@ -518,11 +518,11 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}}{{/parentSchema}}{{^par
|
|||||||
/**
|
/**
|
||||||
* Unsets offset.
|
* Unsets offset.
|
||||||
*
|
*
|
||||||
* @param integer $offset Offset
|
* @param integer|string $offset Offset
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function offsetUnset($offset): void
|
public function offsetUnset(mixed $offset): void
|
||||||
{
|
{
|
||||||
unset($this->container[$offset]);
|
unset($this->container[$offset]);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user