Skip to content

Commit fa82cb5

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

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

system/BaseModel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ abstract class BaseModel
198198
/**
199199
* Our validator instance.
200200
*
201-
* @var Validation
201+
* @var ValidationInterface
202202
*/
203203
protected $validation;
204204

system/Validation/ValidationInterface.php

Lines changed: 13 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,16 @@ 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+
* @return array|ValidationException|null
98+
*/
99+
public function loadRuleGroup(?string $group = null);
87100
}

0 commit comments

Comments
 (0)