/** * Get named element by it's name. * * @param string $name * @return ConstantDeclaration */ public function get($name) { if (!$this->has($name)) { //Automatically creating constant $constant = new ConstantDeclaration($name, null); $this->add($constant); return $constant; } return parent::get($name); }
/** * Get named element by it's name. * * @param string $name * @return PropertyDeclaration */ public function get($name) { if (!$this->has($name)) { //Automatically creating constant $property = new PropertyDeclaration($name); $this->add($property); return $property; } return parent::get($name); }
/** * Get named element by it's name. * * @param string $name * @return MethodDeclaration */ public function get($name) { if (!$this->has($name)) { //Automatically creating constant $method = new MethodDeclaration($name); $this->add($method); return $method; } return parent::get($name); }
/** * Get named element by it's name. * * @param string $name * @return ParameterDeclaration */ public function get($name) { if (!$this->has($name)) { //Automatically creating constant $parameter = new ParameterDeclaration($name, null); $this->add($parameter); return $parameter; } return parent::get($name); }