Skip to content

Commit d2d1cda

Browse files
committed
Merge branch 'main' of github.com:always-open/serp-api
2 parents dd6e775 + 33b94ac commit d2d1cda

File tree

5 files changed

+6
-7
lines changed

5 files changed

+6
-7
lines changed

src/DTOs/Google/ImmersiveProductResponse.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace AlwaysOpen\SerpApi\DTOs\Google;
44

5-
use Spatie\LaravelData\Attributes\DataCollectionOf;
65
use Spatie\LaravelData\Data;
76

87
class ImmersiveProductResponse extends Data

src/SerpApi.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
namespace AlwaysOpen\SerpApi;
44

5-
use Illuminate\Support\Arr;
6-
75
class SerpApi
86
{
97
public const string ENGINE_GOOGLE_IMMERSIVE_PRODUCT = 'google_immersive_product';

src/SerpApiClient.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@
1313
class SerpApiClient
1414
{
1515
protected string $apiKey;
16+
1617
protected string $baseUrl = 'https://serpapi.com/search';
1718

1819
public const string JSON_TYPE = 'json';
20+
1921
public const string HTML_TYPE = 'html';
2022

2123
public function __construct(
@@ -41,7 +43,7 @@ public function makeGetRequest(
4143

4244
$request = new Request(
4345
method: 'get',
44-
uri: $this->baseUrl . ".$responseType" . ($paramString ? '?' . $paramString : ''),
46+
uri: $this->baseUrl.".$responseType".($paramString ? '?'.$paramString : ''),
4547
);
4648

4749
/**
@@ -76,7 +78,7 @@ public function makeGoogleImmersiveProductRequest(
7678

7779
$response = $this->makeGetRequest($params, $responseType);
7880

79-
if (self::JSON_TYPE === $responseType) {
81+
if ($responseType === self::JSON_TYPE) {
8082
if ($asDto) {
8183
return ImmersiveProductResponse::from($response->json());
8284
}

src/SerpApiServiceProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public function register()
1818
public function boot()
1919
{
2020
$this->publishes([
21-
__DIR__ . '/../config/serp-api.php' => config_path('serp-api.php'),
21+
__DIR__.'/../config/serp-api.php' => config_path('serp-api.php'),
2222
__DIR__.'/../config/data.php' => config_path('data.php'),
2323
], 'config');
2424
}

test/Feature/SerpApiClientTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
namespace AlwaysOpen\SerpApi\Tests\Feature;
44

5-
use AlwaysOpen\SerpApi\Tests\BaseTest;
65
use AlwaysOpen\SerpApi\SerpApiClient;
6+
use AlwaysOpen\SerpApi\Tests\BaseTest;
77
use Illuminate\Support\Facades\Http;
88

99
class SerpApiClientTest extends BaseTest

0 commit comments

Comments
 (0)