fix PHP: Fixed typing of offsetGet/offsetSet (#21583)

This commit is contained in:
florentausha 2025-08-28 09:46:44 +02:00 committed by GitHub
parent ac5478e909
commit e4c9eb36e9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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]);
} }