← All changes
|
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/BaseReader.php
+6
-85
3.1.3
→
3.9.5
View file →
| @@ -54,29 +54,18 @@ | ||
| 54 | 54 | * @var XmlScanner |
| 55 | 55 | */ |
| 56 | 56 | protected $securityScanner; |
| 57 | 57 | |
| 58 | - /** | |
| 59 | - * Read data only? | |
| 60 | - * If this is true, then the Reader will only read data values for cells, it will not read any formatting information. | |
| 61 | - * If false (the default) it will read data and formatting. | |
| 62 | - * | |
| 63 | - * @return bool | |
| 64 | - */ | |
| 58 | + public function __construct() | |
| 59 | + { | |
| 60 | + $this->readFilter = new DefaultReadFilter(); | |
| 61 | + } | |
| 62 | + | |
| 65 | 63 | public function getReadDataOnly() |
| 66 | 64 | { |
| 67 | 65 | return $this->readDataOnly; |
| 68 | 66 | } |
| 69 | 67 | |
| 70 | - /** | |
| 71 | - * Set read data only | |
| 72 | - * Set to true, to advise the Reader only to read data values for cells, and to ignore any formatting information. | |
| 73 | - * Set to false (the default) to advise the Reader to read both data and formatting for cells. | |
| 74 | - * | |
| 75 | - * @param bool $pValue | |
| 76 | - * | |
| 77 | - * @return IReader | |
| 78 | - */ | |
| 79 | 68 | public function setReadDataOnly($pValue) |
| 80 | 69 | { |
| 81 | 70 | $this->readDataOnly = (bool) $pValue; |
| 82 | 71 | |
| @@ -82,29 +71,13 @@ | ||
| 82 | 71 | |
| 83 | 72 | return $this; |
| 84 | 73 | } |
| 85 | 74 | |
| 86 | - /** | |
| 87 | - * Read empty cells? | |
| 88 | - * If this is true (the default), then the Reader will read data values for all cells, irrespective of value. | |
| 89 | - * If false it will not read data for cells containing a null value or an empty string. | |
| 90 | - * | |
| 91 | - * @return bool | |
| 92 | - */ | |
| 93 | 75 | public function getReadEmptyCells() |
| 94 | 76 | { |
| 95 | 77 | return $this->readEmptyCells; |
| 96 | 78 | } |
| 97 | 79 | |
| 98 | - /** | |
| 99 | - * Set read empty cells | |
| 100 | - * Set to true (the default) to advise the Reader read data values for all cells, irrespective of value. | |
| 101 | - * Set to false to advise the Reader to ignore cells containing a null value or an empty string. | |
| 102 | - * | |
| 103 | - * @param bool $pValue | |
| 104 | - * | |
| 105 | - * @return IReader | |
| 106 | - */ | |
| 107 | 80 | public function setReadEmptyCells($pValue) |
| 108 | 81 | { |
| 109 | 82 | $this->readEmptyCells = (bool) $pValue; |
| 110 | 83 | |
| @@ -110,31 +83,13 @@ | ||
| 110 | 83 | |
| 111 | 84 | return $this; |
| 112 | 85 | } |
| 113 | 86 | |
| 114 | - /** | |
| 115 | - * Read charts in workbook? | |
| 116 | - * If this is true, then the Reader will include any charts that exist in the workbook. | |
| 117 | - * Note that a ReadDataOnly value of false overrides, and charts won't be read regardless of the IncludeCharts value. | |
| 118 | - * If false (the default) it will ignore any charts defined in the workbook file. | |
| 119 | - * | |
| 120 | - * @return bool | |
| 121 | - */ | |
| 122 | 87 | public function getIncludeCharts() |
| 123 | 88 | { |
| 124 | 89 | return $this->includeCharts; |
| 125 | 90 | } |
| 126 | 91 | |
| 127 | - /** | |
| 128 | - * Set read charts in workbook | |
| 129 | - * Set to true, to advise the Reader to include any charts that exist in the workbook. | |
| 130 | - * Note that a ReadDataOnly value of false overrides, and charts won't be read regardless of the IncludeCharts value. | |
| 131 | - * Set to false (the default) to discard charts. | |
| 132 | - * | |
| 133 | - * @param bool $pValue | |
| 134 | - * | |
| 135 | - * @return IReader | |
| 136 | - */ | |
| 137 | 92 | public function setIncludeCharts($pValue) |
| 138 | 93 | { |
| 139 | 94 | $this->includeCharts = (bool) $pValue; |
| 140 | 95 | |
| @@ -140,29 +95,13 @@ | ||
| 140 | 95 | |
| 141 | 96 | return $this; |
| 142 | 97 | } |
| 143 | 98 | |
| 144 | - /** | |
| 145 | - * Get which sheets to load | |
| 146 | - * Returns either an array of worksheet names (the list of worksheets that should be loaded), or a null | |
| 147 | - * indicating that all worksheets in the workbook should be loaded. | |
| 148 | - * | |
| 149 | - * @return mixed | |
| 150 | - */ | |
| 151 | 99 | public function getLoadSheetsOnly() |
| 152 | 100 | { |
| 153 | 101 | return $this->loadSheetsOnly; |
| 154 | 102 | } |
| 155 | 103 | |
| 156 | - /** | |
| 157 | - * Set which sheets to load. | |
| 158 | - * | |
| 159 | - * @param mixed $value | |
| 160 | - * This should be either an array of worksheet names to be loaded, or a string containing a single worksheet name. | |
| 161 | - * If NULL, then it tells the Reader to read all worksheets in the workbook | |
| 162 | - * | |
| 163 | - * @return IReader | |
| 164 | - */ | |
| 165 | 104 | public function setLoadSheetsOnly($value) |
| 166 | 105 | { |
| 167 | 106 | if ($value === null) { |
| 168 | 107 | return $this->setLoadAllSheets(); |
| @@ -172,14 +111,8 @@ | ||
| 172 | 111 | |
| 173 | 112 | return $this; |
| 174 | 113 | } |
| 175 | 114 | |
| 176 | - /** | |
| 177 | - * Set all sheets to load | |
| 178 | - * Tells the Reader to load all worksheets from the workbook. | |
| 179 | - * | |
| 180 | - * @return IReader | |
| 181 | - */ | |
| 182 | 115 | public function setLoadAllSheets() |
| 183 | 116 | { |
| 184 | 117 | $this->loadSheetsOnly = null; |
| 185 | 118 | |
| @@ -185,25 +118,13 @@ | ||
| 185 | 118 | |
| 186 | 119 | return $this; |
| 187 | 120 | } |
| 188 | 121 | |
| 189 | - /** | |
| 190 | - * Read filter. | |
| 191 | - * | |
| 192 | - * @return IReadFilter | |
| 193 | - */ | |
| 194 | 122 | public function getReadFilter() |
| 195 | 123 | { |
| 196 | 124 | return $this->readFilter; |
| 197 | 125 | } |
| 198 | 126 | |
| 199 | - /** | |
| 200 | - * Set read filter. | |
| 201 | - * | |
| 202 | - * @param IReadFilter $pValue | |
| 203 | - * | |
| 204 | - * @return IReader | |
| 205 | - */ | |
| 206 | 127 | public function setReadFilter(IReadFilter $pValue) |
| 207 | 128 | { |
| 208 | 129 | $this->readFilter = $pValue; |
| 209 | 130 | |
| @@ -209,9 +130,9 @@ | ||
| 209 | 130 | |
| 210 | 131 | return $this; |
| 211 | 132 | } |
| 212 | 133 | |
| 213 | - public function getSecuritySCanner() | |
| 134 | + public function getSecurityScanner() | |
| 214 | 135 | { |
| 215 | 136 | if (property_exists($this, 'securityScanner')) { |
| 216 | 137 | return $this->securityScanner; |
| 217 | 138 | } |