Request   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
c 1
b 0
f 0
dl 0
loc 25
ccs 10
cts 10
cp 1
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A mpn() 0 3 1
A sku() 0 3 1
A store() 0 3 1
A call() 0 6 1
1
<?php
2
3
namespace Reviewsio\Endpoints\ProductReviewBySku;
4
5
use Reviewsio\Endpoints\AbstractEndpointRequest;
6
use Reviewsio\Endpoints\HasQueryPagination;
7
8
/**
9
 * https://api.reviews.io/documentation/index.html#api-Product_Reviews-List_Reviews_for_Product
10
 */
11
class Request extends AbstractEndpointRequest
12
{
13
    use HasQueryPagination;
14
15 1
    public function store(string $store): static
16
    {
17 1
        return $this->addParameterToQuery('store', $store);
18
    }
19
20 2
    public function sku(string $sku): static
21
    {
22 2
        return $this->addParameterToQuery('sku', $sku);
23
    }
24
25 1
    public function mpn(string $mpn): static
26
    {
27 1
        return $this->addParameterToQuery('mpn', $mpn);
28
    }
29
30 2
    public function call(array $options = []): Response
31
    {
32 2
        $this->withQuery($options);
33 2
        $response = $this->client->pendingRequest()->get('product/review', array_merge($this->query(), $options));
34
35 2
        return new Response($response);
36
    }
37
}
38