@@ -54,15 +54,15 @@ discard block |
||
54 | 54 | $this->currentObject->detach(); |
55 | 55 | |
56 | 56 | $obj = serialize($this->currentObject); |
57 | - if (wincache_ucache_exists($this->cachePrefix.$this->currentObjectID.'.cache')) { |
|
58 | - if (!wincache_ucache_set($this->cachePrefix.$this->currentObjectID.'.cache', $obj, $this->cacheTime)) { |
|
57 | + if (wincache_ucache_exists($this->cachePrefix . $this->currentObjectID . '.cache')) { |
|
58 | + if (!wincache_ucache_set($this->cachePrefix . $this->currentObjectID . '.cache', $obj, $this->cacheTime)) { |
|
59 | 59 | $this->__destruct(); |
60 | - throw new \PhpOffice\PhpSpreadsheet\Exception('Failed to store cell '.$this->currentObjectID.' in WinCache'); |
|
60 | + throw new \PhpOffice\PhpSpreadsheet\Exception('Failed to store cell ' . $this->currentObjectID . ' in WinCache'); |
|
61 | 61 | } |
62 | 62 | } else { |
63 | - if (!wincache_ucache_add($this->cachePrefix.$this->currentObjectID.'.cache', $obj, $this->cacheTime)) { |
|
63 | + if (!wincache_ucache_add($this->cachePrefix . $this->currentObjectID . '.cache', $obj, $this->cacheTime)) { |
|
64 | 64 | $this->__destruct(); |
65 | - throw new \PhpOffice\PhpSpreadsheet\Exception('Failed to store cell '.$this->currentObjectID.' in WinCache'); |
|
65 | + throw new \PhpOffice\PhpSpreadsheet\Exception('Failed to store cell ' . $this->currentObjectID . ' in WinCache'); |
|
66 | 66 | } |
67 | 67 | } |
68 | 68 | $this->currentCellIsDirty = false; |
@@ -112,11 +112,11 @@ discard block |
||
112 | 112 | return true; |
113 | 113 | } |
114 | 114 | // Check if the requested entry still exists in cache |
115 | - $success = wincache_ucache_exists($this->cachePrefix.$pCoord.'.cache'); |
|
115 | + $success = wincache_ucache_exists($this->cachePrefix . $pCoord . '.cache'); |
|
116 | 116 | if ($success === false) { |
117 | 117 | // Entry no longer exists in Wincache, so clear it from the cache array |
118 | 118 | parent::deleteCacheData($pCoord); |
119 | - throw new \PhpOffice\PhpSpreadsheet\Exception('Cell entry '.$pCoord.' no longer exists in WinCache'); |
|
119 | + throw new \PhpOffice\PhpSpreadsheet\Exception('Cell entry ' . $pCoord . ' no longer exists in WinCache'); |
|
120 | 120 | } |
121 | 121 | |
122 | 122 | return true; |
@@ -145,11 +145,11 @@ discard block |
||
145 | 145 | $obj = null; |
146 | 146 | if (parent::isDataSet($pCoord)) { |
147 | 147 | $success = false; |
148 | - $obj = wincache_ucache_get($this->cachePrefix.$pCoord.'.cache', $success); |
|
148 | + $obj = wincache_ucache_get($this->cachePrefix . $pCoord . '.cache', $success); |
|
149 | 149 | if ($success === false) { |
150 | 150 | // Entry no longer exists in WinCache, so clear it from the cache array |
151 | 151 | parent::deleteCacheData($pCoord); |
152 | - throw new \PhpOffice\PhpSpreadsheet\Exception('Cell entry '.$pCoord.' no longer exists in WinCache'); |
|
152 | + throw new \PhpOffice\PhpSpreadsheet\Exception('Cell entry ' . $pCoord . ' no longer exists in WinCache'); |
|
153 | 153 | } |
154 | 154 | } else { |
155 | 155 | // Return null if requested entry doesn't exist in cache |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | public function deleteCacheData($pCoord) |
191 | 191 | { |
192 | 192 | // Delete the entry from Wincache |
193 | - wincache_ucache_delete($this->cachePrefix.$pCoord.'.cache'); |
|
193 | + wincache_ucache_delete($this->cachePrefix . $pCoord . '.cache'); |
|
194 | 194 | |
195 | 195 | // Delete the entry from our cell address array |
196 | 196 | parent::deleteCacheData($pCoord); |
@@ -208,20 +208,20 @@ discard block |
||
208 | 208 | parent::copyCellCollection($parent); |
209 | 209 | // Get a new id for the new file name |
210 | 210 | $baseUnique = $this->getUniqueID(); |
211 | - $newCachePrefix = substr(md5($baseUnique), 0, 8).'.'; |
|
211 | + $newCachePrefix = substr(md5($baseUnique), 0, 8) . '.'; |
|
212 | 212 | $cacheList = $this->getCellList(); |
213 | 213 | foreach ($cacheList as $cellID) { |
214 | 214 | if ($cellID != $this->currentObjectID) { |
215 | 215 | $success = false; |
216 | - $obj = wincache_ucache_get($this->cachePrefix.$cellID.'.cache', $success); |
|
216 | + $obj = wincache_ucache_get($this->cachePrefix . $cellID . '.cache', $success); |
|
217 | 217 | if ($success === false) { |
218 | 218 | // Entry no longer exists in WinCache, so clear it from the cache array |
219 | 219 | parent::deleteCacheData($cellID); |
220 | - throw new \PhpOffice\PhpSpreadsheet\Exception('Cell entry '.$cellID.' no longer exists in Wincache'); |
|
220 | + throw new \PhpOffice\PhpSpreadsheet\Exception('Cell entry ' . $cellID . ' no longer exists in Wincache'); |
|
221 | 221 | } |
222 | - if (!wincache_ucache_add($newCachePrefix.$cellID.'.cache', $obj, $this->cacheTime)) { |
|
222 | + if (!wincache_ucache_add($newCachePrefix . $cellID . '.cache', $obj, $this->cacheTime)) { |
|
223 | 223 | $this->__destruct(); |
224 | - throw new \PhpOffice\PhpSpreadsheet\Exception('Failed to store cell '.$cellID.' in Wincache'); |
|
224 | + throw new \PhpOffice\PhpSpreadsheet\Exception('Failed to store cell ' . $cellID . ' in Wincache'); |
|
225 | 225 | } |
226 | 226 | } |
227 | 227 | } |
@@ -259,7 +259,7 @@ discard block |
||
259 | 259 | |
260 | 260 | if (is_null($this->cachePrefix)) { |
261 | 261 | $baseUnique = $this->getUniqueID(); |
262 | - $this->cachePrefix = substr(md5($baseUnique), 0, 8).'.'; |
|
262 | + $this->cachePrefix = substr(md5($baseUnique), 0, 8) . '.'; |
|
263 | 263 | $this->cacheTime = $cacheTime; |
264 | 264 | |
265 | 265 | parent::__construct($parent); |
@@ -273,7 +273,7 @@ discard block |
||
273 | 273 | { |
274 | 274 | $cacheList = $this->getCellList(); |
275 | 275 | foreach ($cacheList as $cellID) { |
276 | - wincache_ucache_delete($this->cachePrefix.$cellID.'.cache'); |
|
276 | + wincache_ucache_delete($this->cachePrefix . $cellID . '.cache'); |
|
277 | 277 | } |
278 | 278 | } |
279 | 279 |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | if ($this->currentCellIsDirty && !empty($this->currentObjectID)) { |
54 | 54 | $this->currentObject->detach(); |
55 | 55 | |
56 | - if (!$this->DBHandle->queryExec('INSERT OR REPLACE INTO kvp_'.$this->TableName." VALUES('".$this->currentObjectID."','".sqlite_escape_string(serialize($this->currentObject))."')")) { |
|
56 | + if (!$this->DBHandle->queryExec('INSERT OR REPLACE INTO kvp_' . $this->TableName . " VALUES('" . $this->currentObjectID . "','" . sqlite_escape_string(serialize($this->currentObject)) . "')")) { |
|
57 | 57 | throw new \PhpOffice\PhpSpreadsheet\Exception(sqlite_error_string($this->DBHandle->lastError())); |
58 | 58 | } |
59 | 59 | $this->currentCellIsDirty = false; |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | } |
101 | 101 | $this->storeData(); |
102 | 102 | |
103 | - $query = 'SELECT value FROM kvp_'.$this->TableName." WHERE id='".$pCoord."'"; |
|
103 | + $query = 'SELECT value FROM kvp_' . $this->TableName . " WHERE id='" . $pCoord . "'"; |
|
104 | 104 | $cellResultSet = $this->DBHandle->query($query, SQLITE_ASSOC); |
105 | 105 | if ($cellResultSet === false) { |
106 | 106 | throw new \PhpOffice\PhpSpreadsheet\Exception(sqlite_error_string($this->DBHandle->lastError())); |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | } |
138 | 138 | |
139 | 139 | // Check if the requested entry exists in the cache |
140 | - $query = 'SELECT id FROM kvp_'.$this->TableName." WHERE id='".$pCoord."'"; |
|
140 | + $query = 'SELECT id FROM kvp_' . $this->TableName . " WHERE id='" . $pCoord . "'"; |
|
141 | 141 | $cellResultSet = $this->DBHandle->query($query, SQLITE_ASSOC); |
142 | 142 | if ($cellResultSet === false) { |
143 | 143 | throw new \PhpOffice\PhpSpreadsheet\Exception(sqlite_error_string($this->DBHandle->lastError())); |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | } |
165 | 165 | |
166 | 166 | // Check if the requested entry exists in the cache |
167 | - $query = 'DELETE FROM kvp_'.$this->TableName." WHERE id='".$pCoord."'"; |
|
167 | + $query = 'DELETE FROM kvp_' . $this->TableName . " WHERE id='" . $pCoord . "'"; |
|
168 | 168 | if (!$this->DBHandle->queryExec($query)) { |
169 | 169 | throw new \PhpOffice\PhpSpreadsheet\Exception(sqlite_error_string($this->DBHandle->lastError())); |
170 | 170 | } |
@@ -188,13 +188,13 @@ discard block |
||
188 | 188 | $this->currentObjectID = $toAddress; |
189 | 189 | } |
190 | 190 | |
191 | - $query = 'DELETE FROM kvp_'.$this->TableName." WHERE id='".$toAddress."'"; |
|
191 | + $query = 'DELETE FROM kvp_' . $this->TableName . " WHERE id='" . $toAddress . "'"; |
|
192 | 192 | $result = $this->DBHandle->exec($query); |
193 | 193 | if ($result === false) { |
194 | 194 | throw new \PhpOffice\PhpSpreadsheet\Exception($this->DBHandle->lastErrorMsg()); |
195 | 195 | } |
196 | 196 | |
197 | - $query = 'UPDATE kvp_'.$this->TableName." SET id='".$toAddress."' WHERE id='".$fromAddress."'"; |
|
197 | + $query = 'UPDATE kvp_' . $this->TableName . " SET id='" . $toAddress . "' WHERE id='" . $fromAddress . "'"; |
|
198 | 198 | $result = $this->DBHandle->exec($query); |
199 | 199 | if ($result === false) { |
200 | 200 | throw new \PhpOffice\PhpSpreadsheet\Exception($this->DBHandle->lastErrorMsg()); |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | $this->storeData(); |
217 | 217 | } |
218 | 218 | |
219 | - $query = 'SELECT id FROM kvp_'.$this->TableName; |
|
219 | + $query = 'SELECT id FROM kvp_' . $this->TableName; |
|
220 | 220 | $cellIdsResult = $this->DBHandle->unbufferedQuery($query, SQLITE_ASSOC); |
221 | 221 | if ($cellIdsResult === false) { |
222 | 222 | throw new \PhpOffice\PhpSpreadsheet\Exception(sqlite_error_string($this->DBHandle->lastError())); |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | |
245 | 245 | // Get a new id for the new table name |
246 | 246 | $tableName = str_replace('.', '_', $this->getUniqueID()); |
247 | - if (!$this->DBHandle->queryExec('CREATE TABLE kvp_'.$tableName.' (id VARCHAR(12) PRIMARY KEY, value BLOB) |
|
247 | + if (!$this->DBHandle->queryExec('CREATE TABLE kvp_' . $tableName . ' (id VARCHAR(12) PRIMARY KEY, value BLOB) |
|
248 | 248 | AS SELECT * FROM kvp_' .$this->TableName) |
249 | 249 | ) { |
250 | 250 | throw new \PhpOffice\PhpSpreadsheet\Exception(sqlite_error_string($this->DBHandle->lastError())); |
@@ -288,7 +288,7 @@ discard block |
||
288 | 288 | if ($this->DBHandle === false) { |
289 | 289 | throw new \PhpOffice\PhpSpreadsheet\Exception(sqlite_error_string($this->DBHandle->lastError())); |
290 | 290 | } |
291 | - if (!$this->DBHandle->queryExec('CREATE TABLE kvp_'.$this->TableName.' (id VARCHAR(12) PRIMARY KEY, value BLOB)')) { |
|
291 | + if (!$this->DBHandle->queryExec('CREATE TABLE kvp_' . $this->TableName . ' (id VARCHAR(12) PRIMARY KEY, value BLOB)')) { |
|
292 | 292 | throw new \PhpOffice\PhpSpreadsheet\Exception(sqlite_error_string($this->DBHandle->lastError())); |
293 | 293 | } |
294 | 294 | } |
@@ -300,7 +300,7 @@ discard block |
||
300 | 300 | public function __destruct() |
301 | 301 | { |
302 | 302 | if (!is_null($this->DBHandle)) { |
303 | - $this->DBHandle->queryExec('DROP TABLE kvp_'.$this->TableName); |
|
303 | + $this->DBHandle->queryExec('DROP TABLE kvp_' . $this->TableName); |
|
304 | 304 | } |
305 | 305 | $this->DBHandle = null; |
306 | 306 | } |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | $this->storeData(); |
250 | 250 | } |
251 | 251 | |
252 | - $query = 'SELECT id FROM kvp_'.$this->TableName; |
|
252 | + $query = 'SELECT id FROM kvp_' . $this->TableName; |
|
253 | 253 | $cellIdsResult = $this->DBHandle->query($query); |
254 | 254 | if ($cellIdsResult === false) { |
255 | 255 | throw new \PhpOffice\PhpSpreadsheet\Exception($this->DBHandle->lastErrorMsg()); |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | |
278 | 278 | // Get a new id for the new table name |
279 | 279 | $tableName = str_replace('.', '_', $this->getUniqueID()); |
280 | - if (!$this->DBHandle->exec('CREATE TABLE kvp_'.$tableName.' (id VARCHAR(12) PRIMARY KEY, value BLOB) |
|
280 | + if (!$this->DBHandle->exec('CREATE TABLE kvp_' . $tableName . ' (id VARCHAR(12) PRIMARY KEY, value BLOB) |
|
281 | 281 | AS SELECT * FROM kvp_' .$this->TableName) |
282 | 282 | ) { |
283 | 283 | throw new \PhpOffice\PhpSpreadsheet\Exception($this->DBHandle->lastErrorMsg()); |
@@ -321,15 +321,15 @@ discard block |
||
321 | 321 | if ($this->DBHandle === false) { |
322 | 322 | throw new \PhpOffice\PhpSpreadsheet\Exception($this->DBHandle->lastErrorMsg()); |
323 | 323 | } |
324 | - if (!$this->DBHandle->exec('CREATE TABLE kvp_'.$this->TableName.' (id VARCHAR(12) PRIMARY KEY, value BLOB)')) { |
|
324 | + if (!$this->DBHandle->exec('CREATE TABLE kvp_' . $this->TableName . ' (id VARCHAR(12) PRIMARY KEY, value BLOB)')) { |
|
325 | 325 | throw new \PhpOffice\PhpSpreadsheet\Exception($this->DBHandle->lastErrorMsg()); |
326 | 326 | } |
327 | 327 | } |
328 | 328 | |
329 | - $this->selectQuery = $this->DBHandle->prepare('SELECT value FROM kvp_'.$this->TableName.' WHERE id = :id'); |
|
330 | - $this->insertQuery = $this->DBHandle->prepare('INSERT OR REPLACE INTO kvp_'.$this->TableName.' VALUES(:id,:data)'); |
|
331 | - $this->updateQuery = $this->DBHandle->prepare('UPDATE kvp_'.$this->TableName.' SET id=:toId WHERE id=:fromId'); |
|
332 | - $this->deleteQuery = $this->DBHandle->prepare('DELETE FROM kvp_'.$this->TableName.' WHERE id = :id'); |
|
329 | + $this->selectQuery = $this->DBHandle->prepare('SELECT value FROM kvp_' . $this->TableName . ' WHERE id = :id'); |
|
330 | + $this->insertQuery = $this->DBHandle->prepare('INSERT OR REPLACE INTO kvp_' . $this->TableName . ' VALUES(:id,:data)'); |
|
331 | + $this->updateQuery = $this->DBHandle->prepare('UPDATE kvp_' . $this->TableName . ' SET id=:toId WHERE id=:fromId'); |
|
332 | + $this->deleteQuery = $this->DBHandle->prepare('DELETE FROM kvp_' . $this->TableName . ' WHERE id = :id'); |
|
333 | 333 | } |
334 | 334 | |
335 | 335 | /** |
@@ -338,7 +338,7 @@ discard block |
||
338 | 338 | public function __destruct() |
339 | 339 | { |
340 | 340 | if (!is_null($this->DBHandle)) { |
341 | - $this->DBHandle->exec('DROP TABLE kvp_'.$this->TableName); |
|
341 | + $this->DBHandle->exec('DROP TABLE kvp_' . $this->TableName); |
|
342 | 342 | $this->DBHandle->close(); |
343 | 343 | } |
344 | 344 | $this->DBHandle = null; |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | parent::copyCellCollection($parent); |
152 | 152 | // Get a new id for the new file name |
153 | 153 | $baseUnique = $this->getUniqueID(); |
154 | - $newFileName = $this->cacheDirectory.'/PhpSpreadsheet.'.$baseUnique.'.cache'; |
|
154 | + $newFileName = $this->cacheDirectory . '/PhpSpreadsheet.' . $baseUnique . '.cache'; |
|
155 | 155 | // Copy the existing cell cache file |
156 | 156 | copy($this->fileName, $newFileName); |
157 | 157 | $this->fileName = $newFileName; |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | parent::__construct($parent); |
193 | 193 | if (is_null($this->fileHandle)) { |
194 | 194 | $baseUnique = $this->getUniqueID(); |
195 | - $this->fileName = $this->cacheDirectory.'/PhpSpreadsheet.'.$baseUnique.'.cache'; |
|
195 | + $this->fileName = $this->cacheDirectory . '/PhpSpreadsheet.' . $baseUnique . '.cache'; |
|
196 | 196 | $this->fileHandle = fopen($this->fileName, 'a+'); |
197 | 197 | } |
198 | 198 | } |
@@ -187,7 +187,7 @@ |
||
187 | 187 | } |
188 | 188 | |
189 | 189 | return md5( |
190 | - $hashElements. |
|
190 | + $hashElements . |
|
191 | 191 | __CLASS__ |
192 | 192 | ); |
193 | 193 | } |
@@ -303,7 +303,7 @@ discard block |
||
303 | 303 | $condition = \PhpOffice\PhpSpreadsheet\Calculation::wrapResult(strtoupper($condition)); |
304 | 304 | } |
305 | 305 | |
306 | - return '='.$condition; |
|
306 | + return '=' . $condition; |
|
307 | 307 | } else { |
308 | 308 | preg_match('/([<>=]+)(.*)/', $condition, $matches); |
309 | 309 | list(, $operator, $operand) = $matches; |
@@ -313,7 +313,7 @@ discard block |
||
313 | 313 | $operand = \PhpOffice\PhpSpreadsheet\Calculation::wrapResult(strtoupper($operand)); |
314 | 314 | } |
315 | 315 | |
316 | - return $operator.$operand; |
|
316 | + return $operator . $operand; |
|
317 | 317 | } |
318 | 318 | } |
319 | 319 | |
@@ -653,10 +653,10 @@ discard block |
||
653 | 653 | foreach ($value as $k2 => $val) { |
654 | 654 | if (is_array($val)) { |
655 | 655 | foreach ($val as $k3 => $v) { |
656 | - $arrayValues[$k1.'.'.$k2.'.'.$k3] = $v; |
|
656 | + $arrayValues[$k1 . '.' . $k2 . '.' . $k3] = $v; |
|
657 | 657 | } |
658 | 658 | } else { |
659 | - $arrayValues[$k1.'.'.$k2] = $val; |
|
659 | + $arrayValues[$k1 . '.' . $k2] = $val; |
|
660 | 660 | } |
661 | 661 | } |
662 | 662 | } else { |
@@ -733,7 +733,7 @@ discard block |
||
733 | 733 | $r = !is_array($replace) ? $replace : (isset($replace[$key]) ? $replace[$key] : ''); |
734 | 734 | $pos = mb_strpos($subject, $s, 0, 'UTF-8'); |
735 | 735 | while ($pos !== false) { |
736 | - $subject = mb_substr($subject, 0, $pos, 'UTF-8').$r.mb_substr($subject, $pos + mb_strlen($s, 'UTF-8'), null, 'UTF-8'); |
|
736 | + $subject = mb_substr($subject, 0, $pos, 'UTF-8') . $r . mb_substr($subject, $pos + mb_strlen($s, 'UTF-8'), null, 'UTF-8'); |
|
737 | 737 | $pos = mb_strpos($subject, $s, $pos + mb_strlen($r, 'UTF-8'), 'UTF-8'); |
738 | 738 | } |
739 | 739 | } |
@@ -91,12 +91,12 @@ discard block |
||
91 | 91 | $testConditionCount = 0; |
92 | 92 | foreach ($criteria as $row => $criterion) { |
93 | 93 | if ($criterion[$key] > '') { |
94 | - $testCondition[] = '[:'.$criteriaName.']'.Functions::ifCondition($criterion[$key]); |
|
94 | + $testCondition[] = '[:' . $criteriaName . ']' . Functions::ifCondition($criterion[$key]); |
|
95 | 95 | ++$testConditionCount; |
96 | 96 | } |
97 | 97 | } |
98 | 98 | if ($testConditionCount > 1) { |
99 | - $testConditions[] = 'OR('.implode(',', $testCondition).')'; |
|
99 | + $testConditions[] = 'OR(' . implode(',', $testCondition) . ')'; |
|
100 | 100 | ++$testConditionsCount; |
101 | 101 | } elseif ($testConditionCount == 1) { |
102 | 102 | $testConditions[] = $testCondition[0]; |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | } |
106 | 106 | |
107 | 107 | if ($testConditionsCount > 1) { |
108 | - $testConditionSet = 'AND('.implode(',', $testConditions).')'; |
|
108 | + $testConditionSet = 'AND(' . implode(',', $testConditions) . ')'; |
|
109 | 109 | } elseif ($testConditionsCount == 1) { |
110 | 110 | $testConditionSet = $testConditions[0]; |
111 | 111 | } |
@@ -119,11 +119,11 @@ discard block |
||
119 | 119 | if (isset($dataValues[$k])) { |
120 | 120 | $dataValue = $dataValues[$k]; |
121 | 121 | $dataValue = (is_string($dataValue)) ? \PhpOffice\PhpSpreadsheet\Calculation::wrapResult(strtoupper($dataValue)) : $dataValue; |
122 | - $testConditionList = str_replace('[:'.$criteriaName.']', $dataValue, $testConditionList); |
|
122 | + $testConditionList = str_replace('[:' . $criteriaName . ']', $dataValue, $testConditionList); |
|
123 | 123 | } |
124 | 124 | } |
125 | 125 | // evaluate the criteria against the row data |
126 | - $result = \PhpOffice\PhpSpreadsheet\Calculation::getInstance()->_calculateFormulaValue('='.$testConditionList); |
|
126 | + $result = \PhpOffice\PhpSpreadsheet\Calculation::getInstance()->_calculateFormulaValue('=' . $testConditionList); |
|
127 | 127 | // If the row failed to meet the criteria, remove it from the database |
128 | 128 | if (!$result) { |
129 | 129 | unset($database[$dataRow]); |
@@ -330,10 +330,10 @@ |
||
330 | 330 | } |
331 | 331 | |
332 | 332 | return md5( |
333 | - $this->getFillType(). |
|
334 | - $this->getRotation(). |
|
335 | - $this->getStartColor()->getHashCode(). |
|
336 | - $this->getEndColor()->getHashCode(). |
|
333 | + $this->getFillType() . |
|
334 | + $this->getRotation() . |
|
335 | + $this->getStartColor()->getHashCode() . |
|
336 | + $this->getEndColor()->getHashCode() . |
|
337 | 337 | __CLASS__ |
338 | 338 | ); |
339 | 339 | } |
@@ -390,8 +390,8 @@ discard block |
||
390 | 390 | } |
391 | 391 | |
392 | 392 | return md5( |
393 | - $this->formatCode. |
|
394 | - $this->builtInFormatCode. |
|
393 | + $this->formatCode . |
|
394 | + $this->builtInFormatCode . |
|
395 | 395 | __CLASS__ |
396 | 396 | ); |
397 | 397 | } |
@@ -465,7 +465,7 @@ discard block |
||
465 | 465 | |
466 | 466 | private static function escapeQuotesCallback($matches) |
467 | 467 | { |
468 | - return '\\'.implode('\\', str_split($matches[1])); |
|
468 | + return '\\' . implode('\\', str_split($matches[1])); |
|
469 | 469 | } |
470 | 470 | |
471 | 471 | private static function formatAsDate(&$value, &$format) |
@@ -506,16 +506,16 @@ discard block |
||
506 | 506 | private static function formatAsPercentage(&$value, &$format) |
507 | 507 | { |
508 | 508 | if ($format === self::FORMAT_PERCENTAGE) { |
509 | - $value = round((100 * $value), 0).'%'; |
|
509 | + $value = round((100 * $value), 0) . '%'; |
|
510 | 510 | } else { |
511 | 511 | if (preg_match('/\.[#0]+/i', $format, $m)) { |
512 | - $s = substr($m[0], 0, 1).(strlen($m[0]) - 1); |
|
512 | + $s = substr($m[0], 0, 1) . (strlen($m[0]) - 1); |
|
513 | 513 | $format = str_replace($m[0], $s, $format); |
514 | 514 | } |
515 | 515 | if (preg_match('/^[#0]+/', $format, $m)) { |
516 | 516 | $format = str_replace($m[0], strlen($m[0]), $format); |
517 | 517 | } |
518 | - $format = '%'.str_replace('%', 'f%%', $format); |
|
518 | + $format = '%' . str_replace('%', 'f%%', $format); |
|
519 | 519 | |
520 | 520 | $value = sprintf($format, 100 * $value); |
521 | 521 | } |
@@ -551,12 +551,12 @@ discard block |
||
551 | 551 | $sign = ($number < 0.0); |
552 | 552 | $number = abs($number); |
553 | 553 | if (strpos($mask, '.') !== false) { |
554 | - $numbers = explode('.', $number.'.0'); |
|
555 | - $masks = explode('.', $mask.'.0'); |
|
554 | + $numbers = explode('.', $number . '.0'); |
|
555 | + $masks = explode('.', $mask . '.0'); |
|
556 | 556 | $result1 = self::complexNumberFormatMask($numbers[0], $masks[0], 1); |
557 | 557 | $result2 = strrev(self::complexNumberFormatMask(strrev($numbers[1]), strrev($masks[1]), 1)); |
558 | 558 | |
559 | - return (($sign) ? '-' : '').$result1.'.'.$result2; |
|
559 | + return (($sign) ? '-' : '') . $result1 . '.' . $result2; |
|
560 | 560 | } |
561 | 561 | |
562 | 562 | $r = preg_match_all('/0+/', $mask, $result, PREG_OFFSET_CAPTURE); |
@@ -564,12 +564,12 @@ discard block |
||
564 | 564 | $result = array_reverse($result[0]); |
565 | 565 | |
566 | 566 | foreach ($result as $block) { |
567 | - $divisor = 1 .$block[0]; |
|
567 | + $divisor = 1 . $block[0]; |
|
568 | 568 | $size = strlen($block[0]); |
569 | 569 | $offset = $block[1]; |
570 | 570 | |
571 | 571 | $blockValue = sprintf( |
572 | - '%0'.$size.'d', |
|
572 | + '%0' . $size . 'd', |
|
573 | 573 | fmod($number, $divisor) |
574 | 574 | ); |
575 | 575 | $number = floor($number / $divisor); |
@@ -583,7 +583,7 @@ discard block |
||
583 | 583 | $result = $number; |
584 | 584 | } |
585 | 585 | |
586 | - return (($sign) ? '-' : '').$result; |
|
586 | + return (($sign) ? '-' : '') . $result; |
|
587 | 587 | } |
588 | 588 | |
589 | 589 | /** |
@@ -669,7 +669,7 @@ discard block |
||
669 | 669 | self::formatAsPercentage($value, $format); |
670 | 670 | } else { |
671 | 671 | if ($format === self::FORMAT_CURRENCY_EUR_SIMPLE) { |
672 | - $value = 'EUR '.sprintf('%1.2f', $value); |
|
672 | + $value = 'EUR ' . sprintf('%1.2f', $value); |
|
673 | 673 | } else { |
674 | 674 | // Some non-number strings are quoted, so we'll get rid of the quotes, likewise any positional * symbols |
675 | 675 | $format = str_replace(['"', '*'], '', $format); |
@@ -734,7 +734,7 @@ discard block |
||
734 | 734 | } elseif (preg_match('/0([^\d\.]+)0/', $format)) { |
735 | 735 | $value = self::complexNumberFormatMask($value, $format); |
736 | 736 | } else { |
737 | - $sprintf_pattern = "%0$minWidth.".strlen($right).'f'; |
|
737 | + $sprintf_pattern = "%0$minWidth." . strlen($right) . 'f'; |
|
738 | 738 | $value = sprintf($sprintf_pattern, $value); |
739 | 739 | $value = preg_replace($number_regex, $value, $format); |
740 | 740 | } |