Skip to content

Commit 8574112

Browse files
Merge branch '3.4' into 4.3
* 3.4: Fix inconsistent return points. [Security/Core] UserInterface::getPassword() can return null [Router] Fix TraceableUrlMatcher behaviour with trailing slash
2 parents 3836b11 + 3dc414b commit 8574112

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

Command/LintCommand.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,10 +199,13 @@ private function getFiles($fileOrDirectory)
199199
}
200200
}
201201

202+
/**
203+
* @return string|null
204+
*/
202205
private function getStdin()
203206
{
204207
if (0 !== ftell(STDIN)) {
205-
return;
208+
return null;
206209
}
207210

208211
$inputs = '';

Parser.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -512,12 +512,12 @@ private function getCurrentLineIndentation(): int
512512
*
513513
* @throws ParseException When indentation problem are detected
514514
*/
515-
private function getNextEmbedBlock(int $indentation = null, bool $inSequence = false): ?string
515+
private function getNextEmbedBlock(int $indentation = null, bool $inSequence = false): string
516516
{
517517
$oldLineIndentation = $this->getCurrentLineIndentation();
518518

519519
if (!$this->moveToNextLine()) {
520-
return null;
520+
return '';
521521
}
522522

523523
if (null === $indentation) {
@@ -560,15 +560,15 @@ private function getNextEmbedBlock(int $indentation = null, bool $inSequence = f
560560
} else {
561561
$this->moveToPreviousLine();
562562

563-
return null;
563+
return '';
564564
}
565565

566566
if ($inSequence && $oldLineIndentation === $newIndent && isset($data[0][0]) && '-' === $data[0][0]) {
567567
// the previous line contained a dash but no item content, this line is a sequence item with the same indentation
568568
// and therefore no nested list or mapping
569569
$this->moveToPreviousLine();
570570

571-
return null;
571+
return '';
572572
}
573573

574574
$isItUnindentedCollection = $this->isStringUnIndentedCollectionItem();

0 commit comments

Comments
 (0)