Conversation
- Remove outdated Input Format Requirements section that contradicted array support - Add comprehensive HTML form examples with Jingu and Horikawa as sample names - Include checkbox and multi-select examples for simple array handling - Clarify data flow from HTML forms to PHP data structures - Maintain existing nested object and key normalization documentation This update makes the documentation more cohesive and removes the confusing restriction about nested arrays that no longer applies with the array support feature. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Reviewer's GuideThis PR refines array support in the README by removing outdated restrictions and adding clear HTML form examples for both object-based and simple arrays. Class diagram for controller method input handling with array supportclassDiagram
class UserListController {
+list(#[Input] array users)
}
class UserInput {
+string id
+string name
}
UserListController --> "*" UserInput : receives array of
class PreferencesController {
+updatePreferences(#[Input] array hobbies, #[Input] array categories)
}
PreferencesController : receives array of strings for hobbies and categories
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
WalkthroughThe README documentation for Ray.InputQuery was updated to provide expanded and clearer guidance on handling array and simple array input formats in HTML forms, including detailed examples. Restrictions on nested array structures were removed, reflecting a change in documented usage. No code or public API changes were made. Changes
Possibly related PRs
Poem
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (4)
README.md (4)
156-160: Promote subsection to a proper Markdown heading for TOC consistencyWithin the “### Array Support” section you switched to bold text instead of a level-4 heading. Using
#### Query data format for arrayskeeps the document hierarchy machine-navigable and matches other parts of the README (e.g., “### Basic Usage”, “### Nested Objects”).-**Query data format for arrays:** +#### Query data format for arrays
160-169: Add a closing</form>tag and blank line after the HTML snippetMinor markup hygiene: although browsers forgive the missing closing tag, including it avoids confusing copy-paste errors and keeps the example symmetrical.
- <input name="users[1][name]" value="Horikawa"> -</form> + <input name="users[1][name]" value="Horikawa"> +</form> +
185-202: Convert bold label to heading & group checkbox / select examples inside<form>For symmetry with the previous example and better formatting in some Markdown renderers, promote the label to a heading and wrap the inputs in a
<form>so that readers instantly see both belong to one submission context.-**Simple array values (e.g., checkboxes):** +#### Simple array values (e.g., checkboxes) -<!-- Checkbox group --> -<input name="hobbies[]" type="checkbox" value="music"> +<form method="post"> + <!-- Checkbox group --> + <input name="hobbies[]" type="checkbox" value="music"> ... -</select> +</select> +</form>
220-226: Remove extraneous colon inside fenced code blockThe colon after “Note” is outside the code fence and renders as plain text, breaking visual flow. Either move the colon inside the bold text or drop it.
-**Note:** For non-array parameters, use flat naming without brackets: +**Note** For non-array parameters, use flat naming without brackets:
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
README.md(1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: CR
PR: ray-di/Ray.InputQuery#0
File: docs/CLAUDE.md:0-0
Timestamp: 2025-07-03T12:18:36.698Z
Learning: Applies to docs/**/*.php : Every parameter sourced from query data must have the #[Input] attribute.
README.md (9)
Learnt from: CR
PR: ray-di/Ray.InputQuery#0
File: docs/CLAUDE.md:0-0
Timestamp: 2025-07-03T12:18:36.698Z
Learning: Applies to docs/**/*.php : Every parameter sourced from query data must have the #[Input] attribute.
Learnt from: CR
PR: ray-di/Ray.InputQuery#0
File: docs/CLAUDE.md:0-0
Timestamp: 2025-07-03T12:18:36.698Z
Learning: Applies to docs/src/InputQuery.php : For parameters with #[Input] and object type, extract prefixed keys from flat query and recursively create nested objects.
Learnt from: CR
PR: ray-di/Ray.InputQuery#0
File: docs/CLAUDE.md:0-0
Timestamp: 2025-07-03T12:18:36.698Z
Learning: Applies to docs/src/InputQuery.php : Implement a reasonable recursion depth limit (e.g., 10 levels) to prevent infinite recursion in nested input resolution.
Learnt from: CR
PR: ray-di/Ray.InputQuery#0
File: docs/CLAUDE.md:0-0
Timestamp: 2025-07-03T12:18:36.698Z
Learning: Applies to docs/src/InputQuery.php : Convert all query keys to camelCase, handling snake_case, kebab-case, and PascalCase.
Learnt from: CR
PR: ray-di/Ray.InputQuery#0
File: docs/CLAUDE.md:0-0
Timestamp: 2025-07-03T12:18:36.698Z
Learning: Applies to docs/src/InputQuery.php : Parameters with #[Input] but missing from query: use parameter default or null if allowed.
Learnt from: CR
PR: ray-di/Ray.InputQuery#0
File: docs/CLAUDE.md:0-0
Timestamp: 2025-07-03T12:18:36.698Z
Learning: Applies to docs/src/InputQuery.php : For parameters without #[Input], resolve them from the DI container, supporting #[Named] for scalar DI values.
Learnt from: CR
PR: ray-di/Ray.InputQuery#0
File: docs/CLAUDE.md:0-0
Timestamp: 2025-07-03T12:18:36.698Z
Learning: Applies to docs/src/InputQuery.php : Parameters without #[Input] that can't be resolved by DI: use parameter default or throw exception.
Learnt from: CR
PR: ray-di/Ray.InputQuery#0
File: docs/CLAUDE.md:0-0
Timestamp: 2025-07-03T12:18:36.698Z
Learning: Applies to docs/src/InputQueryInterface.php : InputQueryInterface must define getArguments(ReflectionMethod $method, array $query): array and create(string $class, array $query): object.
Learnt from: CR
PR: ray-di/Ray.InputQuery#0
File: docs/CLAUDE.md:0-0
Timestamp: 2025-07-03T12:18:36.698Z
Learning: Applies to docs/src/Attribute/Input.php : Attribute class Input must be defined as #[Attribute(Attribute::TARGET_PARAMETER)] in src/Attribute/Input.php.
- Convert bold text to proper markdown headings for better TOC - Add closing form tag and blank line for proper HTML structure - Wrap checkbox/select examples in form tag for consistency - Fix Note formatting by removing extraneous colon 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (3)
README.md (3)
156-184: Consider mentioning how non-sequential or missing numeric indexes are handled
Great example – it makes the object-array mapping crystal-clear. One minor clarification that could save readers troubleshooting time: PHP will preserve the provided numeric keys (and will fill in indexes automatically if[]is used), whileRay\InputQueryonly cares that the values are arrays. Explicitly stating that gaps / non-0-based indexes are tolerated (or not) would make expectations unambiguous.
186-204: Add a note that[]MUST be present for check-box groups & multi-selects
The snippet is correct, but a short sentence such as “Remember: omitting the trailing[]will cause only the last value to be sent” prevents a common pitfall for newcomers who copy / paste the HTML.
214-221: Explicitly document element type expectations for simple arrays
In the controller example the array is implicitly an array of strings. Readers may wonder whether they can declare#[Input(item: int::class)] array $idsfor primitive conversions. Adding a parenthetical (“primitive arrays don’t requireitem, only object arrays do”) would tighten the mental model.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
README.md(1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: CR
PR: ray-di/Ray.InputQuery#0
File: docs/CLAUDE.md:0-0
Timestamp: 2025-07-03T12:18:36.698Z
Learning: Applies to docs/**/*.php : Every parameter sourced from query data must have the #[Input] attribute.
README.md (9)
Learnt from: CR
PR: ray-di/Ray.InputQuery#0
File: docs/CLAUDE.md:0-0
Timestamp: 2025-07-03T12:18:36.698Z
Learning: Applies to docs/**/*.php : Every parameter sourced from query data must have the #[Input] attribute.
Learnt from: CR
PR: ray-di/Ray.InputQuery#0
File: docs/CLAUDE.md:0-0
Timestamp: 2025-07-03T12:18:36.698Z
Learning: Applies to docs/src/InputQuery.php : For parameters with #[Input] and object type, extract prefixed keys from flat query and recursively create nested objects.
Learnt from: CR
PR: ray-di/Ray.InputQuery#0
File: docs/CLAUDE.md:0-0
Timestamp: 2025-07-03T12:18:36.698Z
Learning: Applies to docs/src/InputQuery.php : Parameters with #[Input] but missing from query: use parameter default or null if allowed.
Learnt from: CR
PR: ray-di/Ray.InputQuery#0
File: docs/CLAUDE.md:0-0
Timestamp: 2025-07-03T12:18:36.698Z
Learning: Applies to docs/src/InputQueryInterface.php : InputQueryInterface must define getArguments(ReflectionMethod $method, array $query): array and create(string $class, array $query): object.
Learnt from: CR
PR: ray-di/Ray.InputQuery#0
File: docs/CLAUDE.md:0-0
Timestamp: 2025-07-03T12:18:36.698Z
Learning: Applies to docs/src/InputQuery.php : For parameters without #[Input], resolve them from the DI container, supporting #[Named] for scalar DI values.
Learnt from: CR
PR: ray-di/Ray.InputQuery#0
File: docs/CLAUDE.md:0-0
Timestamp: 2025-07-03T12:18:36.698Z
Learning: Applies to docs/src/InputQuery.php : Parameters without #[Input] that can't be resolved by DI: use parameter default or throw exception.
Learnt from: CR
PR: ray-di/Ray.InputQuery#0
File: docs/CLAUDE.md:0-0
Timestamp: 2025-07-03T12:18:36.698Z
Learning: Applies to docs/src/InputQuery.php : Convert all query keys to camelCase, handling snake_case, kebab-case, and PascalCase.
Learnt from: CR
PR: ray-di/Ray.InputQuery#0
File: docs/CLAUDE.md:0-0
Timestamp: 2025-07-03T12:18:36.698Z
Learning: Applies to docs/src/InputQuery.php : Implement a reasonable recursion depth limit (e.g., 10 levels) to prevent infinite recursion in nested input resolution.
Learnt from: CR
PR: ray-di/Ray.InputQuery#0
File: docs/CLAUDE.md:0-0
Timestamp: 2025-07-03T12:18:36.698Z
Learning: Applies to docs/src/Attribute/Input.php : Attribute class Input must be defined as #[Attribute(Attribute::TARGET_PARAMETER)] in src/Attribute/Input.php.
docs: Improve array support documentation
Summary
Changes
Impact
This makes the documentation clearer and more comprehensive, helping developers understand:
🤖 Generated with Claude Code
Summary by Sourcery
Improve array input documentation by removing outdated restrictions, adding detailed HTML form examples for object and simple arrays, and clarifying resulting PHP data structures and naming conventions.
Documentation:
Summary by CodeRabbit