Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
3 / 3
CRAP
100.00% covered (success)
100.00%
1 / 1
InternalEvent
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
3 / 3
3
100.00% covered (success)
100.00%
1 / 1
 getEventMetadata
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setListeners
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
 getListeners
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2/**
3 * This file is part of the sshilko/php-sql-mydb package.
4 *
5 * (c) Sergei Shilko <contact@sshilko.com>
6 *
7 * MIT License
8 *
9 * For the full copyright and license information, please view the LICENSE
10 * file that was distributed with this source code.
11 * @license https://opensource.org/licenses/mit-license.php MIT
12 */
13
14declare(strict_types = 1);
15
16namespace sql\MydbEvent;
17
18use sql\MydbEvent;
19use sql\MydbEventInterface;
20
21class InternalEvent extends MydbEvent
22{
23
24    /**
25     * @psalm-var array<\sql\MydbListenerInterface>
26     */
27    protected array $listeners = [];
28
29    /**
30     * @psalm-var array<array-key, mixed>|null
31     */
32    protected ?array $data = null;
33
34    public function getEventMetadata(): ?array
35    {
36        return $this->data;
37    }
38
39    /**
40     * @psalm-param array<\sql\MydbListenerInterface> $listeners
41     */
42    public function setListeners(array $listeners): MydbEventInterface
43    {
44        $this->listeners = $listeners;
45
46        return $this;
47    }
48
49    /**
50     * @psalm-return array<\sql\MydbListenerInterface>
51     */
52    protected function getListeners(): array
53    {
54        return $this->listeners;
55    }
56}