3633abc756ce670eadd5cea84415acc1d8c55cc7
[moodle.git] / lib / php-css-parser / Value / CSSFunction.php
1 <?php
3 namespace Sabberworm\CSS\Value;
5 class CSSFunction extends ValueList {
7         private $sName;
9         public function __construct($sName, $aArguments, $sSeparator = ',', $iLineNo = 0) {
10                 if($aArguments instanceof RuleValueList) {
11                         $sSeparator = $aArguments->getListSeparator();
12                         $aArguments = $aArguments->getListComponents();
13                 }
14                 $this->sName = $sName;
15                 $this->iLineNo = $iLineNo;
16                 parent::__construct($aArguments, $sSeparator, $iLineNo);
17         }
19         public function getName() {
20                 return $this->sName;
21         }
23         public function setName($sName) {
24                 $this->sName = $sName;
25         }
27         public function getArguments() {
28                 return $this->aComponents;
29         }
31         public function __toString() {
32                 return $this->render(new \Sabberworm\CSS\OutputFormat());
33         }
35         public function render(\Sabberworm\CSS\OutputFormat $oOutputFormat) {
36                 $aArguments = parent::render($oOutputFormat);
37                 return "{$this->sName}({$aArguments})";
38         }
40 }