private function getBodyElement(\DOMDocument $document)
    {
        $bodyElement = $document->getElementsByTagName('body')->item(0);
        if ($bodyElement === null) {
            throw new \BadMethodCallException(
                'getBodyElement method may only be called after ensureExistenceOfBodyElement has been called.',
                1508173775427
            );
        }

        return $bodyElement;
    }
private function getBodyElement(\DOMDocument $document)
    {
        $bodyElement = $document->getElementsByTagName('body')->item(0);
        if ($bodyElement === null) {
            throw new \BadMethodCallException(
                'getBodyElement method may only be called after ensureExistenceOfBodyElement has been called.',
                1508173775427
            );
        }

        return $bodyElement;
    }
private function getBodyElement ( \ DOMDocument $ document ) { $ bodyElement = $ document -> getElementsByTagName ( 'body' ) -> item ( 0 ) ; if ( $ bodyElement === null ) { throw new \ BadMethodCallException ( 'getBodyElement method may only be called after ensureExistenceOfBodyElement has been called.' , 1508173775427 ) ; } return $ bodyElement ; }
Returns the BODY element.

This method assumes that there always is a BODY element.

@param \DOMDocument $document

@return \DOMElement

@throws \BadMethodCallException
Returns the BODY element .