ModelAppendsRule
class ModelAppendsRule implements Rule
This rule validates that the properties a model appends are computed properties, which serialization reads through a get accessor or a class cast.
Unlike upstream, the rule reads both $appends and #[Appends], and checks each concrete
model with the appends it inherits. A database column can be appended when a get accessor
or class cast computes it, while a set-only accessor does not make a property computed.
Constants
| private SERIALIZATION_METHODS |
The model methods that decide how serialization reads appended properties. |
Methods
Create a new model appends rule instance.
Get the node type the rule checks.
Report appended properties that serialization cannot compute.
Details
at line 64
__construct(ModelHelper $modelHelper, ModelRuleHelper $modelRuleHelper, InitializerExprTypeResolver $initializerExprTypeResolver, ReflectionProvider $reflectionProvider)
Create a new model appends rule instance.
at line 75
string
getNodeType()
Get the node type the rule checks.
at line 86
array
processNode(Node $node, Scope $scope)
Report appended properties that serialization cannot compute.