@@ -67,12 +67,12 @@ discard block |
||
67 | 67 | $testConditionCount = 0; |
68 | 68 | foreach ($criteria as $row => $criterion) { |
69 | 69 | if ($criterion[$key] > '') { |
70 | - $testCondition[] = '[:' . $criteriaName . ']' . Functions::ifCondition($criterion[$key]); |
|
70 | + $testCondition[] = '[:'.$criteriaName.']'.Functions::ifCondition($criterion[$key]); |
|
71 | 71 | ++$testConditionCount; |
72 | 72 | } |
73 | 73 | } |
74 | 74 | if ($testConditionCount > 1) { |
75 | - $testConditions[] = 'OR(' . implode(',', $testCondition) . ')'; |
|
75 | + $testConditions[] = 'OR('.implode(',', $testCondition).')'; |
|
76 | 76 | ++$testConditionsCount; |
77 | 77 | } elseif ($testConditionCount == 1) { |
78 | 78 | $testConditions[] = $testCondition[0]; |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | } |
82 | 82 | |
83 | 83 | if ($testConditionsCount > 1) { |
84 | - $testConditionSet = 'AND(' . implode(',', $testConditions) . ')'; |
|
84 | + $testConditionSet = 'AND('.implode(',', $testConditions).')'; |
|
85 | 85 | } elseif ($testConditionsCount == 1) { |
86 | 86 | $testConditionSet = $testConditions[0]; |
87 | 87 | } |
@@ -95,11 +95,11 @@ discard block |
||
95 | 95 | if (isset($dataValues[$k])) { |
96 | 96 | $dataValue = $dataValues[$k]; |
97 | 97 | $dataValue = (is_string($dataValue)) ? Calculation::wrapResult(strtoupper($dataValue)) : $dataValue; |
98 | - $testConditionList = str_replace('[:' . $criteriaName . ']', $dataValue, $testConditionList); |
|
98 | + $testConditionList = str_replace('[:'.$criteriaName.']', $dataValue, $testConditionList); |
|
99 | 99 | } |
100 | 100 | } |
101 | 101 | // evaluate the criteria against the row data |
102 | - $result = Calculation::getInstance()->_calculateFormulaValue('=' . $testConditionList); |
|
102 | + $result = Calculation::getInstance()->_calculateFormulaValue('='.$testConditionList); |
|
103 | 103 | // If the row failed to meet the criteria, remove it from the database |
104 | 104 | if (!$result) { |
105 | 105 | unset($database[$dataRow]); |
@@ -141,7 +141,7 @@ |
||
141 | 141 | while (is_array($value)) { |
142 | 142 | $value = array_pop($value); |
143 | 143 | } |
144 | - $str .= $value . ' |> '; |
|
144 | + $str .= $value.' |> '; |
|
145 | 145 | } |
146 | 146 | |
147 | 147 | return $str; |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | return Functions::VALUE(); |
95 | 95 | } |
96 | 96 | |
97 | - $args = array_filter($args, function ($value) { |
|
97 | + $args = array_filter($args, function($value) { |
|
98 | 98 | return $value !== null || (is_string($value) && trim($value) == ''); |
99 | 99 | }); |
100 | 100 | $argCount = count($args); |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | return Functions::VALUE(); |
138 | 138 | } |
139 | 139 | |
140 | - $args = array_filter($args, function ($value) { |
|
140 | + $args = array_filter($args, function($value) { |
|
141 | 141 | return $value !== null || (is_string($value) && trim($value) == ''); |
142 | 142 | }); |
143 | 143 | |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | return Functions::VALUE(); |
181 | 181 | } |
182 | 182 | |
183 | - $args = array_filter($args, function ($value) { |
|
183 | + $args = array_filter($args, function($value) { |
|
184 | 184 | return $value !== null || (is_string($value) && trim($value) == ''); |
185 | 185 | }); |
186 | 186 |
@@ -1119,7 +1119,7 @@ discard block |
||
1119 | 1119 | $t = self::romanCut($aValue, 10); |
1120 | 1120 | $aValue %= 10; |
1121 | 1121 | |
1122 | - return $roman . $mill[$m] . $cent[$c] . $tens[$t] . $ones[$aValue]; |
|
1122 | + return $roman.$mill[$m].$cent[$c].$tens[$t].$ones[$aValue]; |
|
1123 | 1123 | } |
1124 | 1124 | |
1125 | 1125 | /** |
@@ -1271,7 +1271,7 @@ discard block |
||
1271 | 1271 | { |
1272 | 1272 | return array_filter( |
1273 | 1273 | $args, |
1274 | - function ($index) use ($cellReference) { |
|
1274 | + function($index) use ($cellReference) { |
|
1275 | 1275 | [, $row, $column] = explode('.', $index); |
1276 | 1276 | |
1277 | 1277 | return $cellReference->getWorksheet()->getRowDimension($row)->getVisible() && |
@@ -1285,12 +1285,12 @@ discard block |
||
1285 | 1285 | { |
1286 | 1286 | return array_filter( |
1287 | 1287 | $args, |
1288 | - function ($index) use ($cellReference) { |
|
1288 | + function($index) use ($cellReference) { |
|
1289 | 1289 | [, $row, $column] = explode('.', $index); |
1290 | - if ($cellReference->getWorksheet()->cellExists($column . $row)) { |
|
1290 | + if ($cellReference->getWorksheet()->cellExists($column.$row)) { |
|
1291 | 1291 | //take this cell out if it contains the SUBTOTAL or AGGREGATE functions in a formula |
1292 | - $isFormula = $cellReference->getWorksheet()->getCell($column . $row)->isFormula(); |
|
1293 | - $cellFormula = !preg_match('/^=.*\b(SUBTOTAL|AGGREGATE)\s*\(/i', $cellReference->getWorksheet()->getCell($column . $row)->getValue()); |
|
1292 | + $isFormula = $cellReference->getWorksheet()->getCell($column.$row)->isFormula(); |
|
1293 | + $cellFormula = !preg_match('/^=.*\b(SUBTOTAL|AGGREGATE)\s*\(/i', $cellReference->getWorksheet()->getCell($column.$row)->getValue()); |
|
1294 | 1294 | |
1295 | 1295 | return !$isFormula || $cellFormula; |
1296 | 1296 | } |
@@ -1421,7 +1421,7 @@ discard block |
||
1421 | 1421 | $arg = Calculation::wrapResult(strtoupper($arg)); |
1422 | 1422 | } |
1423 | 1423 | |
1424 | - $testCondition = '=' . $arg . $condition; |
|
1424 | + $testCondition = '='.$arg.$condition; |
|
1425 | 1425 | $sumValue = array_key_exists($key, $sumArgs) ? $sumArgs[$key] : 0; |
1426 | 1426 | |
1427 | 1427 | if (is_numeric($sumValue) && |
@@ -1476,7 +1476,7 @@ discard block |
||
1476 | 1476 | if (!is_numeric($arg)) { |
1477 | 1477 | $arg = Calculation::wrapResult(strtoupper($arg)); |
1478 | 1478 | } |
1479 | - $testCondition = '=' . $arg . $condition; |
|
1479 | + $testCondition = '='.$arg.$condition; |
|
1480 | 1480 | if (!Calculation::getInstance()->_calculateFormulaValue($testCondition)) { |
1481 | 1481 | // Is not a value within our criteria |
1482 | 1482 | $valid = false; |
@@ -102,8 +102,8 @@ |
||
102 | 102 | $message, |
103 | 103 | PHP_EOL; |
104 | 104 | } |
105 | - $this->debugLog[] = $cellReference . |
|
106 | - ($this->cellStack->count() > 0 ? ' => ' : '') . |
|
105 | + $this->debugLog[] = $cellReference. |
|
106 | + ($this->cellStack->count() > 0 ? ' => ' : ''). |
|
107 | 107 | $message; |
108 | 108 | } |
109 | 109 | } |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | return iconv('UCS-4LE', 'UTF-8', pack('V', $character)); |
35 | 35 | } |
36 | 36 | |
37 | - return mb_convert_encoding('&#' . (int) $character . ';', 'UTF-8', 'HTML-ENTITIES'); |
|
37 | + return mb_convert_encoding('&#'.(int) $character.';', 'UTF-8', 'HTML-ENTITIES'); |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | /** |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | |
166 | 166 | $mask = '$#,##0'; |
167 | 167 | if ($decimals > 0) { |
168 | - $mask .= '.' . str_repeat('0', $decimals); |
|
168 | + $mask .= '.'.str_repeat('0', $decimals); |
|
169 | 169 | } else { |
170 | 170 | $round = pow(10, abs($decimals)); |
171 | 171 | if ($value < 0) { |
@@ -460,7 +460,7 @@ discard block |
||
460 | 460 | $left = self::LEFT($oldText, $start - 1); |
461 | 461 | $right = self::RIGHT($oldText, self::STRINGLENGTH($oldText) - ($start + $chars) + 1); |
462 | 462 | |
463 | - return $left . $newText . $right; |
|
463 | + return $left.$newText.$right; |
|
464 | 464 | } |
465 | 465 | |
466 | 466 | /** |
@@ -553,7 +553,7 @@ discard block |
||
553 | 553 | $numberValue = str_replace( |
554 | 554 | StringHelper::getThousandsSeparator(), |
555 | 555 | '', |
556 | - trim($value, " \t\n\r\0\x0B" . StringHelper::getCurrencyCode()) |
|
556 | + trim($value, " \t\n\r\0\x0B".StringHelper::getCurrencyCode()) |
|
557 | 557 | ); |
558 | 558 | if (is_numeric($numberValue)) { |
559 | 559 | return (float) $numberValue; |
@@ -603,7 +603,7 @@ discard block |
||
603 | 603 | $decimalSeparator = empty($decimalSeparator) ? StringHelper::getDecimalSeparator() : $decimalSeparator; |
604 | 604 | $groupSeparator = empty($groupSeparator) ? StringHelper::getThousandsSeparator() : $groupSeparator; |
605 | 605 | |
606 | - $decimalPositions = preg_match_all('/' . preg_quote($decimalSeparator) . '/', $value, $matches, PREG_OFFSET_CAPTURE); |
|
606 | + $decimalPositions = preg_match_all('/'.preg_quote($decimalSeparator).'/', $value, $matches, PREG_OFFSET_CAPTURE); |
|
607 | 607 | if ($decimalPositions > 1) { |
608 | 608 | return Functions::VALUE(); |
609 | 609 | } |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | |
45 | 45 | if ($sheetText > '') { |
46 | 46 | if (strpos($sheetText, ' ') !== false) { |
47 | - $sheetText = "'" . $sheetText . "'"; |
|
47 | + $sheetText = "'".$sheetText."'"; |
|
48 | 48 | } |
49 | 49 | $sheetText .= '!'; |
50 | 50 | } |
@@ -58,16 +58,16 @@ discard block |
||
58 | 58 | $rowRelative = ''; |
59 | 59 | } |
60 | 60 | |
61 | - return $sheetText . $columnRelative . $column . $rowRelative . $row; |
|
61 | + return $sheetText.$columnRelative.$column.$rowRelative.$row; |
|
62 | 62 | } |
63 | 63 | if (($relativity == 2) || ($relativity == 4)) { |
64 | - $column = '[' . $column . ']'; |
|
64 | + $column = '['.$column.']'; |
|
65 | 65 | } |
66 | 66 | if (($relativity == 3) || ($relativity == 4)) { |
67 | - $row = '[' . $row . ']'; |
|
67 | + $row = '['.$row.']'; |
|
68 | 68 | } |
69 | 69 | |
70 | - return $sheetText . 'R' . $row . 'C' . $column; |
|
70 | + return $sheetText.'R'.$row.'C'.$column; |
|
71 | 71 | } |
72 | 72 | |
73 | 73 | /** |
@@ -288,9 +288,9 @@ discard block |
||
288 | 288 | [$cellAddress1, $cellAddress2] = explode(':', $cellAddress); |
289 | 289 | } |
290 | 290 | |
291 | - if ((!preg_match('/^' . Calculation::CALCULATION_REGEXP_CELLREF . '$/i', $cellAddress1, $matches)) || |
|
292 | - (($cellAddress2 !== null) && (!preg_match('/^' . Calculation::CALCULATION_REGEXP_CELLREF . '$/i', $cellAddress2, $matches)))) { |
|
293 | - if (!preg_match('/^' . Calculation::CALCULATION_REGEXP_NAMEDRANGE . '$/i', $cellAddress1, $matches)) { |
|
291 | + if ((!preg_match('/^'.Calculation::CALCULATION_REGEXP_CELLREF.'$/i', $cellAddress1, $matches)) || |
|
292 | + (($cellAddress2 !== null) && (!preg_match('/^'.Calculation::CALCULATION_REGEXP_CELLREF.'$/i', $cellAddress2, $matches)))) { |
|
293 | + if (!preg_match('/^'.Calculation::CALCULATION_REGEXP_NAMEDRANGE.'$/i', $cellAddress1, $matches)) { |
|
294 | 294 | return Functions::REF(); |
295 | 295 | } |
296 | 296 | |
@@ -396,9 +396,9 @@ discard block |
||
396 | 396 | } |
397 | 397 | $endCellColumn = Coordinate::stringFromColumnIndex($endCellColumn + 1); |
398 | 398 | |
399 | - $cellAddress = $startCellColumn . $startCellRow; |
|
399 | + $cellAddress = $startCellColumn.$startCellRow; |
|
400 | 400 | if (($startCellColumn != $endCellColumn) || ($startCellRow != $endCellRow)) { |
401 | - $cellAddress .= ':' . $endCellColumn . $endCellRow; |
|
401 | + $cellAddress .= ':'.$endCellColumn.$endCellRow; |
|
402 | 402 | } |
403 | 403 | |
404 | 404 | if ($sheetName !== null) { |
@@ -534,7 +534,7 @@ discard block |
||
534 | 534 | if ($matchType === 0) { |
535 | 535 | if ($typeMatch && is_string($lookupValue) && (bool) preg_match('/([\?\*])/', $lookupValue)) { |
536 | 536 | $splitString = $lookupValue; |
537 | - $chars = array_map(function ($i) use ($splitString) { |
|
537 | + $chars = array_map(function($i) use ($splitString) { |
|
538 | 538 | return mb_substr($splitString, $i, 1); |
539 | 539 | }, range(0, mb_strlen($splitString) - 1)); |
540 | 540 | |
@@ -951,9 +951,9 @@ discard block |
||
951 | 951 | return Functions::REF(); |
952 | 952 | } |
953 | 953 | |
954 | - preg_match('/^' . Calculation::CALCULATION_REGEXP_CELLREF . '$/i', $cellReference, $matches); |
|
954 | + preg_match('/^'.Calculation::CALCULATION_REGEXP_CELLREF.'$/i', $cellReference, $matches); |
|
955 | 955 | |
956 | - $cellReference = $matches[6] . $matches[7]; |
|
956 | + $cellReference = $matches[6].$matches[7]; |
|
957 | 957 | $worksheetName = trim($matches[3], "'"); |
958 | 958 | $worksheet = (!empty($worksheetName)) |
959 | 959 | ? $pCell->getWorksheet()->getParent()->getSheetByName($worksheetName) |
@@ -109,10 +109,10 @@ discard block |
||
109 | 109 | |
110 | 110 | $adjustmentMonthsString = (string) $adjustmentMonths; |
111 | 111 | if ($adjustmentMonths > 0) { |
112 | - $adjustmentMonthsString = '+' . $adjustmentMonths; |
|
112 | + $adjustmentMonthsString = '+'.$adjustmentMonths; |
|
113 | 113 | } |
114 | 114 | if ($adjustmentMonths != 0) { |
115 | - $PHPDateObject->modify($adjustmentMonthsString . ' months'); |
|
115 | + $PHPDateObject->modify($adjustmentMonthsString.' months'); |
|
116 | 116 | } |
117 | 117 | $nMonth = (int) $PHPDateObject->format('m'); |
118 | 118 | $nYear = (int) $PHPDateObject->format('Y'); |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | $monthDiff = ($nMonth - $oMonth) + (($nYear - $oYear) * 12); |
121 | 121 | if ($monthDiff != $adjustmentMonths) { |
122 | 122 | $adjustDays = (int) $PHPDateObject->format('d'); |
123 | - $adjustDaysString = '-' . $adjustDays . ' days'; |
|
123 | + $adjustDaysString = '-'.$adjustDays.' days'; |
|
124 | 124 | $PHPDateObject->modify($adjustDaysString); |
125 | 125 | } |
126 | 126 | |
@@ -434,9 +434,9 @@ discard block |
||
434 | 434 | $dayAdjust = floor($hour / 24); |
435 | 435 | $hour = $hour % 24; |
436 | 436 | } |
437 | - $phpDateObject = new \DateTime('1900-01-01 ' . $hour . ':' . $minute . ':' . $second); |
|
437 | + $phpDateObject = new \DateTime('1900-01-01 '.$hour.':'.$minute.':'.$second); |
|
438 | 438 | if ($dayAdjust != 0) { |
439 | - $phpDateObject->modify($dayAdjust . ' days'); |
|
439 | + $phpDateObject->modify($dayAdjust.' days'); |
|
440 | 440 | } |
441 | 441 | |
442 | 442 | return $phpDateObject; |
@@ -529,9 +529,9 @@ discard block |
||
529 | 529 | if ($testVal1 < 31 && $testVal2 < 12 && $testVal3 < 12 && strlen($testVal3) == 2) { |
530 | 530 | $testVal3 += 2000; |
531 | 531 | } |
532 | - $PHPDateArray = date_parse($testVal1 . '-' . $testVal2 . '-' . $testVal3); |
|
532 | + $PHPDateArray = date_parse($testVal1.'-'.$testVal2.'-'.$testVal3); |
|
533 | 533 | if (($PHPDateArray === false) || ($PHPDateArray['error_count'] > 0)) { |
534 | - $PHPDateArray = date_parse($testVal2 . '-' . $testVal1 . '-' . $testVal3); |
|
534 | + $PHPDateArray = date_parse($testVal2.'-'.$testVal1.'-'.$testVal3); |
|
535 | 535 | if (($PHPDateArray === false) || ($PHPDateArray['error_count'] > 0)) { |
536 | 536 | return Functions::VALUE(); |
537 | 537 | } |
@@ -571,7 +571,7 @@ discard block |
||
571 | 571 | case Functions::RETURNDATE_UNIX_TIMESTAMP: |
572 | 572 | return (int) Date::excelToTimestamp($excelDateValue); |
573 | 573 | case Functions::RETURNDATE_PHP_DATETIME_OBJECT: |
574 | - return new \DateTime($PHPDateArray['year'] . '-' . $PHPDateArray['month'] . '-' . $PHPDateArray['day'] . ' 00:00:00'); |
|
574 | + return new \DateTime($PHPDateArray['year'].'-'.$PHPDateArray['month'].'-'.$PHPDateArray['day'].' 00:00:00'); |
|
575 | 575 | } |
576 | 576 | } |
577 | 577 | |
@@ -633,7 +633,7 @@ discard block |
||
633 | 633 | case Functions::RETURNDATE_UNIX_TIMESTAMP: |
634 | 634 | return (int) $phpDateValue = Date::excelToTimestamp($excelDateValue + 25569) - 3600; |
635 | 635 | case Functions::RETURNDATE_PHP_DATETIME_OBJECT: |
636 | - return new \DateTime('1900-01-01 ' . $PHPDateArray['hour'] . ':' . $PHPDateArray['minute'] . ':' . $PHPDateArray['second']); |
|
636 | + return new \DateTime('1900-01-01 '.$PHPDateArray['hour'].':'.$PHPDateArray['minute'].':'.$PHPDateArray['second']); |
|
637 | 637 | } |
638 | 638 | } |
639 | 639 | |
@@ -711,7 +711,7 @@ discard block |
||
711 | 711 | case 'MD': |
712 | 712 | if ($endDays < $startDays) { |
713 | 713 | $retVal = $endDays; |
714 | - $PHPEndDateObject->modify('-' . $endDays . ' days'); |
|
714 | + $PHPEndDateObject->modify('-'.$endDays.' days'); |
|
715 | 715 | $adjustDays = $PHPEndDateObject->format('j'); |
716 | 716 | $retVal += ($adjustDays - $startDays); |
717 | 717 | } else { |
@@ -1364,7 +1364,7 @@ discard block |
||
1364 | 1364 | return (int) $PHPDateObject->format('W'); |
1365 | 1365 | } |
1366 | 1366 | $dayOfYear = $PHPDateObject->format('z'); |
1367 | - $PHPDateObject->modify('-' . $dayOfYear . ' days'); |
|
1367 | + $PHPDateObject->modify('-'.$dayOfYear.' days'); |
|
1368 | 1368 | $firstDayOfFirstWeek = $PHPDateObject->format('w'); |
1369 | 1369 | $daysInFirstWeek = (6 - $firstDayOfFirstWeek + $method) % 7; |
1370 | 1370 | $daysInFirstWeek += 7 * !$daysInFirstWeek; |
@@ -1676,7 +1676,7 @@ discard block |
||
1676 | 1676 | // Execute function |
1677 | 1677 | $PHPDateObject = self::adjustDateByMonths($dateValue, $adjustmentMonths + 1); |
1678 | 1678 | $adjustDays = (int) $PHPDateObject->format('d'); |
1679 | - $adjustDaysString = '-' . $adjustDays . ' days'; |
|
1679 | + $adjustDaysString = '-'.$adjustDays.' days'; |
|
1680 | 1680 | $PHPDateObject->modify($adjustDaysString); |
1681 | 1681 | |
1682 | 1682 | switch (Functions::getReturnDateType()) { |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | $condition = Calculation::wrapResult(strtoupper($condition)); |
281 | 281 | } |
282 | 282 | |
283 | - return str_replace('""""', '""', '=' . $condition); |
|
283 | + return str_replace('""""', '""', '='.$condition); |
|
284 | 284 | } |
285 | 285 | preg_match('/(=|<[>=]?|>=?)(.*)/', $condition, $matches); |
286 | 286 | [, $operator, $operand] = $matches; |
@@ -292,7 +292,7 @@ discard block |
||
292 | 292 | $operand = Calculation::wrapResult(strtoupper($operand)); |
293 | 293 | } |
294 | 294 | |
295 | - return str_replace('""""', '""', $operator . $operand); |
|
295 | + return str_replace('""""', '""', $operator.$operand); |
|
296 | 296 | } |
297 | 297 | |
298 | 298 | /** |
@@ -622,10 +622,10 @@ discard block |
||
622 | 622 | foreach ($value as $k2 => $val) { |
623 | 623 | if (is_array($val)) { |
624 | 624 | foreach ($val as $k3 => $v) { |
625 | - $arrayValues[$k1 . '.' . $k2 . '.' . $k3] = $v; |
|
625 | + $arrayValues[$k1.'.'.$k2.'.'.$k3] = $v; |
|
626 | 626 | } |
627 | 627 | } else { |
628 | - $arrayValues[$k1 . '.' . $k2] = $val; |
|
628 | + $arrayValues[$k1.'.'.$k2] = $val; |
|
629 | 629 | } |
630 | 630 | } |
631 | 631 | } else { |
@@ -666,9 +666,9 @@ discard block |
||
666 | 666 | return self::REF(); |
667 | 667 | } |
668 | 668 | |
669 | - preg_match('/^' . Calculation::CALCULATION_REGEXP_CELLREF . '$/i', $cellReference, $matches); |
|
669 | + preg_match('/^'.Calculation::CALCULATION_REGEXP_CELLREF.'$/i', $cellReference, $matches); |
|
670 | 670 | |
671 | - $cellReference = $matches[6] . $matches[7]; |
|
671 | + $cellReference = $matches[6].$matches[7]; |
|
672 | 672 | $worksheetName = trim($matches[3], "'"); |
673 | 673 | |
674 | 674 | $worksheet = (!empty($worksheetName)) |