Browse Source

Fix return types in proto comments

Andreas Wahlen 1 year ago
parent
commit
b5ef0161fd
4 changed files with 40 additions and 40 deletions
  1. 1 1
      php_gearman.c
  2. 20 20
      php_gearman_client.c
  3. 10 10
      php_gearman_task.c
  4. 9 9
      php_gearman_worker.c

+ 1 - 1
php_gearman.c

@@ -70,7 +70,7 @@ PHP_FUNCTION(gearman_bugreport) {
 }
 }
 /* }}} */
 /* }}} */
 
 
-/* {{{ proto string gearman_verbose_name(constant verbose)
+/* {{{ proto ?string gearman_verbose_name(constant verbose)
    Returns string with the name of the given verbose level */
    Returns string with the name of the given verbose level */
 PHP_FUNCTION(gearman_verbose_name) {
 PHP_FUNCTION(gearman_verbose_name) {
 	zend_long verbose;
 	zend_long verbose;

+ 20 - 20
php_gearman_client.c

@@ -36,7 +36,7 @@ static void gearman_client_ctor(INTERNAL_FUNCTION_PARAMETERS) {
         gearman_client_set_task_context_free_fn(&(client->client), _php_task_free);
         gearman_client_set_task_context_free_fn(&(client->client), _php_task_free);
 }
 }
 
 
-/* {{{ proto object gearman_client_create()
+/* {{{ proto false|object gearman_client_create()
    Returns a GearmanClient object */
    Returns a GearmanClient object */
 PHP_FUNCTION(gearman_client_create) {
 PHP_FUNCTION(gearman_client_create) {
         if (object_init_ex(return_value, gearman_client_ce) != SUCCESS) {
         if (object_init_ex(return_value, gearman_client_ce) != SUCCESS) {
@@ -113,7 +113,7 @@ void gearman_client_free_obj(zend_object *object) {
         zend_object_std_dtor(&intern->std);
         zend_object_std_dtor(&intern->std);
 }
 }
 
 
-/* {{{ proto int gearman_client_return_code()
+/* {{{ proto ?int gearman_client_return_code()
    get last gearman_return_t */
    get last gearman_return_t */
 PHP_FUNCTION(gearman_client_return_code)
 PHP_FUNCTION(gearman_client_return_code)
 {
 {
@@ -129,7 +129,7 @@ PHP_FUNCTION(gearman_client_return_code)
 }
 }
 /* }}} */
 /* }}} */
 
 
-/* {{{ proto string gearman_client_error()
+/* {{{ proto null|false|string gearman_client_error()
    Return an error string for the last error encountered. */
    Return an error string for the last error encountered. */
 PHP_FUNCTION(gearman_client_error) {
 PHP_FUNCTION(gearman_client_error) {
         char *error = NULL;
         char *error = NULL;
@@ -149,7 +149,7 @@ PHP_FUNCTION(gearman_client_error) {
 }
 }
 /* }}} */
 /* }}} */
 
 
-/* {{{ proto int gearman_client_get_errno()
+/* {{{ proto ?int gearman_client_get_errno()
    Value of errno in the case of a GEARMAN_ERRNO return value. */
    Value of errno in the case of a GEARMAN_ERRNO return value. */
 PHP_FUNCTION(gearman_client_get_errno) {
 PHP_FUNCTION(gearman_client_get_errno) {
         gearman_client_obj *obj;
         gearman_client_obj *obj;
@@ -164,7 +164,7 @@ PHP_FUNCTION(gearman_client_get_errno) {
 }
 }
 /* }}} */
 /* }}} */
 
 
-/* {{{ proto int gearman_client_options()
+/* {{{ proto ?int gearman_client_options()
    Get options for a client structure. */
    Get options for a client structure. */
 PHP_FUNCTION(gearman_client_options) {
 PHP_FUNCTION(gearman_client_options) {
         gearman_client_obj *obj;
         gearman_client_obj *obj;
@@ -179,7 +179,7 @@ PHP_FUNCTION(gearman_client_options) {
 }
 }
 /* }}} */
 /* }}} */
 
 
-/* {{{ proto void gearman_client_set_options(constant option)
+/* {{{ proto bool gearman_client_set_options(constant option)
    Set options for a client structure.
    Set options for a client structure.
    NOTE: this is deprecated in gearmand */
    NOTE: this is deprecated in gearmand */
 PHP_FUNCTION(gearman_client_set_options) {
 PHP_FUNCTION(gearman_client_set_options) {
@@ -198,7 +198,7 @@ PHP_FUNCTION(gearman_client_set_options) {
 }
 }
 /* }}} */
 /* }}} */
 
 
-/* {{{ proto void GearmanClient::addOptions(constant option)
+/* {{{ proto bool GearmanClient::addOptions(constant option)
    Set options for a client structure. */
    Set options for a client structure. */
 PHP_FUNCTION(gearman_client_add_options) {
 PHP_FUNCTION(gearman_client_add_options) {
         zend_long options;
         zend_long options;
@@ -216,7 +216,7 @@ PHP_FUNCTION(gearman_client_add_options) {
 }
 }
 /* }}} */
 /* }}} */
 
 
-/* {{{ proto void GearmanClient::removeOptions(constant option)
+/* {{{ proto bool GearmanClient::removeOptions(constant option)
    Set options for a client structure. */
    Set options for a client structure. */
 PHP_FUNCTION(gearman_client_remove_options) {
 PHP_FUNCTION(gearman_client_remove_options) {
         zend_long options;
         zend_long options;
@@ -234,7 +234,7 @@ PHP_FUNCTION(gearman_client_remove_options) {
 }
 }
 /* }}} */
 /* }}} */
 
 
-/* {{{ proto int GearmanClient::timeout()
+/* {{{ proto ?int GearmanClient::timeout()
    Get current socket I/O activity timeout value */
    Get current socket I/O activity timeout value */
 PHP_FUNCTION(gearman_client_timeout) {
 PHP_FUNCTION(gearman_client_timeout) {
         gearman_client_obj *obj;
         gearman_client_obj *obj;
@@ -249,7 +249,7 @@ PHP_FUNCTION(gearman_client_timeout) {
 }
 }
 /* }}} */
 /* }}} */
 
 
-/* {{{ proto void gearman_client_set_timeout(object, constant timeout)
+/* {{{ proto bool gearman_client_set_timeout(object, constant timeout)
    Set timeout for a client structure. */
    Set timeout for a client structure. */
 PHP_FUNCTION(gearman_client_set_timeout) {
 PHP_FUNCTION(gearman_client_set_timeout) {
         zend_long timeout;
         zend_long timeout;
@@ -365,7 +365,7 @@ PHP_FUNCTION(gearman_client_wait) {
 }
 }
 /* }}} */
 /* }}} */
 
 
-/* {{{ proto object gearman_client_do_work_handler(void *add_task_func, object client, string function, zval workload [, string unique ])
+/* {{{ proto string gearman_client_do_work_handler(void *add_task_func, object client, string function, zval workload [, string unique ])
    Run a task, high/normal/low dependent upon do_work_func */
    Run a task, high/normal/low dependent upon do_work_func */
 static void gearman_client_do_work_handler(void* (*do_work_func)(
 static void gearman_client_do_work_handler(void* (*do_work_func)(
                                                                 gearman_client_st *client,
                                                                 gearman_client_st *client,
@@ -443,7 +443,7 @@ PHP_FUNCTION(gearman_client_do_low) {
 }
 }
 /* }}} */
 /* }}} */
 
 
-/* {{{ proto object gearman_client_do_background_work_handler(void *add_task_func, object client, string function, zval workload [, string unique ])
+/* {{{ proto string gearman_client_do_background_work_handler(void *add_task_func, object client, string function, zval workload [, string unique ])
    Run a task in the background, high/normal/low dependent upon do_work_func */
    Run a task in the background, high/normal/low dependent upon do_work_func */
 static void gearman_client_do_background_work_handler(gearman_return_t (*do_background_work_func)(
 static void gearman_client_do_background_work_handler(gearman_return_t (*do_background_work_func)(
                                                                 gearman_client_st *client,
                                                                 gearman_client_st *client,
@@ -651,7 +651,7 @@ PHP_FUNCTION(gearman_client_ping) {
 }
 }
 /* }}} */
 /* }}} */
 
 
-/* {{{ proto object gearman_client_add_task_handler(void *add_task_func, object client, string function, zval workload [, string unique ])
+/* {{{ proto false|object gearman_client_add_task_handler(void *add_task_func, object client, string function, zval workload [, string unique ])
    Add a task to be run in parallel, background or not, high/normal/low dependent upon add_task_func. */
    Add a task to be run in parallel, background or not, high/normal/low dependent upon add_task_func. */
 static void gearman_client_add_task_handler(gearman_task_st* (*add_task_func)(
 static void gearman_client_add_task_handler(gearman_task_st* (*add_task_func)(
                                                                 gearman_client_st *client,
                                                                 gearman_client_st *client,
@@ -739,42 +739,42 @@ static void gearman_client_add_task_handler(gearman_task_st* (*add_task_func)(
 }
 }
 /* }}} */
 /* }}} */
 
 
-/* {{{ proto object GearmanClient::addTask(string function, zval workload [, string unique ])
+/* {{{ proto false|object GearmanClient::addTask(string function, zval workload [, string unique ])
    Add a task to be run in parallel. */
    Add a task to be run in parallel. */
 PHP_FUNCTION(gearman_client_add_task) {
 PHP_FUNCTION(gearman_client_add_task) {
         gearman_client_add_task_handler(gearman_client_add_task, INTERNAL_FUNCTION_PARAM_PASSTHRU);
         gearman_client_add_task_handler(gearman_client_add_task, INTERNAL_FUNCTION_PARAM_PASSTHRU);
 }
 }
 /* }}} */
 /* }}} */
 
 
-/* {{{ proto object GearmanClient::addTaskHigh(string function, zval workload [, string unique ])
+/* {{{ proto false|object GearmanClient::addTaskHigh(string function, zval workload [, string unique ])
    Add a high priority task to be run in parallel. */
    Add a high priority task to be run in parallel. */
 PHP_FUNCTION(gearman_client_add_task_high) {
 PHP_FUNCTION(gearman_client_add_task_high) {
         gearman_client_add_task_handler(gearman_client_add_task_high, INTERNAL_FUNCTION_PARAM_PASSTHRU);
         gearman_client_add_task_handler(gearman_client_add_task_high, INTERNAL_FUNCTION_PARAM_PASSTHRU);
 }
 }
 /* }}} */
 /* }}} */
 
 
-/* {{{ proto object GearmanClient::addTaskLow(string function, zval workload [, string unique ])
+/* {{{ proto false|object GearmanClient::addTaskLow(string function, zval workload [, string unique ])
    Add a low priority task to be run in parallel. */
    Add a low priority task to be run in parallel. */
 PHP_FUNCTION(gearman_client_add_task_low) {
 PHP_FUNCTION(gearman_client_add_task_low) {
         gearman_client_add_task_handler(gearman_client_add_task_low, INTERNAL_FUNCTION_PARAM_PASSTHRU);
         gearman_client_add_task_handler(gearman_client_add_task_low, INTERNAL_FUNCTION_PARAM_PASSTHRU);
 }
 }
 /* }}} */
 /* }}} */
 
 
-/* {{{ proto object GearmanClient::addTaskBackground(string function, zval workload [, string unique ])
+/* {{{ proto false|object GearmanClient::addTaskBackground(string function, zval workload [, string unique ])
    Add a background task to be run in parallel. */
    Add a background task to be run in parallel. */
 PHP_FUNCTION(gearman_client_add_task_background) {
 PHP_FUNCTION(gearman_client_add_task_background) {
         gearman_client_add_task_handler(gearman_client_add_task_background, INTERNAL_FUNCTION_PARAM_PASSTHRU);
         gearman_client_add_task_handler(gearman_client_add_task_background, INTERNAL_FUNCTION_PARAM_PASSTHRU);
 }
 }
 /* }}} */
 /* }}} */
 
 
-/* {{{ proto object GearmanClient::addTaskHighBackground(string function, zval workload [, string unique ])
+/* {{{ proto false|object GearmanClient::addTaskHighBackground(string function, zval workload [, string unique ])
    Add a high priority background task to be run in parallel. */
    Add a high priority background task to be run in parallel. */
 PHP_FUNCTION(gearman_client_add_task_high_background) {
 PHP_FUNCTION(gearman_client_add_task_high_background) {
         gearman_client_add_task_handler(gearman_client_add_task_high_background, INTERNAL_FUNCTION_PARAM_PASSTHRU);
         gearman_client_add_task_handler(gearman_client_add_task_high_background, INTERNAL_FUNCTION_PARAM_PASSTHRU);
 }
 }
 /* }}} */
 /* }}} */
 
 
-/* {{{ proto object GearmanClient::addTaskLowBackground(string function, zval workload [, string unique ])
+/* {{{ proto false|object GearmanClient::addTaskLowBackground(string function, zval workload [, string unique ])
    Add a low priority background task to be run in parallel. */
    Add a low priority background task to be run in parallel. */
 PHP_FUNCTION(gearman_client_add_task_low_background) {
 PHP_FUNCTION(gearman_client_add_task_low_background) {
         gearman_client_add_task_handler(gearman_client_add_task_low_background, INTERNAL_FUNCTION_PARAM_PASSTHRU);
         gearman_client_add_task_handler(gearman_client_add_task_low_background, INTERNAL_FUNCTION_PARAM_PASSTHRU);
@@ -807,7 +807,7 @@ PHP_FUNCTION(gearman_client_run_tasks) {
 /* this function is used to request status information from the gearmand
 /* this function is used to request status information from the gearmand
  * server. it will then call your predefined status callback, passing
  * server. it will then call your predefined status callback, passing
  * zdata/context to it */
  * zdata/context to it */
-/* {{{ proto object gearman_client_add_task_status(object client, string job_handle [, zval data])
+/* {{{ proto false|object gearman_client_add_task_status(object client, string job_handle [, zval data])
    Add task to get the status for a backgound task in parallel. */
    Add task to get the status for a backgound task in parallel. */
 PHP_FUNCTION(gearman_client_add_task_status) {
 PHP_FUNCTION(gearman_client_add_task_status) {
         zval *zdata = NULL;
         zval *zdata = NULL;

+ 10 - 10
php_gearman_task.c

@@ -155,7 +155,7 @@ PHP_FUNCTION(gearman_task_return_code) {
 }
 }
 /* }}} */
 /* }}} */
 
 
-/* {{{ proto ?bool|string gearman_task_function_name(object task)
+/* {{{ proto null|false|string gearman_task_function_name(object task)
    Returns function name associated with a task. */
    Returns function name associated with a task. */
 PHP_FUNCTION(gearman_task_function_name) {
 PHP_FUNCTION(gearman_task_function_name) {
         zval *zobj;
         zval *zobj;
@@ -189,7 +189,7 @@ PHP_FUNCTION(gearman_task_unique) {
 }
 }
 /* }}} */
 /* }}} */
 
 
-/* {{{ proto string gearman_task_job_handle(object task)
+/* {{{ proto null|false|string gearman_task_job_handle(object task)
    Returns job handle for a task. */
    Returns job handle for a task. */
 PHP_FUNCTION(gearman_task_job_handle) {
 PHP_FUNCTION(gearman_task_job_handle) {
         zval *zobj;
         zval *zobj;
@@ -205,7 +205,7 @@ PHP_FUNCTION(gearman_task_job_handle) {
         RETURN_FALSE;
         RETURN_FALSE;
 }
 }
 /* }}} */
 /* }}} */
-/* {{{ proto bool gearman_task_is_known(object task)
+/* {{{ proto ?bool gearman_task_is_known(object task)
    Get status on whether a task is known or not */
    Get status on whether a task is known or not */
 PHP_FUNCTION(gearman_task_is_known) {
 PHP_FUNCTION(gearman_task_is_known) {
 	zval *zobj;
 	zval *zobj;
@@ -223,7 +223,7 @@ PHP_FUNCTION(gearman_task_is_known) {
 /* }}} */
 /* }}} */
 
 
 
 
-/* {{{ proto bool gearman_task_is_running(object task)
+/* {{{ proto ?bool gearman_task_is_running(object task)
    Get status on whether a task is running or not */
    Get status on whether a task is running or not */
 PHP_FUNCTION(gearman_task_is_running) {
 PHP_FUNCTION(gearman_task_is_running) {
 	zval *zobj;
 	zval *zobj;
@@ -241,7 +241,7 @@ PHP_FUNCTION(gearman_task_is_running) {
 /* }}} */
 /* }}} */
 
 
 
 
-/* {{{ proto int gearman_task_numerator(object task)
+/* {{{ proto ?bool|int gearman_task_numerator(object task)
    Returns the numerator of percentage complete for a task. */
    Returns the numerator of percentage complete for a task. */
 PHP_FUNCTION(gearman_task_numerator) {
 PHP_FUNCTION(gearman_task_numerator) {
 	zval *zobj;
 	zval *zobj;
@@ -259,7 +259,7 @@ PHP_FUNCTION(gearman_task_numerator) {
 /* }}} */
 /* }}} */
 
 
 
 
-/* {{{ proto int gearman_task_denominator(object task)
+/* {{{ proto ?bool|int gearman_task_denominator(object task)
    Returns the denominator of percentage complete for a task. */
    Returns the denominator of percentage complete for a task. */
 PHP_FUNCTION(gearman_task_denominator) {
 PHP_FUNCTION(gearman_task_denominator) {
 	zval *zobj;
 	zval *zobj;
@@ -275,7 +275,7 @@ PHP_FUNCTION(gearman_task_denominator) {
 	RETURN_FALSE;
 	RETURN_FALSE;
 }
 }
 /* }}} */
 /* }}} */
-/* {{{ proto string gearman_task_data(object task)
+/* {{{ proto null|false|string gearman_task_data(object task)
    Get data being returned for a task. */
    Get data being returned for a task. */
 PHP_FUNCTION(gearman_task_data) {
 PHP_FUNCTION(gearman_task_data) {
 	zval *zobj;
 	zval *zobj;
@@ -300,7 +300,7 @@ PHP_FUNCTION(gearman_task_data) {
 /* }}} */
 /* }}} */
 
 
 
 
-/* {{{ proto int gearman_task_data_size(object task)
+/* {{{ proto false|int gearman_task_data_size(object task)
    Get data size being returned for a task. */
    Get data size being returned for a task. */
 PHP_FUNCTION(gearman_task_data_size) {
 PHP_FUNCTION(gearman_task_data_size) {
 	zval *zobj;
 	zval *zobj;
@@ -318,7 +318,7 @@ PHP_FUNCTION(gearman_task_data_size) {
 /* }}} */
 /* }}} */
 
 
 
 
-/* {{{ proto int gearman_task_send_workload(object task, string data)
+/* {{{ proto false|int gearman_task_send_workload(object task, string data)
    NOT-TESTED Send packet data for a task. */
    NOT-TESTED Send packet data for a task. */
 PHP_FUNCTION(gearman_task_send_workload) {
 PHP_FUNCTION(gearman_task_send_workload) {
 	zval *zobj;
 	zval *zobj;
@@ -351,7 +351,7 @@ PHP_FUNCTION(gearman_task_send_workload) {
 /* }}} */
 /* }}} */
 
 
 
 
-/* {{{ proto array gearman_task_recv_data(object task, long buffer_size)
+/* {{{ proto null|false|array gearman_task_recv_data(object task, long buffer_size)
    NOT-TESTED Read work or result data into a buffer for a task. */
    NOT-TESTED Read work or result data into a buffer for a task. */
 PHP_FUNCTION(gearman_task_recv_data) {
 PHP_FUNCTION(gearman_task_recv_data) {
 	zval *zobj;
 	zval *zobj;

+ 9 - 9
php_gearman_worker.c

@@ -148,7 +148,7 @@ PHP_FUNCTION(gearman_worker_errno) {
 }
 }
 /* }}} */
 /* }}} */
 
 
-/* {{{ proto int gearman_worker_options(object worker)
+/* {{{ proto ?int gearman_worker_options(object worker)
    Get options for a worker structure. */
    Get options for a worker structure. */
 PHP_FUNCTION(gearman_worker_options) {
 PHP_FUNCTION(gearman_worker_options) {
         zval *zobj;
         zval *zobj;
@@ -163,7 +163,7 @@ PHP_FUNCTION(gearman_worker_options) {
 }
 }
 /* }}} */
 /* }}} */
 
 
-/* {{{ proto void gearman_worker_set_options(object worker, constant option)
+/* {{{ proto null|true gearman_worker_set_options(object worker, constant option)
    Set options for a worker structure. */
    Set options for a worker structure. */
 PHP_FUNCTION(gearman_worker_set_options) {
 PHP_FUNCTION(gearman_worker_set_options) {
         zval *zobj;
         zval *zobj;
@@ -180,7 +180,7 @@ PHP_FUNCTION(gearman_worker_set_options) {
 }
 }
 /* }}} */
 /* }}} */
 
 
-/* {{{ proto void gearman_worker_add_options(object worker, constant option)
+/* {{{ proto null|true gearman_worker_add_options(object worker, constant option)
    Set options for a worker structure. */
    Set options for a worker structure. */
 PHP_FUNCTION(gearman_worker_add_options) {
 PHP_FUNCTION(gearman_worker_add_options) {
         zval *zobj;
         zval *zobj;
@@ -197,7 +197,7 @@ PHP_FUNCTION(gearman_worker_add_options) {
 }
 }
 /* }}} */
 /* }}} */
 
 
-/* {{{ proto void gearman_worker_remove_options(object worker, constant option)
+/* {{{ proto null|true gearman_worker_remove_options(object worker, constant option)
    Set options for a worker structure. */
    Set options for a worker structure. */
 PHP_FUNCTION(gearman_worker_remove_options) {
 PHP_FUNCTION(gearman_worker_remove_options) {
         zval *zobj;
         zval *zobj;
@@ -214,7 +214,7 @@ PHP_FUNCTION(gearman_worker_remove_options) {
 }
 }
 /* }}} */
 /* }}} */
 
 
-/* {{{ proto int gearman_worker_timeout(object worker)
+/* {{{ proto ?int gearman_worker_timeout(object worker)
    Get timeout for a worker structure. */
    Get timeout for a worker structure. */
 PHP_FUNCTION(gearman_worker_timeout) {
 PHP_FUNCTION(gearman_worker_timeout) {
         zval *zobj;
         zval *zobj;
@@ -229,7 +229,7 @@ PHP_FUNCTION(gearman_worker_timeout) {
 }
 }
 /* }}} */
 /* }}} */
 
 
-/* {{{ proto void gearman_worker_set_timeout(object worker, constant timeout)
+/* {{{ proto bool gearman_worker_set_timeout(object worker, constant timeout)
    Set timeout for a worker structure. */
    Set timeout for a worker structure. */
 PHP_FUNCTION(gearman_worker_set_timeout) {
 PHP_FUNCTION(gearman_worker_set_timeout) {
         zval *zobj;
         zval *zobj;
@@ -246,7 +246,7 @@ PHP_FUNCTION(gearman_worker_set_timeout) {
 }
 }
 /* }}} */
 /* }}} */
 
 
-/* {{{ proto void gearman_worker_set_id(object worker, string id)
+/* {{{ proto bool gearman_worker_set_id(object worker, string id)
    Set id for a worker structure. */
    Set id for a worker structure. */
 PHP_FUNCTION(gearman_worker_set_id) {
 PHP_FUNCTION(gearman_worker_set_id) {
         zval *zobj;
         zval *zobj;
@@ -440,7 +440,7 @@ PHP_FUNCTION(gearman_worker_unregister_all) {
 }
 }
 /* }}} */
 /* }}} */
 
 
-/* {{{ proto object gearman_worker_grab_job(obect worker)
+/* {{{ proto false|object gearman_worker_grab_job(obect worker)
    Get a job from one of the job servers.
    Get a job from one of the job servers.
    Note: EXPERIMENTAL - This is undocumented on php.net and needs a test*/
    Note: EXPERIMENTAL - This is undocumented on php.net and needs a test*/
 PHP_FUNCTION(gearman_worker_grab_job) {
 PHP_FUNCTION(gearman_worker_grab_job) {
@@ -627,7 +627,7 @@ PHP_FUNCTION(gearman_worker_add_function) {
 }
 }
 /* }}} */
 /* }}} */
 
 
-/* {{{ proto int gearman_worker_work(object worker)
+/* {{{ proto bool gearman_worker_work(object worker)
 	Wait for a job and call the appropriate callback function when it gets one. */
 	Wait for a job and call the appropriate callback function when it gets one. */
 PHP_FUNCTION(gearman_worker_work) {
 PHP_FUNCTION(gearman_worker_work) {
 	zval *zobj = NULL;
 	zval *zobj = NULL;