Constants

VERSION

VERSION

What version of source map does the generator generate?

Properties

$options

$options : array

Array of options

Type

array

$defaultOptions

$defaultOptions : array

Array of default options

Type

array

$mappings

$mappings : array

Array of mappings

Type

array

$contentsMap

$contentsMap : array

Array of contents map

Type

array

$sources

$sources : array

File to content map

Type

array

$source_keys

$source_keys : 

Type

Methods

setOptions()

setOptions(array|object  $options) 

Set options

If $options is an object it will be converted into an array by called it's toArray method.

Parameters

array|object $options

Throws

\Exception

getOption()

getOption(string  $name, mixed  $default = null) : mixed

Get an option value by name

If the option is empty or not set a NULL value will be returned.

Parameters

string $name
mixed $default

Default value if confiuration of $name is not present

Returns

mixed

setOption()

setOption(string  $name, mixed  $value) 

Set an option

Parameters

string $name
mixed $value

__construct()

__construct(\Less_Tree_Ruleset  $root,   $contentsMap, array  $options = array()) 

Constructor

Parameters

\Less_Tree_Ruleset $root

The root node

$contentsMap
array $options

Array of options

generateCSS()

generateCSS() : string

Generates the CSS

Returns

string

addMapping()

addMapping(integer  $generatedLine, integer  $generatedColumn, integer  $originalLine, integer  $originalColumn,   $fileInfo) 

Adds a mapping

Parameters

integer $generatedLine

The line number in generated file

integer $generatedColumn

The column number in generated file

integer $originalLine

The line number in original file

integer $originalColumn

The column number in original file

$fileInfo

generateMappings()

generateMappings() : string

Generates the mappings string

Returns

string

saveMap()

saveMap(string  $file, string  $content) 

Saves the source map to a file

Parameters

string $file

The absolute path to a file

string $content

The content to write

Throws

\Exception

If the file could not be saved

normalizeFilename()

normalizeFilename(string  $filename) : string

Normalizes the filename

Parameters

string $filename

Returns

string

generateJson()

generateJson() : string

Generates the JSON source map

Returns

string

getSourcesContent()

getSourcesContent() : array|null

Returns the sources contents

Returns

array|null

findFileIndex()

findFileIndex(string  $filename) : integer|false

Finds the index for the filename

Parameters

string $filename

Returns

integer|false