Fix #20645: Add missing generics in yii\helpers and yii\test namespaces. Fix PHPDoc annotations in ArrayAccessTrait

This commit is contained in:
Maksim Spirkov
2025-10-28 14:58:58 +03:00
committed by GitHub
parent 503828ef3a
commit ed9af8a551
5 changed files with 29 additions and 4 deletions

View File

@@ -17,6 +17,9 @@ use yii\base\InvalidConfigException;
*
* @author Mark Jebri <mark.github@yandex.ru>
* @since 2.0
*
* @implements \IteratorAggregate<string, array<string, mixed>>
* @implements \ArrayAccess<string, array<string, mixed>|null>
*/
class ArrayFixture extends Fixture implements \IteratorAggregate, \ArrayAccess, \Countable
{
@@ -25,6 +28,9 @@ class ArrayFixture extends Fixture implements \IteratorAggregate, \ArrayAccess,
/**
* @var array the data rows. Each array element represents one row of data (column name => column value).
*
* @phpstan-var array<string, array<string, mixed>>
* @psalm-var array<string, array<string, mixed>>
*/
public $data = [];
@@ -48,6 +54,9 @@ class ArrayFixture extends Fixture implements \IteratorAggregate, \ArrayAccess,
*
* @return array the data to be put into the database
* @throws InvalidConfigException if the specified data file does not exist.
*
* @phpstan-return array<string, array<string, mixed>>
* @psalm-return array<string, array<string, mixed>>
*/
protected function getData()
{