diff --git a/src/PhpSpreadsheet/Calculation/Statistical.php b/src/PhpSpreadsheet/Calculation/Statistical.php index 1df2cb1f..43cea81e 100644 --- a/src/PhpSpreadsheet/Calculation/Statistical.php +++ b/src/PhpSpreadsheet/Calculation/Statistical.php @@ -2,8 +2,6 @@ namespace PHPExcel\Calculation; -require_once PHPEXCEL_ROOT . 'PHPExcel/Shared/trend/trendClass.php'; - /** LOG_GAMMA_X_MAX_VALUE */ define('LOG_GAMMA_X_MAX_VALUE', 2.55e305); @@ -1168,7 +1166,7 @@ class Statistical return Functions::DIV0(); } - $bestFitLinear = trendClass::calculate(trendClass::TREND_LINEAR, $yValues, $xValues); + $bestFitLinear = \PHPExcel\Shared\trend\trend::calculate(\PHPExcel\Shared\trend\trend::TREND_LINEAR, $yValues, $xValues); return $bestFitLinear->getCorrelation(); } @@ -1326,7 +1324,7 @@ class Statistical return Functions::DIV0(); } - $bestFitLinear = trendClass::calculate(trendClass::TREND_LINEAR, $yValues, $xValues); + $bestFitLinear = \PHPExcel\Shared\trend\trend::calculate(\PHPExcel\Shared\trend\trend::TREND_LINEAR, $yValues, $xValues); return $bestFitLinear->getCovariance(); } @@ -1612,7 +1610,7 @@ class Statistical return Functions::DIV0(); } - $bestFitLinear = trendClass::calculate(trendClass::TREND_LINEAR, $yValues, $xValues); + $bestFitLinear = \PHPExcel\Shared\trend\trend::calculate(\PHPExcel\Shared\trend\trend::TREND_LINEAR, $yValues, $xValues); return $bestFitLinear->getValueOfYForX($xValue); } @@ -1783,7 +1781,7 @@ class Statistical $newValues = Functions::flattenArray($newValues); $const = (is_null($const)) ? true : (boolean) Functions::flattenSingleValue($const); - $bestFitExponential = trendClass::calculate(trendClass::TREND_EXPONENTIAL, $yValues, $xValues, $const); + $bestFitExponential = \PHPExcel\Shared\trend\trend::calculate(\PHPExcel\Shared\trend\trend::TREND_EXPONENTIAL, $yValues, $xValues, $const); if (empty($newValues)) { $newValues = $bestFitExponential->getXValues(); } @@ -1907,7 +1905,7 @@ class Statistical return Functions::DIV0(); } - $bestFitLinear = trendClass::calculate(trendClass::TREND_LINEAR, $yValues, $xValues); + $bestFitLinear = \PHPExcel\Shared\trend\trend::calculate(\PHPExcel\Shared\trend\trend::TREND_LINEAR, $yValues, $xValues); return $bestFitLinear->getIntersect(); } @@ -2029,7 +2027,7 @@ class Statistical return 0; } - $bestFitLinear = trendClass::calculate(trendClass::TREND_LINEAR, $yValues, $xValues, $const); + $bestFitLinear = \PHPExcel\Shared\trend\trend::calculate(\PHPExcel\Shared\trend\trend::TREND_LINEAR, $yValues, $xValues, $const); if ($stats) { return array( array( @@ -2095,7 +2093,7 @@ class Statistical return 1; } - $bestFitExponential = trendClass::calculate(trendClass::TREND_EXPONENTIAL, $yValues, $xValues, $const); + $bestFitExponential = \PHPExcel\Shared\trend\trend::calculate(\PHPExcel\Shared\trend\trend::TREND_EXPONENTIAL, $yValues, $xValues, $const); if ($stats) { return array( array( @@ -2920,7 +2918,7 @@ class Statistical return Functions::DIV0(); } - $bestFitLinear = trendClass::calculate(trendClass::TREND_LINEAR, $yValues, $xValues); + $bestFitLinear = \PHPExcel\Shared\trend\trend::calculate(\PHPExcel\Shared\trend\trend::TREND_LINEAR, $yValues, $xValues); return $bestFitLinear->getGoodnessOfFit(); } @@ -2986,7 +2984,7 @@ class Statistical return Functions::DIV0(); } - $bestFitLinear = trendClass::calculate(trendClass::TREND_LINEAR, $yValues, $xValues); + $bestFitLinear = \PHPExcel\Shared\trend\trend::calculate(\PHPExcel\Shared\trend\trend::TREND_LINEAR, $yValues, $xValues); return $bestFitLinear->getSlope(); } @@ -3279,7 +3277,7 @@ class Statistical return Functions::DIV0(); } - $bestFitLinear = trendClass::calculate(trendClass::TREND_LINEAR, $yValues, $xValues); + $bestFitLinear = \PHPExcel\Shared\trend\trend::calculate(\PHPExcel\Shared\trend\trend::TREND_LINEAR, $yValues, $xValues); return $bestFitLinear->getStdevOfResiduals(); } @@ -3422,7 +3420,7 @@ class Statistical $newValues = Functions::flattenArray($newValues); $const = (is_null($const)) ? true : (boolean) Functions::flattenSingleValue($const); - $bestFitLinear = trendClass::calculate(trendClass::TREND_LINEAR, $yValues, $xValues, $const); + $bestFitLinear = \PHPExcel\Shared\trend\trend::calculate(\PHPExcel\Shared\trend\trend::TREND_LINEAR, $yValues, $xValues, $const); if (empty($newValues)) { $newValues = $bestFitLinear->getXValues(); } diff --git a/src/PhpSpreadsheet/Calculation/TextData.php b/src/PhpSpreadsheet/Calculation/TextData.php index 9e29391b..b4f68801 100644 --- a/src/PhpSpreadsheet/Calculation/TextData.php +++ b/src/PhpSpreadsheet/Calculation/TextData.php @@ -502,7 +502,7 @@ class TextData * @param string $newText String to replace in defined position * @return string */ - public static function REPLACE($oldText = '', $start = 1, $chars = null, $newText) + public static function REPLACE($oldText, $start, $chars, $newText) { $oldText = Functions::flattenSingleValue($oldText); $start = Functions::flattenSingleValue($start); diff --git a/src/PhpSpreadsheet/Reader/Excel2003XML.php b/src/PhpSpreadsheet/Reader/Excel2003XML.php index 5a1c0a21..733336f5 100644 --- a/src/PhpSpreadsheet/Reader/Excel2003XML.php +++ b/src/PhpSpreadsheet/Reader/Excel2003XML.php @@ -1,7 +1,6 @@ '.$key.'
'; switch ($key) { case 'table-header-rows': - foreach ($rowData as $key => $cellData) { + foreach ($rowData as $keyRowData => $cellData) { $rowData = $cellData; break; } + break; case 'table-row': $rowDataTableAttributes = $rowData->attributes($namespacesContent['table']); $rowRepeats = (isset($rowDataTableAttributes['number-rows-repeated'])) ? $rowDataTableAttributes['number-rows-repeated'] : 1; diff --git a/src/PhpSpreadsheet/Shared/Drawing.php b/src/PhpSpreadsheet/Shared/Drawing.php index 4f94ec4b..5d59211b 100644 --- a/src/PhpSpreadsheet/Shared/Drawing.php +++ b/src/PhpSpreadsheet/Shared/Drawing.php @@ -64,7 +64,7 @@ class Drawing * @param \PHPExcel\Style\Font $pDefaultFont Default font of the workbook * @return int Value in cell dimension */ - public static function pixelsToCellDimension($pValue = 0, \PHPExcel\Style\Font $pDefaultFont) + public static function pixelsToCellDimension($pValue, \PHPExcel\Style\Font $pDefaultFont) { // Font name and size $name = $pDefaultFont->getName(); @@ -89,7 +89,7 @@ class Drawing * @param \PHPExcel\Style\Font $pDefaultFont Default font of the workbook * @return int Value in pixels */ - public static function cellDimensionToPixels($pValue = 0, \PHPExcel\Style\Font $pDefaultFont) + public static function cellDimensionToPixels($pValue, \PHPExcel\Style\Font $pDefaultFont) { // Font name and size $name = $pDefaultFont->getName(); diff --git a/src/PhpSpreadsheet/Shared/JAMA/Matrix.php b/src/PhpSpreadsheet/Shared/JAMA/Matrix.php index 9158de25..77b48d83 100644 --- a/src/PhpSpreadsheet/Shared/JAMA/Matrix.php +++ b/src/PhpSpreadsheet/Shared/JAMA/Matrix.php @@ -1088,6 +1088,7 @@ class Matrix } else { throw new \PHPExcel\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION); } + break; case 'array': $M = new Matrix($args[0]); break; diff --git a/src/PhpSpreadsheet/Shared/trend/bestFitClass.php b/src/PhpSpreadsheet/Shared/trend/bestFit.php similarity index 99% rename from src/PhpSpreadsheet/Shared/trend/bestFitClass.php rename to src/PhpSpreadsheet/Shared/trend/bestFit.php index 2de029f9..afff9a8d 100644 --- a/src/PhpSpreadsheet/Shared/trend/bestFitClass.php +++ b/src/PhpSpreadsheet/Shared/trend/bestFit.php @@ -1,7 +1,9 @@ getGoodnessOfFit(); } if ($trendType != self::TREND_BEST_FIT_NO_POLY) { foreach (self::$trendTypePolynomialOrders as $trendMethod) { $order = substr($trendMethod, -1); - $bestFit[$trendMethod] = new PHPExcel_Polynomial_Best_Fit($order, $yValues, $xValues, $const); + $bestFit[$trendMethod] = new polynomialBestFit($order, $yValues, $xValues, $const); if ($bestFit[$trendMethod]->getError()) { unset($bestFit[$trendMethod]); } else { diff --git a/src/PhpSpreadsheet/Writer/Excel2007/Chart.php b/src/PhpSpreadsheet/Writer/Excel2007/Chart.php index 507f46b7..b8dfe063 100644 --- a/src/PhpSpreadsheet/Writer/Excel2007/Chart.php +++ b/src/PhpSpreadsheet/Writer/Excel2007/Chart.php @@ -126,7 +126,7 @@ class Chart extends WriterPart * * @throws \PHPExcel\Writer\Exception */ - private function writeTitle(Title $title = null, $objWriter) + private function writeTitle(Title $title, $objWriter) { if (is_null($title)) { return; @@ -171,7 +171,7 @@ class Chart extends WriterPart * * @throws \PHPExcel\Writer\Exception */ - private function writeLegend(Legend $legend = null, $objWriter) + private function writeLegend(Legend $legend, $objWriter) { if (is_null($legend)) { return; @@ -226,7 +226,7 @@ class Chart extends WriterPart * * @throws \PHPExcel\Writer\Exception */ - private function writePlotArea(PlotArea $plotArea, Title $xAxisLabel = null, Title $yAxisLabel = null, $objWriter, \PHPExcel\Worksheet $pSheet, Axis $xAxis, Axis $yAxis, GridLines $majorGridlines, GridLines $minorGridlines) + private function writePlotArea(PlotArea $plotArea, Title $xAxisLabel, Title $yAxisLabel, $objWriter, \PHPExcel\Worksheet $pSheet, Axis $xAxis, Axis $yAxis, GridLines $majorGridlines, GridLines $minorGridlines) { if (is_null($plotArea)) { return; @@ -270,7 +270,6 @@ class Chart extends WriterPart if ($chartType === DataSeries::TYPE_LINECHART) { // Line only, Line3D can't be smoothed - $objWriter->startElement('c:smooth'); $objWriter->writeAttribute('val', (integer) $plotGroup->getSmoothLine()); $objWriter->endElement(); @@ -1404,7 +1403,7 @@ class Chart extends WriterPart * * @throws \PHPExcel\Writer\Exception */ - private function writeLayout(Layout $layout = null, $objWriter) + private function writeLayout(Layout $layout, $objWriter) { $objWriter->startElement('c:layout'); diff --git a/src/PhpSpreadsheet/Writer/Excel2007/Drawing.php b/src/PhpSpreadsheet/Writer/Excel2007/Drawing.php index 0573b46b..ca04da2f 100644 --- a/src/PhpSpreadsheet/Writer/Excel2007/Drawing.php +++ b/src/PhpSpreadsheet/Writer/Excel2007/Drawing.php @@ -1,5 +1,6 @@