update 1.0.8.0
Commits for version update
This commit is contained in:
2
vendor/symfony/yaml/Dumper.php
vendored
2
vendor/symfony/yaml/Dumper.php
vendored
@@ -40,7 +40,7 @@ class Dumper
|
||||
/**
|
||||
* Sets the indentation.
|
||||
*
|
||||
* @param int $num The amount of spaces to use for indentation of nested nodes.
|
||||
* @param int $num The amount of spaces to use for indentation of nested nodes
|
||||
*/
|
||||
public function setIndentation($num)
|
||||
{
|
||||
|
4
vendor/symfony/yaml/Escaper.php
vendored
4
vendor/symfony/yaml/Escaper.php
vendored
@@ -46,7 +46,7 @@ class Escaper
|
||||
*
|
||||
* @param string $value A PHP value
|
||||
*
|
||||
* @return bool True if the value would require double quotes.
|
||||
* @return bool True if the value would require double quotes
|
||||
*/
|
||||
public static function requiresDoubleQuoting($value)
|
||||
{
|
||||
@@ -70,7 +70,7 @@ class Escaper
|
||||
*
|
||||
* @param string $value A PHP value
|
||||
*
|
||||
* @return bool True if the value would require single quotes.
|
||||
* @return bool True if the value would require single quotes
|
||||
*/
|
||||
public static function requiresSingleQuoting($value)
|
||||
{
|
||||
|
4
vendor/symfony/yaml/Inline.php
vendored
4
vendor/symfony/yaml/Inline.php
vendored
@@ -317,7 +317,7 @@ class Inline
|
||||
}
|
||||
|
||||
if ($output && '%' === $output[0]) {
|
||||
@trigger_error('Not quoting a scalar starting with the "%" indicator character is deprecated since Symfony 3.1 and will throw a ParseException in 4.0.', E_USER_DEPRECATED);
|
||||
@trigger_error(sprintf('Not quoting the scalar "%s" starting with the "%%" indicator character is deprecated since Symfony 3.1 and will throw a ParseException in 4.0.' , $output), E_USER_DEPRECATED);
|
||||
}
|
||||
|
||||
if ($evaluate) {
|
||||
@@ -397,7 +397,7 @@ class Inline
|
||||
$value = self::parseScalar($sequence, $flags, array(',', ']'), array('"', "'"), $i, true, $references);
|
||||
|
||||
// the value can be an array if a reference has been resolved to an array var
|
||||
if (!is_array($value) && !$isQuoted && false !== strpos($value, ': ')) {
|
||||
if (is_string($value) && !$isQuoted && false !== strpos($value, ': ')) {
|
||||
// embedded mapping?
|
||||
try {
|
||||
$pos = 0;
|
||||
|
11
vendor/symfony/yaml/Parser.php
vendored
11
vendor/symfony/yaml/Parser.php
vendored
@@ -278,17 +278,6 @@ class Parser
|
||||
throw $e;
|
||||
}
|
||||
|
||||
if (is_array($value)) {
|
||||
$first = reset($value);
|
||||
if (is_string($first) && 0 === strpos($first, '*')) {
|
||||
$data = array();
|
||||
foreach ($value as $alias) {
|
||||
$data[] = $this->refs[substr($alias, 1)];
|
||||
}
|
||||
$value = $data;
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($mbEncoding)) {
|
||||
mb_internal_encoding($mbEncoding);
|
||||
}
|
||||
|
1
vendor/symfony/yaml/Tests/DumperTest.php
vendored
1
vendor/symfony/yaml/Tests/DumperTest.php
vendored
@@ -296,7 +296,6 @@ EOF;
|
||||
*/
|
||||
public function testDumpObjectAsMap($object, $expected)
|
||||
{
|
||||
|
||||
$yaml = $this->dumper->dump($object, 0, 0, Yaml::DUMP_OBJECT_AS_MAP);
|
||||
|
||||
$this->assertEquals($expected, Yaml::parse($yaml, Yaml::PARSE_OBJECT_FOR_MAP));
|
||||
|
36
vendor/symfony/yaml/Tests/InlineTest.php
vendored
36
vendor/symfony/yaml/Tests/InlineTest.php
vendored
@@ -11,6 +11,7 @@
|
||||
|
||||
namespace Symfony\Component\Yaml\Tests;
|
||||
|
||||
use Symfony\Bridge\PhpUnit\ErrorAssert;
|
||||
use Symfony\Component\Yaml\Inline;
|
||||
use Symfony\Component\Yaml\Yaml;
|
||||
|
||||
@@ -254,27 +255,14 @@ class InlineTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* @group legacy
|
||||
* @requires function Symfony\Bridge\PhpUnit\ErrorAssert::assertDeprecationsAreTriggered
|
||||
* throws \Symfony\Component\Yaml\Exception\ParseException in 4.0
|
||||
*/
|
||||
public function testParseUnquotedScalarStartingWithPercentCharacter()
|
||||
{
|
||||
$deprecations = array();
|
||||
set_error_handler(function ($type, $msg) use (&$deprecations) {
|
||||
if (E_USER_DEPRECATED !== $type) {
|
||||
restore_error_handler();
|
||||
|
||||
return call_user_func_array('PHPUnit_Util_ErrorHandler::handleError', func_get_args());
|
||||
}
|
||||
|
||||
$deprecations[] = $msg;
|
||||
ErrorAssert::assertDeprecationsAreTriggered('Not quoting the scalar "%foo " starting with the "%" indicator character is deprecated since Symfony 3.1 and will throw a ParseException in 4.0.', function () {
|
||||
Inline::parse('{ foo: %foo }');
|
||||
});
|
||||
|
||||
Inline::parse('{ foo: %foo }');
|
||||
|
||||
restore_error_handler();
|
||||
|
||||
$this->assertCount(1, $deprecations);
|
||||
$this->assertContains('Not quoting a scalar starting with the "%" indicator character is deprecated since Symfony 3.1 and will throw a ParseException in 4.0.', $deprecations[0]);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -537,6 +525,22 @@ class InlineTest extends \PHPUnit_Framework_TestCase
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider getTimestampTests
|
||||
*/
|
||||
public function testParseNestedTimestampListAsDateTimeObject($yaml, $year, $month, $day, $hour, $minute, $second)
|
||||
{
|
||||
$expected = new \DateTime($yaml);
|
||||
$expected->setTimeZone(new \DateTimeZone('UTC'));
|
||||
$expected->setDate($year, $month, $day);
|
||||
$expected->setTime($hour, $minute, $second);
|
||||
|
||||
$expectedNested = array('nested' => array($expected));
|
||||
$yamlNested = "{nested: [$yaml]}";
|
||||
|
||||
$this->assertEquals($expectedNested, Inline::parse($yamlNested, Yaml::PARSE_DATETIME));
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider getDateTimeDumpTests
|
||||
*/
|
||||
|
8
vendor/symfony/yaml/Unescaper.php
vendored
8
vendor/symfony/yaml/Unescaper.php
vendored
@@ -31,9 +31,9 @@ class Unescaper
|
||||
/**
|
||||
* Unescapes a single quoted string.
|
||||
*
|
||||
* @param string $value A single quoted string.
|
||||
* @param string $value A single quoted string
|
||||
*
|
||||
* @return string The unescaped string.
|
||||
* @return string The unescaped string
|
||||
*/
|
||||
public function unescapeSingleQuotedString($value)
|
||||
{
|
||||
@@ -43,9 +43,9 @@ class Unescaper
|
||||
/**
|
||||
* Unescapes a double quoted string.
|
||||
*
|
||||
* @param string $value A double quoted string.
|
||||
* @param string $value A double quoted string
|
||||
*
|
||||
* @return string The unescaped string.
|
||||
* @return string The unescaped string
|
||||
*/
|
||||
public function unescapeDoubleQuotedString($value)
|
||||
{
|
||||
|
12
vendor/symfony/yaml/Yaml.php
vendored
12
vendor/symfony/yaml/Yaml.php
vendored
@@ -79,19 +79,19 @@ class Yaml
|
||||
}
|
||||
|
||||
/**
|
||||
* Dumps a PHP array to a YAML string.
|
||||
* Dumps a PHP value to a YAML string.
|
||||
*
|
||||
* The dump method, when supplied with an array, will do its best
|
||||
* to convert the array into friendly YAML.
|
||||
*
|
||||
* @param array $array PHP array
|
||||
* @param mixed $input The PHP value
|
||||
* @param int $inline The level where you switch to inline YAML
|
||||
* @param int $indent The amount of spaces to use for indentation of nested nodes.
|
||||
* @param int $indent The amount of spaces to use for indentation of nested nodes
|
||||
* @param int $flags A bit field of DUMP_* constants to customize the dumped YAML string
|
||||
*
|
||||
* @return string A YAML string representing the original PHP array
|
||||
* @return string A YAML string representing the original PHP value
|
||||
*/
|
||||
public static function dump($array, $inline = 2, $indent = 4, $flags = 0)
|
||||
public static function dump($input, $inline = 2, $indent = 4, $flags = 0)
|
||||
{
|
||||
if (is_bool($flags)) {
|
||||
@trigger_error('Passing a boolean flag to toggle exception handling is deprecated since version 3.1 and will be removed in 4.0. Use the DUMP_EXCEPTION_ON_INVALID_TYPE flag instead.', E_USER_DEPRECATED);
|
||||
@@ -113,6 +113,6 @@ class Yaml
|
||||
|
||||
$yaml = new Dumper($indent);
|
||||
|
||||
return $yaml->dump($array, $inline, 0, $flags);
|
||||
return $yaml->dump($input, $inline, 0, $flags);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user