PluginProbe
WCPOS – Point of Sale (POS) plugin for WooCommerce / 1.10.19
WCPOS – Point of Sale (POS) plugin for WooCommerce v1.10.19
1.10.19 1.10.18 1.10.17 1.10.16 1.10.15 1.10.13 1.10.14 1.10.12 1.10.11 1.10.10 1.10.9 1.10.8 untagged-3d9b7ccddc54df87c672 1.10.7 1.10.6 1.10.5 1.10.3 1.10.4 1.10.2 1.10.1 1.10.0 1.9.17 1.9.15 1.9.16 1.9.14 All 163 releases
woocommerce-pos / vendor_prefixed / sabberworm / php-css-parser / src / Comment / Comment.php

Comment.php in WCPOS – Point of Sale (POS) plugin for WooCommerce 1.10.19, at vendor_prefixed/sabberworm/php-css-parser/src/Comment/Comment.php

59 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 declare (strict_types=1);
4 namespace WCPOS\Vendor\Sabberworm\CSS\Comment;
5
6 use WCPOS\Vendor\Sabberworm\CSS\OutputFormat;
7 use WCPOS\Vendor\Sabberworm\CSS\Position\Position;
8 use WCPOS\Vendor\Sabberworm\CSS\Position\Positionable;
9 use WCPOS\Vendor\Sabberworm\CSS\Renderable;
10 use WCPOS\Vendor\Sabberworm\CSS\ShortClassNameProvider;
11 class Comment implements Positionable, Renderable
12 {
13 use Position;
14 use ShortClassNameProvider;
15 /**
16 * @var string
17 *
18 * @internal since 8.8.0
19 */
20 protected $commentText;
21 /**
22 * @param int<1, max>|null $lineNumber
23 */
24 public function __construct(string $commentText = '', ?int $lineNumber = null)
25 {
26 $this->commentText = $commentText;
27 $this->setPosition($lineNumber);
28 }
29 public function getComment() : string
30 {
31 return $this->commentText;
32 }
33 public function setComment(string $commentText) : void
34 {
35 $this->commentText = $commentText;
36 }
37 /**
38 * @return non-empty-string
39 */
40 public function render(OutputFormat $outputFormat) : string
41 {
42 return '/*' . $this->commentText . '*/';
43 }
44 /**
45 * @return array<string, bool|int|float|string|array<mixed>|null>
46 *
47 * @internal
48 */
49 public function getArrayRepresentation() : array
50 {
51 return [
52 'class' => $this->getShortClassName(),
53 // "contents" is the term used in the W3C specs:
54 // https://www.w3.org/TR/CSS22/syndata.html#comments
55 'contents' => $this->commentText,
56 ];
57 }
58 }
59