Skip to content

Commit

Permalink
Merge pull request grpc#7748 from thinkerou/update_function_desc
Browse files Browse the repository at this point in the history
PHP: update param description of function
  • Loading branch information
stanley-cheung authored Sep 8, 2016
2 parents 93b0947 + efbc9e7 commit 7f936ea
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 44 deletions.
22 changes: 12 additions & 10 deletions src/php/ext/grpc/call.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ PHP_GRPC_FREE_WRAPPED_FUNC_START(wrapped_grpc_call)
}
PHP_GRPC_FREE_WRAPPED_FUNC_END()

/* Initializes an instance of wrapped_grpc_call to be associated with an object
* of a class specified by class_type */
/* Initializes an instance of wrapped_grpc_call to be associated with an
* object of a class specified by class_type */
php_grpc_zend_object create_wrapped_grpc_call(zend_class_entry *class_type
TSRMLS_DC) {
PHP_GRPC_ALLOC_CLASS_OBJECT(wrapped_grpc_call);
Expand Down Expand Up @@ -195,10 +195,11 @@ zval *grpc_php_wrap_call(grpc_call *wrapped, bool owned TSRMLS_DC) {

/**
* Constructs a new instance of the Call class.
* @param Channel $channel The channel to associate the call with. Must not be
* closed.
* @param Channel $channel_obj The channel to associate the call with.
* Must not be closed.
* @param string $method The method to call
* @param Timeval $absolute_deadline The deadline for completing the call
* @param Timeval $deadline_obj The deadline for completing the call
* @param string $host_override The host is set by user (optional)
*/
PHP_METHOD(Call, __construct) {
zval *channel_obj;
Expand Down Expand Up @@ -237,7 +238,7 @@ PHP_METHOD(Call, __construct) {

/**
* Start a batch of RPC actions.
* @param array batch Array of actions to take
* @param array $array Array of actions to take
* @return object Object with results of all actions
*/
PHP_METHOD(Call, startBatch) {
Expand Down Expand Up @@ -515,8 +516,9 @@ PHP_METHOD(Call, getPeer) {
}

/**
* Cancel the call. This will cause the call to end with STATUS_CANCELLED if it
* has not already ended with another status.
* Cancel the call. This will cause the call to end with STATUS_CANCELLED
* if it has not already ended with another status.
* @return void
*/
PHP_METHOD(Call, cancel) {
wrapped_grpc_call *call = Z_WRAPPED_GRPC_CALL_P(getThis());
Expand All @@ -525,8 +527,8 @@ PHP_METHOD(Call, cancel) {

/**
* Set the CallCredentials for this call.
* @param CallCredentials creds_obj The CallCredentials object
* @param int The error code
* @param CallCredentials $creds_obj The CallCredentials object
* @return int The error code
*/
PHP_METHOD(Call, setCredentials) {
zval *creds_obj;
Expand Down
6 changes: 3 additions & 3 deletions src/php/ext/grpc/call_credentials.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ zval *grpc_php_wrap_call_credentials(grpc_call_credentials

/**
* Create composite credentials from two existing credentials.
* @param CallCredentials cred1 The first credential
* @param CallCredentials cred2 The second credential
* @param CallCredentials $cred1_obj The first credential
* @param CallCredentials $cred2_obj The second credential
* @return CallCredentials The new composite credentials object
*/
PHP_METHOD(CallCredentials, createComposite) {
Expand Down Expand Up @@ -119,7 +119,7 @@ PHP_METHOD(CallCredentials, createComposite) {

/**
* Create a call credentials object from the plugin API
* @param function callback The callback function
* @param function $fci The callback function
* @return CallCredentials The new call credentials object
*/
PHP_METHOD(CallCredentials, createFromPlugin) {
Expand Down
9 changes: 5 additions & 4 deletions src/php/ext/grpc/channel.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ void php_grpc_read_args_array(zval *args_array,
* "credentials" key mapping to a ChannelCredentials object, a secure channel
* will be created with those credentials.
* @param string $target The hostname to associate with this channel
* @param array $args The arguments to pass to the Channel (optional)
* @param array $args_array The arguments to pass to the Channel
*/
PHP_METHOD(Channel, __construct) {
wrapped_grpc_channel *channel = Z_WRAPPED_GRPC_CHANNEL_P(getThis());
Expand Down Expand Up @@ -182,7 +182,7 @@ PHP_METHOD(Channel, getTarget) {

/**
* Get the connectivity state of the channel
* @param bool (optional) try to connect on the channel
* @param bool $try_to_connect Try to connect on the channel (optional)
* @return long The grpc connectivity state
*/
PHP_METHOD(Channel, getConnectivityState) {
Expand All @@ -202,8 +202,8 @@ PHP_METHOD(Channel, getConnectivityState) {

/**
* Watch the connectivity state of the channel until it changed
* @param long The previous connectivity state of the channel
* @param Timeval The deadline this function should wait until
* @param long $last_state The previous connectivity state of the channel
* @param Timeval $deadline_obj The deadline this function should wait until
* @return bool If the connectivity state changes from last_state
* before deadline
*/
Expand Down Expand Up @@ -233,6 +233,7 @@ PHP_METHOD(Channel, watchConnectivityState) {

/**
* Close the channel
* @return void
*/
PHP_METHOD(Channel, close) {
wrapped_grpc_channel *channel = Z_WRAPPED_GRPC_CHANNEL_P(getThis());
Expand Down
16 changes: 8 additions & 8 deletions src/php/ext/grpc/channel_credentials.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ zval *grpc_php_wrap_channel_credentials(grpc_channel_credentials

/**
* Set default roots pem.
* @param string pem_roots PEM encoding of the server root certificates
* @param string $pem_roots PEM encoding of the server root certificates
* @return void
*/
PHP_METHOD(ChannelCredentials, setDefaultRootsPem) {
Expand Down Expand Up @@ -129,11 +129,11 @@ PHP_METHOD(ChannelCredentials, createDefault) {

/**
* Create SSL credentials.
* @param string pem_root_certs PEM encoding of the server root certificates
* @param string pem_private_key PEM encoding of the client's private key
* (optional)
* @param string pem_cert_chain PEM encoding of the client's certificate chain
* (optional)
* @param string $pem_root_certs PEM encoding of the server root certificates
* @param string $pem_key_cert_pair.private_key PEM encoding of the client's
* private key (optional)
* @param string $pem_key_cert_pair.cert_chain PEM encoding of the client's
* certificate chain (optional)
* @return ChannelCredentials The new SSL credentials object
*/
PHP_METHOD(ChannelCredentials, createSsl) {
Expand Down Expand Up @@ -168,8 +168,8 @@ PHP_METHOD(ChannelCredentials, createSsl) {

/**
* Create composite credentials from two existing credentials.
* @param ChannelCredentials cred1 The first credential
* @param CallCredentials cred2 The second credential
* @param ChannelCredentials $cred1_obj The first credential
* @param CallCredentials $cred2_obj The second credential
* @return ChannelCredentials The new composite credentials object
*/
PHP_METHOD(ChannelCredentials, createComposite) {
Expand Down
18 changes: 12 additions & 6 deletions src/php/ext/grpc/server.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ PHP_GRPC_FREE_WRAPPED_FUNC_START(wrapped_grpc_server)
}
PHP_GRPC_FREE_WRAPPED_FUNC_END()

/* Initializes an instance of wrapped_grpc_call to be associated with an object
* of a class specified by class_type */
/* Initializes an instance of wrapped_grpc_call to be associated with an
* object of a class specified by class_type */
php_grpc_zend_object create_wrapped_grpc_server(zend_class_entry *class_type
TSRMLS_DC) {
PHP_GRPC_ALLOC_CLASS_OBJECT(wrapped_grpc_server);
Expand All @@ -84,7 +84,7 @@ php_grpc_zend_object create_wrapped_grpc_server(zend_class_entry *class_type

/**
* Constructs a new instance of the Server class
* @param array $args The arguments to pass to the server (optional)
* @param array $args_array The arguments to pass to the server (optional)
*/
PHP_METHOD(Server, __construct) {
wrapped_grpc_server *server = Z_WRAPPED_GRPC_SERVER_P(getThis());
Expand Down Expand Up @@ -116,7 +116,7 @@ PHP_METHOD(Server, __construct) {
* Request a call on a server. Creates a single GRPC_SERVER_RPC_NEW event.
* @param long $tag_new The tag to associate with the new request
* @param long $tag_cancel The tag to use if the call is cancelled
* @return Void
* @return void
*/
PHP_METHOD(Server, requestCall) {
grpc_call_error error_code;
Expand Down Expand Up @@ -180,7 +180,7 @@ PHP_METHOD(Server, requestCall) {
/**
* Add a http2 over tcp listener.
* @param string $addr The address to add
* @return true on success, false on failure
* @return bool True on success, false on failure
*/
PHP_METHOD(Server, addHttp2Port) {
const char *addr;
Expand All @@ -197,6 +197,12 @@ PHP_METHOD(Server, addHttp2Port) {
RETURN_LONG(grpc_server_add_insecure_http2_port(server->wrapped, addr));
}

/**
* Add a secure http2 over tcp listener.
* @param string $addr The address to add
* @param ServerCredentials The ServerCredentials object
* @return bool True on success, false on failure
*/
PHP_METHOD(Server, addSecureHttp2Port) {
const char *addr;
php_grpc_int addr_len;
Expand All @@ -220,7 +226,7 @@ PHP_METHOD(Server, addSecureHttp2Port) {

/**
* Start a server - tells all listeners to start listening
* @return Void
* @return void
*/
PHP_METHOD(Server, start) {
wrapped_grpc_server *server = Z_WRAPPED_GRPC_SERVER_P(getThis());
Expand Down
4 changes: 2 additions & 2 deletions src/php/ext/grpc/server_credentials.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ PHP_GRPC_FREE_WRAPPED_FUNC_START(wrapped_grpc_server_credentials)
}
PHP_GRPC_FREE_WRAPPED_FUNC_END()

/* Initializes an instace of wrapped_grpc_server_credentials to be associated
* with an object of a class specified by class_type */
/* Initializes an instace of wrapped_grpc_server_credentials to be
* associated with an object of a class specified by class_type */
php_grpc_zend_object create_wrapped_grpc_server_credentials(
zend_class_entry *class_type TSRMLS_DC) {
PHP_GRPC_ALLOC_CLASS_OBJECT(wrapped_grpc_server_credentials);
Expand Down
22 changes: 11 additions & 11 deletions src/php/ext/grpc/timeval.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ zval *grpc_php_wrap_timeval(gpr_timespec wrapped TSRMLS_DC) {

/**
* Constructs a new instance of the Timeval class
* @param long $usec The number of microseconds in the interval
* @param long $microseconds The number of microseconds in the interval
*/
PHP_METHOD(Timeval, __construct) {
wrapped_grpc_timeval *timeval = Z_WRAPPED_GRPC_TIMEVAL_P(getThis());
Expand All @@ -100,7 +100,7 @@ PHP_METHOD(Timeval, __construct) {
/**
* Adds another Timeval to this one and returns the sum. Calculations saturate
* at infinities.
* @param Timeval $other The other Timeval object to add
* @param Timeval $other_obj The other Timeval object to add
* @return Timeval A new Timeval object containing the sum
*/
PHP_METHOD(Timeval, add) {
Expand All @@ -126,8 +126,8 @@ PHP_METHOD(Timeval, add) {
/**
* Subtracts another Timeval from this one and returns the difference.
* Calculations saturate at infinities.
* @param Timeval $other The other Timeval object to subtract
* @param Timeval A new Timeval object containing the sum
* @param Timeval $other_obj The other Timeval object to subtract
* @return Timeval A new Timeval object containing the diff
*/
PHP_METHOD(Timeval, subtract) {
zval *other_obj;
Expand All @@ -150,10 +150,10 @@ PHP_METHOD(Timeval, subtract) {
}

/**
* Return negative, 0, or positive according to whether a < b, a == b, or a > b
* respectively.
* @param Timeval $a The first time to compare
* @param Timeval $b The second time to compare
* Return negative, 0, or positive according to whether a < b, a == b,
* or a > b respectively.
* @param Timeval $a_obj The first time to compare
* @param Timeval $b_obj The second time to compare
* @return long
*/
PHP_METHOD(Timeval, compare) {
Expand All @@ -176,9 +176,9 @@ PHP_METHOD(Timeval, compare) {

/**
* Checks whether the two times are within $threshold of each other
* @param Timeval $a The first time to compare
* @param Timeval $b The second time to compare
* @param Timeval $threshold The threshold to check against
* @param Timeval $a_obj The first time to compare
* @param Timeval $b_obj The second time to compare
* @param Timeval $thresh_obj The threshold to check against
* @return bool True if $a and $b are within $threshold, False otherwise
*/
PHP_METHOD(Timeval, similar) {
Expand Down

0 comments on commit 7f936ea

Please sign in to comment.