lesstif / php-jira-rest-client

PHP classes interact Jira with the REST API.
Other
510 stars 263 forks source link

$project->setLead() expects array even thought it should be array #421

Closed LordSimal closed 2 years ago

LordSimal commented 2 years ago

According to https://github.com/lesstif/php-jira-rest-client#create-project creating a project works via

    $p = new Project();

    $p->setKey('EX')
        ....
        ->setLead('lesstif')
        ....;

which results in PHPStorm showing the following warning:

image

because inside the project class your phpdoc expect the given parameter to be an array, not a string. https://github.com/lesstif/php-jira-rest-client/blob/main/src/Project/Project.php#L206

I couldn't find an example where setLead() uses an array nor did I find a test using it like it is defined in the phpdoc.

I will create a PR which changes that to string so static analysis tools like phpstan or pslam don't complain.