Skip to content

Commit

Permalink
Fix initialization error when parent constructor calls setScss(true)
Browse files Browse the repository at this point in the history
  • Loading branch information
werrolf committed Nov 14, 2019
1 parent 77c05fd commit 6526a47
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/SasscFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,14 @@

class SasscFilter extends ScssFilter
{
private $initializing;

public function __construct($sasscPath = '/usr/bin/sassc')
{
$this->initializing = true;
parent::__construct($sasscPath, null);
$this->initializing = false;

// prevent parent's automatic --scss option addition based on file extension
$this->setScss(false);
// undo parent constructor's initialization for unsupported --cache-location option
Expand All @@ -19,6 +24,9 @@ public function __construct($sasscPath = '/usr/bin/sassc')

public function setScss($scss)
{
if ($this->initializing) {
return;
}
if ($scss) {
throw new \InvalidArgumentException("Implementation does not support --scss switch");
}
Expand Down

0 comments on commit 6526a47

Please sign in to comment.