jk / RestServer

A PHP REST server for providing a very light-weight REST API. If you want color highlighting support for TextMate, look here: https://gist.github.com/1149076

Home Page:http://jacwright.com/blog/250/simple-rest-server-in-php-supports-json-amf/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Methods with only optional params are improperly initialized

jk opened this issue · comments

If you have a function, where all parameters are optional and you call it without any parameters, the parameters wouldn't initialized with their default values. Instead they get numbered default values (i.e. param1 → 0, param2 → 1).

/**
     * Unorderd params
     * @url GET /unorderd
     * @url GET /unorderd/$param1
     * @url GET /unorderd/$param2/test/$param1
     */
    public function unorderd($param1 = 'default', $param2 = 'default')
    {
        return array('param1' => $param1, 'param2' => $param2);
    }
  • Reproduce issue
  • Write unit tests covering this issue
  • Fix issue
  • Release new version number