PostAuthEvent::getShop()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

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
rs 10
1
<?php
2
3
namespace CodeCloud\Bundle\ShopifyBundle\Event;
4
5
use Symfony\Component\EventDispatcher\Event;
6
use Symfony\Component\HttpFoundation\Response;
7
8
/**
9
 * Dispatched after a shop has been authorized to use the application.
10
 *
11
 * You can handle this event to handle the access token in whichever way your
12
 * authentication strategy requires. For example, store it in the session, or
13
 * pass it to a client.
14
 */
15
class PostAuthEvent extends Event
16
{
17
    const NAME = 'codecloud_shopify.post_auth';
18
19
    /**
20
     * @var string
21
     */
22
    private $shop;
23
24
    /**
25
     * @var string
26
     */
27
    private $accessToken;
28
29
    /**
30
     * @var Response
31
     */
32
    private $response;
33
34
    /**
35
     * @param string $shop
36
     * @param string $accessToken
37
     */
38
    public function __construct(string $shop, string $accessToken)
39
    {
40
        $this->shop = $shop;
41
        $this->accessToken = $accessToken;
42
    }
43
44
    /**
45
     * @return string
46
     */
47
    public function getShop(): string
48
    {
49
        return $this->shop;
50
    }
51
52
    /**
53
     * @return string
54
     */
55
    public function getAccessToken(): string
56
    {
57
        return $this->accessToken;
58
    }
59
60
    /**
61
     * @return Response
62
     */
63
    public function getResponse(): ?Response
64
    {
65
        return $this->response;
66
    }
67
68
    /**
69
     * @param Response $response
70
     * @return $this
71
     */
72
    public function setResponse(Response $response)
73
    {
74
        $this->response = $response;
75
76
        return $this;
77
    }
78
}
79