Commit 4908dfe 1 parent 5b5de9d commit 4908dfe Copy full SHA for 4908dfe
File tree 2 files changed +10
-10
lines changed
Infrastructure/Repository
2 files changed +10
-10
lines changed Original file line number Diff line number Diff line change 5
5
namespace Fau \DegreeProgram \Common \Domain ;
6
6
7
7
/**
8
- * @psalm-type CampoKeysMap = array<value-of<self::SUPPORTED_CAMPO_KEYS>, string>
8
+ * @psalm-type CampoKeysMap = array<value-of<self::SUPPORTED_CAMPO_KEYS>, array<int, string>| string>
9
9
*/
10
10
final class CampoKeys
11
11
{
12
12
public const SCHEMA = [
13
13
'type ' => 'object ' ,
14
14
'properties ' => [
15
15
DegreeProgram::DEGREE => [
16
- 'type ' => 'string ' ,
16
+ 'type ' => 'array ' ,
17
17
],
18
18
DegreeProgram::AREA_OF_STUDY => [
19
- 'type ' => 'string ' ,
19
+ 'type ' => 'array ' ,
20
20
],
21
21
DegreeProgram::LOCATION => [
22
- 'type ' => 'string ' ,
22
+ 'type ' => 'array ' ,
23
23
],
24
24
],
25
25
];
@@ -28,13 +28,13 @@ final class CampoKeys
28
28
'type ' => 'object ' ,
29
29
'properties ' => [
30
30
DegreeProgram::DEGREE => [
31
- 'type ' => 'string ' ,
31
+ 'type ' => 'array ' ,
32
32
],
33
33
DegreeProgram::AREA_OF_STUDY => [
34
- 'type ' => 'string ' ,
34
+ 'type ' => 'array ' ,
35
35
],
36
36
DegreeProgram::LOCATION => [
37
- 'type ' => 'string ' ,
37
+ 'type ' => 'array ' ,
38
38
],
39
39
],
40
40
];
Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ public function degreeProgramCampoKeys(DegreeProgramId $degreeProgramId): CampoK
51
51
continue ;
52
52
}
53
53
54
- $ map [$ campoKeyType ] = $ campoKey ;
54
+ $ map [$ campoKeyType ][ $ term -> term_id ] = $ campoKey ;
55
55
}
56
56
57
57
return CampoKeys::fromArray ($ map );
@@ -69,9 +69,9 @@ public function taxonomyToTermsMapFromCampoKeys(CampoKeys $campoKeys): array
69
69
$ campoKeys = $ campoKeys ->asArray ();
70
70
71
71
foreach (self ::TAXONOMY_TO_CAMPO_KEY_MAP as $ taxonomy => $ campoKeyType ) {
72
- $ campoKey = $ campoKeys [$ campoKeyType ] ?? '' ;
72
+ $ campoKey = $ campoKeys [$ campoKeyType ] ?? null ;
73
73
74
- if ($ campoKey === '' ) {
74
+ if (! is_string ( $ campoKey ) || $ campoKey === '' ) {
75
75
continue ;
76
76
}
77
77
You can’t perform that action at this time.
0 commit comments