Skip to content
/ yaml Public
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: symfony/yaml
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v4.1.3
Choose a base ref
...
head repository: symfony/yaml
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v4.1.4
Choose a head ref
  • 2 commits
  • 1 file changed
  • 2 contributors

Commits on Aug 10, 2018

  1. clean up unused code

    xabbuh committed Aug 10, 2018
    Copy the full SHA
    c2f4812 View commit details

Commits on Aug 18, 2018

  1. Merge branch '3.4' into 4.1

    * 3.4:
      [travis][appveyor] use symfony/flex to accelerate builds
      Add missing stderr redirection
      clean up unused code
      [Filesystem] Add test to prevent regression when using array|resource with dumpFile
      [Security] Call AccessListener after LogoutListener
    nicolas-grekas committed Aug 18, 2018
    Copy the full SHA
    b832cc2 View commit details
Showing with 0 additions and 36 deletions.
  1. +0 −36 Parser.php
36 changes: 0 additions & 36 deletions Parser.php
Original file line number Diff line number Diff line change
@@ -499,11 +499,6 @@ private function getCurrentLineIndentation(): int
private function getNextEmbedBlock(int $indentation = null, bool $inSequence = false): ?string
{
$oldLineIndentation = $this->getCurrentLineIndentation();
$blockScalarIndentations = array();

if ($this->isBlockScalarHeader()) {
$blockScalarIndentations[] = $oldLineIndentation;
}

if (!$this->moveToNextLine()) {
return null;
@@ -562,30 +557,9 @@ private function getNextEmbedBlock(int $indentation = null, bool $inSequence = f

$isItUnindentedCollection = $this->isStringUnIndentedCollectionItem();

if (empty($blockScalarIndentations) && $this->isBlockScalarHeader()) {
$blockScalarIndentations[] = $this->getCurrentLineIndentation();
}

$previousLineIndentation = $this->getCurrentLineIndentation();

while ($this->moveToNextLine()) {
$indent = $this->getCurrentLineIndentation();

// terminate all block scalars that are more indented than the current line
if (!empty($blockScalarIndentations) && $indent < $previousLineIndentation && '' !== trim($this->currentLine)) {
foreach ($blockScalarIndentations as $key => $blockScalarIndentation) {
if ($blockScalarIndentation >= $indent) {
unset($blockScalarIndentations[$key]);
}
}
}

if (empty($blockScalarIndentations) && !$this->isCurrentLineComment() && $this->isBlockScalarHeader()) {
$blockScalarIndentations[] = $indent;
}

$previousLineIndentation = $indent;

if ($isItUnindentedCollection && !$this->isCurrentLineEmpty() && !$this->isStringUnIndentedCollectionItem() && $newIndent === $indent) {
$this->moveToPreviousLine();
break;
@@ -1002,16 +976,6 @@ private function isStringUnIndentedCollectionItem(): bool
return '-' === rtrim($this->currentLine) || 0 === strpos($this->currentLine, '- ');
}

/**
* Tests whether or not the current line is the header of a block scalar.
*
* @return bool
*/
private function isBlockScalarHeader(): bool
{
return (bool) self::preg_match('~'.self::BLOCK_SCALAR_HEADER_PATTERN.'$~', $this->currentLine);
}

/**
* A local wrapper for `preg_match` which will throw a ParseException if there
* is an internal error in the PCRE engine.