You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I encountered an issue where PHPStan threw an incorrect error regarding method return type declaration. Here's the scenario:
Problem:
I have a method getData() in my codebase which fetches data from the database and returns an array of associative arrays. The return type declaration of this method is specified accurately. However, PHPStan still throws this error suggesting that the return type is incorrect.
Method
App\Repository\FakeRepository::getData()
should return array<array{key1: string, key2: string, key3: string,
key4: int, key5: int}> but returns array.
Please make sure you have the latest versions of PHPStan and phpstan-doctrine installed. And please make sure you have configured objectManagerLoader. See the README here.
Hi All,
I encountered an issue where PHPStan threw an incorrect error regarding method return type declaration. Here's the scenario:
Problem:
I have a method getData() in my codebase which fetches data from the database and returns an array of associative arrays. The return type declaration of this method is specified accurately. However, PHPStan still throws this error suggesting that the return type is incorrect.
Additional Information:
"php": ">=8.3",
"phpstan/extension-installer": "^1.3.1",
"phpstan/phpstan": "^1.10.47",
"phpstan/phpstan-deprecation-rules": "^1.1.4",
"phpstan/phpstan-doctrine": "^1.3.53",
"phpstan/phpstan-phpunit": "^1.3.15",
"phpstan/phpstan-symfony": "^1.3.5",
Thank you for your attention to this matter. Please let me know if you need any further information or clarification.
The text was updated successfully, but these errors were encountered: