Lazer\Classes\Helpers\Config::getKey PHP Method

getKey() public method

Get key from returned config
public getKey ( string $field, boolean $assoc = false ) : mixed
$field string key
$assoc boolean
return mixed
    public function getKey($field, $assoc = false)
    {
        return $assoc ? $this->get($assoc)[$field] : $this->get($assoc)->{$field};
    }

Usage Example

Exemplo n.º 1
0
 /**
  * @covers Lazer\Classes\Helpers\Config::getKey
  */
 public function testGetKey()
 {
     $this->assertInternalType('integer', $this->object->getKey('last_id'));
     $this->assertInternalType('object', $this->object->getKey('schema'));
     $this->assertInternalType('array', $this->object->getKey('schema', true));
 }