@@ -549,11 +549,6 @@ private function getCurrentLineIndentation()
549
549
private function getNextEmbedBlock ($ indentation = null , $ inSequence = false )
550
550
{
551
551
$ oldLineIndentation = $ this ->getCurrentLineIndentation ();
552
- $ blockScalarIndentations = array ();
553
-
554
- if ($ this ->isBlockScalarHeader ()) {
555
- $ blockScalarIndentations [] = $ oldLineIndentation ;
556
- }
557
552
558
553
if (!$ this ->moveToNextLine ()) {
559
554
return ;
@@ -612,30 +607,9 @@ private function getNextEmbedBlock($indentation = null, $inSequence = false)
612
607
613
608
$ isItUnindentedCollection = $ this ->isStringUnIndentedCollectionItem ();
614
609
615
- if (empty ($ blockScalarIndentations ) && $ this ->isBlockScalarHeader ()) {
616
- $ blockScalarIndentations [] = $ this ->getCurrentLineIndentation ();
617
- }
618
-
619
- $ previousLineIndentation = $ this ->getCurrentLineIndentation ();
620
-
621
610
while ($ this ->moveToNextLine ()) {
622
611
$ indent = $ this ->getCurrentLineIndentation ();
623
612
624
- // terminate all block scalars that are more indented than the current line
625
- if (!empty ($ blockScalarIndentations ) && $ indent < $ previousLineIndentation && '' !== trim ($ this ->currentLine )) {
626
- foreach ($ blockScalarIndentations as $ key => $ blockScalarIndentation ) {
627
- if ($ blockScalarIndentation >= $ indent ) {
628
- unset($ blockScalarIndentations [$ key ]);
629
- }
630
- }
631
- }
632
-
633
- if (empty ($ blockScalarIndentations ) && !$ this ->isCurrentLineComment () && $ this ->isBlockScalarHeader ()) {
634
- $ blockScalarIndentations [] = $ indent ;
635
- }
636
-
637
- $ previousLineIndentation = $ indent ;
638
-
639
613
if ($ isItUnindentedCollection && !$ this ->isCurrentLineEmpty () && !$ this ->isStringUnIndentedCollectionItem () && $ newIndent === $ indent ) {
640
614
$ this ->moveToPreviousLine ();
641
615
break ;
@@ -1054,16 +1028,6 @@ private function isStringUnIndentedCollectionItem()
1054
1028
return '- ' === rtrim ($ this ->currentLine ) || 0 === strpos ($ this ->currentLine , '- ' );
1055
1029
}
1056
1030
1057
- /**
1058
- * Tests whether or not the current line is the header of a block scalar.
1059
- *
1060
- * @return bool
1061
- */
1062
- private function isBlockScalarHeader ()
1063
- {
1064
- return (bool ) self ::preg_match ('~ ' .self ::BLOCK_SCALAR_HEADER_PATTERN .'$~ ' , $ this ->currentLine );
1065
- }
1066
-
1067
1031
/**
1068
1032
* A local wrapper for `preg_match` which will throw a ParseException if there
1069
1033
* is an internal error in the PCRE engine.
0 commit comments