PreAuthEvent   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 47
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 9
c 1
b 0
f 0
dl 0
loc 47
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A setResponse() 0 5 1
A getShop() 0 3 1
A __construct() 0 3 1
A getResponse() 0 3 1
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 when a shop requests authorization, before authorization begins.
10
 *
11
 * This event allows you to decline authorizing certain stores or redirect
12
 * to a more elaborate signup process.
13
 */
14
class PreAuthEvent extends Event
15
{
16
    const NAME = 'codecloud_shopify.pre_auth';
17
18
    /**
19
     * @var string
20
     */
21
    private $shop;
22
23
    /**
24
     * @var Response
25
     */
26
    private $response;
27
28
    /**
29
     * @param string $shop
30
     */
31
    public function __construct(string $shop)
32
    {
33
        $this->shop = $shop;
34
    }
35
36
    /**
37
     * @return string
38
     */
39
    public function getShop(): string
40
    {
41
        return $this->shop;
42
    }
43
44
    /**
45
     * @return Response
46
     */
47
    public function getResponse(): ?Response
48
    {
49
        return $this->response;
50
    }
51
52
    /**
53
     * @param Response $response
54
     * @return $this
55
     */
56
    public function setResponse(Response $response)
57
    {
58
        $this->response = $response;
59
60
        return $this;
61
    }
62
}
63