HydratingException::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 3
1
<?php
2
namespace MetaHydrator\Exception;
3
4
/**
5
 * An exception containing the mapping of various errors in a form data.
6
 *
7
 * Class HydratingException
8
 * @package MetaHydrator\Exception
9
 */
10
class HydratingException extends \Exception
11
{
12
    /** @var array */
13
    private $errorsMap;
14
    /** @return array */
15
    public function getErrorsMap() { return $this->errorsMap; }
16
17
    /**
18
     * HydratingException constructor.
19
     * All the leaves of errors map should describe a specific error.
20
     *
21
     * @param array $errorsMap
22
     * @param string $message
23
     * @param int $code
24
     */
25
    public function __construct($errorsMap, $message = "", $code = 412)
26
    {
27
        parent::__construct($message, $code, null);
28
        $this->errorsMap = $errorsMap;
29
    }
30
}
31