NoPublicModelScopeAndAccessorRule
class NoPublicModelScopeAndAccessorRule implements Rule
Unlike upstream, scopes and accessors are recognized as the runtime finds them: a legacy scope by its name and a first parameter that takes the builder, and an accessor by its native Attribute return type. Only a private method is made protected automatically, because a public one can have callers in other files.
Methods
__construct(ModelRuleHelper $modelRuleHelper, bool $noLegacyModelScopes)
Create a new no public model scope and accessor rule instance.
string
getNodeType()
Get the node type the rule checks.
array
processNode(Node $node, Scope $scope)
Report model scopes and accessors that are not protected.
Details
at line 39
__construct(ModelRuleHelper $modelRuleHelper, bool $noLegacyModelScopes)
Create a new no public model scope and accessor rule instance.
at line 49
string
getNodeType()
Get the node type the rule checks.
at line 61
array
processNode(Node $node, Scope $scope)
Report model scopes and accessors that are not protected.