/** * @param MethodContainer $methods * @param StructAttributeModel $attribute * @return Struct */ protected function addStructMethodGet(MethodContainer $methods, StructAttributeModel $attribute) { $method = new PhpMethod($attribute->getGetterName(), $this->getStructMethodGetParameters($attribute)); if ($attribute->nameIsClean()) { $thisAccess = sprintf('%s', $attribute->getName()); } else { $thisAccess = sprintf('{\'%s\'}', addslashes($attribute->getName())); } $this->addStructMethodGetBody($method, $attribute, $thisAccess); $methods->add($method); return $this; }