Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ public function __invoke(EngineType $engineType, mixed $xsdType, TypesConverterC
default => null,
};

// Attributes can have inline types. Mark the attribute as a local type in that case.
$isConsideredAnInlineType = $baseType && $baseType->getName() === null;
if ($isConsideredAnInlineType) {
$engineType = $engineType->withMeta(
static fn ($meta) => $meta->withIsLocal(true)
);
}

return (new SimpleTypeConfigurator())($engineType, $baseType, $context);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,19 @@ public function __invoke(EngineType $engineType, mixed $xsdType, TypesConverterC
return $engineType;
}

// Elements can have inline types. Mark the attribute as a local type in that case.
$innerType = $xsdType->getType();
$isConsideredAnInlineType = $innerType && $innerType->getName() === null;
if ($isConsideredAnInlineType) {
$engineType = $engineType->withMeta(
static fn ($meta) => $meta->withIsLocal(true)
);
}

return $engineType
->withMeta(
static fn (TypeMeta $meta): TypeMeta => $meta
->withIsQualified($xsdType->isQualified())
->withIsLocal($xsdType->isLocal())
->withIsNil($xsdType->isNil())
->withIsNullable($meta->isNullable()->unwrapOr(false) || $xsdType->isNil())
);
Expand Down
Loading