@@ -187,10 +187,10 @@ discard block |
||
187 | 187 | $pValue = '000000'; |
188 | 188 | } |
189 | 189 | if ($this->isSupervisor) { |
190 | - $styleArray = $this->getStyleArray(['argb' => 'FF' . $pValue]); |
|
190 | + $styleArray = $this->getStyleArray(['argb' => 'FF'.$pValue]); |
|
191 | 191 | $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray); |
192 | 192 | } else { |
193 | - $this->argb = 'FF' . $pValue; |
|
193 | + $this->argb = 'FF'.$pValue; |
|
194 | 194 | } |
195 | 195 | |
196 | 196 | return $this; |
@@ -297,12 +297,12 @@ discard block |
||
297 | 297 | } |
298 | 298 | |
299 | 299 | $rgb = strtoupper( |
300 | - str_pad(dechex((int) $red), 2, '0', 0) . |
|
301 | - str_pad(dechex((int) $green), 2, '0', 0) . |
|
300 | + str_pad(dechex((int) $red), 2, '0', 0). |
|
301 | + str_pad(dechex((int) $green), 2, '0', 0). |
|
302 | 302 | str_pad(dechex((int) $blue), 2, '0', 0) |
303 | 303 | ); |
304 | 304 | |
305 | - return (($rgba) ? 'FF' : '') . $rgb; |
|
305 | + return (($rgba) ? 'FF' : '').$rgb; |
|
306 | 306 | } |
307 | 307 | |
308 | 308 | /** |
@@ -404,7 +404,7 @@ discard block |
||
404 | 404 | } |
405 | 405 | |
406 | 406 | return md5( |
407 | - $this->argb . |
|
407 | + $this->argb. |
|
408 | 408 | __CLASS__ |
409 | 409 | ); |
410 | 410 | } |
@@ -298,7 +298,7 @@ discard block |
||
298 | 298 | $rangeStart[1] : $rangeEnd[1] - $yMax + $y; |
299 | 299 | |
300 | 300 | // build range for region |
301 | - $range = $colStart . $rowStart . ':' . $colEnd . $rowEnd; |
|
301 | + $range = $colStart.$rowStart.':'.$colEnd.$rowEnd; |
|
302 | 302 | |
303 | 303 | // retrieve relevant style array for region |
304 | 304 | $regionStyles = $pStyles; |
@@ -607,14 +607,14 @@ discard block |
||
607 | 607 | } |
608 | 608 | |
609 | 609 | return md5( |
610 | - $this->fill->getHashCode() . |
|
611 | - $this->font->getHashCode() . |
|
612 | - $this->borders->getHashCode() . |
|
613 | - $this->alignment->getHashCode() . |
|
614 | - $this->numberFormat->getHashCode() . |
|
615 | - $hashConditionals . |
|
616 | - $this->protection->getHashCode() . |
|
617 | - ($this->quotePrefix ? 't' : 'f') . |
|
610 | + $this->fill->getHashCode(). |
|
611 | + $this->font->getHashCode(). |
|
612 | + $this->borders->getHashCode(). |
|
613 | + $this->alignment->getHashCode(). |
|
614 | + $this->numberFormat->getHashCode(). |
|
615 | + $hashConditionals. |
|
616 | + $this->protection->getHashCode(). |
|
617 | + ($this->quotePrefix ? 't' : 'f'). |
|
618 | 618 | __CLASS__ |
619 | 619 | ); |
620 | 620 | } |
@@ -386,8 +386,8 @@ discard block |
||
386 | 386 | } |
387 | 387 | |
388 | 388 | return md5( |
389 | - $this->formatCode . |
|
390 | - $this->builtInFormatCode . |
|
389 | + $this->formatCode. |
|
390 | + $this->builtInFormatCode. |
|
391 | 391 | __CLASS__ |
392 | 392 | ); |
393 | 393 | } |
@@ -463,7 +463,7 @@ discard block |
||
463 | 463 | |
464 | 464 | private static function escapeQuotesCallback($matches) |
465 | 465 | { |
466 | - return '\\' . implode('\\', str_split($matches[1])); |
|
466 | + return '\\'.implode('\\', str_split($matches[1])); |
|
467 | 467 | } |
468 | 468 | |
469 | 469 | private static function formatAsDate(&$value, &$format) |
@@ -511,16 +511,16 @@ discard block |
||
511 | 511 | private static function formatAsPercentage(&$value, &$format) |
512 | 512 | { |
513 | 513 | if ($format === self::FORMAT_PERCENTAGE) { |
514 | - $value = round((100 * $value), 0) . '%'; |
|
514 | + $value = round((100 * $value), 0).'%'; |
|
515 | 515 | } else { |
516 | 516 | if (preg_match('/\.[#0]+/', $format, $m)) { |
517 | - $s = substr($m[0], 0, 1) . (strlen($m[0]) - 1); |
|
517 | + $s = substr($m[0], 0, 1).(strlen($m[0]) - 1); |
|
518 | 518 | $format = str_replace($m[0], $s, $format); |
519 | 519 | } |
520 | 520 | if (preg_match('/^[#0]+/', $format, $m)) { |
521 | 521 | $format = str_replace($m[0], strlen($m[0]), $format); |
522 | 522 | } |
523 | - $format = '%' . str_replace('%', 'f%%', $format); |
|
523 | + $format = '%'.str_replace('%', 'f%%', $format); |
|
524 | 524 | |
525 | 525 | $value = sprintf($format, 100 * $value); |
526 | 526 | } |
@@ -577,12 +577,12 @@ discard block |
||
577 | 577 | $maskingBlocks = array_reverse($maskingBlocks[0]); |
578 | 578 | |
579 | 579 | foreach ($maskingBlocks as $block) { |
580 | - $divisor = 1 . $block[0]; |
|
580 | + $divisor = 1.$block[0]; |
|
581 | 581 | $size = strlen($block[0]); |
582 | 582 | $offset = $block[1]; |
583 | 583 | |
584 | 584 | $blockValue = sprintf( |
585 | - '%0' . $size . 'd', |
|
585 | + '%0'.$size.'d', |
|
586 | 586 | fmod($number, $divisor) |
587 | 587 | ); |
588 | 588 | $number = floor($number / $divisor); |
@@ -611,12 +611,12 @@ discard block |
||
611 | 611 | $result1 = self::complexNumberFormatMask($numbers[0], $masks[0], false); |
612 | 612 | $result2 = strrev(self::complexNumberFormatMask(strrev($numbers[1]), strrev($masks[1]), false)); |
613 | 613 | |
614 | - return (($sign) ? '-' : '') . $result1 . '.' . $result2; |
|
614 | + return (($sign) ? '-' : '').$result1.'.'.$result2; |
|
615 | 615 | } |
616 | 616 | |
617 | 617 | $result = self::processComplexNumberFormatMask($number, $mask); |
618 | 618 | |
619 | - return (($sign) ? '-' : '') . $result; |
|
619 | + return (($sign) ? '-' : '').$result; |
|
620 | 620 | } |
621 | 621 | |
622 | 622 | private static function formatStraightNumericValue($value, $format, array $matches, $useThousands, $number_regex) |
@@ -645,7 +645,7 @@ discard block |
||
645 | 645 | } |
646 | 646 | $value = self::complexNumberFormatMask($value, $format); |
647 | 647 | } else { |
648 | - $sprintf_pattern = "%0$minWidth." . strlen($right) . 'f'; |
|
648 | + $sprintf_pattern = "%0$minWidth.".strlen($right).'f'; |
|
649 | 649 | $value = sprintf($sprintf_pattern, $value); |
650 | 650 | $value = preg_replace($number_regex, $value, $format); |
651 | 651 | } |
@@ -657,7 +657,7 @@ discard block |
||
657 | 657 | private static function formatAsNumber($value, $format) |
658 | 658 | { |
659 | 659 | if ($format === self::FORMAT_CURRENCY_EUR_SIMPLE) { |
660 | - return 'EUR ' . sprintf('%1.2f', $value); |
|
660 | + return 'EUR '.sprintf('%1.2f', $value); |
|
661 | 661 | } |
662 | 662 | |
663 | 663 | // Some non-number strings are quoted, so we'll get rid of the quotes, likewise any positional * symbols |
@@ -790,7 +790,7 @@ discard block |
||
790 | 790 | // Save format with color information for later use below |
791 | 791 | $formatColor = $format; |
792 | 792 | // Strip colour information |
793 | - $color_regex = '/\[(' . implode('|', Color::NAMED_COLORS) . ')\]/'; |
|
793 | + $color_regex = '/\[('.implode('|', Color::NAMED_COLORS).')\]/'; |
|
794 | 794 | $format = preg_replace($color_regex, '', $format); |
795 | 795 | // Let's begin inspecting the format and converting the value to a formatted string |
796 | 796 |
@@ -411,12 +411,12 @@ |
||
411 | 411 | } |
412 | 412 | |
413 | 413 | return md5( |
414 | - $this->getLeft()->getHashCode() . |
|
415 | - $this->getRight()->getHashCode() . |
|
416 | - $this->getTop()->getHashCode() . |
|
417 | - $this->getBottom()->getHashCode() . |
|
418 | - $this->getDiagonal()->getHashCode() . |
|
419 | - $this->getDiagonalDirection() . |
|
414 | + $this->getLeft()->getHashCode(). |
|
415 | + $this->getRight()->getHashCode(). |
|
416 | + $this->getTop()->getHashCode(). |
|
417 | + $this->getBottom()->getHashCode(). |
|
418 | + $this->getDiagonal()->getHashCode(). |
|
419 | + $this->getDiagonalDirection(). |
|
420 | 420 | __CLASS__ |
421 | 421 | ); |
422 | 422 | } |
@@ -182,8 +182,8 @@ |
||
182 | 182 | } |
183 | 183 | |
184 | 184 | return md5( |
185 | - $this->locked . |
|
186 | - $this->hidden . |
|
185 | + $this->locked. |
|
186 | + $this->hidden. |
|
187 | 187 | __CLASS__ |
188 | 188 | ); |
189 | 189 | } |
@@ -316,10 +316,10 @@ |
||
316 | 316 | // Note that we don't care about colours for fill type NONE, but could have duplicate NONEs with |
317 | 317 | // different hashes if we don't explicitly prevent this |
318 | 318 | return md5( |
319 | - $this->getFillType() . |
|
320 | - $this->getRotation() . |
|
321 | - ($this->getFillType() !== self::FILL_NONE ? $this->getStartColor()->getHashCode() : '') . |
|
322 | - ($this->getFillType() !== self::FILL_NONE ? $this->getEndColor()->getHashCode() : '') . |
|
319 | + $this->getFillType(). |
|
320 | + $this->getRotation(). |
|
321 | + ($this->getFillType() !== self::FILL_NONE ? $this->getStartColor()->getHashCode() : ''). |
|
322 | + ($this->getFillType() !== self::FILL_NONE ? $this->getEndColor()->getHashCode() : ''). |
|
323 | 323 | __CLASS__ |
324 | 324 | ); |
325 | 325 | } |
@@ -541,15 +541,15 @@ |
||
541 | 541 | } |
542 | 542 | |
543 | 543 | return md5( |
544 | - $this->name . |
|
545 | - $this->size . |
|
546 | - ($this->bold ? 't' : 'f') . |
|
547 | - ($this->italic ? 't' : 'f') . |
|
548 | - ($this->superscript ? 't' : 'f') . |
|
549 | - ($this->subscript ? 't' : 'f') . |
|
550 | - $this->underline . |
|
551 | - ($this->strikethrough ? 't' : 'f') . |
|
552 | - $this->color->getHashCode() . |
|
544 | + $this->name. |
|
545 | + $this->size. |
|
546 | + ($this->bold ? 't' : 'f'). |
|
547 | + ($this->italic ? 't' : 'f'). |
|
548 | + ($this->superscript ? 't' : 'f'). |
|
549 | + ($this->subscript ? 't' : 'f'). |
|
550 | + $this->underline. |
|
551 | + ($this->strikethrough ? 't' : 'f'). |
|
552 | + $this->color->getHashCode(). |
|
553 | 553 | __CLASS__ |
554 | 554 | ); |
555 | 555 | } |
@@ -837,7 +837,7 @@ discard block |
||
837 | 837 | return $worksheet; |
838 | 838 | } |
839 | 839 | |
840 | - throw new Exception('Workbook does not contain sheet:' . $pValue); |
|
840 | + throw new Exception('Workbook does not contain sheet:'.$pValue); |
|
841 | 841 | } |
842 | 842 | |
843 | 843 | /** |
@@ -916,7 +916,7 @@ discard block |
||
916 | 916 | $this->namedRanges[$namedRange->getName()] = $namedRange; |
917 | 917 | } else { |
918 | 918 | // local scope |
919 | - $this->namedRanges[$namedRange->getScope()->getTitle() . '!' . $namedRange->getName()] = $namedRange; |
|
919 | + $this->namedRanges[$namedRange->getScope()->getTitle().'!'.$namedRange->getName()] = $namedRange; |
|
920 | 920 | } |
921 | 921 | |
922 | 922 | return true; |
@@ -941,8 +941,8 @@ discard block |
||
941 | 941 | } |
942 | 942 | |
943 | 943 | // then look for local defined name (has priority over global defined name if both names exist) |
944 | - if (($pSheet !== null) && isset($this->namedRanges[$pSheet->getTitle() . '!' . $namedRange])) { |
|
945 | - $returnValue = $this->namedRanges[$pSheet->getTitle() . '!' . $namedRange]; |
|
944 | + if (($pSheet !== null) && isset($this->namedRanges[$pSheet->getTitle().'!'.$namedRange])) { |
|
945 | + $returnValue = $this->namedRanges[$pSheet->getTitle().'!'.$namedRange]; |
|
946 | 946 | } |
947 | 947 | } |
948 | 948 | |
@@ -964,8 +964,8 @@ discard block |
||
964 | 964 | unset($this->namedRanges[$namedRange]); |
965 | 965 | } |
966 | 966 | } else { |
967 | - if (isset($this->namedRanges[$pSheet->getTitle() . '!' . $namedRange])) { |
|
968 | - unset($this->namedRanges[$pSheet->getTitle() . '!' . $namedRange]); |
|
967 | + if (isset($this->namedRanges[$pSheet->getTitle().'!'.$namedRange])) { |
|
968 | + unset($this->namedRanges[$pSheet->getTitle().'!'.$namedRange]); |
|
969 | 969 | } |
970 | 970 | } |
971 | 971 |
@@ -414,7 +414,7 @@ discard block |
||
414 | 414 | } |
415 | 415 | } else { |
416 | 416 | // String values are always tested for equality, factoring in for wildcards (hence a regexp test) |
417 | - $retVal = preg_match('/^' . $rule['value'] . '$/i', $cellValue); |
|
417 | + $retVal = preg_match('/^'.$rule['value'].'$/i', $cellValue); |
|
418 | 418 | } |
419 | 419 | // If there are multiple conditions, then we need to test both using the appropriate join operator |
420 | 420 | switch ($join) { |
@@ -599,7 +599,7 @@ discard block |
||
599 | 599 | |
600 | 600 | private function calculateTopTenValue($columnID, $startRow, $endRow, $ruleType, $ruleValue) |
601 | 601 | { |
602 | - $range = $columnID . $startRow . ':' . $columnID . $endRow; |
|
602 | + $range = $columnID.$startRow.':'.$columnID.$endRow; |
|
603 | 603 | $dataValues = Functions::flattenArray($this->workSheet->rangeToArray($range, null, true, false)); |
604 | 604 | |
605 | 605 | $dataValues = array_filter($dataValues); |
@@ -683,7 +683,7 @@ discard block |
||
683 | 683 | ($ruleValue[AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DATEGROUP_SECOND] !== '')) { |
684 | 684 | $time .= sprintf('%02d', $ruleValue[AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DATEGROUP_SECOND]); |
685 | 685 | } |
686 | - $dateTime = $date . $time; |
|
686 | + $dateTime = $date.$time; |
|
687 | 687 | $arguments['date'][] = $date; |
688 | 688 | $arguments['time'][] = $time; |
689 | 689 | $arguments['dateTime'][] = $dateTime; |
@@ -732,7 +732,7 @@ discard block |
||
732 | 732 | ($dynamicRuleType == AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_BELOWAVERAGE)) { |
733 | 733 | // Number (Average) based |
734 | 734 | // Calculate the average |
735 | - $averageFormula = '=AVERAGE(' . $columnID . ($rangeStart[1] + 1) . ':' . $columnID . $rangeEnd[1] . ')'; |
|
735 | + $averageFormula = '=AVERAGE('.$columnID.($rangeStart[1] + 1).':'.$columnID.$rangeEnd[1].')'; |
|
736 | 736 | $average = Calculation::getInstance()->calculateFormula($averageFormula, null, $this->workSheet->getCell('A1')); |
737 | 737 | // Set above/below rule based on greaterThan or LessTan |
738 | 738 | $operator = ($dynamicRuleType === AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_ABOVEAVERAGE) |
@@ -815,7 +815,7 @@ discard block |
||
815 | 815 | for ($row = $rangeStart[1] + 1; $row <= $rangeEnd[1]; ++$row) { |
816 | 816 | $result = true; |
817 | 817 | foreach ($columnFilterTests as $columnID => $columnFilterTest) { |
818 | - $cellValue = $this->workSheet->getCell($columnID . $row)->getCalculatedValue(); |
|
818 | + $cellValue = $this->workSheet->getCell($columnID.$row)->getCalculatedValue(); |
|
819 | 819 | // Execute the filter test |
820 | 820 | $result = $result && |
821 | 821 | call_user_func_array( |