Skip to content

Commit acec26f

Browse files
committed
Merge branch '2.8' into 3.2
* 2.8: Fix minor phpdoc mismatches with the code(detected by phan) [Asset] Starting slash should indicate no basePath wanted [Security] Fix phpdoc logout listener 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 4bb699b + 93ccdde commit acec26f

File tree

3 files changed

+19
-17
lines changed

3 files changed

+19
-17
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: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -273,13 +273,13 @@ private static function dumpArray($value, $flags)
273273
/**
274274
* Parses a YAML scalar.
275275
*
276-
* @param string $scalar
277-
* @param int $flags
278-
* @param string $delimiters
279-
* @param array $stringDelimiters
280-
* @param int &$i
281-
* @param bool $evaluate
282-
* @param array $references
276+
* @param string $scalar
277+
* @param int $flags
278+
* @param string[] $delimiters
279+
* @param string[] $stringDelimiters
280+
* @param int &$i
281+
* @param bool $evaluate
282+
* @param array $references
283283
*
284284
* @return string
285285
*
@@ -533,7 +533,7 @@ private static function parseMapping($mapping, $flags, &$i = 0, $references = ar
533533
* @param int $flags
534534
* @param array $references
535535
*
536-
* @return string A YAML string
536+
* @return mixed The evaluated YAML string
537537
*
538538
* @throws ParseException when object parsing support was disabled and the parser detected a PHP object or when a reference could not be resolved
539539
*/

0 commit comments

Comments
 (0)