Bluz\Validator\Validator::create PHP Method

create() public static method

Create new instance if Validator
public static create ( ) : Validator
return Validator
    public static function create()
    {
        return new static();
    }

Usage Example

 /**
  * Setup simple builder for array
  */
 public function testValidatorBuilderForOneRuleForArray()
 {
     $validator = new ValidatorBuilder();
     try {
         $validator->add('some', Validator::create()->arrayInput(new Numeric())->setError('"{{name}}" is not numeric, is equal "{{input}}"'));
         $validator->assert(['some' => ['something']]);
     } catch (ValidatorException $e) {
         $this->assertEquals('Invalid Arguments', $e->getMessage());
         $this->assertArrayHasKey('some', $e->getErrors());
     }
 }
All Usage Examples Of Bluz\Validator\Validator::create