Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

Differences Between: [Versions 311 and 401] [Versions 311 and 402] [Versions 311 and 403]

   1  <?php
   2  
   3  namespace Sabberworm\CSS\Value;
   4  
   5  class CSSFunction extends ValueList {
   6  
   7  	 protected $sName;
   8  
   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  	 }
  18  
  19  	public function getName() {
  20  	 	 return $this->sName;
  21  	 }
  22  
  23  	public function setName($sName) {
  24  	 	 $this->sName = $sName;
  25  	 }
  26  
  27  	public function getArguments() {
  28  	 	 return $this->aComponents;
  29  	 }
  30  
  31  	public function __toString() {
  32  	 	 return $this->render(new \Sabberworm\CSS\OutputFormat());
  33  	 }
  34  
  35  	public function render(\Sabberworm\CSS\OutputFormat $oOutputFormat) {
  36  	 	 $aArguments = parent::render($oOutputFormat);
  37  	 	 return "{$this->sName}({$aArguments})";
  38  	 }
  39  
  40  }