Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

Differences Between: [Versions 310 and 401] [Versions 310 and 402] [Versions 310 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  }