Skip to content

Commit 5966efd

Browse files
Merge branch '4.3' into 4.4
* 4.3: cs fix Fix inconsistent return points. [Config] Add handling for ignored keys in ArrayNode::mergeValues. Fix inconsistent return points. [Security/Core] UserInterface::getPassword() can return null [Router] Fix TraceableUrlMatcher behaviour with trailing slash Revert "bug #33092 [DependencyInjection] Improve an exception message (fabpot)"
2 parents 5d17fd3 + 5a0b7c3 commit 5966efd

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
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(string $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 = '';

Inline.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ private static function evaluateScalar(string $scalar, int $flags, array $refere
575575
case 'null' === $scalarLower:
576576
case '' === $scalar:
577577
case '~' === $scalar:
578-
return;
578+
return null;
579579
case 'true' === $scalarLower:
580580
return true;
581581
case 'false' === $scalarLower:
@@ -595,7 +595,7 @@ private static function evaluateScalar(string $scalar, int $flags, array $refere
595595
throw new ParseException('Object support when parsing a YAML file has been disabled.', self::$parsedLineNumber + 1, $scalar, self::$parsedFilename);
596596
}
597597

598-
return;
598+
return null;
599599
case 0 === strpos($scalar, '!php/const'):
600600
if (self::$constantSupport) {
601601
$i = 0;
@@ -609,7 +609,7 @@ private static function evaluateScalar(string $scalar, int $flags, array $refere
609609
throw new ParseException(sprintf('The string "%s" could not be parsed as a constant. Have you forgotten to pass the "Yaml::PARSE_CONSTANT" flag to the parser?', $scalar), self::$parsedLineNumber + 1, $scalar, self::$parsedFilename);
610610
}
611611

612-
return;
612+
return null;
613613
case 0 === strpos($scalar, '!!float '):
614614
return (float) substr($scalar, 8);
615615
case 0 === strpos($scalar, '!!binary '):

Parser.php

Lines changed: 4 additions & 6 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();
@@ -739,8 +739,6 @@ private function parseValue(string $value, int $flags, string $context)
739739
* @param string $style The style indicator that was used to begin this block scalar (| or >)
740740
* @param string $chomping The chomping indicator that was used to begin this block scalar (+ or -)
741741
* @param int $indentation The indentation indicator that was used to begin this block scalar
742-
*
743-
* @return string The text value
744742
*/
745743
private function parseBlockScalar(string $style, string $chomping = '', int $indentation = 0): string
746744
{

0 commit comments

Comments
 (0)