summaryrefslogtreecommitdiff
path: root/php/src/php7/Operation.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'php/src/php7/Operation.cpp')
-rw-r--r--php/src/php7/Operation.cpp28
1 files changed, 15 insertions, 13 deletions
diff --git a/php/src/php7/Operation.cpp b/php/src/php7/Operation.cpp
index e4afea75a8d..2e9c91b29f6 100644
--- a/php/src/php7/Operation.cpp
+++ b/php/src/php7/Operation.cpp
@@ -368,13 +368,13 @@ IcePHP::OperationI::convertParam(zval* p, int pos)
ParamInfoPtr param = new ParamInfo;
param->type = Wrapper<TypeInfoPtr>::value(zend_hash_index_find(arr, 0));
+ param->optional = zend_hash_num_elements(arr) > 1;
- assert(Z_TYPE_P(zend_hash_index_find(arr, 1)) == IS_TRUE || Z_TYPE_P(zend_hash_index_find(arr, 1)) == IS_FALSE);
- param->optional = Z_TYPE_P(zend_hash_index_find(arr, 1)) == IS_TRUE;
-
- assert(Z_TYPE_P(zend_hash_index_find(arr, 2)) == IS_LONG);
- param->tag = static_cast<int>(Z_LVAL_P(zend_hash_index_find(arr, 2)));
-
+ if(param->optional)
+ {
+ assert(Z_TYPE_P(zend_hash_index_find(arr, 1)) == IS_LONG);
+ param->tag = static_cast<int>(Z_LVAL_P(zend_hash_index_find(arr, 1)));
+ }
param->pos = pos;
return param;
@@ -840,11 +840,13 @@ ZEND_FUNCTION(IcePHP_defineOperation)
}
TypeInfoPtr type = Wrapper<TypeInfoPtr>::value(cls);
- ClassInfoPtr c = ClassInfoPtr::dynamicCast(type);
+ ProxyInfoPtr c = ProxyInfoPtr::dynamicCast(type);
assert(c);
- OperationIPtr op = new OperationI(name, static_cast<Ice::OperationMode>(mode),
- static_cast<Ice::OperationMode>(sendMode), static_cast<Ice::FormatType>(format),
+ OperationIPtr op = new OperationI(name,
+ static_cast<Ice::OperationMode>(mode),
+ static_cast<Ice::OperationMode>(sendMode),
+ static_cast<Ice::FormatType>(format),
inParams, outParams, returnType, exceptions);
c->addOperation(name, op);
@@ -853,17 +855,17 @@ ZEND_FUNCTION(IcePHP_defineOperation)
ZEND_FUNCTION(IcePHP_Operation_call)
{
Ice::ObjectPrx proxy;
- ClassInfoPtr cls;
+ ProxyInfoPtr info;
CommunicatorInfoPtr comm;
#ifndef NDEBUG
bool b =
#endif
- fetchProxy(getThis(), proxy, cls, comm);
+ fetchProxy(getThis(), proxy, info, comm);
assert(b);
assert(proxy);
- assert(cls);
+ assert(info);
- OperationPtr op = cls->getOperation(get_active_function_name());
+ OperationPtr op = info->getOperation(get_active_function_name());
assert(op); // handleGetMethod should have already verified the operation's existence.
OperationIPtr opi = OperationIPtr::dynamicCast(op);
assert(opi);