I am fairly new to PHP and battling to resolve an issue between function parameters of type and contentType.

I have the following code {0} where I'm trying to pass through an ID to a function, however, the following error is returned {1}

{0}

/**
 * @path("/getList")
 * @param(string, query,'string')       
 * @return(string,'text/plain')
 */

public function getList($ID)
    {
        ....
    }

{1} Simultaneous usage of the contentType and type attributes is not supported and will produce an error since the type attribute implicitly declares the application/json MIME type.

I've changed the following from * @param(string,query,'text/plain') to * @param(string,query,'string')

But obviously that would change the value of the parameter, and not the type of it.

How would I go about in doing that?

Regards

2

There are 2 best solutions below

0
On BEST ANSWER

Got the resolution.

Instead of saying

  • @param(string, query,'string')

use

  • @param(string, query).
1
On

Remove the Brace {. You have given two braces after the method

/**
 * @path("/getList")
 * @param(string, query,'string')       
 * @return(string,'text/plain')
 */

public function getList($ID)
    {
        ....
    }