Skip to content

Commit

Permalink
Browser class now has types
Browse files Browse the repository at this point in the history
  • Loading branch information
Athlon1600 committed Oct 31, 2023
1 parent 60a8e62 commit bb1a631
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/Browser.php
Expand Up @@ -7,17 +7,17 @@

class Browser extends BrowserClient
{
public function setUserAgent($agent)
public function setUserAgent($agent): void
{
$this->headers['User-Agent'] = $agent;
}

public function getUserAgent()
public function getUserAgent(): ?string
{
return Utils::arrayGet($this->headers, 'User-Agent');
}

public function followRedirects($enabled)
public function followRedirects($enabled): self
{
$this->options[CURLOPT_FOLLOWLOCATION] = $enabled ? 1 : 0;
return $this;
Expand All @@ -44,12 +44,12 @@ public function cachedGet($url)
return $response;
}

protected function getCacheKey($url)
protected function getCacheKey($url): string
{
return md5($url) . '_v3';
return md5($url) . '_v4';
}

public function consentCookies()
public function consentCookies(): void
{
$response = $this->get('https://www.youtube.com/');
$current_url = $response->info->url;
Expand Down

0 comments on commit bb1a631

Please sign in to comment.