Pop\Auth\Auth::getValidator PHP Method

getValidator() public method

Method to get a validator
public getValidator ( string $name ) : mixed
$name string
return mixed
    public function getValidator($name)
    {
        return $this->validators[$name];
    }

Usage Example

示例#1
0
 public function testSetAllowedSubnets()
 {
     $a = new Auth(new File(__DIR__ . '/../tmp/access.txt'));
     $a->setAllowedSubnets('123.123.123');
     $a->setAllowedSubnets(array('123.123.123', '124.124.124'));
     $this->assertEquals(array('123.123.123', '124.124.124'), $a->getValidator('allowedSubnets')->getValue());
     $a->setAllowedSubnets();
     $this->assertEquals(null, $a->getValidator('allowedSubnets'));
 }