Skip to content

Add "Custom hydrator type casters" article - #537

Merged
samdark merged 9 commits into
masterfrom
typecaster
Oct 15, 2026
Merged

samdark merged 9 commits into
masterfrom
typecaster

Conversation

@vjik

@vjik vjik commented Oct 14, 2026

Copy link
Copy Markdown
Member

No description provided.

@vjik
vjik requested a balanced review from Copilot October 14, 2026 11:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The request-input example imports RouteArgument from a nonexistent namespace.

1 open finding
What changed in this PR

Adds a cookbook article explaining custom Yii Hydrator type casters.

Changes:

  • Documents caster creation and registration.
  • Demonstrates UUID value objects with request and form models.
  • Adds cookbook navigation entries.
File Description
src/​cookbook/​index.md Adds the article to the cookbook index.
src/​cookbook/​custom-hydrator-type-casters.md Adds the new tutorial and examples.
src/​.vitepress/​config.js Adds the article to VitePress navigation.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/cookbook/custom-hydrator-type-casters.md Outdated
@vjik
vjik requested a balanced review from Copilot October 14, 2026 11:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The article contains incomplete DI guidance and edge cases that can make examples fail or produce an incorrect value-object type.

3 open findings
1 resolved since last review

🧠 Review effort: Balanced

Comment thread src/cookbook/custom-hydrator-type-casters.md Outdated
Comment thread src/cookbook/custom-hydrator-type-casters.md Outdated
Comment thread src/cookbook/custom-hydrator-type-casters.md Outdated
@vjik
vjik requested a balanced review from Copilot October 14, 2026 11:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The article incorrectly describes failed casts as universally silent, although required constructor arguments cause object creation to fail.

0 open findings

3 resolved since last review
Previously missed (1)

In code that hasn't changed since last review

Low severity Clarify caster behavior for required constructor arguments

src/​cookbook/​custom-hydrator-type-casters.md:91

This is only silent when hydrating a property. If the same caster rejects a value for a required constructor parameter, ConstructorArgumentsExtractor omits that argument and ReflectionObjectFactory throws WrongConstructorArgumentsCountException, so the article's earlier promise that the caster applies to constructor parameters makes this general statement misleading. Please distinguish property hydration from required constructor arguments.

🧠 Review effort: Balanced

@vjik
vjik requested a review from a team October 14, 2026 11:38
@vjik vjik added the status:code review The pull request needs review. label Oct 14, 2026
@samdark
samdark merged commit df7a4a7 into master Oct 15, 2026
2 checks passed
@samdark
samdark deleted the typecaster branch October 15, 2026 11:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status:code review The pull request needs review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants