Source Map Generator.
More...
|
| addMapping ($generatedLine, $generatedColumn, $originalLine, $originalColumn, $sourceFile) |
| Adds a mapping.
|
|
| fixWindowsPath ($path, $addEndSlash=false) |
| Fix windows paths.
|
|
| generateJson ($prefix='') |
| Generates the JSON source map.
|
|
| generateMappings ($prefix='') |
| Generates the mappings string.
|
|
| saveMap ($content) |
| Saves the source map to a file.
|
|
|
const | VERSION = 3 |
| What version of source map does the generator generate?
|
|
|
array | $contentsMap = [] |
| Array of contents map.
|
|
array | $defaultOptions |
| Array of default options.
|
|
ScssPhp ScssPhp SourceMap Base64VLQ | $encoder |
| The base64 VLQ encoder.
|
|
array | $mappings = [] |
| Array of mappings.
|
|
array< string, $sources=[];protected array< string, $sourceKeys=[];private array $options;public function __construct(array $options=[]) { $this->options=array_replace( $this->defaultOptions, $options);$this-> | encoder = new Base64VLQ() |
| File to content map.
|
|
◆ addMapping()
ScssPhp\ScssPhp\SourceMap\SourceMapGenerator::addMapping |
( |
| $generatedLine, |
|
|
| $generatedColumn, |
|
|
| $originalLine, |
|
|
| $originalColumn, |
|
|
| $sourceFile ) |
Adds a mapping.
- Parameters
-
int | $generatedLine | The line number in generated file |
int | $generatedColumn | The column number in generated file |
int | $originalLine | The line number in original file |
int | $originalColumn | The column number in original file |
string | $sourceFile | The original source file |
- Return values
-
◆ findFileIndex()
ScssPhp\ScssPhp\SourceMap\SourceMapGenerator::findFileIndex |
( |
| $filename | ) |
|
|
protected |
Finds the index for the filename.
- Parameters
-
- Return values
-
◆ fixWindowsPath()
ScssPhp\ScssPhp\SourceMap\SourceMapGenerator::fixWindowsPath |
( |
| $path, |
|
|
| $addEndSlash = false ) |
Fix windows paths.
- Parameters
-
string | $path | |
bool | $addEndSlash | |
- Return values
-
◆ generateJson()
ScssPhp\ScssPhp\SourceMap\SourceMapGenerator::generateJson |
( |
| $prefix = '' | ) |
|
◆ generateMappings()
ScssPhp\ScssPhp\SourceMap\SourceMapGenerator::generateMappings |
( |
| $prefix = '' | ) |
|
Generates the mappings string.
- Parameters
-
string | $prefix | A prefix added in the output file, which needs to shift mappings |
- Return values
-
◆ getSourcesContent()
ScssPhp\ScssPhp\SourceMap\SourceMapGenerator::getSourcesContent |
( |
| ) |
|
|
protected |
Returns the sources contents.
- Return values
-
◆ normalizeFilename()
ScssPhp\ScssPhp\SourceMap\SourceMapGenerator::normalizeFilename |
( |
| $filename | ) |
|
|
protected |
Normalize filename.
- Parameters
-
- Return values
-
◆ saveMap()
ScssPhp\ScssPhp\SourceMap\SourceMapGenerator::saveMap |
( |
| $content | ) |
|
Saves the source map to a file.
- Parameters
-
string | $content | The content to write |
- Return values
-
- Exceptions
-
- Deprecated
◆ $defaultOptions
array ScssPhp\ScssPhp\SourceMap\SourceMapGenerator::$defaultOptions |
|
protected |
Initial value:= [
'sourceRoot' => '',
'sourceMapFilename' => null,
'sourceMapURL' => null,
'sourceMapWriteTo' => null,
'outputSourceFiles' => false,
'sourceMapRootpath' => '',
'sourceMapBasepath' => ''
]
Array of default options.
@phpstan-var array{sourceRoot: string, sourceMapFilename: string|null, sourceMapURL: string|null, sourceMapWriteTo: string|null, outputSourceFiles: bool, sourceMapRootpath: string, sourceMapBasepath: string}
◆ $mappings
array ScssPhp\ScssPhp\SourceMap\SourceMapGenerator::$mappings = [] |
|
protected |
Array of mappings.
@phpstan-var list<array{generated_line: int, generated_column: int, original_line: int, original_column: int, source_file: string}>
◆ encoder
array<string, $sources = []; protected array<string, $sourceKeys = []; private array $options; public function __construct(array $options = []) { $this->options = array_replace($this->defaultOptions, $options); $this-> ScssPhp\ScssPhp\SourceMap\SourceMapGenerator::encoder = new Base64VLQ() |
|
protected |
File to content map.
string>
The documentation for this class was generated from the following file:
- lib/scssphp/SourceMap/SourceMapGenerator.php