chore: Аннотации к типам
This commit is contained in:
parent
386a927254
commit
245b5c6c19
18 changed files with 191 additions and 104 deletions
|
|
@ -123,11 +123,17 @@ class Validator
|
|||
$this->errorMsg = [];
|
||||
}
|
||||
|
||||
public function validate(Collection $container, $rule = null, $status = null): bool
|
||||
/**
|
||||
* @param Collection $container
|
||||
* @param AbstractRule[]|null $rules
|
||||
* @param bool|null $status
|
||||
* @return bool
|
||||
*/
|
||||
public function validate(Collection $container, $rules = null, $status = null): bool
|
||||
{
|
||||
$fields = [];
|
||||
if ($rule) {
|
||||
$this->chain = $rule;
|
||||
if ($rules) {
|
||||
$this->chain = $rules;
|
||||
}
|
||||
|
||||
foreach ($this->chain as $rule) {
|
||||
|
|
@ -156,7 +162,10 @@ class Validator
|
|||
return empty($this->errorMsg);
|
||||
}
|
||||
|
||||
public function getErrorMsg()
|
||||
/**
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public function getErrorMsg(): array
|
||||
{
|
||||
return $this->errorMsg;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue