Completed
Push — master ( 7bae76...0958d1 )
by Vladimir
9s
created

SourceMapGenerator::getSourceMapContents()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
/**
4
 * @copyright 2018 Vladimir Jimenez
5
 * @license   https://github.com/stakx-io/stakx/blob/master/LICENSE.md MIT
6
 */
7
8
namespace allejo\stakx\AssetEngine\Sass;
9
10
use Leafo\ScssPhp\SourceMap\SourceMapGenerator as BaseGenerator;
11
12
/**
13
 * A custom SourceMapGenerator to override the one provided by ScssPhp.
14
 *
15
 * This version stores the content of its source map and makes it available for a later time. This class allows us to
16
 * give the source map to our stakx Compiler to write out instead of letting ScssPhp do that.
17
 */
18
class SourceMapGenerator extends BaseGenerator
19
{
20
    protected $generatorOptions;
21
    protected $sourceMapContent;
22
23 1
    public function __construct(array $options = [])
24
    {
25 1
        parent::__construct($options);
26
27 1
        $this->generatorOptions = $options;
28 1
    }
29
30 1
    public function getSourceMapContents()
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
31
    {
32 1
        return $this->sourceMapContent;
33
    }
34
35 1
    public function saveMap($content)
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
36
    {
37 1
        $this->sourceMapContent = $content;
38
39 1
        return $this->generatorOptions['sourceMapURL'];
40
    }
41
}
42