Repository navigation
Give a computed field an argument for each parameter of its method - #313
Merged
TomHAnderson merged 1 commit intoOct 3, 2026
Merged
TomHAnderson merged 1 commit into
TomHAnderson merged 1 commit into
Conversation
#[ComputedField(type: 'int')]
public function getTotalRecordings(int|null $year = null): int
is queried as totalRecordings or totalRecordings(year: 2002).
An int, float, string or bool parameter is an Int, Float, String or
Boolean argument; the attribute's new args give the registered type of
any other parameter. A parameter which does not allow null is a
non-null argument, and its default value is the argument's. A variadic
or by-reference parameter, a parameter of another type without one in
args, a default which is not scalar, and args naming no parameter are
errors when the metadata is built; an argument whose type cannot be
input is one when the type is built.
The method is called with the arguments by name. The values of a field
with arguments are cached per set of them, so aliases with different
arguments each have their own, and the hydrator's extract() leaves such
a field out.
The metadata format version is 3, as computed fields have an args key.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 14.0.x #313 +/- ##
============================================
Coverage 100.00% 100.00%
- Complexity 1147 1191 +44
============================================
Files 79 80 +1
Lines 3100 3213 +113
============================================
+ Hits 3100 3213 +113 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
is queried as totalRecordings or totalRecordings(year: 2002).
An int, float, string or bool parameter is an Int, Float, String or Boolean argument; the attribute's new args give the registered type of any other parameter. A parameter which does not allow null is a non-null argument, and its default value is the argument's. A variadic or by-reference parameter, a parameter of another type without one in args, a default which is not scalar, and args naming no parameter are errors when the metadata is built; an argument whose type cannot be input is one when the type is built.
The method is called with the arguments by name. The values of a field with arguments are cached per set of them, so aliases with different arguments each have their own, and the hydrator's extract() leaves such a field out.
The metadata format version is 3, as computed fields have an args key.