Passed
Push — main ( 0d5649...d7c64d )
by Breno
01:51
created

EventManager::releaseEvents()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
1
<?php
2
declare(strict_types=1);
3
4
namespace OniBus\Event;
5
6
use OniBus\Utility\Singleton;
7
8
/**
9
 * @method static EventProvider instance()
10
 */
11
final class EventManager
12
{
13
    use Singleton;
14
15
    protected static function singleInstance(): EventProvider
16
    {
17
        return new EventProvider();
18
    }
19
20
    public static function recordEvent(Event ...$events): void
21
    {
22
        self::instance()->recordEvent(...$events);
23
    }
24
25
    /**
26
     * @return Event[]
27
     */
28
    public static function releaseEvents(): iterable
29
    {
30
        return self::instance()->releaseEvents();
0 ignored issues
show
Bug Best Practice introduced by
The expression return self::instance()->releaseEvents() returns the type Generator which is incompatible with the documented return type OniBus\Event\Event[].
Loading history...
31
    }
32
}
33