Completed
Push — master ( a2735d...ef7580 )
by Edgar
03:32
created

NotImplementedException::newInstance()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 10
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 12
ccs 10
cts 10
cp 1
rs 9.4285
cc 1
eloc 8
nc 1
nop 0
crap 1
1
<?php
2
namespace nstdio\svg\xml;
3
4
/**
5
 * Class NotImplementedException
6
 *
7
 * @package nstdio\svg\xml
8
 * @author  Edgar Asatryan <[email protected]>
9
 */
10
class NotImplementedException extends \RuntimeException
11
{
12 1
    public static function newInstance()
13
    {
14 1
        $backTrack = debug_backtrace()[1];
15 1
        return new static(
16 1
            sprintf("Method %s::%s not implemented yet, but called in %s on line %d",
17 1
                $backTrack['class'],
18 1
                $backTrack['function'],
19 1
                $backTrack['file'],
20 1
                $backTrack['line']
21 1
            )
22 1
        );
23
    }
24
}