*
* @var array
*/
- private $classes = null;
+ private $classes;
/**
* {@inheritdoc}
$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) {
}
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()));
}
$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));
}