Skip to content

Commit

Permalink
feature: update HasValidationRules trait with latest ruleset functions
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonTheAdams committed Mar 30, 2023
1 parent c5e7fcc commit ca809e0
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions src/Concerns/HasValidationRules.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ public function __construct()
}

/**
* @see ValidationRuleSet::rules()
*
* @since 1.0.0
*/
public function rules(...$rules): self
Expand All @@ -40,6 +42,8 @@ public function rules(...$rules): self
}

/**
* @see ValidationRuleSet::hasRule()
*
* @since 1.0.0
*/
public function hasRule(string $ruleId): bool
Expand All @@ -48,6 +52,18 @@ public function hasRule(string $ruleId): bool
}

/**
* @see ValidationRuleSet::hasRules()
*
* @since 1.3.1
*/
public function hasRules(): bool
{
return $this->validationRules->hasRules();
}

/**
* @see ValidationRuleSet::getRule()
*
* @since 1.0.0
*/
public function getRule(string $ruleId): ValidationRule
Expand All @@ -56,6 +72,38 @@ public function getRule(string $ruleId): ValidationRule
}

/**
* @see ValidationRuleSet::replaceRule()
*
* @since 1.3.1
*/
public function replaceRule(string $ruleId, $rule): bool
{
return $this->validationRules->replaceRule($ruleId, $rule);
}

/**
* @see ValidationRuleSet::replaceOrAppendRule()
*
* @since 1.3.1
*/
public function replaceOrAppendRule(string $ruleId, $rule): bool
{
return $this->validationRules->replaceOrAppendRule($ruleId, $rule);
}

/**
* @see ValidationRuleSet::replaceOrPrependRule()
*
* @since 1.3.1
*/
public function replaceOrPrependRule(string $ruleId, $rule): bool
{
return $this->validationRules->replaceOrPrependRule($ruleId, $rule);
}

/**
* @see ValidationRuleSet::forgetRule()
*
* @since 1.0.0
*/
public function forgetRule(string $ruleId): self
Expand Down

0 comments on commit ca809e0

Please sign in to comment.