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\Comment;
   4  
   5  use Sabberworm\CSS\Renderable;
   6  
   7  class Comment implements Renderable {
   8  	 protected $iLineNo;
   9  	 protected $sComment;
  10  
  11  	public function __construct($sComment = '', $iLineNo = 0) {
  12  	 	 $this->sComment = $sComment;
  13  	 	 $this->iLineNo = $iLineNo;
  14  	 }
  15  
  16  	 /**
  17  	  * @return string
  18  	  */
  19  	public function getComment() {
  20  	 	 return $this->sComment;
  21  	 }
  22  
  23  	 /**
  24  	  * @return int
  25  	  */
  26  	public function getLineNo() {
  27  	 	 return $this->iLineNo;
  28  	 }
  29  
  30  	 /**
  31  	  * @return string
  32  	  */
  33  	public function setComment($sComment) {
  34  	 	 $this->sComment = $sComment;
  35  	 }
  36  
  37  	 /**
  38  	  * @return string
  39  	  */
  40  	public function __toString() {
  41  	 	 return $this->render(new \Sabberworm\CSS\OutputFormat());
  42  	 }
  43  
  44  	 /**
  45  	  * @return string
  46  	  */
  47  	public function render(\Sabberworm\CSS\OutputFormat $oOutputFormat) {
  48  	 	 return '/*' . $this->sComment . '*/';
  49  	 }
  50  
  51  }