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

FacadeTrait::__call()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 1
c 1
b 0
f 1
nc 1
nop 2
dl 0
loc 2
rs 10
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