/** * Returns the signature of an internal method */ public function getInternalSignature(ClassMethod $method, CompilationContext $context) { if ($method->isInitializer() && !$method->isStatic()) { return 'static zend_object *' . $method->getName() . '(zend_class_entry *class_type TSRMLS_DC)'; } if ($method->isInitializer() && $method->isStatic()) { return 'void ' . $method->getName() . '(TSRMLS_D)'; } $signatureParameters = array(); $parameters = $method->getParameters(); if (is_object($parameters)) { foreach ($parameters->getParameters() as $parameter) { switch ($parameter['data-type']) { case 'int': case 'uint': case 'long': case 'double': case 'bool': case 'char': case 'uchar': case 'string': case 'array': $signatureParameters[] = 'zval *' . $parameter['name'] . '_param_ext'; break; default: $signatureParameters[] = 'zval *' . $parameter['name'] . '_ext '; break; } } } if (count($signatureParameters)) { return 'void ' . $method->getInternalName() . '(int ht, zval *return_value, zval *this_ptr, int return_value_used, ' . join(', ', $signatureParameters) . ')'; } return 'void ' . $method->getInternalName() . '(int ht, zval *return_value, zval *this_ptr, int return_value_used)'; }