services: Do not use deprecated ReflectionType::__toString() in tests
The \MediaWikiServicesTest::provideGetService() PHPUnit data provider
method uses the ReflectionType::__toString() method to obtain the
return type of service instantiator callables as a string.
In PHP 7.4, calling this method generates an E_DEPRECATED notice.
The solution is to use ReflectionType::getName() instead, available
since PHP 7.1.[1]
This patch updates the method to use ReflectionType::getName()
if it is available, and fall back to ReflectionType::__toString()
otherwise.
---
[1] https://github.com/php/php-src/blob/php-7.4.0RC1/UPGRADING#L395
Bug: T233012
Change-Id: I69b97f75795e6c4e005bf1a23fb798f7e52da2fd