File tree Expand file tree Collapse file tree 2 files changed +5
-6
lines changed
src/agent/src/Bridge/Brave Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -63,19 +63,19 @@ public function __invoke(
63
63
$ data = $ result ->toArray ();
64
64
65
65
$ results = [];
66
- if (isset ($ data ['web ' ]) && is_array ($ data ['web ' ]) && isset ($ data ['web ' ]['results ' ]) && is_array ($ data ['web ' ]['results ' ])) {
66
+ if (isset ($ data ['web ' ]) && \ is_array ($ data ['web ' ]) && isset ($ data ['web ' ]['results ' ]) && \ is_array ($ data ['web ' ]['results ' ])) {
67
67
$ results = $ data ['web ' ]['results ' ];
68
68
}
69
69
70
70
return array_values (array_map (static function (mixed $ result ): array {
71
- if (!is_array ($ result )) {
71
+ if (!\ is_array ($ result )) {
72
72
return ['title ' => '' , 'description ' => '' , 'url ' => '' ];
73
73
}
74
74
75
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 ' ] : '' ,
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
79
];
80
80
}, $ results ));
81
81
}
Original file line number Diff line number Diff line change 15
15
use Symfony \AI \Agent \Bridge \Brave \Brave ;
16
16
use Symfony \Component \HttpClient \MockHttpClient ;
17
17
use Symfony \Component \HttpClient \Response \JsonMockResponse ;
18
- use Symfony \Component \HttpClient \Response \MockResponse ;
19
18
20
19
final class BraveTest extends TestCase
21
20
{
You can’t perform that action at this time.
0 commit comments