Respect\Validation\Rules\KeySet::validate PHP Method

validate() public method

public validate ( $input )
    public function validate($input)
    {
        if (!$this->hasValidStructure($input)) {
            return false;
        }
        return parent::validate($input);
    }

Usage Example

Example #1
0
 public function testShouldValidateKeysWhenEmpty()
 {
     $input = [];
     $key1 = new Key('foo', new AlwaysValid(), true);
     $key2 = new Key('bar', new AlwaysValid(), true);
     $keySet = new KeySet($key1, $key2);
     $this->assertFalse($keySet->validate($input));
 }