BpostInvalidLengthException   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 21
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 10 1
1
<?php
2
3
namespace Bpost\BpostApiClient\Exception\BpostLogicException;
4
5
use Bpost\BpostApiClient\Exception\BpostLogicException;
6
7
/**
8
 * Class BpostInvalidLengthException
9
 * @package Bpost\BpostApiClient\Exception\LogicException
10
 */
11
class BpostInvalidLengthException extends BpostLogicException
12
{
13
    /**
14
     * BpostInvalidLengthException constructor.
15
     * @param string     $nameEntry
16
     * @param int        $invalidLength
17
     * @param int        $maximumLength
18
     * @param int        $code
19
     * @param \Exception $previous
0 ignored issues
show
Documentation introduced by
Should the type for parameter $previous not be null|\Exception?

This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.

It makes a suggestion as to what type it considers more descriptive.

Most often this is a case of a parameter that can be null in addition to its declared types.

Loading history...
20
     */
21 14
    public function __construct($nameEntry, $invalidLength, $maximumLength, $code = 0, \Exception $previous = null)
22
    {
23 14
        $message = sprintf(
24 14
            'Invalid length for entry "%1$s" (%2$s characters), maximum is %3$s.',
25 14
            $nameEntry,
26 14
            $invalidLength,
27
            $maximumLength
28 14
        );
29 14
        parent::__construct($message, $code, $previous);
30 14
    }
31
}
32