PluginProbe
TablePress – Tables in WordPress made easy / 3.4
TablePress – Tables in WordPress made easy v3.4
3.4 3.3.4 3.3.3 3.3.2 3.3.1 trunk 1.12 1.14 1.9.2 2.0.4 2.1.7 2.1.8 2.2 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.3 2.3.1 2.3.2 2.4 2.4.1 2.4.2 2.4.3 All 45 releases
tablepress / libraries / vendor / PhpSpreadsheet / Reader / CsvNoEscape.php

CsvNoEscape.php in TablePress – Tables in WordPress made easy 3.4, at libraries/vendor/PhpSpreadsheet/Reader/CsvNoEscape.php

52 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace TablePress\PhpOffice\PhpSpreadsheet\Reader;
4
5 use TablePress\PhpOffice\PhpSpreadsheet\Reader\Exception as ReaderException;
6
7 class CsvNoEscape extends Csv
8 {
9 /**
10 * The character that can escape the enclosure.
11 * Non-null-string will probably become unsupported in Php 9.
12 * It must always be null-string in this class.
13 */
14 protected ?string $escapeCharacter = '';
15
16 /**
17 * Should not be needed in this class, but we will permit it.
18 *
19 * @var ?callable
20 */
21 protected static $constructorCallback;
22
23 protected bool $testAutodetect = false;
24
25 /**
26 * Changing escape character not allowed in this class.
27 */
28 public function setEscapeCharacter(string $escapeCharacter, int $version = PHP_VERSION_ID): self
29 {
30 if ($escapeCharacter !== '') {
31 throw new ReaderException('Escape character must be null string');
32 }
33
34 $this->escapeCharacter = $escapeCharacter;
35
36 return $this;
37 }
38
39 /**
40 * Changing auto-detect not allowed in this class.
41 */
42 public function setTestAutoDetect(bool $value): self
43 {
44 if ($value !== false) {
45 throw new ReaderException('This class requires that testAutoDetect be false');
46 }
47 $this->testAutodetect = $value;
48
49 return $this;
50 }
51 }
52