Bug report
Code snippet that reproduces the problem
https://phpstan.org/r/db3495e0-2cc4-4acb-ba04-ce742258680a
A smaller variant of the original snippet:
https://phpstan.org/r/e2636992-cccb-46db-9f06-56a4e34c0855
Output:
+-----------------------------------------------------------------------------------------------------------------------------------------------------------+
| Line | test.php |
+-----------------------------------------------------------------------------------------------------------------------------------------------------------+
| 64 | Method ArrayItemRemoval::getResultSettings() should return array('remove' => string, 'limit' => int) but returns array<string, mixed>. |
+-----------------------------------------------------------------------------------------------------------------------------------------------------------+
Expected output
I would expect no issue, as within the method i make sure the two keys are the correct value.
The array merge makes sure the keys exist are there. Since it is a const the keys are (should) be known to phpstan. The rest of the method asserts they are correct.
I would've expected phpstan to add the new information of the shape of the array to the type system.
Bug report
Code snippet that reproduces the problem
https://phpstan.org/r/db3495e0-2cc4-4acb-ba04-ce742258680a
A smaller variant of the original snippet:
https://phpstan.org/r/e2636992-cccb-46db-9f06-56a4e34c0855
Output:
Expected output
I would expect no issue, as within the method i make sure the two keys are the correct value.
The array merge makes sure the keys exist are there. Since it is a const the keys are (should) be known to phpstan. The rest of the method asserts they are correct.
I would've expected phpstan to add the new information of the shape of the array to the type system.