Completed
Push — master ( 7d1c77...3a4e71 )
by Artem
10:34
created

UnexpectedConstraintException   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 11
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
1
<?php
2
/*
3
 * This file is part of the StfalconApiBundle.
4
 *
5
 * (c) Stfalcon LLC <stfalcon.com>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
declare(strict_types=1);
12
13
namespace StfalconStudio\ApiBundle\Exception\Validator;
14
15
use StfalconStudio\ApiBundle\Exception\InvalidArgumentException;
16
use Symfony\Component\Validator\Constraint;
17
18
/**
19
 * UnexpectedConstraintException.
20
 */
21
class UnexpectedConstraintException extends InvalidArgumentException
22
{
23
    /**
24
     * @param Constraint $constraint
25
     * @param string     $expectedClass
26
     */
27
    public function __construct(Constraint $constraint, string $expectedClass)
28
    {
29
        parent::__construct(\sprintf('Object of class %s is not instance of %s', \get_class($constraint), $expectedClass));
30
    }
31
}
32