Skip to content

Commit 1751503

Browse files
committed
[CLEANUP] Rector: Add return type void to function like without any return
This applies the rule AddVoidReturnTypeWhereNoReturnRector. For Details see: https://github.com/rectorphp/rector/blob/main/docs/rector_rules_overview.md#addvoidreturntypewherenoreturnrector Signed-off-by: Daniel Ziegenberg <[email protected]>
1 parent 3163c9f commit 1751503

23 files changed

+72
-72
lines changed

src/CSSList/CSSList.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public function __construct($iLineNo = 0)
6262
* @throws UnexpectedTokenException
6363
* @throws SourceException
6464
*/
65-
public static function parseList(ParserState $oParserState, CSSList $oList)
65+
public static function parseList(ParserState $oParserState, CSSList $oList): void
6666
{
6767
$bIsRoot = $oList instanceof Document;
6868
if (is_string($oParserState)) {
@@ -263,7 +263,7 @@ public function getLineNo()
263263
*
264264
* @return void
265265
*/
266-
public function prepend($oItem)
266+
public function prepend($oItem): void
267267
{
268268
array_unshift($this->aContents, $oItem);
269269
}
@@ -275,7 +275,7 @@ public function prepend($oItem)
275275
*
276276
* @return void
277277
*/
278-
public function append($oItem)
278+
public function append($oItem): void
279279
{
280280
$this->aContents[] = $oItem;
281281
}
@@ -289,7 +289,7 @@ public function append($oItem)
289289
*
290290
* @return void
291291
*/
292-
public function splice($iOffset, $iLength = null, $mReplacement = null)
292+
public function splice($iOffset, $iLength = null, $mReplacement = null): void
293293
{
294294
array_splice($this->aContents, $iOffset, $iLength, $mReplacement);
295295
}
@@ -355,7 +355,7 @@ public function replace($oOldItem, $mNewItem)
355355
/**
356356
* @param array<int, RuleSet|Import|Charset|CSSList> $aContents
357357
*/
358-
public function setContents(array $aContents)
358+
public function setContents(array $aContents): void
359359
{
360360
$this->aContents = [];
361361
foreach ($aContents as $content) {
@@ -371,7 +371,7 @@ public function setContents(array $aContents)
371371
*
372372
* @return void
373373
*/
374-
public function removeDeclarationBlockBySelector($mSelector, $bRemoveAll = false)
374+
public function removeDeclarationBlockBySelector($mSelector, $bRemoveAll = false): void
375375
{
376376
if ($mSelector instanceof DeclarationBlock) {
377377
$mSelector = $mSelector->getSelectors();
@@ -469,7 +469,7 @@ public function getContents()
469469
*
470470
* @return void
471471
*/
472-
public function addComments(array $aComments)
472+
public function addComments(array $aComments): void
473473
{
474474
$this->aComments = array_merge($this->aComments, $aComments);
475475
}
@@ -487,7 +487,7 @@ public function getComments()
487487
*
488488
* @return void
489489
*/
490-
public function setComments(array $aComments)
490+
public function setComments(array $aComments): void
491491
{
492492
$this->aComments = $aComments;
493493
}

src/CSSList/Document.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public function getSelectorsBySpecificity($sSpecificitySearch = null)
117117
*
118118
* @deprecated This will be removed without substitution in version 10.0.
119119
*/
120-
public function expandShorthands()
120+
public function expandShorthands(): void
121121
{
122122
foreach ($this->getAllDeclarationBlocks() as $oDeclaration) {
123123
$oDeclaration->expandShorthands();
@@ -131,7 +131,7 @@ public function expandShorthands()
131131
*
132132
* @deprecated This will be removed without substitution in version 10.0.
133133
*/
134-
public function createShorthands()
134+
public function createShorthands(): void
135135
{
136136
foreach ($this->getAllDeclarationBlocks() as $oDeclaration) {
137137
$oDeclaration->createShorthands();

src/CSSList/KeyFrame.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function __construct($iLineNo = 0)
3030
/**
3131
* @param string $vendorKeyFrame
3232
*/
33-
public function setVendorKeyFrame($vendorKeyFrame)
33+
public function setVendorKeyFrame($vendorKeyFrame): void
3434
{
3535
$this->vendorKeyFrame = $vendorKeyFrame;
3636
}
@@ -46,7 +46,7 @@ public function getVendorKeyFrame()
4646
/**
4747
* @param string $animationName
4848
*/
49-
public function setAnimationName($animationName)
49+
public function setAnimationName($animationName): void
5050
{
5151
$this->animationName = $animationName;
5252
}

src/Comment/Comment.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function getLineNo()
4848
*
4949
* @return void
5050
*/
51-
public function setComment($sComment)
51+
public function setComment($sComment): void
5252
{
5353
$this->sComment = $sComment;
5454
}

src/OutputFormat.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ public function nextLevel()
277277
/**
278278
* @return void
279279
*/
280-
public function beLenient()
280+
public function beLenient(): void
281281
{
282282
$this->bIgnoreExceptions = true;
283283
}

src/Parser.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function __construct($sText, Settings $oParserSettings = null, $iLineNo =
3636
*
3737
* @return void
3838
*/
39-
public function setCharset($sCharset)
39+
public function setCharset($sCharset): void
4040
{
4141
$this->oParserState->setCharset($sCharset);
4242
}
@@ -46,7 +46,7 @@ public function setCharset($sCharset)
4646
*
4747
* @return void
4848
*/
49-
public function getCharset()
49+
public function getCharset(): void
5050
{
5151
// Note: The `return` statement is missing here. This is a bug that needs to be fixed.
5252
$this->oParserState->getCharset();

src/Parsing/Anchor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public function __construct($iPosition, ParserState $oParserState)
2727
/**
2828
* @return void
2929
*/
30-
public function backtrack()
30+
public function backtrack(): void
3131
{
3232
$this->oParserState->setPosition($this->iPosition);
3333
}

src/Parsing/ParserState.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public function __construct($sText, Settings $oParserSettings, $iLineNo = 1)
7272
*
7373
* @return void
7474
*/
75-
public function setCharset($sCharset)
75+
public function setCharset($sCharset): void
7676
{
7777
$this->sCharset = $sCharset;
7878
$this->aText = $this->strsplit($this->sText);
@@ -126,7 +126,7 @@ public function anchor(): Anchor
126126
*
127127
* @return void
128128
*/
129-
public function setPosition($iPosition)
129+
public function setPosition($iPosition): void
130130
{
131131
$this->iCurrentPosition = $iPosition;
132132
}
@@ -429,7 +429,7 @@ public function streql($sString1, $sString2, $bCaseInsensitive = true): bool
429429
*
430430
* @return void
431431
*/
432-
public function backtrack($iAmount)
432+
public function backtrack($iAmount): void
433433
{
434434
$this->iCurrentPosition -= $iAmount;
435435
}

src/Property/CSSNamespace.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public function getPrefix()
8686
*
8787
* @return void
8888
*/
89-
public function setUrl($mUrl)
89+
public function setUrl($mUrl): void
9090
{
9191
$this->mUrl = $mUrl;
9292
}
@@ -96,7 +96,7 @@ public function setUrl($mUrl)
9696
*
9797
* @return void
9898
*/
99-
public function setPrefix($sPrefix)
99+
public function setPrefix($sPrefix): void
100100
{
101101
$this->sPrefix = $sPrefix;
102102
}
@@ -126,7 +126,7 @@ public function atRuleArgs(): array
126126
*
127127
* @return void
128128
*/
129-
public function addComments(array $aComments)
129+
public function addComments(array $aComments): void
130130
{
131131
$this->aComments = array_merge($this->aComments, $aComments);
132132
}
@@ -144,7 +144,7 @@ public function getComments()
144144
*
145145
* @return void
146146
*/
147-
public function setComments(array $aComments)
147+
public function setComments(array $aComments): void
148148
{
149149
$this->aComments = $aComments;
150150
}

src/Property/Charset.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function getLineNo()
5555
*
5656
* @return void
5757
*/
58-
public function setCharset($sCharset)
58+
public function setCharset($sCharset): void
5959
{
6060
$sCharset = $sCharset instanceof CSSString ? $sCharset : new CSSString($sCharset);
6161
$this->oCharset = $sCharset;
@@ -100,7 +100,7 @@ public function atRuleArgs()
100100
*
101101
* @return void
102102
*/
103-
public function addComments(array $aComments)
103+
public function addComments(array $aComments): void
104104
{
105105
$this->aComments = array_merge($this->aComments, $aComments);
106106
}
@@ -118,7 +118,7 @@ public function getComments()
118118
*
119119
* @return void
120120
*/
121-
public function setComments(array $aComments)
121+
public function setComments(array $aComments): void
122122
{
123123
$this->aComments = $aComments;
124124
}

src/Property/Import.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function getLineNo()
5757
*
5858
* @return void
5959
*/
60-
public function setLocation($oLocation)
60+
public function setLocation($oLocation): void
6161
{
6262
$this->oLocation = $oLocation;
6363
}
@@ -106,7 +106,7 @@ public function atRuleArgs(): array
106106
*
107107
* @return void
108108
*/
109-
public function addComments(array $aComments)
109+
public function addComments(array $aComments): void
110110
{
111111
$this->aComments = array_merge($this->aComments, $aComments);
112112
}
@@ -124,7 +124,7 @@ public function getComments()
124124
*
125125
* @return void
126126
*/
127-
public function setComments(array $aComments)
127+
public function setComments(array $aComments): void
128128
{
129129
$this->aComments = $aComments;
130130
}

src/Property/Selector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public function getSelector()
107107
*
108108
* @return void
109109
*/
110-
public function setSelector($sSelector)
110+
public function setSelector($sSelector): void
111111
{
112112
$this->sSelector = trim($sSelector);
113113
$this->iSpecificity = null;

src/Rule/Rule.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ public function getColNo()
145145
*
146146
* @return void
147147
*/
148-
public function setPosition($iLine, $iColumn)
148+
public function setPosition($iLine, $iColumn): void
149149
{
150150
$this->iColNo = $iColumn;
151151
$this->iLineNo = $iLine;
@@ -156,7 +156,7 @@ public function setPosition($iLine, $iColumn)
156156
*
157157
* @return void
158158
*/
159-
public function setRule($sRule)
159+
public function setRule($sRule): void
160160
{
161161
$this->sRule = $sRule;
162162
}
@@ -182,7 +182,7 @@ public function getValue()
182182
*
183183
* @return void
184184
*/
185-
public function setValue($mValue)
185+
public function setValue($mValue): void
186186
{
187187
$this->mValue = $mValue;
188188
}
@@ -196,7 +196,7 @@ public function setValue($mValue)
196196
*
197197
* @return void
198198
*/
199-
public function addValue($mValue, $sType = ' ')
199+
public function addValue($mValue, $sType = ' '): void
200200
{
201201
if (!is_array($mValue)) {
202202
$mValue = [$mValue];
@@ -218,7 +218,7 @@ public function addValue($mValue, $sType = ' ')
218218
*
219219
* @return void
220220
*/
221-
public function addIeHack($iModifier)
221+
public function addIeHack($iModifier): void
222222
{
223223
$this->aIeHack[] = $iModifier;
224224
}
@@ -228,7 +228,7 @@ public function addIeHack($iModifier)
228228
*
229229
* @return void
230230
*/
231-
public function setIeHack(array $aModifiers)
231+
public function setIeHack(array $aModifiers): void
232232
{
233233
$this->aIeHack = $aModifiers;
234234
}
@@ -246,7 +246,7 @@ public function getIeHack()
246246
*
247247
* @return void
248248
*/
249-
public function setIsImportant($bIsImportant)
249+
public function setIsImportant($bIsImportant): void
250250
{
251251
$this->bIsImportant = $bIsImportant;
252252
}
@@ -290,7 +290,7 @@ public function render(OutputFormat $oOutputFormat): string
290290
*
291291
* @return void
292292
*/
293-
public function addComments(array $aComments)
293+
public function addComments(array $aComments): void
294294
{
295295
$this->aComments = array_merge($this->aComments, $aComments);
296296
}
@@ -308,7 +308,7 @@ public function getComments()
308308
*
309309
* @return void
310310
*/
311-
public function setComments(array $aComments)
311+
public function setComments(array $aComments): void
312312
{
313313
$this->aComments = $aComments;
314314
}

0 commit comments

Comments
 (0)