From 11f7a0293c45236c335669bd63df918f5e87df96 Mon Sep 17 00:00:00 2001 From: Konstantin Date: Mon, 7 Jan 2019 22:41:25 +0300 Subject: [PATCH] fix: rename setDestkopUserAgent() to setDesktopUserAgent() BREAKING CHANGE method renamed in UserAgentTrait update tests and docs --- README.md | 4 ++-- src/UserAgentTrait.php | 4 ++-- tests/RequestTest.php | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index cf8adaa..df970c1 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ $request = new Request($url); $request ->setDefaultSpeedOptions(true) ->setDownloadOnlyIf('text/html') - ->setDestkopUserAgent() + ->setDesktopUserAgent() ; $result = $request->exec(); if ($result instanceof \PiedWeb\Curl\Response) { @@ -57,7 +57,7 @@ $r ->setReferer(string $url) ->setUserAgent(string $ua) - ->setDestkopUserAgent() + ->setDesktopUserAgent() ->setMobileUserAgent() ->setLessJsUserAgent() diff --git a/src/UserAgentTrait.php b/src/UserAgentTrait.php index ffefb52..22c29dd 100644 --- a/src/UserAgentTrait.php +++ b/src/UserAgentTrait.php @@ -5,11 +5,11 @@ trait UserAgentTrait { /** - * An self::setUserAgent()'s alias to add an user-agent wich correspond to a Destkop PC. + * An self::setUserAgent()'s alias to add an user-agent wich correspond to a Desktop PC. * * @return self */ - public function setDestkopUserAgent() + public function setDesktopUserAgent() { $this->setUserAgent('Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:64.0) Gecko/20100101 Firefox/64.0'); diff --git a/tests/RequestTest.php b/tests/RequestTest.php index 0580145..5039365 100644 --- a/tests/RequestTest.php +++ b/tests/RequestTest.php @@ -17,7 +17,7 @@ public function testNotDownload() ->setDefaultGetOptions() ->setDownloadOnlyIf('html') ->setReturnHeader() - ->setDestkopUserAgent() + ->setDesktopUserAgent() ->setEncodingGzip() ; $result = $request->exec(); @@ -34,7 +34,7 @@ public function testEffectiveUrl() ->setDefaultGetOptions() ->setDownloadOnlyIf('html') ->setReturnHeader() - ->setDestkopUserAgent() + ->setDesktopUserAgent() ->setEncodingGzip() ; $result = $request->exec(); @@ -53,7 +53,7 @@ public function testCurlError() $request ->setDefaultGetOptions() ->setReturnHeader() - ->setDestkopUserAgent() + ->setDesktopUserAgent() ->setEncodingGzip() ; $result = $request->exec(); @@ -69,7 +69,7 @@ public function test404() $request ->setDefaultGetOptions() ->setDownloadOnlyIf('html') - ->setDestkopUserAgent() + ->setDesktopUserAgent() ->setEncodingGzip() ; $result = $request->exec();