You are here

public function SassPropertyNode::__construct in Sassy 7.3

Same name and namespace in other branches
  1. 7 phamlp/sass/tree/SassPropertyNode.php \SassPropertyNode::__construct()

SassPropertyNode constructor.

Parameters

object source token:

string property syntax:

Return value

SassPropertyNode

Overrides SassNode::__construct

File

phpsass/tree/SassPropertyNode.php, line 77

Class

SassPropertyNode
SassPropertyNode class. Represents a CSS property. @package PHamlP @subpackage Sass.tree

Code

public function __construct($token, $syntax = 'new') {
  parent::__construct($token);
  $matches = self::match($token, $syntax);
  $this->name = $matches[self::NAME];
  $this->value = $matches[self::VALUE];
  if ($matches[self::SCRIPT] === self::IS_SCRIPT) {
    $this
      ->addWarning('Setting CSS properties with "=" is deprecated; use "{name}: {value};"', array(
      '{name}' => e,
      '{value}' => $this->value,
    ));
  }
}