kollapsminoriteten/wp-includes/html-api/class-wp-html-span.php

57 lines
1.1 KiB
PHP
Raw Normal View History

2023-04-26 17:39:43 +02:00
<?php
/**
2023-09-26 10:33:34 +02:00
* HTML API: WP_HTML_Span class
2023-04-26 17:39:43 +02:00
*
* @package WordPress
* @subpackage HTML-API
* @since 6.2.0
*/
/**
2023-09-26 10:33:34 +02:00
* Core class used by the HTML tag processor to represent a textual span
* inside an HTML document.
2023-04-26 17:39:43 +02:00
*
2023-09-26 10:33:34 +02:00
* This is a two-tuple in disguise, used to avoid the memory overhead
* involved in using an array for the same purpose.
2023-04-26 17:39:43 +02:00
*
* This class is for internal usage of the WP_HTML_Tag_Processor class.
*
* @access private
* @since 6.2.0
2024-04-17 11:32:24 +02:00
* @since 6.5.0 Replaced `end` with `length` to more closely align with `substr()`.
2023-04-26 17:39:43 +02:00
*
* @see WP_HTML_Tag_Processor
*/
class WP_HTML_Span {
/**
* Byte offset into document where span begins.
*
* @since 6.2.0
2024-04-17 11:32:24 +02:00
*
2023-04-26 17:39:43 +02:00
* @var int
*/
public $start;
/**
2024-04-17 11:32:24 +02:00
* Byte length of this span.
*
* @since 6.5.0
2023-04-26 17:39:43 +02:00
*
* @var int
*/
2024-04-17 11:32:24 +02:00
public $length;
2023-04-26 17:39:43 +02:00
/**
* Constructor.
*
* @since 6.2.0
*
2024-04-17 11:32:24 +02:00
* @param int $start Byte offset into document where replacement span begins.
* @param int $length Byte length of span.
2023-04-26 17:39:43 +02:00
*/
2025-02-28 08:42:11 +01:00
public function __construct( int $start, int $length ) {
2024-04-17 11:32:24 +02:00
$this->start = $start;
$this->length = $length;
2023-04-26 17:39:43 +02:00
}
}