From 5ec0e333dd06f3ef187b94fdeb799ea1f7e57578 Mon Sep 17 00:00:00 2001 From: Adrien Crivelli Date: Sun, 17 Nov 2019 17:44:02 +0100 Subject: [PATCH] Fix code style --- src/PhpSpreadsheet/Calculation/Calculation.php | 1 + src/PhpSpreadsheet/IOFactory.php | 2 ++ src/PhpSpreadsheet/Reader/Xml.php | 1 + src/PhpSpreadsheet/Worksheet/Worksheet.php | 1 + src/PhpSpreadsheet/Writer/Html.php | 1 + src/PhpSpreadsheet/Writer/Xls/Parser.php | 2 ++ 6 files changed, 8 insertions(+) diff --git a/src/PhpSpreadsheet/Calculation/Calculation.php b/src/PhpSpreadsheet/Calculation/Calculation.php index 737efe7bcf..69fa756ec9 100644 --- a/src/PhpSpreadsheet/Calculation/Calculation.php +++ b/src/PhpSpreadsheet/Calculation/Calculation.php @@ -4786,6 +4786,7 @@ private function getTokensAsString($tokens) return $value; }, $tokens); + return '[ ' . implode(' | ', $tokensStr) . ' ]'; } } diff --git a/src/PhpSpreadsheet/IOFactory.php b/src/PhpSpreadsheet/IOFactory.php index dcd2716c0d..4266ea546a 100644 --- a/src/PhpSpreadsheet/IOFactory.php +++ b/src/PhpSpreadsheet/IOFactory.php @@ -52,6 +52,7 @@ public static function createWriter(Spreadsheet $spreadsheet, $writerType) // Instantiate writer $className = self::$writers[$writerType]; + return new $className($spreadsheet); } @@ -72,6 +73,7 @@ public static function createReader($readerType) // Instantiate reader $className = self::$readers[$readerType]; + return new $className(); } diff --git a/src/PhpSpreadsheet/Reader/Xml.php b/src/PhpSpreadsheet/Reader/Xml.php index 5cddd3319c..b4fffa4fb8 100644 --- a/src/PhpSpreadsheet/Reader/Xml.php +++ b/src/PhpSpreadsheet/Reader/Xml.php @@ -285,6 +285,7 @@ protected static function widthUnits2Pixel($widthUnits) { $pixels = ($widthUnits / 256) * 7; $offsetWidthUnits = $widthUnits % 256; + return $pixels + round($offsetWidthUnits / (256 / 7)); } diff --git a/src/PhpSpreadsheet/Worksheet/Worksheet.php b/src/PhpSpreadsheet/Worksheet/Worksheet.php index 3caa6f940f..f01632bce9 100644 --- a/src/PhpSpreadsheet/Worksheet/Worksheet.php +++ b/src/PhpSpreadsheet/Worksheet/Worksheet.php @@ -2912,6 +2912,7 @@ public function shrinkRangeToFit($range) $rangeSet = $rangeBoundaries[0][0] . $rangeBoundaries[0][1] . ':' . $rangeBoundaries[1][0] . $rangeBoundaries[1][1]; } unset($rangeSet); + return implode(' ', $rangeBlocks); } diff --git a/src/PhpSpreadsheet/Writer/Html.php b/src/PhpSpreadsheet/Writer/Html.php index 852a246ad5..0f55f2f403 100644 --- a/src/PhpSpreadsheet/Writer/Html.php +++ b/src/PhpSpreadsheet/Writer/Html.php @@ -1058,6 +1058,7 @@ private function createCSSStyleBorder(Border $pStyle) { // Create CSS - add !important to non-none border styles for merged cells $borderStyle = $this->mapBorderStyle($pStyle->getBorderStyle()); + return $borderStyle . ' #' . $pStyle->getColor()->getRGB() . (($borderStyle == 'none') ? '' : ' !important'); } diff --git a/src/PhpSpreadsheet/Writer/Xls/Parser.php b/src/PhpSpreadsheet/Writer/Xls/Parser.php index b49b9b9ec7..1b8bae27ad 100644 --- a/src/PhpSpreadsheet/Writer/Xls/Parser.php +++ b/src/PhpSpreadsheet/Writer/Xls/Parser.php @@ -1161,12 +1161,14 @@ private function expression() // catch "-" Term $this->advance(); $result2 = $this->expression(); + return $this->createTree('ptgUminus', $result2, ''); // If it's a positive value } elseif ($this->currentToken == '+') { // catch "+" Term $this->advance(); $result2 = $this->expression(); + return $this->createTree('ptgUplus', $result2, ''); } $result = $this->term();