Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / symfony / serializer / Mapping / Loader / YamlFileLoader.php
index e3afa4763271e693081947af0b4937b493a22c30..ca9d43e15b7939ba3e87c268272a9734b87c473b 100644 (file)
@@ -30,7 +30,7 @@ class YamlFileLoader extends FileLoader
      *
      * @var array
      */
-    private $classes = null;
+    private $classes;
 
     /**
      * {@inheritdoc}
@@ -51,7 +51,7 @@ class YamlFileLoader extends FileLoader
 
         $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 @@ class YamlFileLoader extends FileLoader
                 }
 
                 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 @@ class YamlFileLoader extends FileLoader
             $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));
         }