Repository navigation
Conversation
Reviewer's GuideConfigurationAdd Middleware to the Internals sidebar so readers can navigate to the new article.
DocumentationDocument middleware failure-handler conventions and examples, and list the article in the Internals index.
Lock files and vendored codeUpdate package-lock metadata associated with the change.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Linked issuesChecked at commit 21c0de5 #318 Create "Middleware" article in "Internals" · 2 of 3 met
|
There was a problem hiding this comment.
Hey - I've found 3 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="src/internals/024-middleware.md" line_range="12" />
<code_context>
+```php
+interface AuthenticationFailureHandlerInterface
+{
+ public function handle(ServerRequestInterface $request): ResponseInterface;
+}
+```
</code_context>
<issue_to_address>
**Handler examples fail in namespaces**
When a reader copies either interface into a namespaced PHP file and implements it using the PSR message interfaces, the type names resolve in the code's namespace instead of to PSR message types, so an implementation using the actual PSR interfaces has incompatible method signatures and PHP rejects it.
Add the appropriate `use` statements or fully qualify the PSR types and `Throwable` in both examples.
Also at `src/internals/024-middleware.md:21`.
</issue_to_address>
### Comment 2
<location path="src/internals/024-middleware.md" line_range="1" />
<code_context>
+# Middleware
+
+## Failure Handlers
</code_context>
<issue_to_address>
**Middleware stays undiscoverable**
When the Middleware article is added to navigation without updating the manually maintained Internals Table of Contents, `src/internals/index.md` still ends its Table of Contents at GitHub Actions, so readers using that index cannot find or open the new article.
Add Middleware to the Table of Contents in `src/internals/index.md`.
Also at `src/.vitepress/config.js:285`.
</issue_to_address>
### Comment 3
<location path="src/internals/024-middleware.md" line_range="1" />
<code_context>
+# Middleware
+
+## Failure Handlers
</code_context>
<issue_to_address>
**Localized readers can't find article**
When readers browse the Internals section in a non-English locale, the localized Internals sections have no corresponding article or sidebar link for 024, so readers using those locales cannot find the new guidance there and must switch to English or navigate to it directly.
Add localized versions of the article and corresponding entries to the localized Internals sidebars.
Also at `src/.vitepress/config.js:285`.
</issue_to_address>Sourcery assessment
Approval pending. 2 findings to address first.
Blocking findings: src/internals/024-middleware.md:12, src/internals/024-middleware.md:1
Signed-off-by: Rhys Morgan <rhysw@users.noreply.github.com>
|
|
||
| ## Failure Handlers | ||
|
|
||
| Each middleware may have its own failure handler. A failure handler should **not** implement `RequestHandlerInterface` because it is specific to the middleware. |
There was a problem hiding this comment.
🟡 Medium · State interface convention
The issue asks for a separate failure handler interface for each middleware. The article says each middleware may have its own failure handler, but does not explicitly require a separate interface for each one.
Prompt for AI agents
In `src/internals/024-middleware.md` at line 5:
**State interface convention**
The issue asks for a separate failure handler interface for each middleware. The article says each middleware may have its own failure handler, but does not explicitly require a separate interface for each one.From #318:
Create a separate failure handler interface for each middleware.
Fixes #318
Summary
Summary by Sourcery
Document middleware failure handler conventions and add the new article to the Internals documentation navigation.
New Features:
Documentation: