@@ -267,7 +267,7 @@ private function doParse($value, $flags)
267
267
268
268
$ data += $ refValue ; // array union
269
269
} else {
270
- if (isset ($ values ['value ' ]) && $ values [ ' value ' ] !== '' ) {
270
+ if (isset ($ values ['value ' ]) && '' !== $ values [ ' value ' ] ) {
271
271
$ value = $ values ['value ' ];
272
272
} else {
273
273
$ value = $ this ->getNextEmbedBlock ();
@@ -550,7 +550,7 @@ private function getNextEmbedBlock($indentation = null, $inSequence = false)
550
550
$ indent = $ this ->getCurrentLineIndentation ();
551
551
552
552
// terminate all block scalars that are more indented than the current line
553
- if (!empty ($ blockScalarIndentations ) && $ indent < $ previousLineIndentation && trim ($ this ->currentLine ) !== '' ) {
553
+ if (!empty ($ blockScalarIndentations ) && $ indent < $ previousLineIndentation && '' !== trim ($ this ->currentLine )) {
554
554
foreach ($ blockScalarIndentations as $ key => $ blockScalarIndentation ) {
555
555
if ($ blockScalarIndentation >= $ indent ) {
556
556
unset($ blockScalarIndentations [$ key ]);
@@ -686,7 +686,7 @@ private function parseValue($value, $flags, $context)
686
686
687
687
while ($ this ->moveToNextLine ()) {
688
688
// unquoted strings end before the first unindented line
689
- if (null === $ quotation && $ this ->getCurrentLineIndentation () === 0 ) {
689
+ if (null === $ quotation && 0 === $ this ->getCurrentLineIndentation ()) {
690
690
$ this ->moveToPreviousLine ();
691
691
692
692
break ;
@@ -882,7 +882,7 @@ private function isCurrentLineComment()
882
882
//checking explicitly the first char of the trim is faster than loops or strpos
883
883
$ ltrimmedLine = ltrim ($ this ->currentLine , ' ' );
884
884
885
- return '' !== $ ltrimmedLine && $ ltrimmedLine [ 0 ] === ' # ' ;
885
+ return '' !== $ ltrimmedLine && ' # ' === $ ltrimmedLine [ 0 ] ;
886
886
}
887
887
888
888
private function isCurrentLineLastLineInDocument ()
@@ -908,15 +908,15 @@ private function cleanup($value)
908
908
909
909
// remove leading comments
910
910
$ trimmedValue = preg_replace ('#^(\#.*?\n)+#s ' , '' , $ value , -1 , $ count );
911
- if ($ count == 1 ) {
911
+ if (1 == $ count ) {
912
912
// items have been removed, update the offset
913
913
$ this ->offset += substr_count ($ value , "\n" ) - substr_count ($ trimmedValue , "\n" );
914
914
$ value = $ trimmedValue ;
915
915
}
916
916
917
917
// remove start of the document marker (---)
918
918
$ trimmedValue = preg_replace ('#^\-\-\-.*?\n#s ' , '' , $ value , -1 , $ count );
919
- if ($ count == 1 ) {
919
+ if (1 == $ count ) {
920
920
// items have been removed, update the offset
921
921
$ this ->offset += substr_count ($ value , "\n" ) - substr_count ($ trimmedValue , "\n" );
922
922
$ value = $ trimmedValue ;
0 commit comments