Mercurial > hg > isophonics-drupal-site
diff vendor/symfony/serializer/Mapping/Loader/YamlFileLoader.php @ 14:1fec387a4317
Update Drupal core to 8.5.2 via Composer
author | Chris Cannam |
---|---|
date | Mon, 23 Apr 2018 09:46:53 +0100 |
parents | 4c8ae668cc8c |
children | 129ea1e6d783 |
line wrap: on
line diff
--- a/vendor/symfony/serializer/Mapping/Loader/YamlFileLoader.php Mon Apr 23 09:33:26 2018 +0100 +++ b/vendor/symfony/serializer/Mapping/Loader/YamlFileLoader.php Mon Apr 23 09:46:53 2018 +0100 @@ -30,7 +30,7 @@ * * @var array */ - private $classes = null; + private $classes; /** * {@inheritdoc} @@ -51,7 +51,7 @@ $yaml = $this->classes[$classMetadata->getName()]; - if (isset($yaml['attributes']) && is_array($yaml['attributes'])) { + if (isset($yaml['attributes']) && \is_array($yaml['attributes'])) { $attributesMetadata = $classMetadata->getAttributesMetadata(); foreach ($yaml['attributes'] as $attribute => $data) { @@ -63,12 +63,12 @@ } if (isset($data['groups'])) { - if (!is_array($data['groups'])) { + if (!\is_array($data['groups'])) { throw new MappingException(sprintf('The "groups" key must be an array of strings in "%s" for the attribute "%s" of the class "%s".', $this->file, $attribute, $classMetadata->getName())); } foreach ($data['groups'] as $group) { - if (!is_string($group)) { + if (!\is_string($group)) { throw new MappingException(sprintf('Group names must be strings in "%s" for the attribute "%s" of the class "%s".', $this->file, $attribute, $classMetadata->getName())); } @@ -113,13 +113,13 @@ $this->yamlParser = new Parser(); } - $classes = $this->yamlParser->parse(file_get_contents($this->file)); + $classes = $this->yamlParser->parseFile($this->file); if (empty($classes)) { return array(); } - if (!is_array($classes)) { + if (!\is_array($classes)) { throw new MappingException(sprintf('The file "%s" must contain a YAML array.', $this->file)); }