Skip to content

Commit a266675

Browse files
authored
[Bug] AssetMetaData language and name are switched (#218)
* fix: metadata fields are listed as field name and language * use better variable naming * fix failing test issues
1 parent e9d1545 commit a266675

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

.github/workflows/static-analysis.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060

6161
- name: "Upload baseline file"
6262
if: ${{ failure() }}
63-
uses: actions/upload-artifact@v2
63+
uses: actions/upload-artifact@v4
6464
with:
6565
name: phpstan-baseline.neon
6666
path: phpstan-baseline.neon

composer.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
"symfony/messenger": "^6.4"
2727
},
2828
"require-dev": {
29-
"roave/security-advisories": "dev-latest",
3029
"codeception/codeception": "^5.0.10",
3130
"codeception/phpunit-wrapper": "^9",
3231
"codeception/module-asserts": "^2",

src/Service/Serializer/Denormalizer/Search/AssetSearchResultDenormalizer.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,11 @@ private function hydrateMetadata(array $standardFields): array
8484
{
8585
$result = [];
8686

87-
foreach ($standardFields as $language => $fields) {
88-
foreach ($fields as $fieldName => $fieldData) {
89-
87+
foreach ($standardFields as $fieldName => $data) {
88+
foreach ($data as $languageKey => $fieldData) {
9089
$result[] = new AssetMetaData(
9190
name: $fieldName,
92-
language: $language !== MappingProperty::NOT_LOCALIZED_KEY ? $language : null,
91+
language: $languageKey !== MappingProperty::NOT_LOCALIZED_KEY ? $languageKey : null,
9392
data: $fieldData,
9493
);
9594
}

0 commit comments

Comments
 (0)