Skip to content

Commit a0b9a78

Browse files
authored
[CLEANUP] And some more annotations for non-empty strings (#1199)
1 parent 3572062 commit a0b9a78

File tree

15 files changed

+46
-1
lines changed

15 files changed

+46
-1
lines changed

src/CSSList/AtRuleBlockList.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ public function atRuleArgs(): string
4646
return $this->arguments;
4747
}
4848

49+
/**
50+
* @return non-empty-string
51+
*/
4952
public function render(OutputFormat $outputFormat): string
5053
{
5154
$formatter = $outputFormat->getFormatter();

src/CSSList/KeyFrame.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ public function getAnimationName(): string
5151
return $this->animationName;
5252
}
5353

54+
/**
55+
* @return non-empty-string
56+
*/
5457
public function render(OutputFormat $outputFormat): string
5558
{
5659
$formatter = $outputFormat->getFormatter();

src/Comment/Comment.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ public function setComment(string $commentText): void
5050
$this->commentText = $commentText;
5151
}
5252

53+
/**
54+
* @return non-empty-string
55+
*/
5356
public function render(OutputFormat $outputFormat): string
5457
{
5558
return '/*' . $this->commentText . '*/';

src/OutputFormat.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ final class OutputFormat
99
/**
1010
* Value format: `"` means double-quote, `'` means single-quote
1111
*
12-
* @var string
12+
* @var non-empty-string
1313
*/
1414
private $stringQuotingType = '"';
1515

@@ -181,6 +181,8 @@ final class OutputFormat
181181
private $indentationLevel = 0;
182182

183183
/**
184+
* @return non-empty-string
185+
*
184186
* @internal
185187
*/
186188
public function getStringQuotingType(): string
@@ -189,6 +191,8 @@ public function getStringQuotingType(): string
189191
}
190192

191193
/**
194+
* @param non-empty-string $quotingType
195+
*
192196
* @return $this fluent interface
193197
*/
194198
public function setStringQuotingType(string $quotingType): self

src/Property/CSSNamespace.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ public function getLineNo(): int
5555
return $this->lineNumber;
5656
}
5757

58+
/**
59+
* @return non-empty-string
60+
*/
5861
public function render(OutputFormat $outputFormat): string
5962
{
6063
return '@namespace ' . ($this->prefix === null ? '' : $this->prefix . ' ')

src/Property/Charset.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ public function getCharset(): string
6868
return $this->charset->getString();
6969
}
7070

71+
/**
72+
* @return non-empty-string
73+
*/
7174
public function render(OutputFormat $outputFormat): string
7275
{
7376
return "{$outputFormat->getFormatter()->comments($this)}@charset {$this->charset->render($outputFormat)};";

src/Property/Import.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ public function getLocation(): URL
6565
return $this->location;
6666
}
6767

68+
/**
69+
* @return non-empty-string
70+
*/
6871
public function render(OutputFormat $outputFormat): string
6972
{
7073
return $outputFormat->getFormatter()->comments($this) . '@import ' . $this->location->render($outputFormat)

src/RuleSet/AtRuleSet.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ public function atRuleArgs(): string
4949
return $this->arguments;
5050
}
5151

52+
/**
53+
* @return non-empty-string
54+
*/
5255
public function render(OutputFormat $outputFormat): string
5356
{
5457
$formatter = $outputFormat->getFormatter();

src/RuleSet/DeclarationBlock.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,8 @@ public function getSelectors(): array
138138
}
139139

140140
/**
141+
* @return non-empty-string
142+
*
141143
* @throws OutputException
142144
*/
143145
public function render(OutputFormat $outputFormat): string

src/Value/CSSFunction.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,9 @@ public function getArguments(): array
105105
return $this->components;
106106
}
107107

108+
/**
109+
* @return non-empty-string
110+
*/
108111
public function render(OutputFormat $outputFormat): string
109112
{
110113
$arguments = parent::render($outputFormat);

src/Value/CSSString.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ public function getString(): string
8383
return $this->string;
8484
}
8585

86+
/**
87+
* @return non-empty-string
88+
*/
8689
public function render(OutputFormat $outputFormat): string
8790
{
8891
$string = \addslashes($this->string);

src/Value/Color.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,9 @@ public function getColorDescription(): string
224224
return $this->getName();
225225
}
226226

227+
/**
228+
* @return non-empty-string
229+
*/
227230
public function render(OutputFormat $outputFormat): string
228231
{
229232
if ($this->shouldRenderAsHex($outputFormat)) {

src/Value/LineName.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ public static function parse(ParserState $parserState): LineName
4949
return new LineName($names, $parserState->currentLine());
5050
}
5151

52+
/**
53+
* @return non-empty-string
54+
*/
5255
public function render(OutputFormat $outputFormat): string
5356
{
5457
return '[' . parent::render(OutputFormat::createCompact()) . ']';

src/Value/Size.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,9 @@ public function isRelative(): bool
195195
return false;
196196
}
197197

198+
/**
199+
* @return non-empty-string
200+
*/
198201
public function render(OutputFormat $outputFormat): string
199202
{
200203
$locale = \localeconv();

src/Value/URL.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ public function getURL(): CSSString
7373
return $this->url;
7474
}
7575

76+
/**
77+
* @return non-empty-string
78+
*/
7679
public function render(OutputFormat $outputFormat): string
7780
{
7881
return "url({$this->url->render($outputFormat)})";

0 commit comments

Comments
 (0)