UnsupportedFeatureException::__construct()   A
last analyzed

Complexity

Conditions 2
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 2
Metric Value
dl 0
loc 8
ccs 7
cts 7
cp 1
rs 9.4285
cc 2
eloc 5
nc 1
nop 2
crap 2
1
<?php
2
3
namespace LWI\DeliveryTracking\Exception;
4
5
use \Exception;
6
7
/**
8
 * UnsupportedFeatureException
9
 *
10
 * Used when a method or a feature is not supported by the delivery service used.
11
 */
12
class UnsupportedFeatureException extends Exception
13
{
14
    /**
15
     * UnsupportedFeature constructor.
16
     * @param string $functionName
17
     * @param string $adapter
18
     */
19 9
    public function __construct($functionName, $adapter = '')
20
    {
21 9
        parent::__construct(sprintf(
22 9
            'The feature "%s" is not supported by this adapter%s.',
23 6
            $functionName,
24 9
            $adapter ? ' ('.$adapter.')' : ''
25 6
        ));
26 9
    }
27
}
28