1
0
Fork 0
mirror of https://github.com/composer/composer synced 2025-05-10 00:53:06 +00:00

Add parameter types to all the things

This commit is contained in:
Jordi Boggiano 2022-02-22 16:47:09 +01:00
parent c9baeda95b
commit 6da38f83a0
No known key found for this signature in database
GPG key ID: 7BBD42C429EC80BC
279 changed files with 1377 additions and 1504 deletions

View file

@ -77,7 +77,7 @@ class ProxyManagerTest extends TestCase
* @param bool $expectedSecure
* @param string $expectedMessage
*/
public function testGetProxyForRequest($server, $url, $expectedUrl, $expectedOptions, $expectedSecure, $expectedMessage): void
public function testGetProxyForRequest(array $server, string $url, string $expectedUrl, array $expectedOptions, bool $expectedSecure, string $expectedMessage): void
{
$_SERVER = array_merge($_SERVER, $server);
$proxyManager = ProxyManager::getInstance();
@ -136,10 +136,8 @@ class ProxyManagerTest extends TestCase
* @dataProvider dataStatus
*
* @param array<string, mixed> $server
* @param bool $expectedStatus
* @param string $expectedMessage
*/
public function testGetStatus($server, $expectedStatus, $expectedMessage): void
public function testGetStatus(array $server, bool $expectedStatus, ?string $expectedMessage): void
{
$_SERVER = array_merge($_SERVER, $server);
$proxyManager = ProxyManager::getInstance();
@ -148,7 +146,7 @@ class ProxyManagerTest extends TestCase
$this->assertSame($expectedStatus, $status);
if ($expectedMessage) {
if ($expectedMessage !== null) {
$condition = stripos($message, $expectedMessage) !== false;
} else {
$condition = $expectedMessage === $message;