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

getKeys() public method

public getKeys ( ) : array
return array
    public function getKeys()
    {
        $keys = [];
        foreach ($this->getRules() as $keyRule) {
            $keys[] = $keyRule->reference;
        }
        return $keys;
    }

Usage Example

Example #1
0
 public function testShouldReturnKeys()
 {
     $key1 = new Key('foo', new AlwaysValid(), true);
     $key2 = new Key('bar', new AlwaysValid(), false);
     $keySet = new KeySet($key1, $key2);
     $this->assertEquals(['foo', 'bar'], $keySet->getKeys());
 }