Skip to content

Fix [Bug]: diagnostics for middleware wrong on #[Middleware] attribute#651

Open
N1ebieski wants to merge 1 commit into
laravel:mainfrom
N1ebieski:#649-Bug-diagnostics-for-middleware-wrong-on-Middleware-attribute
Open

Fix [Bug]: diagnostics for middleware wrong on #[Middleware] attribute#651
N1ebieski wants to merge 1 commit into
laravel:mainfrom
N1ebieski:#649-Bug-diagnostics-for-middleware-wrong-on-Middleware-attribute

Conversation

@N1ebieski

@N1ebieski N1ebieski commented May 21, 2026

Copy link
Copy Markdown
Contributor

Fixes #649

There is a bug affecting all FeatureTag patterns for PHP attributes such as #[Middleware]. The parser currently supports only class and method attributes in FeatureTag. The argumentIndex is ignored.

I see two possible solutions:

  1. Add support for argumentIndex in the parser
  2. Introduce isCorrectIndexForMethod for every linkProvider/diagnosticProvider that supports PHP attributes, similar to this solution for Route::view

This PR proposes the first solution.

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.

[Bug]: diagnostics for middleware wrong on #[Middleware] attribute

1 participant