composer update
This commit is contained in:
parent
f6abc3dce2
commit
71dfaca858
1753 changed files with 45274 additions and 14619 deletions
52
vendor/symfony/yaml/Inline.php
vendored
52
vendor/symfony/yaml/Inline.php
vendored
|
|
@ -110,35 +110,37 @@ class Inline
|
|||
mb_internal_encoding('ASCII');
|
||||
}
|
||||
|
||||
$i = 0;
|
||||
$tag = self::parseTag($value, $i, $flags);
|
||||
switch ($value[$i]) {
|
||||
case '[':
|
||||
$result = self::parseSequence($value, $flags, $i, $references);
|
||||
++$i;
|
||||
break;
|
||||
case '{':
|
||||
$result = self::parseMapping($value, $flags, $i, $references);
|
||||
++$i;
|
||||
break;
|
||||
default:
|
||||
$result = self::parseScalar($value, $flags, null, $i, null === $tag, $references);
|
||||
}
|
||||
try {
|
||||
$i = 0;
|
||||
$tag = self::parseTag($value, $i, $flags);
|
||||
switch ($value[$i]) {
|
||||
case '[':
|
||||
$result = self::parseSequence($value, $flags, $i, $references);
|
||||
++$i;
|
||||
break;
|
||||
case '{':
|
||||
$result = self::parseMapping($value, $flags, $i, $references);
|
||||
++$i;
|
||||
break;
|
||||
default:
|
||||
$result = self::parseScalar($value, $flags, null, $i, null === $tag, $references);
|
||||
}
|
||||
|
||||
if (null !== $tag) {
|
||||
return new TaggedValue($tag, $result);
|
||||
}
|
||||
if (null !== $tag) {
|
||||
return new TaggedValue($tag, $result);
|
||||
}
|
||||
|
||||
// some comments are allowed at the end
|
||||
if (preg_replace('/\s+#.*$/A', '', substr($value, $i))) {
|
||||
throw new ParseException(sprintf('Unexpected characters near "%s".', substr($value, $i)), self::$parsedLineNumber + 1, $value, self::$parsedFilename);
|
||||
}
|
||||
// some comments are allowed at the end
|
||||
if (preg_replace('/\s+#.*$/A', '', substr($value, $i))) {
|
||||
throw new ParseException(sprintf('Unexpected characters near "%s".', substr($value, $i)), self::$parsedLineNumber + 1, $value, self::$parsedFilename);
|
||||
}
|
||||
|
||||
if (isset($mbEncoding)) {
|
||||
mb_internal_encoding($mbEncoding);
|
||||
return $result;
|
||||
} finally {
|
||||
if (isset($mbEncoding)) {
|
||||
mb_internal_encoding($mbEncoding);
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
2
vendor/symfony/yaml/LICENSE
vendored
2
vendor/symfony/yaml/LICENSE
vendored
|
|
@ -1,4 +1,4 @@
|
|||
Copyright (c) 2004-2018 Fabien Potencier
|
||||
Copyright (c) 2004-2019 Fabien Potencier
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
|
|
|||
14
vendor/symfony/yaml/Parser.php
vendored
14
vendor/symfony/yaml/Parser.php
vendored
|
|
@ -35,6 +35,7 @@ class Parser
|
|||
private $refs = array();
|
||||
private $skippedLineNumbers = array();
|
||||
private $locallySkippedLineNumbers = array();
|
||||
private $refsBeingParsed = array();
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
|
|
@ -212,6 +213,7 @@ class Parser
|
|||
|
||||
if (isset($values['value']) && self::preg_match('#^&(?P<ref>[^ ]+) *(?P<value>.*)#u', $values['value'], $matches)) {
|
||||
$isRef = $matches['ref'];
|
||||
$this->refsBeingParsed[] = $isRef;
|
||||
$values['value'] = $matches['value'];
|
||||
}
|
||||
|
||||
|
|
@ -244,6 +246,7 @@ class Parser
|
|||
}
|
||||
if ($isRef) {
|
||||
$this->refs[$isRef] = end($data);
|
||||
array_pop($this->refsBeingParsed);
|
||||
}
|
||||
} elseif (
|
||||
self::preg_match('#^(?P<key>(?:![^\s]++\s++)?(?:'.Inline::REGEX_QUOTED_STRING.'|(?:!?!php/const:)?[^ \'"\[\{!].*?)) *\:(\s++(?P<value>.+))?$#u', rtrim($this->currentLine), $values)
|
||||
|
|
@ -287,6 +290,10 @@ class Parser
|
|||
if (isset($values['value'][0]) && '*' === $values['value'][0]) {
|
||||
$refName = substr(rtrim($values['value']), 1);
|
||||
if (!array_key_exists($refName, $this->refs)) {
|
||||
if (false !== $pos = array_search($refName, $this->refsBeingParsed, true)) {
|
||||
throw new ParseException(sprintf('Circular reference [%s, %s] detected for reference "%s".', implode(', ', \array_slice($this->refsBeingParsed, $pos)), $refName, $refName), $this->currentLineNb + 1, $this->currentLine, $this->filename);
|
||||
}
|
||||
|
||||
throw new ParseException(sprintf('Reference "%s" does not exist.', $refName), $this->getRealCurrentLineNb() + 1, $this->currentLine, $this->filename);
|
||||
}
|
||||
|
||||
|
|
@ -340,6 +347,7 @@ class Parser
|
|||
}
|
||||
} elseif ('<<' !== $key && isset($values['value']) && self::preg_match('#^&(?P<ref>[^ ]++) *+(?P<value>.*)#u', $values['value'], $matches)) {
|
||||
$isRef = $matches['ref'];
|
||||
$this->refsBeingParsed[] = $isRef;
|
||||
$values['value'] = $matches['value'];
|
||||
}
|
||||
|
||||
|
|
@ -395,6 +403,7 @@ class Parser
|
|||
}
|
||||
if ($isRef) {
|
||||
$this->refs[$isRef] = $data[$key];
|
||||
array_pop($this->refsBeingParsed);
|
||||
}
|
||||
} else {
|
||||
// multiple documents are not supported
|
||||
|
|
@ -500,6 +509,7 @@ class Parser
|
|||
$parser->totalNumberOfLines = $this->totalNumberOfLines;
|
||||
$parser->skippedLineNumbers = $skippedLineNumbers;
|
||||
$parser->refs = &$this->refs;
|
||||
$parser->refsBeingParsed = $this->refsBeingParsed;
|
||||
|
||||
return $parser->doParse($yaml, $flags);
|
||||
}
|
||||
|
|
@ -689,6 +699,10 @@ class Parser
|
|||
}
|
||||
|
||||
if (!array_key_exists($value, $this->refs)) {
|
||||
if (false !== $pos = array_search($value, $this->refsBeingParsed, true)) {
|
||||
throw new ParseException(sprintf('Circular reference [%s, %s] detected for reference "%s".', implode(', ', \array_slice($this->refsBeingParsed, $pos)), $value, $value), $this->currentLineNb + 1, $this->currentLine, $this->filename);
|
||||
}
|
||||
|
||||
throw new ParseException(sprintf('Reference "%s" does not exist.', $value), $this->currentLineNb + 1, $this->currentLine, $this->filename);
|
||||
}
|
||||
|
||||
|
|
|
|||
42
vendor/symfony/yaml/Tests/ParserTest.php
vendored
42
vendor/symfony/yaml/Tests/ParserTest.php
vendored
|
|
@ -2177,6 +2177,48 @@ EOE;
|
|||
$this->parser->parse($yaml);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider circularReferenceProvider
|
||||
* @expectedException \Symfony\Component\Yaml\Exception\ParseException
|
||||
* @expectedExceptionMessage Circular reference [foo, bar, foo] detected
|
||||
*/
|
||||
public function testDetectCircularReferences($yaml)
|
||||
{
|
||||
$this->parser->parse($yaml, Yaml::PARSE_CUSTOM_TAGS);
|
||||
}
|
||||
|
||||
public function circularReferenceProvider()
|
||||
{
|
||||
$tests = array();
|
||||
|
||||
$yaml = <<<YAML
|
||||
foo:
|
||||
- &foo
|
||||
- &bar
|
||||
bar: foobar
|
||||
baz: *foo
|
||||
YAML;
|
||||
$tests['sequence'] = array($yaml);
|
||||
|
||||
$yaml = <<<YAML
|
||||
foo: &foo
|
||||
bar: &bar
|
||||
foobar: baz
|
||||
baz: *foo
|
||||
YAML;
|
||||
$tests['mapping'] = array($yaml);
|
||||
|
||||
$yaml = <<<YAML
|
||||
foo: &foo
|
||||
bar: &bar
|
||||
foobar: baz
|
||||
<<: *foo
|
||||
YAML;
|
||||
$tests['mapping with merge key'] = array($yaml);
|
||||
|
||||
return $tests;
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider indentedMappingData
|
||||
*/
|
||||
|
|
|
|||
2
vendor/symfony/yaml/phpunit.xml.dist
vendored
2
vendor/symfony/yaml/phpunit.xml.dist
vendored
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd"
|
||||
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/5.2/phpunit.xsd"
|
||||
backupGlobals="false"
|
||||
colors="true"
|
||||
bootstrap="vendor/autoload.php"
|
||||
|
|
|
|||
Reference in a new issue