diff --git a/src/Symfony/Component/Routing/Route.php b/src/Symfony/Component/Routing/Route.php index 060e978116..5bc535c683 100644 --- a/src/Symfony/Component/Routing/Route.php +++ b/src/Symfony/Component/Routing/Route.php @@ -57,7 +57,7 @@ class Route implements \Serializable private $options = array(); /** - * @var null|RouteCompiler + * @var null|CompiledRoute */ private $compiled; diff --git a/src/Symfony/Component/Yaml/Parser.php b/src/Symfony/Component/Yaml/Parser.php index 4905e71ac9..e86b7e5b9e 100644 --- a/src/Symfony/Component/Yaml/Parser.php +++ b/src/Symfony/Component/Yaml/Parser.php @@ -111,7 +111,7 @@ class Parser $data[] = $this->parseValue($values['value'], $exceptionOnInvalidType, $objectSupport); } } - } elseif (preg_match('#^(?P'.Inline::REGEX_QUOTED_STRING.'|[^ \'"\[\{].*?) *\:(\s+(?P.+?))?\s*$#u', $this->currentLine, $values)) { + } elseif (preg_match('#^(?P'.Inline::REGEX_QUOTED_STRING.'|[^ \'"\[\{].*?) *\:(\s+(?P.+?))?\s*$#u', $this->currentLine, $values) && false === strpos($values['key'],' #')) { if ($context && 'sequence' == $context) { throw new ParseException('You cannot define a mapping item when in a sequence'); } diff --git a/src/Symfony/Component/Yaml/Tests/Fixtures/sfComments.yml b/src/Symfony/Component/Yaml/Tests/Fixtures/sfComments.yml index 34225e11e0..46addfcd3d 100644 --- a/src/Symfony/Component/Yaml/Tests/Fixtures/sfComments.yml +++ b/src/Symfony/Component/Yaml/Tests/Fixtures/sfComments.yml @@ -49,3 +49,17 @@ yaml: | foo: bar # a comment php: | array('foo' => 'bar') +--- +test: Comment containing a colon on a hash line +brief: > + Comment containing a colon on a scalar line +yaml: 'foo # comment: this is also part of the comment' +php: | + 'foo' +--- +test: 'Hash key containing a #' +brief: > + 'Hash key containing a #' +yaml: 'foo#bar: baz' +php: | + array('foo#bar' => 'baz')