private function findPHPClass(PHPClass $class, Item $node, $force = false) { if ($node instanceof ElementRef) { return $this->visitElementDef($node->getReferencedElement()); } if (!$node->getType()->getName()) { return $this->visitTypeAnonymous($node->getType(), $node->getName(), $class); } else { return $this->visitType($node->getType(), $force); } }
private function findPHPClass(&$class, Item $node) { $type = $node->getType(); if ($alias = $this->getTypeAlias($node->getType())) { return $alias; } if ($node instanceof ElementRef) { $elementRef = $this->visitElementDef($node->getSchema(), $node->getReferencedElement()); return key($elementRef); } if ($valueProp = $this->typeHasValue($type, $class, '')) { return $valueProp; } if (!$node->getType()->getName()) { $visited = $this->visitTypeAnonymous($node->getType(), $node->getName(), $class); } else { $visited = $this->visitType($node->getType()); } return key($visited); }