minor #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 #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
This commit is contained in:
Fabien Potencier 2015-11-29 11:53:55 +01:00
commit 52209dbcdc
1 changed files with 4 additions and 4 deletions

View File

@ -311,7 +311,7 @@ class Parser
if (null === $indentation) {
$newIndent = $this->getCurrentLineIndentation();
$unindentedEmbedBlock = $this->isStringUnIndentedCollectionItem($this->currentLine);
$unindentedEmbedBlock = $this->isStringUnIndentedCollectionItem();
if (!$this->isCurrentLineEmpty() && 0 === $newIndent && !$unindentedEmbedBlock) {
throw new ParseException('Indentation problem.', $this->getRealCurrentLineNb() + 1, $this->currentLine);
@ -337,7 +337,7 @@ class Parser
return;
}
$isItUnindentedCollection = $this->isStringUnIndentedCollectionItem($this->currentLine);
$isItUnindentedCollection = $this->isStringUnIndentedCollectionItem();
// Comments must not be removed inside a block scalar
$removeCommentsPattern = '~'.self::BLOCK_SCALAR_HEADER_PATTERN.'$~';
@ -350,7 +350,7 @@ class Parser
$removeComments = !preg_match($removeCommentsPattern, $this->currentLine);
}
if ($isItUnindentedCollection && !$this->isStringUnIndentedCollectionItem($this->currentLine) && $newIndent === $indent) {
if ($isItUnindentedCollection && !$this->isStringUnIndentedCollectionItem() && $newIndent === $indent) {
$this->moveToPreviousLine();
break;
}
@ -653,7 +653,7 @@ class Parser
if (
$this->getCurrentLineIndentation() == $currentIndentation
&&
$this->isStringUnIndentedCollectionItem($this->currentLine)
$this->isStringUnIndentedCollectionItem()
) {
$ret = true;
}