Fix phpcs, phpstan and scrutinizer issues

This commit is contained in:
MarkBaker 2021-05-28 22:11:43 +02:00 committed by Mark Baker
parent e0e5a81d69
commit 5e531b4511
4 changed files with 8 additions and 21 deletions

View File

@ -341,6 +341,5 @@ class LocaleGenerator
echo $message, PHP_EOL;
return;
}
}

View File

@ -2235,11 +2235,6 @@ parameters:
count: 1
path: src/PhpSpreadsheet/Document/Properties.php
-
message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\DocumentGenerator\\:\\:getPhpSpreadsheetFunctionText\\(\\) has parameter \\$functionCall with no typehint specified\\.$#"
count: 1
path: src/PhpSpreadsheet/DocumentGenerator.php
-
message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\HashTable\\:\\:getIndexForHashCode\\(\\) should return int but returns int\\|string\\|false\\.$#"
count: 1

View File

@ -19,7 +19,7 @@ class Font extends Supervisor
protected $name = 'Calibri';
/**
* Font Size in points.
* Font Size.
*
* @var null|float
*/
@ -249,27 +249,20 @@ class Font extends Supervisor
/**
* Set Size.
*
* @param float $fontSizeInPoints
* @param float $pValue
*
* @return $this
*/
public function setSize($fontSizeInPoints)
public function setSize($pValue)
{
if (is_string($fontSizeInPoints) || is_int($fontSizeInPoints)) {
$fontSizeInPoints = (float) $fontSizeInPoints; // $pValue = 0 if given string is not numeric
if ($pValue == '') {
$pValue = 10;
}
// Size must be a positive floating point number
// ECMA-376-1:2016, part 1, chapter 18.4.11 sz (Font Size), p. 1536
if (!is_float($fontSizeInPoints) || !($fontSizeInPoints > 0)) {
$fontSizeInPoints = 10.0;
}
if ($this->isSupervisor) {
$styleArray = $this->getStyleArray(['size' => $fontSizeInPoints]);
$styleArray = $this->getStyleArray(['size' => $pValue]);
$this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
} else {
$this->size = $fontSizeInPoints;
$this->size = $pValue;
}
return $this;

View File

@ -17,7 +17,7 @@ class LocaleGeneratorTest extends TestCase
$phpSpreadsheetFunctions = $phpSpreadsheetFunctionsProperty->getValue();
$localeGenerator = new LocaleGenerator(
realpath(__DIR__ . '/../../src/PhpSpreadsheet/Calculation/locale/'),
(string) realpath(__DIR__ . '/../../src/PhpSpreadsheet/Calculation/locale/'),
'Translations.xlsx',
$phpSpreadsheetFunctions
);