← All changes
|
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/ReferenceHelper.php
+13
-13
3.1.3
→
3.4.9
View file →
| @@ -81,15 +81,15 @@ | ||
| 81 | 81 | * @return int |
| 82 | 82 | */ |
| 83 | 83 | public static function cellSort($a, $b) |
| 84 | 84 | { |
| 85 | - $ac = $bc = ''; | |
| 86 | - $ar = $br = 0; | |
| 85 | + // TODO Scrutinizer doesn't like sscanf($a, '%[A-Z]%d', $ac, $ar), and we can't use short list() syntax | |
| 86 | + // [$ac, $ar] = sscanf($a, '%[A-Z]%d') while retaining PHP 5.6 support. | |
| 87 | + // Switch when we drop support for 5.6 | |
| 88 | + list($ac, $ar) = sscanf($a, '%[A-Z]%d'); | |
| 89 | + list($bc, $br) = sscanf($b, '%[A-Z]%d'); | |
| 87 | 90 | |
| 88 | - sscanf($a, '%[A-Z]%d', $ac, $ar); | |
| 89 | - sscanf($b, '%[A-Z]%d', $bc, $br); | |
| 90 | - | |
| 91 | - if ($ar == $br) { | |
| 91 | + if ($ar === $br) { | |
| 92 | 92 | return strcasecmp(strlen($ac) . $ac, strlen($bc) . $bc); |
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | return ($ar < $br) ? -1 : 1; |
| @@ -105,15 +105,15 @@ | ||
| 105 | 105 | * @return int |
| 106 | 106 | */ |
| 107 | 107 | public static function cellReverseSort($a, $b) |
| 108 | 108 | { |
| 109 | - $ac = $bc = ''; | |
| 110 | - $ar = $br = 0; | |
| 109 | + // TODO Scrutinizer doesn't like sscanf($a, '%[A-Z]%d', $ac, $ar), and we can't use short list() syntax | |
| 110 | + // [$ac, $ar] = sscanf($a, '%[A-Z]%d') while retaining PHP 5.6 support. | |
| 111 | + // Switch when we drop support for 5.6 | |
| 112 | + list($ac, $ar) = sscanf($a, '%[A-Z]%d'); | |
| 113 | + list($bc, $br) = sscanf($b, '%[A-Z]%d'); | |
| 111 | 114 | |
| 112 | - sscanf($a, '%[A-Z]%d', $ac, $ar); | |
| 113 | - sscanf($b, '%[A-Z]%d', $bc, $br); | |
| 114 | - | |
| 115 | - if ($ar == $br) { | |
| 115 | + if ($ar === $br) { | |
| 116 | 116 | return 1 - strcasecmp(strlen($ac) . $ac, strlen($bc) . $bc); |
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | return ($ar < $br) ? 1 : -1; |
| @@ -624,9 +624,9 @@ | ||
| 624 | 624 | /** |
| 625 | 625 | * Update references within formulas. |
| 626 | 626 | * |
| 627 | 627 | * @param string $pFormula Formula to update |
| 628 | - * @param int $pBefore Insert before this one | |
| 628 | + * @param string $pBefore Insert before this one | |
| 629 | 629 | * @param int $pNumCols Number of columns to insert |
| 630 | 630 | * @param int $pNumRows Number of rows to insert |
| 631 | 631 | * @param string $sheetName Worksheet name/title |
| 632 | 632 | * |