Skip to content

Commit e00a82e

Browse files
authored
Document array shape for ArrayResult::__unserialize() (#7251)
| Q | A |------------- | ----------- | Type | improvement #### Summary Related #7248 This small PR fixes only this 2 warnings in this file: ``` vendor/bin/phpstan analyse --level=9 src/Cache/ArrayResult.php Note: Using configuration file /home/shakaran/Documentos/ProjectsSSD/dbal/phpstan.neon.dist. 1/1 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100% ------ ---------------------------------------------------------------------------------------------- Line ArrayResult.php ------ ---------------------------------------------------------------------------------------------- 124 Property Doctrine\DBAL\Cache\ArrayResult::$columnNames (list<string>) does not accept mixed. 🪪 assign.propertyType 💡 mixed is not a list. 124 Property Doctrine\DBAL\Cache\ArrayResult::$rows (list<list<mixed>>) does not accept mixed. 🪪 assign.propertyType 💡 mixed is not a list. ------ ---------------------------------------------------------------------------------------------- ``` This pull request makes a minor improvement to the type annotation in the docblock for the `$data` parameter of the `__unserialize` method in `src/Cache/ArrayResult.php`, providing a more precise description of the expected array structure.
1 parent cfe0d15 commit e00a82e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Cache/ArrayResult.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public function __serialize(): array
107107
return [$this->columnNames, $this->rows];
108108
}
109109

110-
/** @param mixed[] $data */
110+
/** @param array{list<string>, list<list<mixed>>} $data */
111111
public function __unserialize(array $data): void
112112
{
113113
// Handle objects serialized with DBAL 4.1 and earlier.

0 commit comments

Comments
 (0)