CreatingSubAccountEvent   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 43
rs 10
c 0
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getResponse() 0 2 1
A __construct() 0 2 1
A getCreatingSubAccount() 0 2 1
A getRequest() 0 2 1
1
<?php
2
3
/*
4
 * This file is part of the smsmode-bundle package.
5
 *
6
 * (c) 2019 WEBEWEB
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace WBW\Bundle\SmsModeBundle\Event;
13
14
use WBW\Library\SmsMode\Entity\CreatingSubAccountInterface;
15
use WBW\Library\SmsMode\Request\CreatingSubAccountRequest;
16
use WBW\Library\SmsMode\Response\CreatingSubAccountResponse;
17
18
/**
19
 * Creating sub-account event.
20
 *
21
 * @author webeweb <https://github.com/webeweb>
22
 * @package WBW\Bundle\SmsModeBundle\Event
23
 */
24
class CreatingSubAccountEvent extends AbstractEvent {
25
26
    /**
27
     * Event name.
28
     *
29
     * @var string
30
     */
31
    const EVENT_NAME = "wbw.smsmode.event.creating_sub_account";
32
33
    /**
34
     * Constructor.
35
     *
36
     * @param CreatingSubAccountInterface $creatingSubAccount The creating sub-account.
37
     */
38
    public function __construct(CreatingSubAccountInterface $creatingSubAccount) {
39
        parent::__construct(self::EVENT_NAME, $creatingSubAccount);
40
    }
41
42
    /**
43
     * Get the creating sub-account.
44
     *
45
     * @return CreatingSubAccountInterface|null Returns the creating sub-account.
46
     */
47
    public function getCreatingSubAccount(): ?CreatingSubAccountInterface {
48
        return $this->getEntity();
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->getEntity() could return the type WBW\Library\SmsMode\Entity\SmsModeEntityInterface which includes types incompatible with the type-hinted return WBW\Library\SmsMode\Enti...ubAccountInterface|null. Consider adding an additional type-check to rule them out.
Loading history...
49
    }
50
51
    /**
52
     * Get the creating sub-account request.
53
     *
54
     * @return CreatingSubAccountRequest|null Returns the creating sub-account request.
55
     */
56
    public function getRequest(): ?CreatingSubAccountRequest {
57
        return parent::getRequest();
0 ignored issues
show
Bug Best Practice introduced by
The expression return parent::getRequest() could return the type WBW\Library\SmsMode\Request\AbstractRequest which includes types incompatible with the type-hinted return WBW\Library\SmsMode\Requ...gSubAccountRequest|null. Consider adding an additional type-check to rule them out.
Loading history...
58
    }
59
60
    /**
61
     * Get the creating sub-account response.
62
     *
63
     * @return CreatingSubAccountResponse Returns the creating sub-account response.
64
     */
65
    public function getResponse(): ?CreatingSubAccountResponse {
66
        return parent::getResponse();
0 ignored issues
show
Bug Best Practice introduced by
The expression return parent::getResponse() could return the type WBW\Library\SmsMode\Response\AbstractResponse which includes types incompatible with the type-hinted return WBW\Library\SmsMode\Resp...SubAccountResponse|null. Consider adding an additional type-check to rule them out.
Loading history...
67
    }
68
}
69