ZF-3345: Zend_Rest_Server doesn't support argument defaults

Issue Type: Bug Created: 2008-05-28T18:57:51.000+0000 Last Updated: 2009-01-11T04:15:12.000+0000 Status: Resolved Fix version(s): - 1.6.0 (02/Sep/08)

Reporter: Christian Kissner (chrispsm&w) Assignee: Benjamin Eberlei (beberlei) Tags: - Zend_Rest_Server

Related issues: - ZF-2540



When omitting optional arguments for functions/methods that have default argument as in

<pre class="highlight">
function foo($required,$optional='not required') { }

Zend Rest Server fails with an "Invalid Method" Call Exception in handle()

<pre class="highlight">
                    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);



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

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.