PluginProbe
Better Payment – Instant Payments, Donations, Fundraising with Subscriptions & More / 2.2.2
Better Payment – Instant Payments, Donations, Fundraising with Subscriptions & More v2.2.2
2.4.0 2.3.4 2.3.3 2.3.2 2.3.1 2.3.0 2.2.2 2.2.1 2.2.0 2.1.2 2.1.1 trunk 0.0.1 0.0.2 0.0.3 0.0.4 0.0.5 0.0.6 0.0.7 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 All 67 releases
better-payment / vendor / league / csv / src / CannotInsertRecord.php

CannotInsertRecord.php in Better Payment – Instant Payments, Donations, Fundraising with Subscriptions & More 2.2.2, at vendor/league/csv/src/CannotInsertRecord.php

67 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * League.Csv (https://csv.thephpleague.com)
5 *
6 * (c) Ignace Nyamagana Butera <[email protected]>
7 *
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
10 */
11
12 declare(strict_types=1);
13
14 namespace League\Csv;
15
16 /**
17 * Thrown when a data is not added to the Csv Document.
18 */
19 class CannotInsertRecord extends Exception
20 {
21 /** The record submitted for insertion. */
22 protected array $record;
23 /** Validator which did not validated the data. */
24 protected string $name = '';
25
26 /**
27 * Create an Exception from a record insertion into a stream.
28 */
29 public static function triggerOnInsertion(array $record): self
30 {
31 $exception = new self('Unable to write record to the CSV document');
32 $exception->record = $record;
33
34 return $exception;
35 }
36
37 /**
38 * Create an Exception from a Record Validation.
39 */
40 public static function triggerOnValidation(string $name, array $record): self
41 {
42 $exception = new self('Record validation failed');
43 $exception->name = $name;
44 $exception->record = $record;
45
46 return $exception;
47 }
48
49 /**
50 * return the validator name.
51 *
52 */
53 public function getName(): string
54 {
55 return $this->name;
56 }
57
58 /**
59 * return the invalid data submitted.
60 *
61 */
62 public function getRecord(): array
63 {
64 return $this->record;
65 }
66 }
67