Completed
Pull Request — master (#383)
by Anton
05:14
created

ProxyTrait   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 75%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 20
ccs 3
cts 4
cp 0.75
rs 10
c 1
b 0
f 0
wmc 2
lcom 0
cbo 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __callStatic() 0 8 2
1
<?php
2
/**
3
 * Bluz Framework Component
4
 *
5
 * @copyright Bluz PHP Team
6
 * @link https://github.com/bluzphp/framework
7
 */
8
9
/**
10
 * @namespace
11
 */
12
namespace Bluz\Proxy;
13
14
use Bluz\Common\Singleton;
15
16
/**
17
 * ProxyTrait
18
 *
19
 * @package  Bluz\Proxy
20
 * @author   Anton Shevchuk
21
 */
22
trait ProxyTrait
23
{
24
    use Singleton;
25
26
    /**
27
     * Handle dynamic, static calls to the object.
28
     *
29
     * @param  string $method
30
     * @param  array $args
31
     * @return mixed
32
     */
33 650
    public static function __callStatic($method, $args)
34
    {
35 650
        if ($instance = static::getInstance()) {
36 650
            return $instance->$method(...$args);
37
        } else {
38
            return false;
39
        }
40
    }
41
}
42