Skip to content

Commit 5956330

Browse files
committed
Merge branch '3.4'
* 3.4: use the parseFile() method of the YAML parser [Yaml] support parsing files Adding Definition::addError() and a compiler pass to throw errors as exceptions [DI] Add AutowireRequiredMethodsPass to fix bindings for `@required` methods [Cache] Add ResettableInterface to allow resetting any pool's local state [DI][DX] Throw exception on some ContainerBuilder methods used from extensions added missing @author tag for new class allow forms without translations and validator [VarDumper] Make `dump()` a little bit more easier to use [Form] Add ambiguous & exception debug:form tests Reset the authentication token between requests. [Serializer] Getter for extra attributes in ExtraAttributesException [DI] Dont use JSON_BIGINT_AS_STRING # Conflicts: # src/Symfony/Component/Routing/composer.json # src/Symfony/Component/Translation/composer.json # src/Symfony/Component/Yaml/Inline.php # src/Symfony/Component/Yaml/Tests/ParserTest.php # src/Symfony/Component/Yaml/Yaml.php
2 parents c195819 + f853467 commit 5956330

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ CHANGELOG
1818
* added `AbstractObjectNormalizer::DISABLE_TYPE_ENFORCEMENT` context option
1919
to disable throwing an `UnexpectedValueException` on a type mismatch
2020
* added support for serializing `DateInterval` objects
21+
* added getter for extra attributes in `ExtraAttributesException`
2122

2223
3.3.0
2324
-----

Exception/ExtraAttributesException.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,24 @@
1818
*/
1919
class ExtraAttributesException extends RuntimeException
2020
{
21+
private $extraAttributes;
22+
2123
public function __construct(array $extraAttributes, \Exception $previous = null)
2224
{
2325
$msg = sprintf('Extra attributes are not allowed ("%s" are unknown).', implode('", "', $extraAttributes));
2426

27+
$this->extraAttributes = $extraAttributes;
28+
2529
parent::__construct($msg, 0, $previous);
2630
}
31+
32+
/**
33+
* Get the extra attributes that are not allowed.
34+
*
35+
* @return array
36+
*/
37+
public function getExtraAttributes()
38+
{
39+
return $this->extraAttributes;
40+
}
2741
}

Mapping/Loader/YamlFileLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ private function getClassesFromYaml()
113113
$this->yamlParser = new Parser();
114114
}
115115

116-
$classes = $this->yamlParser->parse(file_get_contents($this->file));
116+
$classes = $this->yamlParser->parseFile($this->file);
117117

118118
if (empty($classes)) {
119119
return array();

0 commit comments

Comments
 (0)