Skip to content

Commit dcbd318

Browse files
committed
Merge branch '3.2'
* 3.2: fixed tests fixed merge Fix minor phpdoc mismatches with the code(detected by phan) [Asset] Starting slash should indicate no basePath wanted [Security] Fix phpdoc logout listener [EventDispatcher] fix getting priorities of listeners during dispatch Add iconv extension to suggested dependencies Fix minor typo in the main README.md Allow Upper Case property names in ObjectNormalizer [EventDispatcher] fix: unwrap listeners for correct info
2 parents e389c47 + acec26f commit dcbd318

File tree

3 files changed

+18
-16
lines changed

3 files changed

+18
-16
lines changed

Escaper.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,15 @@ class Escaper
3333
"\x08", "\x09", "\x0a", "\x0b", "\x0c", "\x0d", "\x0e", "\x0f",
3434
"\x10", "\x11", "\x12", "\x13", "\x14", "\x15", "\x16", "\x17",
3535
"\x18", "\x19", "\x1a", "\x1b", "\x1c", "\x1d", "\x1e", "\x1f",
36-
"\xc2\x85", "\xc2\xa0", "\xe2\x80\xa8", "\xe2\x80\xa9");
36+
"\xc2\x85", "\xc2\xa0", "\xe2\x80\xa8", "\xe2\x80\xa9",
37+
);
3738
private static $escaped = array('\\\\', '\\"', '\\\\', '\\"',
3839
'\\0', '\\x01', '\\x02', '\\x03', '\\x04', '\\x05', '\\x06', '\\a',
3940
'\\b', '\\t', '\\n', '\\v', '\\f', '\\r', '\\x0e', '\\x0f',
4041
'\\x10', '\\x11', '\\x12', '\\x13', '\\x14', '\\x15', '\\x16', '\\x17',
4142
'\\x18', '\\x19', '\\x1a', '\\e', '\\x1c', '\\x1d', '\\x1e', '\\x1f',
42-
'\\N', '\\_', '\\L', '\\P');
43+
'\\N', '\\_', '\\L', '\\P',
44+
);
4345

4446
/**
4547
* Determines if a PHP value would require double quoting in YAML.
@@ -50,7 +52,7 @@ class Escaper
5052
*/
5153
public static function requiresDoubleQuoting($value)
5254
{
53-
return preg_match('/'.self::REGEX_CHARACTER_TO_ESCAPE.'/u', $value);
55+
return 0 < preg_match('/'.self::REGEX_CHARACTER_TO_ESCAPE.'/u', $value);
5456
}
5557

5658
/**
@@ -82,7 +84,7 @@ public static function requiresSingleQuoting($value)
8284

8385
// Determines if the PHP value contains any single characters that would
8486
// cause it to require single quoting in YAML.
85-
return preg_match('/[ \s \' " \: \{ \} \[ \] , & \* \# \?] | \A[ \- ? | < > = ! % @ ` ]/x', $value);
87+
return 0 < preg_match('/[ \s \' " \: \{ \} \[ \] , & \* \# \?] | \A[ \- ? | < > = ! % @ ` ]/x', $value);
8688
}
8789

8890
/**

Exception/ParseException.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ class ParseException extends RuntimeException
2626
/**
2727
* Constructor.
2828
*
29-
* @param string $message The error message
30-
* @param int $parsedLine The line where the error occurred
31-
* @param int $snippet The snippet of code near the problem
32-
* @param string $parsedFile The file name where the error occurred
33-
* @param \Exception $previous The previous exception
29+
* @param string $message The error message
30+
* @param int $parsedLine The line where the error occurred
31+
* @param string|null $snippet The snippet of code near the problem
32+
* @param string|null $parsedFile The file name where the error occurred
33+
* @param \Exception|null $previous The previous exception
3434
*/
3535
public function __construct($message, $parsedLine = -1, $snippet = null, $parsedFile = null, \Exception $previous = null)
3636
{

Inline.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -283,12 +283,12 @@ private static function dumpArray($value, $flags)
283283
/**
284284
* Parses a YAML scalar.
285285
*
286-
* @param string $scalar
287-
* @param int $flags
288-
* @param string $delimiters
289-
* @param int &$i
290-
* @param bool $evaluate
291-
* @param array $references
286+
* @param string $scalar
287+
* @param int $flags
288+
* @param string[] $delimiters
289+
* @param int &$i
290+
* @param bool $evaluate
291+
* @param array $references
292292
*
293293
* @return string
294294
*
@@ -564,7 +564,7 @@ private static function parseMapping($mapping, $flags, &$i = 0, $references = ar
564564
* @param int $flags
565565
* @param array $references
566566
*
567-
* @return string A YAML string
567+
* @return mixed The evaluated YAML string
568568
*
569569
* @throws ParseException when object parsing support was disabled and the parser detected a PHP object or when a reference could not be resolved
570570
*/

0 commit comments

Comments
 (0)