src/Document.php
public function attr($key = null, $default = null)
    {
        return is_null($key) ? $this->attributes : array_get($this->attributes, $key, $default);
    }
public function attr($key = null, $default = null)
    {
        return is_null($key) ? $this->attributes : array_get($this->attributes, $key, $default);
    }
public function attr ( $ key = null , $ default = null ) { return is_null ( $ key ) ? $ this -> attributes : array_get ( $ this -> attributes , $ key , $ default ) ; }
Get a attribute using dot notation

@param  string    $key
@param null|mixed $default
@return array|null|mixed
Get a attribute using dot notation