class AbstractRule (View source)

Constants

VALIDATION_RULE_COMMENT_SENTENCE

Properties

protected Rules $rules

Methods

__construct(Rules $rules)

No description

applyRule(string $parameterName, string|string[] $value, bool $itemType = false)

This method has to add the validation rule to the method's body

string
validationRuleComment(string|string[] $value)

No description

string
name()

Name of the validation rule

string
testConditions(string $parameterName, string|string[] $value, bool $itemType = false)

Inline tests of the validation rule

string
exceptionMessageOnTestFailure(string $parameterName, string|string[] $value, bool $itemType = false)

Message when test fails in order to throw the exception

getRules()

No description

PhpMethod
getMethod()

No description

getMethods()

No description

getFile()

No description

getAttribute()

No description

getGenerator()

No description

Details

__construct(Rules $rules)

Parameters

Rules $rules

final AbstractRule applyRule(string $parameterName, string|string[] $value, bool $itemType = false)

This method has to add the validation rule to the method's body

Parameters

string $parameterName
string|string[] $value
bool $itemType

Return Value

AbstractRule

final string validationRuleComment(string|string[] $value)

Parameters

string|string[] $value

Return Value

string

abstract string name()

Name of the validation rule

Return Value

string

abstract string testConditions(string $parameterName, string|string[] $value, bool $itemType = false)

Inline tests of the validation rule

Parameters

string $parameterName
string|string[] $value
bool $itemType

Return Value

string

abstract string exceptionMessageOnTestFailure(string $parameterName, string|string[] $value, bool $itemType = false)

Message when test fails in order to throw the exception

Parameters

string $parameterName
string|string[] $value
bool $itemType

Return Value

string

Rules getRules()

Return Value

Rules

PhpMethod getMethod()

Return Value

PhpMethod

Method getMethods()

Return Value

Method

AbstractModelFile getFile()

Return Value

AbstractModelFile

StructAttribute getAttribute()

Return Value

StructAttribute

Generator getGenerator()

Return Value

Generator