2222class Rule implements Renderable, Commentable
2323{
2424 /**
25- * @var string
25+ * @var non-empty- string
2626 */
2727 private $ rule ;
2828
@@ -42,7 +42,7 @@ class Rule implements Renderable, Commentable
4242 protected $ lineNumber ;
4343
4444 /**
45- * @var int
45+ * @var int<0, max>
4646 *
4747 * @internal since 8.8.0
4848 */
@@ -56,11 +56,11 @@ class Rule implements Renderable, Commentable
5656 protected $ comments = [];
5757
5858 /**
59- * @param string $rule
59+ * @param non-empty- string $rule
6060 * @param int<0, max> $lineNumber
61- * @param int $columnNumber
61+ * @param int<0, max> $columnNumber
6262 */
63- public function __construct ($ rule , int $ lineNumber = 0 , $ columnNumber = 0 )
63+ public function __construct (string $ rule , int $ lineNumber = 0 , int $ columnNumber = 0 )
6464 {
6565 $ this ->rule = $ rule ;
6666 $ this ->lineNumber = $ lineNumber ;
@@ -108,11 +108,11 @@ public static function parse(ParserState $parserState, array $commentsBeforeRule
108108 * The first item is the innermost separator (or, put another way, the highest-precedence operator).
109109 * The sequence continues to the outermost separator (or lowest-precedence operator).
110110 *
111- * @param string $rule
111+ * @param non-empty- string $rule
112112 *
113113 * @return list<non-empty-string>
114114 */
115- private static function listDelimiterForRule ($ rule ): array
115+ private static function listDelimiterForRule (string $ rule ): array
116116 {
117117 if (\preg_match ('/^font($|-)/ ' , $ rule )) {
118118 return [', ' , '/ ' , ' ' ];
@@ -135,35 +135,35 @@ public function getLineNo(): int
135135 }
136136
137137 /**
138- * @return int
138+ * @return int<0, max>
139139 */
140- public function getColNo ()
140+ public function getColNo (): int
141141 {
142142 return $ this ->columnNumber ;
143143 }
144144
145145 /**
146146 * @param int<0, max> $lineNumber
147- * @param int $columnNumber
147+ * @param int<0, max> $columnNumber
148148 */
149- public function setPosition (int $ lineNumber , $ columnNumber ): void
149+ public function setPosition (int $ lineNumber , int $ columnNumber ): void
150150 {
151151 $ this ->columnNumber = $ columnNumber ;
152152 $ this ->lineNumber = $ lineNumber ;
153153 }
154154
155155 /**
156- * @param string $rule
156+ * @param non-empty- string $rule
157157 */
158- public function setRule ($ rule ): void
158+ public function setRule (string $ rule ): void
159159 {
160160 $ this ->rule = $ rule ;
161161 }
162162
163163 /**
164- * @return string
164+ * @return non-empty- string
165165 */
166- public function getRule ()
166+ public function getRule (): string
167167 {
168168 return $ this ->rule ;
169169 }
@@ -189,9 +189,8 @@ public function setValue($value): void
189189 * Otherwise, the existing value will be wrapped by one.
190190 *
191191 * @param RuleValueList|array<int, RuleValueList> $value
192- * @param string $type
193192 */
194- public function addValue ($ value , $ type = ' ' ): void
193+ public function addValue ($ value , string $ type = ' ' ): void
195194 {
196195 if (!\is_array ($ value )) {
197196 $ value = [$ value ];
@@ -208,22 +207,19 @@ public function addValue($value, $type = ' '): void
208207 }
209208 }
210209
211- /**
212- * @param bool $isImportant
213- */
214- public function setIsImportant ($ isImportant ): void
210+ public function setIsImportant (bool $ isImportant ): void
215211 {
216212 $ this ->isImportant = $ isImportant ;
217213 }
218214
219- /**
220- * @return bool
221- */
222- public function getIsImportant ()
215+ public function getIsImportant (): bool
223216 {
224217 return $ this ->isImportant ;
225218 }
226219
220+ /**
221+ * @return non-empty-string
222+ */
227223 public function render (OutputFormat $ outputFormat ): string
228224 {
229225 $ formatter = $ outputFormat ->getFormatter ();
0 commit comments