Skip to content

Commit 27b9d57

Browse files
committed
fix: add missing ValidationInterface::loadRuleGroup()
1 parent b29b0f8 commit 27b9d57

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

system/Validation/ValidationInterface.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace CodeIgniter\Validation;
1313

1414
use CodeIgniter\HTTP\RequestInterface;
15+
use CodeIgniter\Validation\Exceptions\ValidationException;
1516

1617
/**
1718
* Expected behavior of a validator
@@ -84,4 +85,18 @@ public function setError(string $alias, string $error): ValidationInterface;
8485
* you need to process more than one array.
8586
*/
8687
public function reset(): ValidationInterface;
88+
89+
/**
90+
* Loads custom rule groups (if set) into the current rules.
91+
*
92+
* Rules can be pre-defined in Config\Validation and can
93+
* be any name, but must all still be an array of the
94+
* same format used with setRules(). Additionally, check
95+
* for {group}_errors for an array of custom error messages.
96+
*
97+
* @throws ValidationException
98+
*
99+
* @return array
100+
*/
101+
public function loadRuleGroup(?string $group = null);
87102
}

0 commit comments

Comments
 (0)