Passed
Push — master ( 38cf41...2af3c5 )
by Hirofumi
02:50
created

BaseResourceOwner::getShopName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Shippinno\Base\OAuth2\Client\Provider;
4
5
use League\OAuth2\Client\Provider\ResourceOwnerInterface;
6
7
class BaseResourceOwner implements ResourceOwnerInterface
8
{
9
    /**
10
     * Raw response
11
     *
12
     * @var array
13
     */
14
    protected $response;
15
16
    /**
17
     * @param array $response
18
     */
19 1
    public function __construct(array $response)
20
    {
21 1
        $this->response = $response;
22 1
    }
23
24
    /**
25
     * Returns the identifier of the authorized resource owner.
26
     *
27
     * @return string
28
     */
29 1
    public function getId()
30
    {
31 1
        return $this->response['user']['shop_id'];
32
    }
33
34
    /**
35
     * Returns the shop name.
36
     *
37
     * @return string
38
     */
39 1
    public function getShopName()
40
    {
41 1
        return $this->response['user']['shop_name'];
42
    }
43
44
    /**
45
     * Return all of the owner details available as an array.
46
     *
47
     * @return array
48
     */
49 1
    public function toArray()
50
    {
51 1
        return $this->response;
52
    }
53
}
54