Scrutinizer resolutions (#1031)

* list($ac, $ar) = sscanf($a, '%[A-Z]%d'); to appease scrutinizer, which complains about ($a, '%[A-Z]%d')

* Fix a docblock error
This commit is contained in:
Mark Baker 2019-06-23 19:19:45 +02:00 committed by GitHub
parent 14e980625f
commit 591f1e0c70
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 5 deletions

View File

@ -82,8 +82,11 @@ class ReferenceHelper
*/ */
public static function cellSort($a, $b) public static function cellSort($a, $b)
{ {
sscanf($a, '%[A-Z]%d', $ac, $ar); // TODO Scrutinizer doesn't like sscanf($a, '%[A-Z]%d', $ac, $ar), and we can't use short list() syntax
sscanf($b, '%[A-Z]%d', $bc, $br); // [$ac, $ar] = sscanf($a, '%[A-Z]%d') while retaining PHP 5.6 support.
// Switch when we drop support for 5.6
list($ac, $ar) = sscanf($a, '%[A-Z]%d');
list($bc, $br) = sscanf($b, '%[A-Z]%d');
if ($ar === $br) { if ($ar === $br) {
return strcasecmp(strlen($ac) . $ac, strlen($bc) . $bc); return strcasecmp(strlen($ac) . $ac, strlen($bc) . $bc);
@ -103,8 +106,11 @@ class ReferenceHelper
*/ */
public static function cellReverseSort($a, $b) public static function cellReverseSort($a, $b)
{ {
sscanf($a, '%[A-Z]%d', $ac, $ar); // TODO Scrutinizer doesn't like sscanf($a, '%[A-Z]%d', $ac, $ar), and we can't use short list() syntax
sscanf($b, '%[A-Z]%d', $bc, $br); // [$ac, $ar] = sscanf($a, '%[A-Z]%d') while retaining PHP 5.6 support.
// Switch when we drop support for 5.6
list($ac, $ar) = sscanf($a, '%[A-Z]%d');
list($bc, $br) = sscanf($b, '%[A-Z]%d');
if ($ar === $br) { if ($ar === $br) {
return 1 - strcasecmp(strlen($ac) . $ac, strlen($bc) . $bc); return 1 - strcasecmp(strlen($ac) . $ac, strlen($bc) . $bc);

View File

@ -2064,7 +2064,7 @@ class Worksheet implements IComparable
/** /**
* Insert a new column, updating all possible related data. * Insert a new column, updating all possible related data.
* *
* @param int $pBefore Insert before this one, eg: 'A' * @param string $pBefore Insert before this one, eg: 'A'
* @param int $pNumCols Number of columns to insert * @param int $pNumCols Number of columns to insert
* *
* @throws Exception * @throws Exception