CannotReassignException   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Test Coverage

Coverage 66.67%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 13
ccs 4
cts 6
cp 0.6667
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getField() 0 3 1
1
<?php
2
/**
3
 * PHP Billing Library
4
 *
5
 * @link      https://github.com/hiqdev/php-billing
6
 * @package   php-billing
7
 * @license   BSD-3-Clause
8
 * @copyright Copyright (c) 2017-2020, HiQDev (http://hiqdev.com/)
9
 */
10
11
namespace hiqdev\php\billing\Exception;
12
13
use Exception;
14
use hiqdev\php\billing\ExceptionInterface;
15
use Throwable;
16
17
/**
18
 * @author Andrii Vasyliev <[email protected]>
19
 */
20
class CannotReassignException extends Exception implements ExceptionInterface
21
{
22
    private $field;
23
24 4
    public function __construct(string $message, int $code = 0, Throwable $previous = null)
25
    {
26 4
        $this->field = $message;
27 4
        parent::__construct("cannot reassign $message", $code, $previous);
28 4
    }
29
30
    public function getField()
31
    {
32
        return $this->field;
33
    }
34
}
35