Passed
Pull Request — master (#1045)
by Aleksei
09:49
created

ProxyTrait::__callStatic()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 4
ccs 0
cts 3
cp 0
rs 10
cc 1
nc 1
nop 2
crap 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Spiral\Core\Internal\Proxy;
6
7
use Spiral\Core\ContainerScope;
8
use Spiral\Core\Exception\Container\ContainerException;
9
10
/**
11
 * @internal
12
 */
13
trait ProxyTrait
14
{
15
    private static string $__container_proxy_alias;
16
    private \Stringable|string|null $__container_proxy_context = null;
17
18 3
    public function __call(string $name, array $arguments)
19
    {
20 3
        return Resolver::resolve(static::$__container_proxy_alias, $this->__container_proxy_context)
0 ignored issues
show
Bug introduced by
Since $__container_proxy_alias is declared private, accessing it with static will lead to errors in possible sub-classes; you can either use self, or increase the visibility of $__container_proxy_alias to at least protected.
Loading history...
21 3
            ->$name(...$arguments);
22
    }
23
24
    public static function __callStatic(string $name, array $arguments)
25
    {
26
        return Resolver::resolve(static::$__container_proxy_alias)
0 ignored issues
show
Bug introduced by
Since $__container_proxy_alias is declared private, accessing it with static will lead to errors in possible sub-classes; you can either use self, or increase the visibility of $__container_proxy_alias to at least protected.
Loading history...
27
            ->$name(...$arguments);
28
    }
29
}
30