From fdf6eba77fa7e46126db1fc4f3ca4008428087b7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 31 Mar 2024 15:54:04 +0200 Subject: [PATCH] tools(deps-dev): Update friendsofphp/php-cs-fixer requirement from v3.51.0 to v3.52.1 in /tools/php-cs-fixer (#469) * tools(deps-dev): Update friendsofphp/php-cs-fixer requirement Updates the requirements on [friendsofphp/php-cs-fixer](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer) to permit the latest version. - [Release notes](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/releases) - [Changelog](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/master/CHANGELOG.md) - [Commits](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/compare/v3.51.0...v3.52.1) --- updated-dependencies: - dependency-name: friendsofphp/php-cs-fixer dependency-type: direct:development ... Signed-off-by: dependabot[bot] * apply CS Signed-off-by: Jan Kowalleck --------- Signed-off-by: dependabot[bot] Signed-off-by: Jan Kowalleck Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jan Kowalleck --- HISTORY.md | 5 ++++ tests/Unit/MakeBom/BuilderTest.php | 44 +++++++++++++++--------------- tests/Unit/MakeBom/OptionsTest.php | 4 +-- tools/php-cs-fixer/composer.json | 2 +- 4 files changed, 30 insertions(+), 25 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index 716fdea0..68469f0d 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file. ## unreleased +* Style + * Applied latest PHP Coding Standards (via [#469]) + +[#469]: https://github.com/CycloneDX/cyclonedx-php-composer/pull/469 + ## 5.0.1 - 2024-02-05 * Style diff --git a/tests/Unit/MakeBom/BuilderTest.php b/tests/Unit/MakeBom/BuilderTest.php index 9282e94e..b412f98c 100644 --- a/tests/Unit/MakeBom/BuilderTest.php +++ b/tests/Unit/MakeBom/BuilderTest.php @@ -163,10 +163,10 @@ private static function assertComponentSymfonyLock(Models\Bom $sbom): void self::assertSame('pkg:composer/symfony/lock@v6.2.7', (string) $component->getPackageUrl()); $componentProperties = $component->getProperties()->getItems(); foreach ([ - 'cdx:composer:package:type' => ['library'], - 'cdx:composer:package:distReference' => ['febdeed9473e568ff34bf4350c04760f5357dfe2'], - 'cdx:composer:package:sourceReference' => ['febdeed9473e568ff34bf4350c04760f5357dfe2'], - ] as $propertyName => $expectedValues) { + 'cdx:composer:package:type' => ['library'], + 'cdx:composer:package:distReference' => ['febdeed9473e568ff34bf4350c04760f5357dfe2'], + 'cdx:composer:package:sourceReference' => ['febdeed9473e568ff34bf4350c04760f5357dfe2'], + ] as $propertyName => $expectedValues) { $fComponentPropertyValues = array_values(array_map( static fn ($p) => $p->getValue(), array_filter($componentProperties, static fn ($c) => $c->getName() === $propertyName))); @@ -174,9 +174,9 @@ private static function assertComponentSymfonyLock(Models\Bom $sbom): void } $extRefs = $component->getExternalReferences()->getItems(); foreach ([ - [Enums\ExternalReferenceType::Distribution, ['https://api.github.com/repos/symfony/lock/zipball/febdeed9473e568ff34bf4350c04760f5357dfe2']], - [Enums\ExternalReferenceType::VCS, ['https://github.com/symfony/lock.git', 'https://github.com/symfony/lock/tree/v6.2.7']], - ] as [$extRefType, $expectedUrls]) { + [Enums\ExternalReferenceType::Distribution, ['https://api.github.com/repos/symfony/lock/zipball/febdeed9473e568ff34bf4350c04760f5357dfe2']], + [Enums\ExternalReferenceType::VCS, ['https://github.com/symfony/lock.git', 'https://github.com/symfony/lock/tree/v6.2.7']], + ] as [$extRefType, $expectedUrls]) { $fExtRefUrls = array_values(array_map( static fn ($er) => $er->getUrl(), array_filter($extRefs, static fn ($er) => $er->getType() === $extRefType))); @@ -202,10 +202,10 @@ public static function assertComponentPsrLog(Models\Bom $sbom): void self::assertSame('pkg:composer/psr/log@3.0.0', (string) $component->getPackageUrl()); $componentProperties = $component->getProperties()->getItems(); foreach ([ - 'cdx:composer:package:type' => ['library'], - 'cdx:composer:package:distReference' => ['fe5ea303b0887d5caefd3d431c3e61ad47037001'], - 'cdx:composer:package:sourceReference' => ['fe5ea303b0887d5caefd3d431c3e61ad47037001'], - ] as $propertyName => $expectedValues) { + 'cdx:composer:package:type' => ['library'], + 'cdx:composer:package:distReference' => ['fe5ea303b0887d5caefd3d431c3e61ad47037001'], + 'cdx:composer:package:sourceReference' => ['fe5ea303b0887d5caefd3d431c3e61ad47037001'], + ] as $propertyName => $expectedValues) { $fComponentPropertyValues = array_values(array_map( static fn ($p) => $p->getValue(), array_filter($componentProperties, static fn ($c) => $c->getName() === $propertyName))); @@ -213,9 +213,9 @@ public static function assertComponentPsrLog(Models\Bom $sbom): void } $extRefs = $component->getExternalReferences()->getItems(); foreach ([ - [Enums\ExternalReferenceType::Distribution, ['https://api.github.com/repos/php-fig/log/zipball/fe5ea303b0887d5caefd3d431c3e61ad47037001']], - [Enums\ExternalReferenceType::VCS, ['https://github.com/php-fig/log.git', 'https://github.com/php-fig/log/tree/3.0.0']], - ] as [$extRefType, $expectedUrls]) { + [Enums\ExternalReferenceType::Distribution, ['https://api.github.com/repos/php-fig/log/zipball/fe5ea303b0887d5caefd3d431c3e61ad47037001']], + [Enums\ExternalReferenceType::VCS, ['https://github.com/php-fig/log.git', 'https://github.com/php-fig/log/tree/3.0.0']], + ] as [$extRefType, $expectedUrls]) { $fExtRefUrls = array_values(array_map( static fn ($er) => $er->getUrl(), array_filter($extRefs, static fn ($er) => $er->getType() === $extRefType))); @@ -239,9 +239,9 @@ private static function assertComponentCdxPlugin(Models\Bom $sbom): void self::assertSame('pkg:composer/cyclonedx/cyclonedx-php-composer@dev-master', (string) $component->getPackageUrl()); $componentProperties = $component->getProperties()->getItems(); foreach ([ - 'cdx:composer:package:isDevRequirement' => ['true'], - 'cdx:composer:package:type' => ['composer-plugin'], - ] as $propertyName => $expectedValues) { + 'cdx:composer:package:isDevRequirement' => ['true'], + 'cdx:composer:package:type' => ['composer-plugin'], + ] as $propertyName => $expectedValues) { $fComponentPropertyValues = array_values(array_map( static fn ($p) => $p->getValue(), array_filter($componentProperties, static fn ($c) => $c->getName() === $propertyName))); @@ -249,11 +249,11 @@ private static function assertComponentCdxPlugin(Models\Bom $sbom): void } $extRefs = $component->getExternalReferences()->getItems(); foreach ([ - [Enums\ExternalReferenceType::Distribution, ['../../../..']], - [Enums\ExternalReferenceType::VCS, ['https://github.com/CycloneDX/cyclonedx-php-composer/']], - [Enums\ExternalReferenceType::Website, ['https://github.com/CycloneDX/cyclonedx-php-composer/#readme']], - [Enums\ExternalReferenceType::IssueTracker, ['https://github.com/CycloneDX/cyclonedx-php-composer/issues']], - ] as [$extRefType, $expectedUrls]) { + [Enums\ExternalReferenceType::Distribution, ['../../../..']], + [Enums\ExternalReferenceType::VCS, ['https://github.com/CycloneDX/cyclonedx-php-composer/']], + [Enums\ExternalReferenceType::Website, ['https://github.com/CycloneDX/cyclonedx-php-composer/#readme']], + [Enums\ExternalReferenceType::IssueTracker, ['https://github.com/CycloneDX/cyclonedx-php-composer/issues']], + ] as [$extRefType, $expectedUrls]) { $fExtRefUrls = array_values(array_map( static fn ($er) => $er->getUrl(), array_filter($extRefs, static fn ($er) => $er->getType() === $extRefType))); diff --git a/tests/Unit/MakeBom/OptionsTest.php b/tests/Unit/MakeBom/OptionsTest.php index e46284bc..acf7801b 100644 --- a/tests/Unit/MakeBom/OptionsTest.php +++ b/tests/Unit/MakeBom/OptionsTest.php @@ -71,7 +71,7 @@ public static function dpProducesOption(): Generator foreach ([ 'XML' => Format::XML, 'JSON' => Format::JSON, - ] as $outputFormatIn => $outputFormat) { + ] as $outputFormatIn => $outputFormat) { yield "outputFormat $outputFormatIn" => [ '--output-format '.escapeshellarg($outputFormatIn), ['outputFormat' => $outputFormat], @@ -96,7 +96,7 @@ public static function dpProducesOption(): Generator '1.3' => Version::v1dot3, '1.2' => Version::v1dot2, '1.1' => Version::v1dot1, - ] as $specVersionIn => $specVersion) { + ] as $specVersionIn => $specVersion) { yield "specVersion '$specVersionIn'" => [ '--spec-version '.escapeshellarg($specVersionIn), ['specVersion' => $specVersion], diff --git a/tools/php-cs-fixer/composer.json b/tools/php-cs-fixer/composer.json index 8f714588..96f1fcee 100644 --- a/tools/php-cs-fixer/composer.json +++ b/tools/php-cs-fixer/composer.json @@ -3,7 +3,7 @@ "type": "metapackage", "description": "php-cs-fixer", "require-dev": { - "friendsofphp/php-cs-fixer": "v3.51.0", + "friendsofphp/php-cs-fixer": "v3.52.1", "roave/security-advisories": "dev-latest" }, "config": {