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

different (better?) solution here

this is a duplicate of one already assigned to Matthew