mirror of
https://github.com/composer/composer
synced 2025-05-09 00:22:53 +00:00
Fix CS (#11003)
This commit is contained in:
parent
6e205a0c84
commit
131da999ac
357 changed files with 5943 additions and 9174 deletions
|
@ -21,10 +21,10 @@ class PoolTest extends TestCase
|
|||
{
|
||||
$package = $this->getPackage('foo', '1');
|
||||
|
||||
$pool = $this->createPool(array($package));
|
||||
$pool = $this->createPool([$package]);
|
||||
|
||||
$this->assertEquals(array($package), $pool->whatProvides('foo'));
|
||||
$this->assertEquals(array($package), $pool->whatProvides('foo'));
|
||||
$this->assertEquals([$package], $pool->whatProvides('foo'));
|
||||
$this->assertEquals([$package], $pool->whatProvides('foo'));
|
||||
}
|
||||
|
||||
public function testWhatProvidesPackageWithConstraint(): void
|
||||
|
@ -32,20 +32,20 @@ class PoolTest extends TestCase
|
|||
$firstPackage = $this->getPackage('foo', '1');
|
||||
$secondPackage = $this->getPackage('foo', '2');
|
||||
|
||||
$pool = $this->createPool(array(
|
||||
$pool = $this->createPool([
|
||||
$firstPackage,
|
||||
$secondPackage,
|
||||
));
|
||||
]);
|
||||
|
||||
$this->assertEquals(array($firstPackage, $secondPackage), $pool->whatProvides('foo'));
|
||||
$this->assertEquals(array($secondPackage), $pool->whatProvides('foo', $this->getVersionConstraint('==', '2')));
|
||||
$this->assertEquals([$firstPackage, $secondPackage], $pool->whatProvides('foo'));
|
||||
$this->assertEquals([$secondPackage], $pool->whatProvides('foo', $this->getVersionConstraint('==', '2')));
|
||||
}
|
||||
|
||||
public function testPackageById(): void
|
||||
{
|
||||
$package = $this->getPackage('foo', '1');
|
||||
|
||||
$pool = $this->createPool(array($package));
|
||||
$pool = $this->createPool([$package]);
|
||||
|
||||
$this->assertSame($package, $pool->packageById(1));
|
||||
}
|
||||
|
@ -54,14 +54,13 @@ class PoolTest extends TestCase
|
|||
{
|
||||
$pool = $this->createPool();
|
||||
|
||||
$this->assertEquals(array(), $pool->whatProvides('foo'));
|
||||
$this->assertEquals([], $pool->whatProvides('foo'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<\Composer\Package\BasePackage>|null $packages
|
||||
* @return \Composer\DependencyResolver\Pool
|
||||
*/
|
||||
protected function createPool(?array $packages = array()): Pool
|
||||
protected function createPool(?array $packages = []): Pool
|
||||
{
|
||||
return new Pool($packages);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue