22
33namespace Ziming \LaravelScrapingBee ;
44
5+ use Illuminate \Http \Client \ConnectionException ;
56use Illuminate \Http \Client \Response ;
67use Illuminate \Support \Facades \Http ;
78use Illuminate \Support \Traits \Conditionable ;
@@ -17,12 +18,12 @@ final class LaravelScrapingBee
1718 private array $ params = [];
1819 private array $ headers = [];
1920
20- public static function make (?string $ apiKey = null , ?int $ timeout = null ): self
21+ public static function make (#[\SensitiveParameter] ?string $ apiKey = null , ?int $ timeout = null ): self
2122 {
2223 return new self ($ apiKey , $ timeout );
2324 }
2425
25- public function __construct (?string $ apiKey = null , ?int $ timeout = null )
26+ public function __construct (#[\SensitiveParameter] ?string $ apiKey = null , ?int $ timeout = null )
2627 {
2728 // If somebody pass '' into the constructor, we should use '' as the api key
2829 // even if it doesn't make sense.
@@ -36,6 +37,9 @@ public function __construct(?string $apiKey = null, ?int $timeout = null)
3637 );
3738 }
3839
40+ /**
41+ * @throws ConnectionException
42+ */
3943 private function request (string $ method , string $ url , array $ data = [], string $ postContentType = 'application/x-www-form-urlencoded; charset=utf-8 ' ): Response
4044 {
4145 // https://www.scrapingbee.com/documentation/#encoding-url
0 commit comments