protected static function remove_adjacent_characters( $string, callable $strlen, callable $substr, $prev_length = 0, $next_length = 0 ) {
		// Remove previous character.
		if ( $prev_length > 0 ) {
			$string = $substr( $string, $prev_length, $strlen( $string ) );
		}

		// Remove next character.
		if ( $next_length > 0 ) {
			$string = $substr( $string, 0, $strlen( $string ) - $next_length );
		}

		return $string;
	}