Completed
Push — master ( bdbfd8...7102d7 )
by Ashley
01:28
created

BadMethodCallException   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 0
dl 0
loc 21
ccs 9
cts 9
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A throw() 0 18 4
1
<?php
2
3
namespace Clarkeash\Converter\Exceptions;
4
5
class BadMethodCallException extends \BadMethodCallException
6
{
7 3
    public static function throw($method, $class, $via = null)
8
    {
9 3
        if (is_object($class)) {
10 3
            $class = get_class($class);
11
        }
12
13 3
        $message = sprintf('Method: %s does not exist on class: %s', $method, $class);
14
15 3
        if (is_object($via)) {
16 2
            $via = get_class($via);
17
        }
18
19 3
        if ($via) {
20 2
            $message .= sprintf(' via: %s', $via);
21
        }
22
23 3
        throw new BadMethodCallException($message);
24
    }
25
}
26