public function getChild()
    {
        $children = $this->getChildren();

        if (!$children) {
            throw new OutOfBoundsException(sprintf(
                'Expected exactly one child, got "%s"',
                count($children)
            ));
        }

        if (count($children) > 1) {
            throw new OutOfBoundsException(sprintf(
                'More than one child node but getChild will only ever return one. "%d" returned.',
                count($children)
            ));
        }

        return current($children);
    }
public function getChild()
    {
        $children = $this->getChildren();

        if (!$children) {
            throw new OutOfBoundsException(sprintf(
                'Expected exactly one child, got "%s"',
                count($children)
            ));
        }

        if (count($children) > 1) {
            throw new OutOfBoundsException(sprintf(
                'More than one child node but getChild will only ever return one. "%d" returned.',
                count($children)
            ));
        }

        return current($children);
    }
public function getChild ( ) { $ children = $ this -> getChildren ( ) ; if ( ! $ children ) { throw new OutOfBoundsException ( sprintf ( 'Expected exactly one child, got "%s"' , count ( $ children ) ) ) ; } if ( count ( $ children ) > 1 ) { throw new OutOfBoundsException ( sprintf ( 'More than one child node but getChild will only ever return one. "%d" returned.' , count ( $ children ) ) ) ; } return current ( $ children ) ; }
Return child of node, there must be exactly one child of any type.

@throws OutOfBoundsException if there are more than one or none

@return AbstractNode
Return child of node there must be exactly one child of any type .