BpostInvalidWeightException::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 9
ccs 7
cts 7
cp 1
rs 9.6666
c 0
b 0
f 0
cc 1
eloc 6
nc 1
nop 4
crap 1
1
<?php
2
3
namespace Bpost\BpostApiClient\Exception\BpostLogicException;
4
5
use Bpost\BpostApiClient\Exception\BpostLogicException;
6
7
/**
8
 * Class BpostInvalidWeightException
9
 * @package Bpost\BpostApiClient\Exception\LogicException
10
 */
11
class BpostInvalidWeightException extends BpostLogicException
12
{
13
    /**
14
     * @param string     $invalidWeight
15
     * @param int        $maximumWeight
16
     * @param int        $code
17
     * @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...
18
     */
19 1
    public function __construct($invalidWeight, $maximumWeight, $code = 0, \Exception $previous = null)
20
    {
21 1
        $message = sprintf(
22 1
            'Invalid weight (%1$s kg), maximum is %2$s.',
23 1
            $invalidWeight,
24
            $maximumWeight
25 1
        );
26 1
        parent::__construct($message, $code, $previous);
27 1
    }
28
}
29