Upgrade tests for PHP 7.4. (#20545)

This commit is contained in:
Wilmer Arambula
2025-09-29 19:33:08 -03:00
committed by GitHub
parent 33ed3218bf
commit 9b158e514e
57 changed files with 594 additions and 424 deletions

View File

@ -1,12 +1,18 @@
<?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/
declare(strict_types=1);
namespace yiiunit\data\base;
use ArrayAccess;
use ReturnTypeWillChange;
/**
* ArrayAccessObject
* Object that extends [[TraversableObject]] and implements `\ArrayAccess`
@ -14,7 +20,7 @@ namespace yiiunit\data\base;
* @author Dmytro Naumenko <d.naumenko.a@gmail.com>
* @since 2.0.14.1
*/
class ArrayAccessObject extends TraversableObject implements \ArrayAccess
class ArrayAccessObject extends TraversableObject implements ArrayAccess
{
/**
* Whether a offset exists
@ -29,8 +35,7 @@ class ArrayAccessObject extends TraversableObject implements \ArrayAccess
* The return value will be casted to boolean if non-boolean was returned.
* @since 2.0.14.1
*/
#[\ReturnTypeWillChange]
public function offsetExists($offset)
public function offsetExists($offset): bool
{
return isset($this->data[$offset]);
}
@ -45,7 +50,7 @@ class ArrayAccessObject extends TraversableObject implements \ArrayAccess
* @return mixed Can return all value types.
* @since 2.0.14.1
*/
#[\ReturnTypeWillChange]
#[ReturnTypeWillChange]
public function offsetGet($offset)
{
return $this->data[$offset];
@ -64,8 +69,7 @@ class ArrayAccessObject extends TraversableObject implements \ArrayAccess
* @return void
* @since 2.0.14.1
*/
#[\ReturnTypeWillChange]
public function offsetSet($offset, $value)
public function offsetSet($offset, $value): void
{
$this->data[$offset] = $value;
}
@ -80,8 +84,7 @@ class ArrayAccessObject extends TraversableObject implements \ArrayAccess
* @return void
* @since 2.0.14.1
*/
#[\ReturnTypeWillChange]
public function offsetUnset($offset)
public function offsetUnset($offset): void
{
unset($this->data[$offset]);
}