| 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 7.2.0 |
| 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\Exception; |
| 14 |
|
| 15 |
/** |
| 16 |
* Thrown when a data is not validated prior to insertion |
| 17 |
* |
| 18 |
* @package League.csv |
| 19 |
* @since 7.0.0 |
| 20 |
* |
| 21 |
*/ |
| 22 |
class InvalidRowException extends \InvalidArgumentException |
| 23 |
{ |
| 24 |
/** |
| 25 |
* Validator which did not validated the data |
| 26 |
* @var string |
| 27 |
*/ |
| 28 |
private $name; |
| 29 |
|
| 30 |
/** |
| 31 |
* Validator Data which caused the error |
| 32 |
* @var array |
| 33 |
*/ |
| 34 |
private $data; |
| 35 |
|
| 36 |
/** |
| 37 |
* New Instance |
| 38 |
* |
| 39 |
* @param string $name validator name |
| 40 |
* @param array $data invalid data |
| 41 |
* @param string $message exception message |
| 42 |
*/ |
| 43 |
public function __construct($name, array $data = [], $message = '') |
| 44 |
{ |
| 45 |
parent::__construct($message); |
| 46 |
$this->name = $name; |
| 47 |
$this->data = $data; |
| 48 |
} |
| 49 |
|
| 50 |
/** |
| 51 |
* return the validator name |
| 52 |
* |
| 53 |
* @return string |
| 54 |
*/ |
| 55 |
public function getName() |
| 56 |
{ |
| 57 |
return $this->name; |
| 58 |
} |
| 59 |
|
| 60 |
/** |
| 61 |
* return the invalid data submitted |
| 62 |
* |
| 63 |
* @return array |
| 64 |
*/ |
| 65 |
public function getData() |
| 66 |
{ |
| 67 |
return $this->data; |
| 68 |
} |
| 69 |
} |
| 70 |
|