Automattic / phpcs-neutron-standard

A set of phpcs sniffs for PHP >7 development
MIT License
94 stars 7 forks source link

Variable by reference throws NoArgumentType error. #87

Closed stian-overasen closed 1 year ago

stian-overasen commented 2 years ago

For functions that accepts passing variables by reference Neutron will throw NoArgumentType error.

Screenshot 2022-08-31 at 14 09 54

Simple example:

/**
 * Undocumented function
 *
 * @param int $foo Foo.
 * @return integer
 */
function any_function( int &$foo ) : int {
    return 1;
}
---------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
---------------------------------------------------------------------------------------------
 21 | WARNING | Argument type is missing
    |         | (NeutronStandard.Functions.TypeHint.NoArgumentType)
---------------------------------------------------------------------------------------------