I need to use a splat operator within a PHP docblock and cannot figure out how to escape the character

100 Views Asked by At

I am using codeception and running multiple sets of example data. I am sending in multiple accept headers, one of which is "*/*".

so the example code is:

   /**
     * My description of the test
     *
     * GET a/path/i/am/testing
     *
     * @example ["*/*", 200]
     * @example ["application/json", 200]
     * @example ["text/html", 200]
     *
     */

I have tried single quotes within the double, I have tried double within single, I have tried concatenating each piece, I have tried backslash, I have tried Unicode. PHP thinks the splat is speaking to the docblock. What am I missing? Thanks in advance!

1

There are 1 best solutions below

0
Alexandre Datain On

try {@*} instead of */

 * @example ["{@*}*", 200]
should be interpreted as
* @example ["*/*", 200]