File tree Expand file tree Collapse file tree 1 file changed +3
-16
lines changed
src/agent/src/Bridge/Brave Expand file tree Collapse file tree 1 file changed +3
-16
lines changed Original file line number Diff line number Diff line change @@ -62,21 +62,8 @@ public function __invoke(
6262
6363 $ data = $ result ->toArray ();
6464
65- $ results = [];
66- if (isset ($ data ['web ' ]) && \is_array ($ data ['web ' ]) && isset ($ data ['web ' ]['results ' ]) && \is_array ($ data ['web ' ]['results ' ])) {
67- $ results = $ data ['web ' ]['results ' ];
68- }
69-
70- return array_values (array_map (static function (mixed $ result ): array {
71- if (!\is_array ($ result )) {
72- return ['title ' => '' , 'description ' => '' , 'url ' => '' ];
73- }
74-
75- return [
76- 'title ' => \is_string ($ result ['title ' ] ?? null ) ? $ result ['title ' ] : '' ,
77- 'description ' => \is_string ($ result ['description ' ] ?? null ) ? $ result ['description ' ] : '' ,
78- 'url ' => \is_string ($ result ['url ' ] ?? null ) ? $ result ['url ' ] : '' ,
79- ];
80- }, $ results ));
65+ return array_map (static function (array $ result ) {
66+ return ['title ' => $ result ['title ' ], 'description ' => $ result ['description ' ], 'url ' => $ result ['url ' ]];
67+ }, $ data ['web ' ]['results ' ] ?? []);
8168 }
8269}
You can’t perform that action at this time.
0 commit comments