Skip to content

Commit 2d3d2fe

Browse files
authored
don't add non-record schema to cache (#18)
* don't add non-record schema to cache * remove obsolete func argument
1 parent bdbeca8 commit 2d3d2fe

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/Merger/SchemaMerger.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,15 +108,13 @@ private function replaceSchemaIdWithDefinition(
108108
/**
109109
* @param bool $prefixWithNamespace
110110
* @param bool $useTemplateName
111-
* @param bool $optimizeFullNames
112111
* @return integer
113112
* @throws AvroSchemaParseException
114113
* @throws SchemaMergerException
115114
*/
116115
public function merge(
117116
bool $prefixWithNamespace = false,
118-
bool $useTemplateName = false,
119-
bool $optimizeFullNames = false
117+
bool $useTemplateName = false
120118
): int {
121119
$mergedFiles = 0;
122120
$registry = $this->getSchemaRegistry();

src/Registry/SchemaRegistry.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,10 @@ private function registerSchemaFile(\SplFileInfo $fileInfo): void
148148

149149
$schemaId = $this->getSchemaId($schemaData, $template);
150150
$this->schemas[$schemaId] = $template->withSchemaId($schemaId);
151-
$this->schemaNamesPerNamespace[$namespace][] = $schemaData['name'];
151+
152+
if (true === isset($schemaData['name'])) {
153+
$this->schemaNamesPerNamespace[$namespace][] = $schemaData['name'];
154+
}
152155
}
153156

154157
/**

0 commit comments

Comments
 (0)