Skip to content

Commit 9773872

Browse files
committed
fix(resources): Fix issues with extending {XML,Yaml} -> {XML,Yaml} resources
1 parent b1b4f14 commit 9773872

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/Metadata/Extractor/YamlResourceExtractor.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,15 @@ private function buildResources(array $resourcesYaml, string $path): void
7575
$resourceYaml = [$resourceYaml];
7676
}
7777

78+
$resourcesCount = isset($this->resources[$resourceName]) ? count($this->resources[$resourceName]) : 0;
7879
foreach ($resourceYaml as $key => $resourceYamlDatum) {
7980
if (null === $resourceYamlDatum) {
8081
$resourceYamlDatum = [];
8182
}
8283

8384
try {
8485
$base = $this->buildExtendedBase($resourceYamlDatum);
85-
$this->resources[$resourceName][$key] = array_merge($base, [
86+
$this->resources[$resourceName][$resourcesCount+$key] = array_merge($base, [
8687
'operations' => $this->buildOperations($resourceYamlDatum, $base),
8788
'graphQlOperations' => $this->buildGraphQlOperations($resourceYamlDatum, $base),
8889
]);

src/Metadata/Resource/Factory/ExtractorResourceMetadataCollectionFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function create(string $resourceClass): ResourceMetadataCollection
6060
}
6161
}
6262

63-
$resourceMetadataCollection[$i] = $resource;
63+
$resourceMetadataCollection[] = $resource;
6464
}
6565

6666
return $resourceMetadataCollection;

0 commit comments

Comments
 (0)