InvalidParam   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 2
1
<?php
2
3
namespace Mfonte\Base62x\Exception;
4
5
class InvalidParam extends \InvalidArgumentException
6
{
7
    public const REASON = 'Invalid param "#PARAM#" passed in method "#METHOD#" on class "#CLASS#" ';
8
    public const CODE = 0;
9
10
    public function __construct($param, $method, $class, $detailedReason = null)
11
    {
12
        $reason = str_replace(['#PARAM#', '#METHOD#', '#CLASS#'], [$param, $method, $class], static::REASON);
13
        if ($detailedReason) {
14
            $reason .= ': '.$detailedReason;
15
        }
16
        parent::__construct($reason, static::CODE);
17
    }
18
}
19