BpostInvalidLengthException   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 7
c 1
b 0
f 0
dl 0
loc 11
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 9 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 BpostInvalidLengthException
11
 */
12
class BpostInvalidLengthException extends BpostLogicException
13
{
14
    public function __construct(string $nameEntry, int $invalidLength, int $maximumLength, int $code = 0, ?Exception $previous = null)
15
    {
16
        $message = sprintf(
17
            'Invalid length for entry "%s" (%d characters), maximum is %d.',
18
            $nameEntry,
19
            $invalidLength,
20
            $maximumLength
21
        );
22
        parent::__construct($message, $code, $previous);
23
    }
24
}