@@ -263,7 +263,7 @@ private function doParse($value, $flags)
263
263
264
264
$ data += $ refValue ; // array union
265
265
} else {
266
- if (isset ($ values ['value ' ]) && $ values [ ' value ' ] !== '' ) {
266
+ if (isset ($ values ['value ' ]) && '' !== $ values [ ' value ' ] ) {
267
267
$ value = $ values ['value ' ];
268
268
} else {
269
269
$ value = $ this ->getNextEmbedBlock ();
@@ -544,7 +544,7 @@ private function getNextEmbedBlock($indentation = null, $inSequence = false)
544
544
$ indent = $ this ->getCurrentLineIndentation ();
545
545
546
546
// terminate all block scalars that are more indented than the current line
547
- if (!empty ($ blockScalarIndentations ) && $ indent < $ previousLineIndentation && trim ($ this ->currentLine ) !== '' ) {
547
+ if (!empty ($ blockScalarIndentations ) && $ indent < $ previousLineIndentation && '' !== trim ($ this ->currentLine )) {
548
548
foreach ($ blockScalarIndentations as $ key => $ blockScalarIndentation ) {
549
549
if ($ blockScalarIndentation >= $ indent ) {
550
550
unset($ blockScalarIndentations [$ key ]);
@@ -680,7 +680,7 @@ private function parseValue($value, $flags, $context)
680
680
681
681
while ($ this ->moveToNextLine ()) {
682
682
// unquoted strings end before the first unindented line
683
- if (null === $ quotation && $ this ->getCurrentLineIndentation () === 0 ) {
683
+ if (null === $ quotation && 0 === $ this ->getCurrentLineIndentation ()) {
684
684
$ this ->moveToPreviousLine ();
685
685
686
686
break ;
@@ -876,7 +876,7 @@ private function isCurrentLineComment()
876
876
//checking explicitly the first char of the trim is faster than loops or strpos
877
877
$ ltrimmedLine = ltrim ($ this ->currentLine , ' ' );
878
878
879
- return '' !== $ ltrimmedLine && $ ltrimmedLine [ 0 ] === ' # ' ;
879
+ return '' !== $ ltrimmedLine && ' # ' === $ ltrimmedLine [ 0 ] ;
880
880
}
881
881
882
882
private function isCurrentLineLastLineInDocument ()
@@ -902,15 +902,15 @@ private function cleanup($value)
902
902
903
903
// remove leading comments
904
904
$ trimmedValue = preg_replace ('#^(\#.*?\n)+#s ' , '' , $ value , -1 , $ count );
905
- if ($ count == 1 ) {
905
+ if (1 == $ count ) {
906
906
// items have been removed, update the offset
907
907
$ this ->offset += substr_count ($ value , "\n" ) - substr_count ($ trimmedValue , "\n" );
908
908
$ value = $ trimmedValue ;
909
909
}
910
910
911
911
// remove start of the document marker (---)
912
912
$ trimmedValue = preg_replace ('#^\-\-\-.*?\n#s ' , '' , $ value , -1 , $ count );
913
- if ($ count == 1 ) {
913
+ if (1 == $ count ) {
914
914
// items have been removed, update the offset
915
915
$ this ->offset += substr_count ($ value , "\n" ) - substr_count ($ trimmedValue , "\n" );
916
916
$ value = $ trimmedValue ;
0 commit comments