Hmac
class Hmac extends Rule implements RuleInterface
Hmac rule.
Traits
I18n aware trait.
Doesn't validate when empty trait.
Properties
protected I18n | $i18n | I18n. | from I18nAwareTrait |
protected string | $hmac | HMAC. | |
protected string | $key | Key. | |
protected string | $algorithm | Algorithm. | |
protected array | $i18nParameters | I18n parameters. |
Methods
string
translateFieldName(string $field, string $package)
Returns a translated field name.
from I18nAwareTrait
array
getI18nParameters(string $field, string $package)
Gets the i18n parameters.
from I18nAwareTrait
getTranslatedErrorMessage(string $field, string $rule, string|null $package = null)
{@inheritdoc}
from I18nAwareTrait
__construct(string $hmac, string $key, string $algorithm = 'sha256')
Constructor.
bool
validate(mixed $value, array $input)
Returns true if the rule succeeds and false if not.
string
getErrorMessage(string $field)
Returns an error message.
Details
in I18nAwareTrait at line 41
setI18n(I18n $i18n)
{@inheritdoc}
in I18nAwareTrait at line 55
protected string
translateFieldName(string $field, string $package)
Returns a translated field name.
in I18nAwareTrait at line 76
protected array
getI18nParameters(string $field, string $package)
Gets the i18n parameters.
in I18nAwareTrait at line 102
getTranslatedErrorMessage(string $field, string $rule, string|null $package = null)
{@inheritdoc}
in DoesntValidateWhenEmptyTrait at line 20
validateWhenEmpty()
{@inheritdoc}
at line 50
__construct(string $hmac, string $key, string $algorithm = 'sha256')
Constructor.
at line 69
bool
validate(mixed $value, array $input)
Returns true if the rule succeeds and false if not.
at line 77
string
getErrorMessage(string $field)
Returns an error message.