@@ -26,7 +26,7 @@ |
||
| 26 | 26 | { |
| 27 | 27 | // The very first step is to reorder the packages alphabetically. |
| 28 | 28 | // This is to ensure the same order every time, even between packages that are unrelated. |
| 29 | - usort($unorderedPackagesList, function (PackageInterface $packageA, PackageInterface $packageB) { |
|
| 29 | + usort($unorderedPackagesList, function(PackageInterface $packageA, PackageInterface $packageB) { |
|
| 30 | 30 | return strcmp($packageA->getName(), $packageB->getName()); |
| 31 | 31 | }); |
| 32 | 32 | |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | $this->assets[] = $operation->getAsset(); |
| 37 | 37 | } else { |
| 38 | 38 | // This is a remove! |
| 39 | - $this->assets = array_values(array_filter($this->assets, function (Asset $asset) use ($operation) { |
|
| 39 | + $this->assets = array_values(array_filter($this->assets, function(Asset $asset) use ($operation) { |
|
| 40 | 40 | return $asset->getValue() !== $operation->getAsset()->getValue(); |
| 41 | 41 | })); |
| 42 | 42 | } |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | // Let's order assets by priority. |
| 57 | - $this->stableSort($this->assets, function (Asset $asset1, Asset $asset2) { |
|
| 57 | + $this->stableSort($this->assets, function(Asset $asset1, Asset $asset2) { |
|
| 58 | 58 | return $asset2->getPriority() <=> $asset1->getPriority(); |
| 59 | 59 | }); |
| 60 | 60 | |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | */ |
| 130 | 130 | public function getValues() : array |
| 131 | 131 | { |
| 132 | - return array_map(function (Asset $asset) { |
|
| 132 | + return array_map(function(Asset $asset) { |
|
| 133 | 133 | return $asset->getValue(); |
| 134 | 134 | }, $this->getAssets()); |
| 135 | 135 | } |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | */ |
| 144 | 144 | public function jsonSerialize() |
| 145 | 145 | { |
| 146 | - return array_map(function (Asset $asset) { |
|
| 146 | + return array_map(function(Asset $asset) { |
|
| 147 | 147 | return $asset->jsonSerialize(); |
| 148 | 148 | }, $this->getAssets()); |
| 149 | 149 | } |
@@ -47,7 +47,7 @@ |
||
| 47 | 47 | */ |
| 48 | 48 | public static function fromArray(string $name, array $assetsArray) : ImmutableAssetType |
| 49 | 49 | { |
| 50 | - $assets = array_map(function (array $assetArray) { |
|
| 50 | + $assets = array_map(function(array $assetArray) { |
|
| 51 | 51 | return Asset::fromArray($assetArray); |
| 52 | 52 | }, $assetsArray); |
| 53 | 53 | return new self($name, $assets); |
@@ -33,7 +33,7 @@ |
||
| 33 | 33 | $output->writeln(sprintf('<error>Could not find the "%s" asset type.</error>', $assetTypeName)); |
| 34 | 34 | return; |
| 35 | 35 | } |
| 36 | - $assetTypes = [ $assetTypes[$assetTypeName] ]; |
|
| 36 | + $assetTypes = [$assetTypes[$assetTypeName]]; |
|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | switch ($input->getOption('format')) { |
@@ -112,7 +112,7 @@ |
||
| 112 | 112 | $simple = $this->asset->toSimpleArray(); |
| 113 | 113 | if ($this->operation === self::REMOVE) { |
| 114 | 114 | if (is_string($simple)) { |
| 115 | - $simple = [ 'value' => $simple ]; |
|
| 115 | + $simple = ['value' => $simple]; |
|
| 116 | 116 | } |
| 117 | 117 | $simple['action'] = self::REMOVE; |
| 118 | 118 | } |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | $assetTypes = $this->getAssetsBuilder()->findAssetTypes($compositeRepos); |
| 44 | 44 | |
| 45 | 45 | // Let's get an array of values, indexed by asset type (to store in the discovery_values.php file) |
| 46 | - $values = array_map(function (AssetType $assetType) { |
|
| 46 | + $values = array_map(function(AssetType $assetType) { |
|
| 47 | 47 | return $assetType->getValues(); |
| 48 | 48 | }, $assetTypes); |
| 49 | 49 | |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | return '.var_export($values, true).";\n"); |
| 52 | 52 | |
| 53 | 53 | // Let's get an array of assetTypes, indexed by asset type (to store in the discovery_asset_types.php file) |
| 54 | - $assetTypes = array_map(function (AssetType $assetType) { |
|
| 54 | + $assetTypes = array_map(function(AssetType $assetType) { |
|
| 55 | 55 | return $assetType->jsonSerialize(); |
| 56 | 56 | }, $assetTypes); |
| 57 | 57 | |
@@ -53,14 +53,14 @@ |
||
| 53 | 53 | // This has been observed when doing a "composer install" on an empty vendor directory. |
| 54 | 54 | // Let's ensure each package is represented only once. |
| 55 | 55 | $dedupPackages = []; |
| 56 | - foreach($unorderedPackagesList as $package) { |
|
| 56 | + foreach ($unorderedPackagesList as $package) { |
|
| 57 | 57 | $dedupPackages[$package->getName()] = $package; |
| 58 | 58 | } |
| 59 | 59 | $dedupPackages = array_values($dedupPackages); |
| 60 | 60 | |
| 61 | 61 | $orderedPackageList = PackagesOrderer::reorderPackages($dedupPackages); |
| 62 | 62 | |
| 63 | - $packages = array_filter($orderedPackageList, function (PackageInterface $package) { |
|
| 63 | + $packages = array_filter($orderedPackageList, function(PackageInterface $package) { |
|
| 64 | 64 | $packageInstallPath = $this->getInstallPath($package); |
| 65 | 65 | |
| 66 | 66 | return file_exists($packageInstallPath.'/discovery.json'); |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | { |
| 25 | 25 | $result = Discovery::getInstance()->get('test-asset'); |
| 26 | 26 | |
| 27 | - $this->assertSame([ 'a1', 'a2', 'b' ], $result); |
|
| 27 | + $this->assertSame(['a1', 'a2', 'b'], $result); |
|
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | public function testEmptyValues() |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | $io = new BufferIO(); |
| 21 | 21 | |
| 22 | 22 | $assetsBuilder = new AssetsBuilder($installationManager, $io, '.'); |
| 23 | - $assetTypes = $assetsBuilder->buildAssetTypes([ $packageA ]); |
|
| 23 | + $assetTypes = $assetsBuilder->buildAssetTypes([$packageA]); |
|
| 24 | 24 | |
| 25 | 25 | $this->assertCount(1, $assetTypes); |
| 26 | 26 | $this->assertArrayHasKey('test-asset', $assetTypes); |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | $io = new BufferIO(); |
| 37 | 37 | |
| 38 | 38 | $assetsBuilder = new AssetsBuilder($installationManager, $io, '.'); |
| 39 | - $assetTypes = $assetsBuilder->buildAssetTypes([ $packageA ]); |
|
| 39 | + $assetTypes = $assetsBuilder->buildAssetTypes([$packageA]); |
|
| 40 | 40 | |
| 41 | 41 | $this->assertCount(0, $assetTypes); |
| 42 | 42 | $this->assertNotEmpty($io->getOutput()); |