Issues (26)

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