ConsoleEventNameResolver::__invoke()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 2
nc 2
nop 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * Webino™ (http://webino.sk)
4
 *
5
 * @link        https://github.com/webino for the canonical source repository
6
 * @copyright   Copyright (c) 2015-2017 Webino, s.r.o. (http://webino.sk)
7
 * @author      Peter Bačinský <[email protected]>
8
 * @license     BSD-3-Clause
9
 */
10
11
namespace WebinoAppLib\Util;
12
13
use WebinoAppLib\Event\ConsoleEvent;
14
use WebinoAppLib\Event\RouteEvent;
15
16
/**
17
 * Class ConsoleEventNameResolver
18
 */
19
class ConsoleEventNameResolver extends RouteEventNameResolver
20
{
21
    /**
22
     * @param string $name
23
     * @return string
24
     */
25
    public function __invoke($name)
26
    {
27
        return $this->getUsePrefix($name) ? $name : RouteEvent::PREFIX . ConsoleEvent::PREFIX . $name;
28
    }
29
}
30