| 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\BreachInterface; |
||
| 15 | use WBW\Library\HaveIBeenPwned\Request\BreachRequest; |
||
| 16 | use WBW\Library\HaveIBeenPwned\Response\BreachesResponse; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * Breach event. |
||
| 20 | * |
||
| 21 | * @author webeweb <https://github.com/webeweb> |
||
| 22 | * @package WBW\Bundle\HaveIBeenPwnedBundle\Event |
||
| 23 | */ |
||
| 24 | class BreachEvent extends AbstractEvent { |
||
| 25 | |||
| 26 | /** |
||
| 27 | * Event name. |
||
| 28 | * |
||
| 29 | * @var string |
||
| 30 | */ |
||
| 31 | const EVENT_NAME = "wbw.haveibeenpwned.event.breach"; |
||
| 32 | |||
| 33 | /** |
||
| 34 | * Constructor. |
||
| 35 | * |
||
| 36 | * @param BreachInterface $entity The breach. |
||
| 37 | */ |
||
| 38 | public function __construct(BreachInterface $entity) { |
||
| 39 | parent::__construct(self::EVENT_NAME, $entity); |
||
| 40 | } |
||
| 41 | |||
| 42 | /** |
||
| 43 | * Get the breach. |
||
| 44 | * |
||
| 45 | * @return BreachInterface Returns the breach. |
||
| 46 | */ |
||
| 47 | public function getBreach(): BreachInterface { |
||
| 48 | return $this->getEntity(); |
||
|
0 ignored issues
–
show
Bug
Best Practice
introduced
by
Loading history...
|
|||
| 49 | } |
||
| 50 | |||
| 51 | /** |
||
| 52 | * Get the breach request. |
||
| 53 | * |
||
| 54 | * @return BreachRequest|null Returns the breach request. |
||
| 55 | */ |
||
| 56 | public function getRequest(): ?BreachRequest { |
||
| 57 | return parent::getRequest(); |
||
|
0 ignored issues
–
show
|
|||
| 58 | } |
||
| 59 | |||
| 60 | /** |
||
| 61 | * Get the breach response. |
||
| 62 | * |
||
| 63 | * @return BreachesResponse|null Returns the breaches response. |
||
| 64 | */ |
||
| 65 | public function getResponse(): ?BreachesResponse { |
||
| 66 | return parent::getResponse(); |
||
|
0 ignored issues
–
show
|
|||
| 67 | } |
||
| 68 | } |
||
| 69 |