Issues (26)

Event/BreachedAccountEvent.php (3 issues)

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\BreachedAccountInterface;
15
use WBW\Library\HaveIBeenPwned\Request\BreachedAccountRequest;
16
use WBW\Library\HaveIBeenPwned\Response\BreachesResponse;
17
18
/**
19
 * Breached account event.
20
 *
21
 * @author webeweb <https://github.com/webeweb>
22
 * @package WBW\Bundle\HaveIBeenPwnedBundle\Event
23
 */
24
class BreachedAccountEvent extends AbstractEvent {
25
26
    /**
27
     * Event name.
28
     *
29
     * @var string
30
     */
31
    const EVENT_NAME = "wbw.haveibeenpwned.event.breached_account";
32
33
    /**
34
     * Constructor.
35
     *
36
     * @param BreachedAccountInterface $entity The breached account.
37
     */
38
    public function __construct(BreachedAccountInterface $entity) {
39
        parent::__construct(self::EVENT_NAME, $entity);
40
    }
41
42
    /**
43
     * Get the breached account.
44
     *
45
     * @return BreachedAccountInterface Returns the breached account.
46
     */
47
    public function getBreachedAccount(): BreachedAccountInterface {
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...reachedAccountInterface.
Loading history...
49
    }
50
51
    /**
52
     * Get the breached account request.
53
     *
54
     * @return BreachedAccountRequest|null Returns the breached account request.
55
     */
56
    public function getRequest(): ?BreachedAccountRequest {
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...chedAccountRequest|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