HasHelpersTrait   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 2
eloc 4
dl 0
loc 23
rs 10
c 2
b 0
f 0
ccs 4
cts 4
cp 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A Url() 0 3 1
A getHelper() 0 3 1
1
<?php
2
3
namespace Nip\Controllers\Traits;
4
5
use Nip\HelperBroker;
6
use Nip\Helpers\AbstractHelper;
7
8
/**
9
 * Trait HasHelpersTrait
10
 * @package Nip\Controllers\Trait
11
 *
12
 * @method \Nip_Helper_Arrays Arrays()
13
 * @method \Nip_Helper_Async Async()
14
 */
15
trait HasHelpersTrait
16
{
17
    /**
18
     * @var AbstractHelper[]
19
     */
20
    protected $helpers = [];
21
22
    /**
23
     * @param $name
24
     * @return AbstractHelper
25
     */
26 2
    public function getHelper($name)
27
    {
28 2
        return HelperBroker::get($name);
29
    }
30
31
    /**
32
     * @return \Nip_Helper_Url
33
     * @deprecated use \Nip\url() instead
34
     */
35 1
    public function Url()
36
    {
37 1
        return $this->getHelper('Url');
38
    }
39
}
40