Completed
Pull Request — master (#410)
by Anton
06:09
created

EventManager::initInstance()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * Bluz Framework Component
4
 *
5
 * @copyright Bluz PHP Team
6
 * @link https://github.com/bluzphp/framework
7
 */
8
9
declare(strict_types=1);
10
11
namespace Bluz\Proxy;
12
13
use Bluz\EventManager\EventManager as Instance;
14
15
/**
16
 * Proxy to EventManager
17
 *
18
 * Example of usage
19
 * <code>
20
 *     use Bluz\Proxy\EventManager;
21
 *
22
 *     EvenManager::attach('event name', function() {
23
 *         // ... some logic
24
 *     });
25
 *
26
 *     EventManager::trigger('event name');
27
 * </code>
28
 *
29
 * @package  Bluz\Proxy
30
 * @author   Anton Shevchuk
31
 *
32
 * @method   static Instance getInstance()
33
 *
34
 * @method   static Instance attach($eventName, $callback, $priority = 1)
35
 * @see      Instance::attach()
36
 *
37
 * @method   static string|object trigger($event, $target = null, $params = null)
38
 * @see      Instance::trigger()
39
 */
40
class EventManager
41
{
42
    use ProxyTrait;
43
44
    /**
45
     * Init instance
46
     *
47
     * @return Instance
48
     */
49 1
    protected static function initInstance()
50
    {
51 1
        return new Instance();
52
    }
53
}
54