Warning on Result constructor
Argument 1 passed to chobie\Jira\Api\Result::__construct() must be of the type array, null given, called in /Jira/Api.php on line 748 and defined
I think this happens in https://github.com/chobie/jira-api-restclient/blob/master/src/Jira/Api.php#L748:
return new Result($json);
The $json is not an array because some results are null for example for:
Api->search() called by Walker.php if nothing is found.
That is quite strange considering, that Walker is used a lot and nobody haven't reported any warning so far.
Are you sure this isn't because of an error on JIRA side, that haven't resulted in exception and popped back up as a warning?
I recently started getting tons of this very error. We did migrate Jira to a different infrastructure, so it might be related.
@lookyman , can you please attach some stack trace if possible from place where that warning happens?
I've added array typehint to Result class constructor in 4812b0f1fb9817b62e304e4c3200b0269137b151 because constructor itself was threating data as an array in the first place. It seems, that some of JIRA calls wrapped with Result class doesn't return array as they should.
Also there might be an error during JSON decoding of JIRA response that causes null to happen.
I'm OK with removing typehint, but I need few cases where this would help so that test suite can be updated.
I'll look into it.