BpostInvalidWeightException   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 6
c 0
b 0
f 0
dl 0
loc 10
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Bpost\BpostApiClient\Exception\BpostLogicException;
5
6
use Bpost\BpostApiClient\Exception\BpostLogicException;
7
use Exception;
8
9
/**
10
 * Class BpostInvalidWeightException
11
 */
12
class BpostInvalidWeightException extends BpostLogicException
13
{
14
    public function __construct(int $invalidWeight, int $maximumWeight, int $code = 0, ?Exception $previous = null)
15
    {
16
        $message = sprintf(
17
            'Invalid weight (%d g), maximum is %d g.',
18
            $invalidWeight,
19
            $maximumWeight * 1000
20
        );
21
        parent::__construct($message, $code, $previous);
22
    }
23
}
24