@@ -61,7 +61,7 @@ public function __construct($offset = 0, $totalNumberOfLines = null, array $skip
61
61
*/
62
62
public function parse ($ value , $ exceptionOnInvalidType = false , $ objectSupport = false , $ objectForMap = false )
63
63
{
64
- if (! self :: preg_match ('//u ' , $ value )) {
64
+ if (false === preg_match ('//u ' , $ value )) {
<
8000
td data-grid-cell-id="diff-0a12ae513347f5548e97b59d07e5648e5a83298e73a36e77e1ee9e597dbe3f5a-65-65-0" data-selected="false" role="gridcell" style="background-color:var(--bgColor-default);text-align:center" tabindex="-1" valign="top" class="focusable-grid-cell diff-line-number position-relative diff-line-number-neutral left-side">65
65
throw new ParseException ('The YAML value does not appear to be valid UTF-8. ' );
66
66
}
67
67
$ this ->currentLineNb = -1 ;
@@ -127,7 +127,6 @@ public function parse($value, $exceptionOnInvalidType = false, $objectSupport =
127
127
} elseif (self ::preg_match ('#^(?P<key> ' .Inline::REGEX_QUOTED_STRING .'|[^ \'"\[\{].*?) *\:(\s+(?P<value>.+))?$#u ' , rtrim ($ this ->currentLine ), $ values )
128
128
&& (false === strpos ($ values ['key ' ], ' # ' )
129
129
|| in_array ($ values ['key ' ][0 ], array ('" ' , "' " )))) {
130
-
131
130
if ($ context && 'sequence ' == $ context ) {
132
131
throw new ParseException ('You cannot define a mapping item when in a sequence ' , $ this ->currentLineNb + 1 , $ this ->currentLine );
133
132
}
@@ -269,7 +268,7 @@ public function parse($value, $exceptionOnInvalidType = false, $objectSupport =
269
268
return $ value ;
270
269
}
271
270
272
- throw new ParseException (" Unable to parse " , $ this ->getRealCurrentLineNb () + 1 , $ this ->currentLine );
271
+ throw new ParseException (' Unable to parse ' , $ this ->getRealCurrentLineNb () + 1 , $ this ->currentLine );
273
272
}
274
273
}
275
274
@@ -794,9 +793,11 @@ private function isBlockScalarHeader()
794
793
* in the YAML engine
795
794
*
796
795
* @throws ParseException on a PCRE internal error
796
+ *
797
797
* @see preg_last_error()
798
+ * @internal
798
799
*/
799
- static function preg_match ($ pattern , $ subject , &$ matches = null , $ flags = 0 , $ offset = 0 )
800
+ public static function preg_match ($ pattern , $ subject , &$ matches = null , $ flags = 0 , $ offset = 0 )
800
801
{
801
802
$ ret = preg_match ($ pattern , $ subject , $ matches , $ flags , $ offset );
802
803
if ($ ret === false ) {
@@ -822,6 +823,7 @@ static function preg_match($pattern, $subject, &$matches = null, $flags = 0, $of
822
823
823
824
throw new ParseException ($ error );
824
825
}
826
+
825
827
return $ ret ;
826
828
}
827
829
}
0 commit comments