add return type hints (#1351)

now that 7.4 and 8.0 support is dropped, we can add correct return type-hints
to these functions, and remove the ReturnTypeWillChange attribute.
This commit is contained in:
Brett McBride 2024-07-19 23:33:49 +10:00 committed by GitHub
parent e4f9604411
commit 1271f1ed69
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 15 deletions

View File

@ -49,20 +49,16 @@ final class AttributesBuilder implements AttributesBuilderInterface
/**
* @phan-suppress PhanUndeclaredClassAttribute
* @return mixed
*/
#[\ReturnTypeWillChange]
public function offsetGet($offset)
public function offsetGet($offset): mixed
{
return $this->attributes[$offset] ?? null;
}
/**
* @phan-suppress PhanUndeclaredClassAttribute
* @return void
*/
#[\ReturnTypeWillChange]
public function offsetSet($offset, $value)
public function offsetSet($offset, $value): void
{
if ($offset === null) {
return;
@ -92,10 +88,8 @@ final class AttributesBuilder implements AttributesBuilderInterface
/**
* @phan-suppress PhanUndeclaredClassAttribute
* @return void
*/
#[\ReturnTypeWillChange]
public function offsetUnset($offset)
public function offsetUnset($offset): void
{
unset($this->attributes[$offset]);
}

View File

@ -48,8 +48,7 @@ final class FilteredAttributesBuilder implements AttributesBuilderInterface
/**
* @phan-suppress PhanUndeclaredClassAttribute
*/
#[\ReturnTypeWillChange]
public function offsetGet($offset)
public function offsetGet(mixed $offset): mixed
{
return $this->builder->offsetGet($offset);
}
@ -57,8 +56,7 @@ final class FilteredAttributesBuilder implements AttributesBuilderInterface
/**
* @phan-suppress PhanUndeclaredClassAttribute
*/
#[\ReturnTypeWillChange]
public function offsetSet($offset, $value)
public function offsetSet($offset, $value): void
{
if ($value !== null && in_array($offset, $this->rejectedKeys, true)) {
$this->rejected++;
@ -72,8 +70,7 @@ final class FilteredAttributesBuilder implements AttributesBuilderInterface
/**
* @phan-suppress PhanUndeclaredClassAttribute
*/
#[\ReturnTypeWillChange]
public function offsetUnset($offset)
public function offsetUnset($offset): void
{
$this->builder->offsetUnset($offset);
}