wikimedia/minify
Minification of JavaScript code and CSS stylesheets
Loading...
Searching...
No Matches
Wikimedia\Minify\IndexMapOffset Class Reference

A class representing a line/column offset into a combined generated file, for index map generation. More...

Public Member Functions

 __construct (int $line, int $column)
 
 toArray ()
 Convert the object to plain data.
 
 add (self $nextSize)
 Advance the offset, assuming a file of the specified size was added to the combined file.
 

Static Public Member Functions

static newFromText (string $text)
 Count the number of lines and columns in the specified string, and create an IndexMapOffset representing the corresponding size.
 
static newFromArray (array $data)
 Restore an IndexMapOffset which was serialized with toArray().
 

Public Attributes

 $line
 
 $column
 

Detailed Description

A class representing a line/column offset into a combined generated file, for index map generation.

Or it can represent the past-the-end offset of a single specified file, that is, the number of lines in the file and the number of columns in the last line of the file.

Constructor & Destructor Documentation

◆ __construct()

Wikimedia\Minify\IndexMapOffset::__construct ( int $line,
int $column )
Parameters
int$lineThe zero-based line number
int$columnThe zero-based column number

Member Function Documentation

◆ add()

Wikimedia\Minify\IndexMapOffset::add ( self $nextSize)

Advance the offset, assuming a file of the specified size was added to the combined file.

Parameters
IndexMapOffset$nextSize
Returns
void

◆ newFromArray()

static Wikimedia\Minify\IndexMapOffset::newFromArray ( array $data)
static

Restore an IndexMapOffset which was serialized with toArray().

Parameters
array$data
Returns
self

◆ newFromText()

static Wikimedia\Minify\IndexMapOffset::newFromText ( string $text)
static

Count the number of lines and columns in the specified string, and create an IndexMapOffset representing the corresponding size.

Parameters
string$text
Returns
self

◆ toArray()

Wikimedia\Minify\IndexMapOffset::toArray ( )

Convert the object to plain data.

Returns
array

The documentation for this class was generated from the following file: