zendesk / zendesk_api_client_php

Official Zendesk API v2 client library for PHP
336 stars 259 forks source link

\Zendesk\API\Resources\Core\Search::find has wrong parameter type annotation #462

Closed georgms closed 12 months ago

georgms commented 3 years ago

\Zendesk\API\Resources\Core\Search::find parameter $query has the type annotation null while it should clearly be string:

https://github.com/zendesk/zendesk_api_client_php/blob/13f0c1f299796cc271a2b84c7eda98b3ab0c97a9/src/Zendesk/API/Resources/Core/Search.php#L32

I came across this while validating a project with PHPStan.

pointybeard commented 2 years ago

Hit this one while running PHPStan also. Quick fix is to add a line like this to phpstan.neon.dist in the ignoreErrors segment:

  ignoreErrors:
    - '#Parameter \#1 \$query of method Zendesk\\API\\Resources\\Core\\Search::find\(\) expects null, string given.#'

Proper fix, of course, is to change * @param null $query to * @param string $query as mentioned.

pointybeard commented 2 years ago

Just popped through PR #486 for this one.