HydratingException   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 21
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getErrorsMap() 0 1 1
A __construct() 0 5 1
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