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(
6363 $ data = $ result ->toArray ();
6464
6565 $ 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 ' ])) {
6767 $ results = $ data ['web ' ]['results ' ];
6868 }
6969
7070 return array_values (array_map (static function (mixed $ result ): array {
71- if (!is_array ($ result )) {
71+ if (!\ is_array ($ result )) {
7272 return ['title ' => '' , 'description ' => '' , 'url ' => '' ];
7373 }
7474
7575 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 ' ] : '' ,
7979 ];
8080 }, $ results ));
8181 }
Original file line number Diff line number Diff line change 1515use Symfony \AI \Agent \Bridge \Brave \Brave ;
1616use Symfony \Component \HttpClient \MockHttpClient ;
1717use Symfony \Component \HttpClient \Response \JsonMockResponse ;
18- use Symfony \Component \HttpClient \Response \MockResponse ;
1918
2019final class BraveTest extends TestCase
2120{
You can’t perform that action at this time.
0 commit comments