Issues (26)

Event/PasteAccountEvent.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\PasteAccountInterface;
15
use WBW\Library\HaveIBeenPwned\Request\PasteAccountRequest;
16
use WBW\Library\HaveIBeenPwned\Response\PastesResponse;
17
18
/**
19
 * Paste account event.
20
 *
21
 * @author webeweb <https://github.com/webeweb>
22
 * @package WBW\Bundle\HaveIBeenPwnedBundle\Event
23
 */
24
class PasteAccountEvent extends AbstractEvent {
25
26
    /**
27
     * Event name.
28
     *
29
     * @var string
30
     */
31
    const EVENT_NAME = "wbw.haveibeenpwned.event.paste_account";
32
33
    /**
34
     * Constructor.
35
     *
36
     * @param PasteAccountInterface $entity The paste account.
37
     */
38
    public function __construct(PasteAccountInterface $entity) {
39
        parent::__construct(self::EVENT_NAME, $entity);
40
    }
41
42
    /**
43
     * Get the paste account.
44
     *
45
     * @return PasteAccountInterface Returns the paste account.
46
     */
47
    public function getPasteAccount(): PasteAccountInterface {
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...y\PasteAccountInterface.
Loading history...
49
    }
50
51
    /**
52
     * Get the paste account request.
53
     *
54
     * @return PasteAccountRequest|null Returns the paste account request.
55
     */
56
    public function getRequest(): ?PasteAccountRequest {
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...asteAccountRequest|null.
Loading history...
58
    }
59
60
    /**
61
     * Get the pastes response.
62
     *
63
     * @return PastesResponse|null Returns the pastes response.
64
     */
65
    public function getResponse(): ?PastesResponse {
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...nse\PastesResponse|null.
Loading history...
67
    }
68
}
69