public function get($key)
    {
        if ($this->has($key) === false) {
            throw new \RuntimeException(sprintf('Element with key: "%s" not found.', $key));
        }

        return $this->elements[$key];
    }
public function get($key)
    {
        if ($this->has($key) === false) {
            throw new \RuntimeException(sprintf('Element with key: "%s" not found.', $key));
        }

        return $this->elements[$key];
    }
public function get ( $ key ) { if ( $ this -> has ( $ key ) === false ) { throw new \ RuntimeException ( sprintf ( 'Element with key: "%s" not found.' , $ key ) ) ; } return $ this -> elements [ $ key ] ; }
Gets a element from the collection.

@param string $key The element identifier

@return mixed The element

@throws RuntimeException If the key is not defined
Gets a element from the collection .