Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed Larastan Errors: Return type for rules() methods #323

Closed
wants to merge 2 commits into from

Conversation

ryo-kozin
Copy link

While analyzing the codebase with Larastan, I encountered the following errors:

./vendor/bin/phpstan analyse --memory-limit=2G
...
Line Http/Requests/Auth/LoginRequest.php
:27 Method App\Http\Requests\Auth\LoginRequest::rules() return type has no value type specified
in iterable type array.
💡 See: https://phpstan.org/blog/solving-phpstan-no-value-type-specified-in-iterable-type

Line Http/Requests/ProfileUpdateRequest.php
:16 Method App\Http\Requests\ProfileUpdateRequest::rules() return type has no value type
specified in iterable type array.
💡 See: https://phpstan.org/blog/solving-phpstan-no-value-type-specified-in-iterable-type
...

To address these issues, I've made modifications to the return type of the rules() methods. Specifically, I've changed the array to string[]. With this adjustment, the aforementioned Larastan errors are resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants