jeremyvii / vs-docblockr

DocBlockr for Visual Studio Code
GNU Lesser General Public License v3.0
21 stars 8 forks source link

PHP ignores next parameter without type #60

Closed jeremyvii closed 4 years ago

jeremyvii commented 4 years ago

Describe the bug If the first function parameter has a type and the second parameter doesn't, the latter is ignored in PHP.

Expected behavior

<?php
/**
 * [test description]
 *
 * @param int $foo
 *   [$foo description]
 * @param [type] $bar
 *   [$bar description]
 *
 * @return [type]
 *   [return description]
 */
function test(int $foo,  $bar) {
}

Code Snippet

<?php
/**
 * [test description]
 *
 * @param int $bar
 *   [$bar description]
 *
 * @return [type]
 *   [return description]
 */
function test(int $foo,  $bar) {

}

Enviroment (please complete the following information):

jeremyvii commented 4 years ago

I am betting it is because this function isn't resetting expectParameterType flag after adding the name https://github.com/jeremyvii/vs-docblockr/blob/master/src/languages/php.ts#L221