Skip to content

Commit 52209db

Browse files
committed
minor symfony#16737 [Yaml] minor CS cleaning (mhujer)
This PR was submitted for the master branch but it was merged into the 2.3 branch instead (closes symfony#16737). Discussion ---------- [Yaml] minor CS cleaning | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - PHPStorm reported different types of coding style suggestions along the Symfony codebase. I've fixed some of them in the Yaml compontent and I have two questions: 1) What is the correct branch for such changes? Not all of them can be fixed in 2.3/2.8, for example `ParserTest`'s docblock is different there. 2) Should I create similar PRs for other components or is there a plan to do all such fixes at once someday in the future (e.g. after 2.8/3.0 is released)? Commits ------- 613804d [Yaml] minor CS cleaning
2 parents 0239d4a + 613804d commit 52209db

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Symfony/Component/Yaml/Parser.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ private function getNextEmbedBlock($indentation = null, $inSequence = false)
311311
if (null === $indentation) {
312312
$newIndent = $this->getCurrentLineIndentation();
313313

314-
$unindentedEmbedBlock = $this->isStringUnIndentedCollectionItem($this->currentLine);
314+
$unindentedEmbedBlock = $this->isStringUnIndentedCollectionItem();
315315

316316
if (!$this->isCurrentLineEmpty() && 0 === $newIndent && !$unindentedEmbedBlock) {
317317
throw new ParseException('Indentation problem.', $this->getRealCurrentLineNb() + 1, $this->currentLine);
@@ -337,7 +337,7 @@ private function getNextEmbedBlock($indentation = null, $inSequence = false)
337337
return;
338338
}
339339

340-
$isItUnindentedCollection = $this->isStringUnIndentedCollectionItem($this->currentLine);
340+
$isItUnindentedCollection = $this->isStringUnIndentedCollectionItem();
341341

342342
// Comments must not be removed inside a block scalar
343343
$removeCommentsPattern = '~'.self::BLOCK_SCALAR_HEADER_PATTERN.'$~';
@@ -350,7 +350,7 @@ private function getNextEmbedBlock($indentation = null, $inSequence = false)
350350
$removeComments = !preg_match($removeCommentsPattern, $this->currentLine);
351351
}
352352

353-
if ($isItUnindentedCollection && !$this->isStringUnIndentedCollectionItem($this->currentLine) && $newIndent === $indent) {
353+
if ($isItUnindentedCollection && !$this->isStringUnIndentedCollectionItem() && $newIndent === $indent) {
354354
$this->moveToPreviousLine();
355355
break;
356356
}
@@ -653,7 +653,7 @@ private function isNextLineUnIndentedCollection()
653653
if (
654654
$this->getCurrentLineIndentation() == $currentIndentation
655655
&&
656-
$this->isStringUnIndentedCollectionItem($this->currentLine)
656+
$this->isStringUnIndentedCollectionItem()
657657
) {
658658
$ret = true;
659659
}

0 commit comments

Comments
 (0)