Passed
Push — master ( c8570b...99b6ec )
by Korotkov
01:50 queued 17s
created

FacadeTrait::__call()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 2
Metric Value
cc 1
eloc 1
c 2
b 0
f 2
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\Rudra;
11
12
trait FacadeTrait
13
{
14
//    public function __call($method, $parameters) {
15
//        return $this->$method(...$parameters);
16
//    }
17
18
    public static function __callStatic($method, $parameters)
19
    {
20
        if (!Rudra::_has(static::class)) {
0 ignored issues
show
Bug Best Practice introduced by
The method Rudra\Container\Rudra::_has() is not static, but was called statically. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

20
        if (!Rudra::/** @scrutinizer ignore-call */ _has(static::class)) {
Loading history...
21
            Rudra::_set([static::class, [static::class]]);
0 ignored issues
show
Bug Best Practice introduced by
The method Rudra\Container\Rudra::_set() is not static, but was called statically. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

21
            Rudra::/** @scrutinizer ignore-call */ 
22
                   _set([static::class, [static::class]]);
Loading history...
22
        }
23
24
        $object = Rudra::_get(static::class);
0 ignored issues
show
Bug Best Practice introduced by
The method Rudra\Container\Rudra::_get() is not static, but was called statically. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

24
        /** @scrutinizer ignore-call */ 
25
        $object = Rudra::_get(static::class);
Loading history...
25
26
        return $object->$method(...$parameters);
27
    }
28
}
29