I have this code
/** @var array{total: integer, records: array} $response */
$response = $this->getResponse();
foreach($response['total'] as $value) {
$this->saveRecord($value);
}
Shouldn't PhpStorm give me a warning using PHPDoc static analysis that I'm trying to iterate over $response['total'], which is an integer ?
At the moment, we add the
mixedtype to all array shapes, that is why the inspection isn't triggered.You can check what type any symbol holds by selecting it and clicking View | Type Info.