PHP 5.6+ supports ...$arg for variable number of arguments. However, code sniffer is parsing it incorrectly, for example:

/**
 * Docblock
 * @param string ...$var
 */

Is getting parsed as type string ... and var $var, rather than string and var ...$var. This results in an errors Parameter type "string ..." must not contain spaces and Expected 1 spaces after parameter type; 0 found.

Comments

andrewbelcher created an issue. See original summary.

klausi’s picture

Version: 8.x-2.x-dev » 8.3.x-dev
Priority: Major » Normal
Status: Active » Closed (duplicate)

I think this was fixed in #2878783: Add support of variadic type hinting and argument specification, let me know if you still see a problem!