Completed
Pull Request — master (#49)
by John
04:43
created

InvalidParametersException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getValidationErrors() 0 4 1
1
<?php
2
/*
3
 * This file is part of the KleijnWeb\SwaggerBundle package.
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 */
8
9
namespace KleijnWeb\SwaggerBundle\Exception;
10
11
/**
12
 * @author John Kleijn <[email protected]>
13
 */
14
class InvalidParametersException extends \Exception
15
{
16
    /**
17
     * @var array
18
     */
19
    private $validationErrors;
20
21
    /**
22
     * @param string     $message
23
     * @param int        $code
24
     * @param array      $validationErrors
25
     * @param \Exception $previous
26
     */
27
    public function __construct($message, array $validationErrors, $code = 400, $previous = null)
28
    {
29
        parent::__construct($message, $code, $previous);
30
31
        $this->validationErrors = $validationErrors;
32
    }
33
34
    /**
35
     * @return array
36
     */
37
    public function getValidationErrors()
38
    {
39
        return $this->validationErrors;
40
    }
41
}
42