Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wildcard aliases #46

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Wildcard aliases #46

wants to merge 3 commits into from

Conversation

goetas
Copy link
Member

@goetas goetas commented Dec 3, 2017

allow wildcard aliasing and aliasing of elements

@@ -60,6 +60,14 @@ public function getTypeAlias($type, Schema $schemapos = null)
if (isset($this->typeAliases[$schema->getTargetNamespace()][$type->getName()])) {
return $this->aliasCache[$cid] = call_user_func($this->typeAliases[$schema->getTargetNamespace()][$type->getName()], $type);
}

if (!empty($this->typeAliases[$schema->getTargetNamespace()])) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be moved to a private method and documented

$class = array();
$data = array();

if (($alias = $this->getTypeAlias($element))) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be moved to a private method as well

@@ -155,6 +155,15 @@ public function visitElementDef(ElementDef $element, $skip = false)
$class->setName($this->getNamingStrategy()->getItemName($element));
$class->setDoc($element->getDoc());

if ($alias = $this->getTypeAlias($element)) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also here - private method to be added

@goetas goetas changed the title Changes Wildcard aliases Dec 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants