1 | <?php |
||
20 | class CommentNode extends Node implements MarkableAsReferencedInterface |
||
21 | { |
||
22 | /** |
||
23 | * Node type. |
||
24 | * |
||
25 | * @var string |
||
26 | */ |
||
27 | protected $type = 'Comment'; |
||
28 | |||
29 | /** |
||
30 | * Current index. |
||
31 | * |
||
32 | * @var int |
||
33 | */ |
||
34 | public $index = 0; |
||
35 | |||
36 | /** |
||
37 | * Is line comment? |
||
38 | * |
||
39 | * @var bool |
||
40 | */ |
||
41 | protected $isLineComment = false; |
||
42 | |||
43 | /** |
||
44 | * Reference flag. |
||
45 | * |
||
46 | * @var bool |
||
47 | */ |
||
48 | protected $isReferenced = false; |
||
49 | |||
50 | /** |
||
51 | * Constructor. |
||
52 | * |
||
53 | * @param string $value The comment value |
||
54 | * @param bool $isLineComment |
||
55 | */ |
||
56 | public function __construct($value, $isLineComment = false, $index = 0, FileInfo $currentFileInfo = null) |
||
63 | |||
64 | /** |
||
65 | * Is the comment silent? |
||
66 | * |
||
67 | * @param Context $context |
||
68 | * |
||
69 | * @return bool |
||
70 | */ |
||
71 | public function isSilent(Context $context) |
||
78 | |||
79 | /** |
||
80 | * {@inheritdoc} |
||
81 | */ |
||
82 | public function generateCSS(Context $context, OutputInterface $output) |
||
89 | |||
90 | /** |
||
91 | * Mark the comment as referenced. |
||
92 | */ |
||
93 | public function markReferenced() |
||
97 | } |
||
98 |
If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:
If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.