Response::entityKey()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
3
namespace Reviewsio\Endpoints\ProductReviewBySku;
4
5
use Illuminate\Support\Collection;
6
use Reviewsio\Endpoints\AbstractEndpointResponse;
7
use Reviewsio\Endpoints\HasResponsePagination;
8
9
class Response extends AbstractEndpointResponse
10
{
11
    use HasResponsePagination;
12
13 1
    public function storeName(): string
14
    {
15 1
        return (string) $this->baseResponse()->json('store.name');
16
    }
17
18 1
    public function storeLogo(): string
19
    {
20 1
        return (string) $this->baseResponse()->json('store.logo');
21
    }
22
23 1
    public function averageRating(): float
24
    {
25 1
        return (float) $this->baseResponse()->json('stats.average', 0);
26
    }
27
28 1
    public function count(): int
29
    {
30 1
        return (int) $this->baseResponse()->json('stats.count', 0);
31
    }
32
33 1
    public function reviews(): Collection
34
    {
35 1
        return collect($this->items());
36
    }
37
38 1
    protected function entityKey(): string
39
    {
40 1
        return 'reviews';
41
    }
42
}
43