Skip to content

Commit ce70286

Browse files
committed
[CLEANUP] Rector: Add return type from return direct array
This applies the rule ReturnTypeFromReturnDirectArrayRector. For Details see: https://github.com/rectorphp/rector/blob/main/docs/rector_rules_overview.md#returntypefromreturndirectarrayrector Signed-off-by: Daniel Ziegenberg <[email protected]>
1 parent 83c7196 commit ce70286

File tree

2 files changed

+4
-11
lines changed

2 files changed

+4
-11
lines changed

src/Parsing/ParserState.php

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -270,10 +270,8 @@ public function comes($sString, $bCaseInsensitive = false): bool
270270
/**
271271
* @param int $iLength
272272
* @param int $iOffset
273-
*
274-
* @return string
275273
*/
276-
public function peek($iLength = 1, $iOffset = 0)
274+
public function peek($iLength = 1, $iOffset = 0): string
277275
{
278276
$iOffset += $this->iCurrentPosition;
279277
if ($iOffset >= $this->iLength) {
@@ -285,12 +283,10 @@ public function peek($iLength = 1, $iOffset = 0)
285283
/**
286284
* @param int $mValue
287285
*
288-
* @return string
289-
*
290286
* @throws UnexpectedEOFException
291287
* @throws UnexpectedTokenException
292288
*/
293-
public function consume($mValue = 1)
289+
public function consume($mValue = 1): string
294290
{
295291
if (is_string($mValue)) {
296292
$iLineCount = substr_count($mValue, "\n");
@@ -410,10 +406,7 @@ public function consumeUntil($aEnd, $bIncludeEnd = false, $consumeEnd = false, a
410406
);
411407
}
412408

413-
/**
414-
* @return string
415-
*/
416-
private function inputLeft()
409+
private function inputLeft(): string
417410
{
418411
return $this->substr($this->iCurrentPosition, -1);
419412
}

src/Rule/Rule.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public static function parse(ParserState $oParserState)
117117
*
118118
* @return array<int, string>
119119
*/
120-
private static function listDelimiterForRule($sRule)
120+
private static function listDelimiterForRule($sRule): array
121121
{
122122
if (preg_match('/^font($|-)/', $sRule)) {
123123
return [',', '/', ' '];

0 commit comments

Comments
 (0)