PluginProbe
WooCommerce / 11.0.0
WooCommerce v11.0.0
11.1.0 11.1.0-rc.2 11.1.0-rc.1 11.1.0-beta.2 11.1.0-beta.1 11.0.1 11.0.0 11.0.0-rc.3 11.0.0-rc.2 11.0.0-rc.1 11.0.0-beta.2 11.0.0-beta.1 10.9.4 10.9.3 10.9.2 10.9.1 10.9.0 10.9.0-rc.1 10.9.0-beta.2 10.9.0-beta.1 10.8.1 10.8.0 10.8.0-rc.1 10.8.0-beta.2 10.8.0-beta.1 All 648 releases
woocommerce / lib / packages / Sabberworm / CSS / Comment / Comment.php
Comment.php
69 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Automattic\WooCommerce\Vendor\Sabberworm\CSS\Comment;
4
5 use Automattic\WooCommerce\Vendor\Sabberworm\CSS\OutputFormat;
6 use Automattic\WooCommerce\Vendor\Sabberworm\CSS\Renderable;
7 use Automattic\WooCommerce\Vendor\Sabberworm\CSS\Position\Position;
8 use Automattic\WooCommerce\Vendor\Sabberworm\CSS\Position\Positionable;
9
10 class Comment implements Positionable, Renderable
11 {
12 use Position;
13
14 /**
15 * @var string
16 *
17 * @internal since 8.8.0
18 */
19 protected $sComment;
20
21 /**
22 * @param string $sComment
23 * @param int $iLineNo
24 */
25 public function __construct($sComment = '', $iLineNo = 0)
26 {
27 $this->sComment = $sComment;
28 $this->setPosition($iLineNo);
29 }
30
31 /**
32 * @return string
33 */
34 public function getComment()
35 {
36 return $this->sComment;
37 }
38
39 /**
40 * @param string $sComment
41 *
42 * @return void
43 */
44 public function setComment($sComment)
45 {
46 $this->sComment = $sComment;
47 }
48
49 /**
50 * @return string
51 *
52 * @deprecated in V8.8.0, will be removed in V9.0.0. Use `render` instead.
53 */
54 public function __toString()
55 {
56 return $this->render(new OutputFormat());
57 }
58
59 /**
60 * @param OutputFormat|null $oOutputFormat
61 *
62 * @return string
63 */
64 public function render($oOutputFormat)
65 {
66 return '/*' . $this->sComment . '*/';
67 }
68 }
69