class Rules (View source)

Properties

protected StructAttribute $attribute
protected AbstractModelFile $file
protected PhpMethod $method
protected Method $methods

Methods

__construct(AbstractModelFile $file, PhpMethod $method, StructAttribute $attribute, Method $methods)

No description

applyRules(string $parameterName, bool $itemType = false)

No description

applyRulesFromAttribute(string $parameterName, bool $itemType = false)

Generic method to apply rules from current model

getRule(string $name)

No description

getArrayRule()

No description

getItemTypeRule()

No description

getListRule()

No description

getAttribute()

No description

setAttribute(StructAttribute $attribute)

No description

getFile()

No description

PhpMethod
getMethod()

No description

setMethod(PhpMethod $method)

No description

getMethods()

No description

getGenerator()

No description

static 
ruleHasBeenAppliedToAttribute(AbstractRule $rule, string|string[] $value, StructAttribute $attribute)

No description

static bool
hasRuleBeenAppliedToAttribute(AbstractRule $rule, string|string[] $value, StructAttribute $attribute)

No description

Details

__construct(AbstractModelFile $file, PhpMethod $method, StructAttribute $attribute, Method $methods)

Parameters

AbstractModelFile $file
PhpMethod $method
StructAttribute $attribute
Method $methods

applyRules(string $parameterName, bool $itemType = false)

Parameters

string $parameterName
bool $itemType

protected applyRulesFromAttribute(string $parameterName, bool $itemType = false)

Generic method to apply rules from current model

Parameters

string $parameterName
bool $itemType

AbstractRule|null getRule(string $name)

Parameters

string $name

Return Value

AbstractRule|null

ArrayRule getArrayRule()

Return Value

ArrayRule

EnumerationRule getEnumerationRule()

Return Value

EnumerationRule

ItemTypeRule getItemTypeRule()

Return Value

ItemTypeRule

ListRule getListRule()

Return Value

ListRule

StructAttribute getAttribute()

Return Value

StructAttribute

Rules setAttribute(StructAttribute $attribute)

Parameters

StructAttribute $attribute

Return Value

Rules

AbstractModelFile getFile()

Return Value

AbstractModelFile

PhpMethod getMethod()

Return Value

PhpMethod

Rules setMethod(PhpMethod $method)

Parameters

PhpMethod $method

Return Value

Rules

Method getMethods()

Return Value

Method

Generator getGenerator()

Return Value

Generator

static ruleHasBeenAppliedToAttribute(AbstractRule $rule, string|string[] $value, StructAttribute $attribute)

Parameters

AbstractRule $rule
string|string[] $value
StructAttribute $attribute

static bool hasRuleBeenAppliedToAttribute(AbstractRule $rule, string|string[] $value, StructAttribute $attribute)

Parameters

AbstractRule $rule
string|string[] $value
StructAttribute $attribute

Return Value

bool