src/mako/validator/Validator.php
public function validate(): array
	{
		if($this->isInvalid())
		{
			throw new ValidationException($this->errors, 'Invalid input.');
		}

		$validated = [];

		foreach(array_keys($this->ruleSets) as $validatedKey)
		{
			if(Arr::has($this->input, $validatedKey))
			{
				Arr::set($validated, $validatedKey, Arr::get($this->input, $validatedKey));
			}
		}

		return $validated;
	}
public function validate(): array
	{
		if($this->isInvalid())
		{
			throw new ValidationException($this->errors, 'Invalid input.');
		}

		$validated = [];

		foreach(array_keys($this->ruleSets) as $validatedKey)
		{
			if(Arr::has($this->input, $validatedKey))
			{
				Arr::set($validated, $validatedKey, Arr::get($this->input, $validatedKey));
			}
		}

		return $validated;
	}
public function validate ( ) : array { if ( $ this -> isInvalid ( ) ) { throw new ValidationException ( $ this -> errors , 'Invalid input.' ) ; } $ validated = [ ] ; foreach ( array_keys ( $ this -> ruleSets ) as $ validatedKey ) { if ( Arr :: has ( $ this -> input , $ validatedKey ) ) { Arr :: set ( $ validated , $ validatedKey , Arr :: get ( $ this -> input , $ validatedKey ) ) ; } } return $ validated ; }
Validates the input and returns an array containing validated data.

@throws \mako\validator\ValidationException
@return array
Validates the input and returns an array containing validated data .