diff --git a/src/PhpSpreadsheet/HashTable.php b/src/PhpSpreadsheet/HashTable.php index e615b060..445addd6 100644 --- a/src/PhpSpreadsheet/HashTable.php +++ b/src/PhpSpreadsheet/HashTable.php @@ -111,7 +111,7 @@ class HashTable * * @param string $hashCode * - * @return int Index + * @return false|int Index */ public function getIndexForHashCode($hashCode) { diff --git a/src/PhpSpreadsheet/Helper/Size.php b/src/PhpSpreadsheet/Helper/Size.php index 12bccaad..80b6fbd7 100644 --- a/src/PhpSpreadsheet/Helper/Size.php +++ b/src/PhpSpreadsheet/Helper/Size.php @@ -14,7 +14,7 @@ class Size public function __construct(string $size) { - $this->valid = preg_match(self::REGEXP_SIZE_VALIDATION, $size, $matches); + $this->valid = (bool) preg_match(self::REGEXP_SIZE_VALIDATION, $size, $matches); if ($this->valid) { $this->size = $matches['size']; $this->unit = $matches['unit'] ?? 'pt';