Skip to content

Commit 93ccdde

Browse files
committed
Merge branch '2.7' into 2.8
* 2.7: Fix minor phpdoc mismatches with the code(detected by phan) [Asset] Starting slash should indicate no basePath wanted [Security] Fix phpdoc logout listener Fix minor typo in the main README.md
2 parents bb09834 + b8e3f3b commit 93ccdde

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
@@ -212,12 +212,12 @@ private static function dumpArray($value, $exceptionOnInvalidType, $objectSuppor
212212
/**
213213
* Parses a YAML scalar.
214214
*
215-
* @param string $scalar
216-
* @param string $delimiters
217-
* @param array $stringDelimiters
218-
* @param int &$i
219-
* @param bool $evaluate
220-
* @param array $references
215+
* @param string $scalar
216+
* @param string[] $delimiters
217+
* @param string[] $stringDelimiters
218+
* @param int &$i
219+
* @param bool $evaluate
220+
* @param array $references
221221
*
222222
* @return string
223223
*
@@ -453,7 +453,7 @@ private static function parseMapping($mapping, &$i = 0, $references = array())
453453
* @param string $scalar
454454
* @param array $references
455455
*
456-
* @return string A YAML string
456+
* @return mixed The evaluated YAML string
457457
*
458458
* @throws ParseException when object parsing support was disabled and the parser detected a PHP object or when a reference could not be resolved
459459
*/

0 commit comments

Comments
 (0)