ClassWatchdog   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 24
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __callStatic() 0 4 1
A __call() 0 4 1
1
<?php
2
namespace PHPDaemon\Traits;
3
4
use PHPDaemon\Exceptions\UndefinedMethodCalled;
5
6
/**
7
 * Watchdog of __call and __callStatic
8
 * @package PHPDaemon\Traits
9
 * @author  Vasily Zorin <[email protected]>
10
 */
11
trait ClassWatchdog
12
{
13
    /**
14
     * @param  string $method Method name
15
     * @param  array $args Arguments
16
     * @throws UndefinedMethodCalled if call to undefined static method
17
     * @return mixed
18
     */
19
    public static function __callStatic($method, $args)
20
    {
21
        throw new UndefinedMethodCalled('Call to undefined static method ' . static::class . '::' . $method);
22
    }
23
24
    /**
25
     * @param  string $method Method name
26
     * @param  array $args Arguments
27
     * @throws UndefinedMethodCalled if call to undefined method
28
     * @return mixed
29
     */
30
    public function __call($method, $args)
31
    {
32
        throw new UndefinedMethodCalled('Call to undefined method ' . get_class($this) . '->' . $method);
33
    }
34
}
35