1: <?php
2:
3: namespace ngatngay\http;
4:
5: use Symfony\Component\BrowserKit\HttpBrowser;
6: use Symfony\Component\BrowserKit\History;
7: use Symfony\Component\BrowserKit\CookieJar;
8: use Symfony\Contracts\HttpClient\HttpClientInterface;
9:
10: class browser extends HttpBrowser
11: {
12: /**
13: * @param HttpClientInterface|null $client
14: * @param History|null $history
15: * @param CookieJar|null $cookieJar
16: */
17: public function __construct($client = null, $history = null, $cookieJar = null)
18: {
19: parent::__construct($client ?? new client(), $history, $cookieJar); // @phpstan-ignore-line
20: }
21:
22: /**
23: * @param string $userAgent
24: * @return void
25: */
26: public function setUserAgent($userAgent) {
27: $this->setServerParameter('HTTP_USER_AGENT', $userAgent);
28: }
29: }
30: