Completed
Pull Request — master (#49)
by John
02:41
created

InvalidParametersException::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 1
Metric Value
c 2
b 0
f 1
dl 0
loc 6
rs 9.4285
cc 1
eloc 3
nc 1
nop 4
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