$this->_name =
$this->
getName();
} /**
* Returns the api name for this rule. The name has to be unique in the system.
*/
public function getName(): string
{ $ruleName =
static::RULE_NAME;
if ($ruleName === null
) { throw new \
Error('Implement own getName or add RULE_NAME constant'
);
} return $ruleName;
} /**
* Validate the current rule and returns the matching of the rule
*/
abstract public function match(RuleScope
$scope): bool;
/**
* Gets the constraints of the rule
* Format:
* [
* 'propertyName' => [new Constraint(), new OtherConstraint()],
* 'propertyName2' => [new Constraint(), new OtherConstraint()],
* ]
*
* @return array<string, array<Constraint>>
*/