File tree 1 file changed +11
-10
lines changed
src/Drupal/Driver/Fields/Drupal8
1 file changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -11,21 +11,22 @@ class LinkHandler extends AbstractHandler {
11
11
* {@inheritdoc}
12
12
*/
13
13
public function expand ($ values ) {
14
- $ return = [];
14
+ $ return_values = [];
15
15
foreach ($ values as $ value ) {
16
16
// 'options' is required to be an array, otherwise the utility class
17
17
// Drupal\Core\Utility\UnroutedUrlAssembler::assemble() will complain.
18
- $ options = [];
19
- if (!empty ($ value [2 ])) {
20
- parse_str ($ value [2 ], $ options );
21
- }
22
- $ return [] = [
23
- 'options ' => $ options ,
24
- 'title ' => $ value [0 ],
25
- 'uri ' => $ value [1 ],
18
+ $ return_value = [
19
+ 'title ' => $ value ['title ' ] ?? $ value [0 ] ?? NULL ,
20
+ 'uri ' => $ value ['uri ' ] ?? $ value [1 ] ?? NULL ,
21
+ 'options ' => [],
26
22
];
23
+ $ options = $ value ['options ' ] ?? $ value [2 ] ?? NULL ;
24
+ if ($ options ) {
25
+ parse_str ($ options , $ return_value ['options ' ]);
26
+ }
27
+ $ return_values [] = $ return_value ;
27
28
}
28
- return $ return ;
29
+ return $ return_values ;
29
30
}
30
31
31
32
}
You can’t perform that action at this time.
0 commit comments