1 | <?php |
||
7 | final class CsvOptions |
||
8 | { |
||
9 | /** |
||
10 | * @var string |
||
11 | */ |
||
12 | private $delimiter; |
||
13 | |||
14 | /** |
||
15 | * @var string |
||
16 | */ |
||
17 | private $enclosure; |
||
18 | |||
19 | /** |
||
20 | * @var string |
||
21 | */ |
||
22 | private $escapeChar; |
||
23 | |||
24 | /** |
||
25 | * Construct a new CsvOptions instance. |
||
26 | * |
||
27 | * @param string $delimiter The field delimiter (one character only). |
||
28 | * @param string $enclosure The field enclosure character (one character only). |
||
29 | * @param string $escapeChar The escape character (one character only). |
||
30 | * |
||
31 | * @throws InvalidArgumentException Thrown if $delimiter is not one character. |
||
32 | * @throws InvalidArgumentException Thrown if $enclosure is not one character. |
||
33 | * @throws InvalidArgumentException Thrown if $escapeChar is not one character. |
||
34 | */ |
||
35 | public function __construct(string $delimiter = ',', string $enclosure = '"', string $escapeChar = '\\') |
||
53 | |||
54 | /** |
||
55 | * Gets the field delimiter (one character only). |
||
56 | * |
||
57 | * @return string |
||
58 | */ |
||
59 | public function getDelimiter() : string |
||
63 | |||
64 | /** |
||
65 | * Gets the field enclosure character (one character only). |
||
66 | * |
||
67 | * @return string |
||
68 | */ |
||
69 | public function getEnclosure() : string |
||
73 | |||
74 | /** |
||
75 | * Gets the escape character (one character only). |
||
76 | * |
||
77 | * @return string |
||
78 | */ |
||
79 | public function getEscapeChar() : string |
||
83 | } |
||
84 |