Sheath rule
statamic-fluent-required-parameters
Executed literal Statamic fluent calls must provide the parameters required by
their core tag and method.
#Why
An executed fluent call can reach Statamic without an input that its tag needs. The resulting failure or empty output otherwise appears only when the view is rendered.
#Examples
#Bad
{{-- vite:asset is executed without its required src parameter. --}}
{{ Statamic::tag('vite:asset')->fetch() }}
#Good
{{-- Each form supplies the required src parameter. --}}
{{ Statamic::tag('vite:asset')->src('resources/js/app.js') }}
{{ Statamic::tag('vite:asset')->param('src', 'resources/js/app.js') }}
{{ Statamic::tag('vite:asset')->params(['src' => 'resources/js/app.js']) }}
#Notes
The final concrete write to a parameter wins. A later dynamic map or dynamic parameter name makes the affected result unknown, while a later concrete write can make it knowable again.
Dynamic tag names, values, and maps are skipped when runtime state could supply the input. Builders that are never consumed are also skipped. Requirements are limited to Statamic 6 core tags and do not infer add-on contracts.
#See Also
Equivalent rules cover the other literal invocation forms:
- statamic-required-tag-parameter: Check component attributes
- statamic-tags-directive-required-parameters: Check
@tagsmaps - statamic-fluent-tag-method-exists: Validate the method before its inputs