ExceptionThrower   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 0%
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 18
ccs 0
cts 4
cp 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A throwUnsupportedFeatureException() 0 4 1
A throwDataNotFoundException() 0 4 1
1
<?php
2
3
namespace LWI\DeliveryTracking\Behavior;
4
5
use LWI\DeliveryTracking\Exception\DataNotFoundException;
6
use LWI\DeliveryTracking\Exception\UnsupportedFeatureException;
7
8
/**
9
 * Class ExceptionThrower
10
 */
11
trait ExceptionThrower
12
{
13
    /**
14
     * @throws UnsupportedFeatureException
15
     */
16
    public function throwUnsupportedFeatureException()
17
    {
18
        throw new UnsupportedFeatureException(__FUNCTION__, (new \ReflectionClass($this))->getShortName());
19
    }
20
21
    /**
22
     * @throws DataNotFoundException
23
     */
24
    public function throwDataNotFoundException()
25
    {
26
        throw new DataNotFoundException((new \ReflectionClass($this))->getShortName());
27
    }
28
}
29