Completed
Pull Request — master (#178)
by ignace nyamagana
03:12
created

InvalidRowException   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getName() 0 4 1
A getData() 0 4 1
1
<?php
2
/**
3
* This file is part of the League.csv library
4
*
5
* @license http://opensource.org/licenses/MIT
6
* @link https://github.com/thephpleague/csv/
7
* @version 8.1.1
8
* @package League.csv
9
*
10
* For the full copyright and license information, please view the LICENSE
11
* file that was distributed with this source code.
12
*/
13
namespace League\Csv;
14
15
use InvalidArgumentException;
16
17
/**
18
 *  Thrown when a data is not validated prior to insertion
19
 *
20
 * @package League.csv
21
 * @since  7.0.0
22
 *
23
 */
24
class InvalidRowException extends InvalidArgumentException
25
{
26
    /**
27
     * Validator which did not validated the data
28
     * @var string
29
     */
30
    private $name;
31
32
    /**
33
     * Validator Data which caused the error
34
     * @var array
35
     */
36
    private $data;
37
38
    /**
39
     * New Instance
40
     *
41
     * @param string $name    validator name
42
     * @param array  $data    invalid  data
43
     * @param string $message exception message
44
     */
45
    public function __construct($name, array $data = [], $message = '')
46
    {
47
        parent::__construct($message);
48
        $this->name = $name;
49
        $this->data = $data;
50
    }
51
52
    /**
53
     * return the validator name
54
     *
55
     * @return string
56
     */
57
    public function getName()
58
    {
59
        return $this->name;
60
    }
61
62
    /**
63
     * return the invalid data submitted
64
     *
65
     * @return array
66
     */
67
    public function getData()
68
    {
69
        return $this->data;
70
    }
71
}
72