8000 [Yaml] Fix wrong line number when comments are inserted in the middle of a block. by paradajozsef · Pull Request #17733 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Yaml] Fix wrong line number when comments are inserted in the middle of a block. #17733

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prev Previous commit
Coding standard + unnecessary comment fixes.
  • Loading branch information
paradajozsef committed May 11, 2016
commit c8b34a76c2d43b33b938b1edb2e4c10cda03cb5a
6 changes: 3 additions & 3 deletions src/Symfony/Component/Yaml/Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -816,7 +816,7 @@ private function isBlockScalarHeader()
/**
* Returns true if the current line is a collection item.
*
* @return bool Returns true if the current line is a collection item line, false otherwise.
* @return bool
*/
private function isCurrentLineCollectionItem()
{
Expand All @@ -834,7 +834,7 @@ private function checkIfPreviousNonCommentLineIsCollectionItem()
{
$isCollectionItem = false;
$moves = 0;
while($this->moveToPreviousLine()) {
while ($this->moveToPreviousLine()) {
++$moves;
// If previous line is a comment, move back again.
if ($this->isCurrentLineComment()) {
Expand All @@ -845,7 +845,7 @@ private function checkIfPreviousNonCommentLineIsCollectionItem()
}

// Move parser back to previous line.
while($moves > 0) {
while ($moves > 0) {
$this->moveToNextLine();
--$moves;
}
Expand Down
0