Skip to content

Conversation

@google-labs-jules
Copy link
Contributor

This submission fixes three errors reported by the PHPStan static analysis tool.

  1. Undefined method middleware() in UserController and SuggestionController: The calls to $this->middleware() were removed from the constructors of these controllers. This method of defining middleware in constructors is deprecated. The middleware was already correctly applied to the UserController routes, and was added to the SuggestionController routes.

  2. Incorrect PHPDoc in CheckRole middleware: The PHPDoc for the handle method was corrected to properly document the variadic ...$roles parameter.

- Refactors middleware definitions to resolve undefined method calls.
- The middleware logic was moved from controller constructors to the route definitions in routes/web.php, which is the modern and correct approach in Laravel.
- Corrects an inaccurate PHPDoc in the CheckRole middleware.

These changes resolve all errors reported by the phpstan analyse command.
Adds a new section to AGENTS.md to instruct agents not to run tests unless specifically asked by the user.
@attogram attogram marked this pull request as ready for review August 27, 2025 22:02
@attogram attogram merged commit e2cbc4c into master Aug 27, 2025
1 check passed
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