/** * Get C++ code for function * * @return string C++ code */ public function getCode() { $this->variablesFromCode(); $this->codeGenerator->getScope()->debug(); $variables = ''; foreach ($this->vars as $var) { $var->setVariable($this->codeGenerator->getScope()['$' . $var->getName()]); $variables .= $var->getCode(); } return 'Php::Value phpFunc_' . $this->getName() . '(Php::Parameters &args)' . "\n" . '{' . "\n" . '' . $variables . "\n" . '' . $this->codeGenerator->getCode() . "\n" . ' return nullptr;' . "\n" . '}' . "\n\n"; }