Passed
Push — master ( e12ef7...685c6b )
by Korotkov
02:37 queued 01:10
created

FacadeTrait   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 5
c 1
b 0
f 1
dl 0
loc 12
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __callStatic() 0 4 1
A __call() 0 2 1
1
<?php
2
3
/**
4
 * @author    : Jagepard <[email protected]">
5
 * @license   https://mit-license.org/ MIT
6
 */
7
8
namespace Rudra\Container\Traits;
9
10
use Rudra\Container\Application;
11
12
trait FacadeTrait
13
{
14
    public static string $name;
15
16
    public function __call($method, $parameters) {
17
        return $this->$method(...$parameters);
18
    }
19
20
    public static function __callStatic($method, $parameters)
21
    {
22
        $object = Application::run()->objects()->get(static::$name);
23
        return $object->$method(...$parameters);
24
    }
25
}
26