Skip to content

Commit

Permalink
Fix bad arg info for RdKafka\Conf::set
Browse files Browse the repository at this point in the history
  • Loading branch information
euskadi31 committed Feb 19, 2016
1 parent df6e51d commit 043efca
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
5 changes: 2 additions & 3 deletions conf.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ static zend_object_value kafka_conf_new(zend_class_entry *class_type TSRMLS_DC)
retval.handle = zend_objects_store_put(&intern->std, (zend_objects_store_dtor_t) zend_objects_destroy_object, kafka_conf_free, NULL TSRMLS_CC);
retval.handlers = &kafka_object_handlers;

return retval;
return retval;
}
/* }}} */

Expand Down Expand Up @@ -196,10 +196,9 @@ PHP_METHOD(RdKafka__Conf, dump)
/* {{{ proto void RdKafka\Conf::set(RdKafka\Conf $conf, string $name, string $value[, string &$errstr])
Sets a configuration property. */

ZEND_BEGIN_ARG_INFO_EX(arginfo_kafka_conf_set, 0, 0, 3)
ZEND_BEGIN_ARG_INFO_EX(arginfo_kafka_conf_set, 0, 0, 2)
ZEND_ARG_INFO(0, name)
ZEND_ARG_INFO(0, value)
ZEND_ARG_INFO(0, errstr)
ZEND_END_ARG_INFO()

PHP_METHOD(RdKafka__Conf, set)
Expand Down
18 changes: 18 additions & 0 deletions tests/bugConfSetArgument.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
--TEST--
RdKafka\Conf
--FILE--
<?php

class TestBug extends RdKafka\Conf
{
public function set($name, $value)
{
return parent::set($name, $value);
}
}

$conf = new TestBug();
$conf->set('metadata.broker.list', '127.0.0.1');
echo "done" . PHP_EOL;
--EXPECT--
done

0 comments on commit 043efca

Please sign in to comment.