InvalidArgumentException   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 9 3
1
<?php
2
3
namespace OpenConext\Value\Exception;
4
5
use Assert\InvalidArgumentException as InvalidAssertionException;
6
7
class InvalidArgumentException extends InvalidAssertionException implements OpenConextValueException
8
{
9
    // according to CS used, propertypath and value should be switched, but that breaks the integration with the library
10
    // @codingStandardsIgnoreStart
11
    public function __construct($message, $code, $propertyPath = null, $value, array $constraints = array())
12
    {
13
        // @codingStandardsIgnoreEnd
14
        if ($propertyPath !== null && strpos($message, $propertyPath) === false) {
15
            $message = sprintf('Invalid argument given for "%s": %s', $propertyPath, $message);
16
        }
17
18
        parent::__construct($message, $code, $propertyPath, $value, $constraints);
19
    }
20
}
21