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

Fix many PHPStan issues and update baseline

This commit is contained in:
Jordi Boggiano 2021-12-09 22:14:04 +01:00
parent 6ed3aeb343
commit 96486d81cb
No known key found for this signature in database
GPG key ID: 7BBD42C429EC80BC
21 changed files with 252 additions and 361 deletions

View file

@ -59,15 +59,15 @@ class RepositoryManagerTest extends TestCase
* @param array<string, mixed> $options
* @param class-string<\Throwable>|null $exception
*/
public function testRepoCreation($type, $options, $exception = null)
public function testRepoCreation($type, $options, ?string $exception = null)
{
if ($exception) {
if ($exception !== null) {
self::expectException($exception);
}
$rm = new RepositoryManager(
$this->getMockBuilder('Composer\IO\IOInterface')->getMock(),
$config = $this->getMockBuilder('Composer\Config')->setMethods(array('get'))->getMock(),
$config = $this->getMockBuilder('Composer\Config')->onlyMethods(array('get'))->getMock(),
$this->getMockBuilder('Composer\Util\HttpDownloader')->disableOriginalConstructor()->getMock(),
$this->getMockBuilder('Composer\EventDispatcher\EventDispatcher')->disableOriginalConstructor()->getMock()
);
@ -119,7 +119,7 @@ class RepositoryManagerTest extends TestCase
{
$rm = new RepositoryManager(
$this->getMockBuilder('Composer\IO\IOInterface')->getMock(),
$config = $this->getMockBuilder('Composer\Config')->setMethods(array('get'))->getMock(),
$config = $this->getMockBuilder('Composer\Config')->onlyMethods(array('get'))->getMock(),
$this->getMockBuilder('Composer\Util\HttpDownloader')->disableOriginalConstructor()->getMock(),
$this->getMockBuilder('Composer\EventDispatcher\EventDispatcher')->disableOriginalConstructor()->getMock()
);