protected function createProperty(Tag $tag) { $name = trim($tag->getVariableName(), '$'); $prop = new ClassProperty(); $prop->name = $name; $prop->setType($this->getFQCN($tag->getType())); return $prop; }
/** * @return ClassProperty */ public function getProperty($name) { $prop = null; if (array_key_exists($name, $this->properties)) { $prop = $this->properties[$name]; } if (!$prop instanceof ClassProperty && array_key_exists('', $this->properties)) { $prop = $this->properties['']; } if (empty($prop)) { $var = $this->getVar($name); if ($var instanceof Variable) { $prop = new ClassProperty(); $prop->name = $var->getName(); $prop->setType($var->getType()); } } return $prop; }