Prototypeable::__callStatic()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 1
Metric Value
cc 1
eloc 1
c 1
b 1
f 1
nc 1
nop 2
dl 0
loc 3
rs 10
1
<?php
2
3
namespace skrtdev\Prototypes;
4
5
trait Prototypeable{
6
7
    /**
8
     * @param string $name
9
     * @param array $args
10
     * @return mixed
11
     */
12
    public function __call(string $name, array $args)
13
    {
14
        return Prototypes::call($this, $name, $args);
15
    }
16
17
    /**
18
     * @param string $name
19
     * @param callable $fun
20
     * @throws Exception
21
     */
22
    public static function addMethod(string $name, callable $fun): void
23
    {
24
        Prototypes::addClassMethod(static::class, $name, $fun);
25
    }
26
27
    /**
28
     * @param string $name
29
     * @param array $args
30
     * @return mixed
31
     */
32
    public static function __callStatic(string $name, array $args)
33
    {
34
        return Prototypes::callStatic(static::class, $name, $args);
35
    }
36
37
    /**
38
     * @param string $name
39
     * @param callable $fun
40
     * @throws Exception
41
     */
42
    public static function addStaticMethod(string $name, callable $fun): void
43
    {
44
        Prototypes::addClassStaticMethod(static::class, $name, $fun);
45
    }
46
}
47
48