Comment.php
36 lines
| 1 | <?php |
| 2 | namespace MailPoetVendor\Sabberworm\CSS\Comment; |
| 3 | if (!defined('ABSPATH')) exit; |
| 4 | use MailPoetVendor\Sabberworm\CSS\OutputFormat; |
| 5 | use MailPoetVendor\Sabberworm\CSS\Renderable; |
| 6 | class Comment implements Renderable |
| 7 | { |
| 8 | protected $iLineNo; |
| 9 | protected $sComment; |
| 10 | public function __construct($sComment = '', $iLineNo = 0) |
| 11 | { |
| 12 | $this->sComment = $sComment; |
| 13 | $this->iLineNo = $iLineNo; |
| 14 | } |
| 15 | public function getComment() |
| 16 | { |
| 17 | return $this->sComment; |
| 18 | } |
| 19 | public function getLineNo() |
| 20 | { |
| 21 | return $this->iLineNo; |
| 22 | } |
| 23 | public function setComment($sComment) |
| 24 | { |
| 25 | $this->sComment = $sComment; |
| 26 | } |
| 27 | public function __toString() |
| 28 | { |
| 29 | return $this->render(new OutputFormat()); |
| 30 | } |
| 31 | public function render(OutputFormat $oOutputFormat) |
| 32 | { |
| 33 | return '/*' . $this->sComment . '*/'; |
| 34 | } |
| 35 | } |
| 36 |