Skip to content

Commit e260ec8

Browse files
committed
resolve subresource class just like the resource class
1 parent cfc05d1 commit e260ec8

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/Metadata/Extractor/XmlExtractor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ private function getProperties(\SimpleXMLElement $resource): array
120120
'attributes' => $this->getAttributes($property, 'attribute'),
121121
'subresource' => $property->subresource ? [
122122
'collection' => $this->phpize($property->subresource, 'collection', 'bool'),
123-
'resourceClass' => $this->phpize($property->subresource, 'resourceClass', 'string'),
123+
'resourceClass' => $this->resolve($this->phpize($property->subresource, 'resourceClass', 'string')),
124124
'maxDepth' => $this->phpize($property->subresource, 'maxDepth', 'integer'),
125125
] : null,
126126
];

src/Metadata/Extractor/YamlExtractor.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,9 @@ private function extractProperties(array $resourceYaml, string $resourceName, st
100100
if (!\is_array($propertyValues)) {
101101
throw new InvalidArgumentException(sprintf('"%s" setting is expected to be null or an array, %s given in "%s".', $propertyName, \gettype($propertyValues), $path));
102102
}
103+
if (isset($propertyValues['subresource']['resourceClass'])) {
104+
$propertyValues['subresource']['resourceClass'] = $this->resolve($propertyValues['subresource']['resourceClass']);
105+
}
103106

104107
$this->resources[$resourceName]['properties'][$propertyName] = [
105108
'description' => $this->phpize($propertyValues, 'description', 'string'),

0 commit comments

Comments
 (0)