ZF-3345: Zend_Rest_Server doesn't support argument defaults
Description
When omitting optional arguments for functions/methods that have default argument as in
function foo($required,$optional='not required') { }
Zend Rest Server fails with an "Invalid Method" Call Exception in handle()
if (count($calling_args) < count($func_args)) { /* this is where it fails */
/* if (count($calling_args) < $this->_functions[$this->_method]->getNumberOfRequiredParameters()) { /* this fixes the issue */
throw new Zend_Rest_Server_Exception('Invalid Method Call to ' . $this->_method . '. Requires ' . count($func_args) . ', ' . count($calling_args) . ' given.', 400);
}
Comments
Posted by Christian Kissner (chrispsm&w) on 2008-05-28T19:59:47.000+0000
different (better?) solution here
Posted by Christian Kissner (chrispsm&w) on 2008-05-28T20:03:13.000+0000
this is a duplicate of one already assigned to Matthew