Skip to content

PHP: add macro for arg info in extension#9751

Merged
stanley-cheung merged 1 commit intogrpc:masterfrom
stanley-cheung:php-ext-arg-info
Feb 17, 2017
Merged

PHP: add macro for arg info in extension#9751
stanley-cheung merged 1 commit intogrpc:masterfrom
stanley-cheung:php-ext-arg-info

Conversation

@stanley-cheung
Copy link
Copy Markdown
Contributor

A first step to fix #8859

These macros ZEND_BEGIN_ARG_INFO_EX are going to help us generate better documentation for the PHP PECL extension.

Also broken up some long lines (just white space changes for those)

Technically instead of just using the ZEND_ARG_INFO macro per parameter, we can use ZEND_ARG_TYPE_INFO and ZEND_ARG_OBJ_INFO to even better type hint each parameter. However, there are a couple of issues.

  1. ZEND_ARG_TYPE_INFO only supports IS_ARRAY and IS_CALLABLE but not scalar type like IS_STRING, IS_LONG, etc
  2. If we switch to use ZEND_ARG_OBJ_INFO, the error being thrown when a wrong type of argument being passed to the function changes from InvalidArgumentException to a "PHP Catchable Fatal Error" which requires a different way of handling it. So I did not do that.

@stanley-cheung stanley-cheung merged commit a8ea5de into grpc:master Feb 17, 2017
@stanley-cheung stanley-cheung deleted the php-ext-arg-info branch February 17, 2017 22:12
@lock lock bot locked as resolved and limited conversation to collaborators Jan 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Lack of document for php extension of grpc

3 participants