BreachesEvent::getResponse()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 2
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
/*
4
 * This file is part of the haveibeenpwned-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\HaveIBeenPwnedBundle\Event;
13
14
use WBW\Library\HaveIBeenPwned\Entity\BreachesInterface;
15
use WBW\Library\HaveIBeenPwned\Request\BreachesRequest;
16
use WBW\Library\HaveIBeenPwned\Response\BreachesResponse;
17
18
/**
19
 * Breaches event.
20
 *
21
 * @author webeweb <https://github.com/webeweb>
22
 * @package WBW\Bundle\HaveIBeenPwnedBundle\Event
23
 */
24
class BreachesEvent extends AbstractEvent {
25
26
    /**
27
     * Event name.
28
     *
29
     * @var string
30
     */
31
    const EVENT_NAME = "wbw.haveibeenpwned.event.breaches";
32
33
    /**
34
     * Constructor.
35
     *
36
     * @param BreachesInterface $entity The breaches.
37
     */
38
    public function __construct(BreachesInterface $entity) {
39
        parent::__construct(self::EVENT_NAME, $entity);
40
    }
41
42
    /**
43
     * Get the breaches.
44
     *
45
     * @return BreachesInterface Returns the breaches.
46
     */
47
    public function getBreaches(): BreachesInterface {
48
        return $this->getEntity();
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->getEntity() returns the type WBW\Library\HaveIBeenPwn...eenPwnedEntityInterface which includes types incompatible with the type-hinted return WBW\Library\HaveIBeenPwn...ntity\BreachesInterface.
Loading history...
49
    }
50
51
    /**
52
     * Get the breaches request.
53
     *
54
     * @return BreachesRequest|null Returns the breaches request.
55
     */
56
    public function getRequest(): ?BreachesRequest {
57
        return parent::getRequest();
0 ignored issues
show
Bug Best Practice introduced by
The expression return parent::getRequest() returns the type WBW\Library\HaveIBeenPwned\Request\AbstractRequest which includes types incompatible with the type-hinted return WBW\Library\HaveIBeenPwn...st\BreachesRequest|null.
Loading history...
58
    }
59
60
    /**
61
     * Get the breaches response.
62
     *
63
     * @return BreachesResponse|null Returns the breaches response.
64
     */
65
    public function getResponse(): ?BreachesResponse {
66
        return parent::getResponse();
0 ignored issues
show
Bug Best Practice introduced by
The expression return parent::getResponse() returns the type WBW\Library\HaveIBeenPwn...sponse\AbstractResponse which includes types incompatible with the type-hinted return WBW\Library\HaveIBeenPwn...e\BreachesResponse|null.
Loading history...
67
    }
68
}
69