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
|
@ -32,7 +32,6 @@ class PoolOptimizerTest extends TestCase
|
|||
* @param mixed[] $requestData
|
||||
* @param BasePackage[] $packagesBefore
|
||||
* @param BasePackage[] $expectedPackages
|
||||
* @param string $message
|
||||
*/
|
||||
public function testPoolOptimizer(array $requestData, array $packagesBefore, array $expectedPackages, string $message): void
|
||||
{
|
||||
|
@ -74,7 +73,7 @@ class PoolOptimizerTest extends TestCase
|
|||
public function provideIntegrationTests(): array
|
||||
{
|
||||
$fixturesDir = realpath(__DIR__.'/Fixtures/pooloptimizer/');
|
||||
$tests = array();
|
||||
$tests = [];
|
||||
foreach (new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($fixturesDir), \RecursiveIteratorIterator::LEAVES_ONLY) as $file) {
|
||||
$file = (string) $file;
|
||||
|
||||
|
@ -92,7 +91,7 @@ class PoolOptimizerTest extends TestCase
|
|||
die(sprintf('Test "%s" is not valid: '.$e->getMessage(), str_replace($fixturesDir.'/', '', $file)));
|
||||
}
|
||||
|
||||
$tests[basename($file)] = array($requestData, $packagesBefore, $expectedPackages, $message);
|
||||
$tests[basename($file)] = [$requestData, $packagesBefore, $expectedPackages, $message];
|
||||
}
|
||||
|
||||
return $tests;
|
||||
|
@ -106,15 +105,15 @@ class PoolOptimizerTest extends TestCase
|
|||
$tokens = Preg::split('#(?:^|\n*)--([A-Z-]+)--\n#', file_get_contents($file), -1, PREG_SPLIT_DELIM_CAPTURE);
|
||||
|
||||
/** @var array<string, bool> $sectionInfo */
|
||||
$sectionInfo = array(
|
||||
$sectionInfo = [
|
||||
'TEST' => true,
|
||||
'REQUEST' => true,
|
||||
'POOL-BEFORE' => true,
|
||||
'POOL-AFTER' => true,
|
||||
);
|
||||
];
|
||||
|
||||
$section = null;
|
||||
$data = array();
|
||||
$data = [];
|
||||
foreach ($tokens as $i => $token) {
|
||||
if (null === $section && empty($token)) {
|
||||
continue; // skip leading blank
|
||||
|
@ -157,7 +156,7 @@ class PoolOptimizerTest extends TestCase
|
|||
*/
|
||||
private function reducePackagesInfoForComparison(array $packages): array
|
||||
{
|
||||
$packagesInfo = array();
|
||||
$packagesInfo = [];
|
||||
|
||||
foreach ($packages as $package) {
|
||||
$packagesInfo[] = $package->getName() . '@' . $package->getVersion() . ($package instanceof AliasPackage ? ' (alias of '.$package->getAliasOf()->getVersion().')' : '');
|
||||
|
@ -174,7 +173,7 @@ class PoolOptimizerTest extends TestCase
|
|||
*/
|
||||
private function loadPackages(array $packagesData): array
|
||||
{
|
||||
$packages = array();
|
||||
$packages = [];
|
||||
|
||||
foreach ($packagesData as $packageData) {
|
||||
$packages[] = $package = $this->loadPackage($packageData);
|
||||
|
@ -188,7 +187,6 @@ class PoolOptimizerTest extends TestCase
|
|||
|
||||
/**
|
||||
* @param mixed[] $packageData
|
||||
* @return BasePackage
|
||||
*/
|
||||
private function loadPackage(array $packageData): BasePackage
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue