InvalidArgumentException   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 2
c 1
b 0
f 1
lcom 0
cbo 0
dl 0
loc 14
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A wrongType() 0 11 2
1
<?php
2
3
namespace PhpDDD\DomainDrivenDesign\Exception;
4
5
/**
6
 *
7
 */
8
final class InvalidArgumentException extends \InvalidArgumentException implements ExceptionInterface
9
{
10
    public static function wrongType($argumentName, $value, $expectedType)
11
    {
12
        return new self(
13
            sprintf(
14
                'The parameter "%s" expect to be of type %s, %s given.',
15
                $argumentName,
16
                $expectedType,
17
                is_object($value) ? get_class($value) : gettype($value)
18
            )
19
        );
20
    }
21
}
22