1 | <?php |
||
20 | class AnonymousNode extends Node implements ComparableInterface, |
||
21 | MarkableAsReferencedInterface, ReferencedInterface |
||
22 | { |
||
23 | /** |
||
24 | * Node type. |
||
25 | * |
||
26 | * @var string |
||
27 | */ |
||
28 | protected $type = 'Anonymous'; |
||
29 | |||
30 | /** |
||
31 | * Current index. |
||
32 | * |
||
33 | * @var int |
||
34 | */ |
||
35 | public $index = 0; |
||
36 | |||
37 | /** |
||
38 | * Map lines flag. |
||
39 | * |
||
40 | * @var bool |
||
41 | */ |
||
42 | public $mapLines; |
||
43 | |||
44 | /** |
||
45 | * @var bool |
||
46 | */ |
||
47 | private $rulesetLike = false; |
||
48 | |||
49 | /** |
||
50 | * Is referenced? |
||
51 | * |
||
52 | * @var bool |
||
53 | */ |
||
54 | public $isReferenced = false; |
||
55 | |||
56 | /** |
||
57 | * Constructor. |
||
58 | * |
||
59 | * @param string|ValueNode|null $value |
||
60 | * @param int $index |
||
61 | * @param FileInfo $currentFileInfo |
||
62 | * @param bool $mapLines |
||
63 | * @param bool $rulesetLike |
||
64 | * @param bool $referenced |
||
65 | */ |
||
66 | public function __construct( |
||
82 | |||
83 | /** |
||
84 | * {@inheritdoc} |
||
85 | */ |
||
86 | public function generateCSS(Context $context, OutputInterface $output) |
||
90 | |||
91 | /** |
||
92 | * Converts to CSS. |
||
93 | * |
||
94 | * @param Context $context |
||
95 | * |
||
96 | * @return string |
||
97 | */ |
||
98 | public function toCSS(Context $context) |
||
102 | |||
103 | /** |
||
104 | * Compiles the node. |
||
105 | * |
||
106 | * @param Context $context The context |
||
107 | * @param array|null $arguments Array of arguments |
||
108 | * @param bool|null $important Important flag |
||
109 | * |
||
110 | * @return AnonymousNode |
||
111 | */ |
||
112 | public function compile(Context $context, $arguments = null, $important = null) |
||
117 | |||
118 | /** |
||
119 | * {@inheritdoc} |
||
120 | */ |
||
121 | public function compare(Node $other) |
||
129 | |||
130 | /** |
||
131 | * @return bool |
||
132 | */ |
||
133 | public function isRulesetLike() |
||
137 | |||
138 | /** |
||
139 | * @return bool |
||
140 | */ |
||
141 | public function getIsReferenced() |
||
145 | |||
146 | /** |
||
147 | * Marks as referenced. |
||
148 | */ |
||
149 | public function markReferenced() |
||
153 | } |
||
154 |
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.