Reduce duplicate code in ApiDetailRetrieverTest
This patch streamlines the ApiDetailRetrieverTest:
- Add type hints all over the place, most notably a lot of "array" type hints.
- Extract duplicated code to private helper functions, most notably the newInstance() method.
- Remove not needed assertTrue( true ).
- Replace the ones that are needed with addToAssertionCount.
- Remove $this->any(). This is the default anyway.