Yet more minor improvements (#1030)
This commit is contained in:
parent
1b00fac6ad
commit
14e980625f
@ -192,7 +192,7 @@ class Date
|
|||||||
$interval = $days . ' days';
|
$interval = $days . ' days';
|
||||||
|
|
||||||
return $baseDate->modify($interval)
|
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)
|
public static function dateTimeToExcel(DateTimeInterface $dateValue)
|
||||||
{
|
{
|
||||||
return self::formattedPHPToExcel(
|
return self::formattedPHPToExcel(
|
||||||
$dateValue->format('Y'),
|
(int) $dateValue->format('Y'),
|
||||||
$dateValue->format('m'),
|
(int) $dateValue->format('m'),
|
||||||
$dateValue->format('d'),
|
(int) $dateValue->format('d'),
|
||||||
$dateValue->format('H'),
|
(int) $dateValue->format('H'),
|
||||||
$dateValue->format('i'),
|
(int) $dateValue->format('i'),
|
||||||
$dateValue->format('s')
|
(int) $dateValue->format('s')
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -113,7 +113,9 @@ class ExponentialBestFit extends BestFit
|
|||||||
*/
|
*/
|
||||||
public function __construct($yValues, $xValues = [], $const = true)
|
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);
|
$this->exponentialRegression($yValues, $xValues, $const);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -72,7 +72,9 @@ class LinearBestFit extends BestFit
|
|||||||
*/
|
*/
|
||||||
public function __construct($yValues, $xValues = [], $const = true)
|
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);
|
$this->linearRegression($yValues, $xValues, $const);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -81,7 +81,9 @@ class LogarithmicBestFit extends BestFit
|
|||||||
*/
|
*/
|
||||||
public function __construct($yValues, $xValues = [], $const = true)
|
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);
|
$this->logarithmicRegression($yValues, $xValues, $const);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -182,7 +182,9 @@ class PolynomialBestFit extends BestFit
|
|||||||
*/
|
*/
|
||||||
public function __construct($order, $yValues, $xValues = [], $const = true)
|
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) {
|
if ($order < $this->valueCount) {
|
||||||
$this->bestFitType .= '_' . $order;
|
$this->bestFitType .= '_' . $order;
|
||||||
$this->order = $order;
|
$this->order = $order;
|
||||||
|
@ -105,7 +105,9 @@ class PowerBestFit extends BestFit
|
|||||||
*/
|
*/
|
||||||
public function __construct($yValues, $xValues = [], $const = true)
|
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);
|
$this->powerRegression($yValues, $xValues, $const);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user