public function getMetadata($key = null)
    {
        if (null === $key) {
            return stream_get_meta_data($this->resource);
        }

        $metadata = stream_get_meta_data($this->resource);
        if (! array_key_exists($key, $metadata)) {
            return;
        }

        return $metadata[$key];
    }
public function getMetadata($key = null)
    {
        if (null === $key) {
            return stream_get_meta_data($this->resource);
        }

        $metadata = stream_get_meta_data($this->resource);
        if (! array_key_exists($key, $metadata)) {
            return;
        }

        return $metadata[$key];
    }
public function getMetadata ( $ key = null ) { if ( null === $ key ) { return stream_get_meta_data ( $ this -> resource ) ; } $ metadata = stream_get_meta_data ( $ this -> resource ) ; if ( ! array_key_exists ( $ key , $ metadata ) ) { return ; } return $ metadata [ $ key ] ; }
Retrieve metadata from the underlying stream.

@see http://php.net/stream_get_meta_data for a description of the expected output.

@return array
Retrieve metadata from the underlying stream .