private static function get_adjacent_textnode( callable $iterate, callable $get_adjacent_parent, \DOMNode $node = null ) {
		if ( ! isset( $node ) || self::is_block_tag( $node ) ) {
			return null;
		}

		/**
		 * The result node.
		 *
		 * @var \DOMText|null
		 */
		$adjacent = null;

		/**
		 * The initial node.
		 *
		 * @var \DOMNode|null
		 */
		$iterated_node = $node;

		// Iterate to find adjacent node.
		while ( null !== $iterated_node && null === $adjacent ) {
			/**
			 * Let's try the next node.
			 *
			 * @var \DOMNode|null
			 */
			$adjacent = $iterate( $iterated_node );
		}

		// Last ressort.
		if ( null === $adjacent ) {
			/**
			 * The parent node.
			 *
			 * @var \DOMNode|null
			 */
			$adjacent = $get_adjacent_parent( $node->parentNode );
		}

		return $adjacent;
	}
private static function get_adjacent_textnode( callable $iterate, callable $get_adjacent_parent, \DOMNode $node = null ) {
		if ( ! isset( $node ) || self::is_block_tag( $node ) ) {
			return null;
		}

		/**
		 * The result node.
		 *
		 * @var \DOMText|null
		 */
		$adjacent = null;

		/**
		 * The initial node.
		 *
		 * @var \DOMNode|null
		 */
		$iterated_node = $node;

		// Iterate to find adjacent node.
		while ( null !== $iterated_node && null === $adjacent ) {
			/**
			 * Let's try the next node.
			 *
			 * @var \DOMNode|null
			 */
			$adjacent = $iterate( $iterated_node );
		}

		// Last ressort.
		if ( null === $adjacent ) {
			/**
			 * The parent node.
			 *
			 * @var \DOMNode|null
			 */
			$adjacent = $get_adjacent_parent( $node->parentNode );
		}

		return $adjacent;
	}
private static function get_adjacent_textnode ( callable $ iterate , callable $ get_adjacent_parent , \ DOMNode $ node = null ) { if ( ! isset ( $ node ) || self :: is_block_tag ( $ node ) ) { return null ; } /**
		 * The result node.
		 *
		 * @var \DOMText|null
		 */ $ adjacent = null ; /**
		 * The initial node.
		 *
		 * @var \DOMNode|null
		 */ $ iterated_node = $ node ; // Iterate to find adjacent node. while ( null !== $ iterated_node && null === $ adjacent ) { /**
			 * Let's try the next node.
			 *
			 * @var \DOMNode|null
			 */ $ adjacent = $ iterate ( $ iterated_node ) ; } // Last ressort. if ( null === $ adjacent ) { /**
			 * The parent node.
			 *
			 * @var \DOMNode|null
			 */ $ adjacent = $ get_adjacent_parent ( $ node -> parentNode ) ; } return $ adjacent ; }
Retrieves an adjacent \DOMText sibling if there is one.

@since 5.0.0

@param callable      $iterate             Takes a reference \DOMElement and returns a \DOMText (or null).
@param callable      $get_adjacent_parent Takes a single \DOMElement parameter and returns a \DOMText (or null).
@param \DOMNode|null $node                Optional. The content node. Default null.

@return \DOMText|null Null if $node is a block-level element or no text sibling exists.
Retrieves an adjacent \ DOMText sibling if there is one .