Yet more minor improvements (#1030)

This commit is contained in:
Mark Baker 2019-06-23 16:50:45 +02:00 committed by GitHub
parent 1b00fac6ad
commit 14e980625f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 22 additions and 12 deletions

View File

@ -192,7 +192,7 @@ class Date
$interval = $days . ' days';
return $baseDate->modify($interval)
->setTime($hours, $minutes, $seconds);
->setTime((int) $hours, (int) $minutes, (int) $seconds);
}
/**
@ -244,12 +244,12 @@ class Date
public static function dateTimeToExcel(DateTimeInterface $dateValue)
{
return self::formattedPHPToExcel(
$dateValue->format('Y'),
$dateValue->format('m'),
$dateValue->format('d'),
$dateValue->format('H'),
$dateValue->format('i'),
$dateValue->format('s')
(int) $dateValue->format('Y'),
(int) $dateValue->format('m'),
(int) $dateValue->format('d'),
(int) $dateValue->format('H'),
(int) $dateValue->format('i'),
(int) $dateValue->format('s')
);
}

View File

@ -113,7 +113,9 @@ class ExponentialBestFit extends BestFit
*/
public function __construct($yValues, $xValues = [], $const = true)
{
if (parent::__construct($yValues, $xValues) !== false) {
parent::__construct($yValues, $xValues);
if (!$this->error) {
$this->exponentialRegression($yValues, $xValues, $const);
}
}

View File

@ -72,7 +72,9 @@ class LinearBestFit extends BestFit
*/
public function __construct($yValues, $xValues = [], $const = true)
{
if (parent::__construct($yValues, $xValues) !== false) {
parent::__construct($yValues, $xValues);
if (!$this->error) {
$this->linearRegression($yValues, $xValues, $const);
}
}

View File

@ -81,7 +81,9 @@ class LogarithmicBestFit extends BestFit
*/
public function __construct($yValues, $xValues = [], $const = true)
{
if (parent::__construct($yValues, $xValues) !== false) {
parent::__construct($yValues, $xValues);
if (!$this->error) {
$this->logarithmicRegression($yValues, $xValues, $const);
}
}

View File

@ -182,7 +182,9 @@ class PolynomialBestFit extends BestFit
*/
public function __construct($order, $yValues, $xValues = [], $const = true)
{
if (parent::__construct($yValues, $xValues) !== false) {
parent::__construct($yValues, $xValues);
if (!$this->error) {
if ($order < $this->valueCount) {
$this->bestFitType .= '_' . $order;
$this->order = $order;

View File

@ -105,7 +105,9 @@ class PowerBestFit extends BestFit
*/
public function __construct($yValues, $xValues = [], $const = true)
{
if (parent::__construct($yValues, $xValues) !== false) {
parent::__construct($yValues, $xValues);
if (!$this->error) {
$this->powerRegression($yValues, $xValues, $const);
}
}