Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.

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