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: | public function __construct(?HttpClientInterface $client = null, ?History $history = null, ?CookieJar $cookieJar = null) |
13: | { |
14: | parent::__construct($client ?? new client(), $history, $cookieJar); |
15: | } |
16: | |
17: | public function setUserAgent(string $userAgent): void { |
18: | $this->setServerParameter('HTTP_USER_AGENT', $userAgent); |
19: | } |
20: | } |
21: | |