From 0c52f173aa4b44169e083cba146224343052fa9a Mon Sep 17 00:00:00 2001 From: paulkned Date: Wed, 19 Feb 2020 20:12:30 +0100 Subject: [PATCH 1/7] Added support for the base function (#1344) --- CHANGELOG.md | 1 + .../Calculation/Calculation.php | 5 ++ src/PhpSpreadsheet/Calculation/MathTrig.php | 43 ++++++++++++++ .../Calculation/functionlist.txt | 1 + .../Functions/MathTrig/BaseTest.php | 31 ++++++++++ tests/data/Calculation/MathTrig/BASE.php | 59 +++++++++++++++++++ 6 files changed, 140 insertions(+) create mode 100644 tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/BaseTest.php create mode 100644 tests/data/Calculation/MathTrig/BASE.php diff --git a/CHANGELOG.md b/CHANGELOG.md index cbf1bdde55..c2931dcab3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org). ## [Unreleased] +- Added support for the BASE function - Added support for the ARABIC function - Conditionals - Extend Support for (NOT)CONTAINSBLANKS [#1278](/~https://github.com/PHPOffice/PhpSpreadsheet/pull/1278) - Handle Error in Formula Processing Better for Xls [#1267](/~https://github.com/PHPOffice/PhpSpreadsheet/pull/1267) diff --git a/src/PhpSpreadsheet/Calculation/Calculation.php b/src/PhpSpreadsheet/Calculation/Calculation.php index 1901e5d3e6..4ebce2ae15 100644 --- a/src/PhpSpreadsheet/Calculation/Calculation.php +++ b/src/PhpSpreadsheet/Calculation/Calculation.php @@ -333,6 +333,11 @@ class Calculation 'functionCall' => [Functions::class, 'DUMMY'], 'argumentCount' => '1', ], + 'BASE' => [ + 'category' => Category::CATEGORY_MATH_AND_TRIG, + 'functionCall' => [MathTrig::class, 'BASE'], + 'argumentCount' => '2,3', + ], 'BESSELI' => [ 'category' => Category::CATEGORY_ENGINEERING, 'functionCall' => [Engineering::class, 'BESSELI'], diff --git a/src/PhpSpreadsheet/Calculation/MathTrig.php b/src/PhpSpreadsheet/Calculation/MathTrig.php index 7ad78524e7..33bfee1952 100644 --- a/src/PhpSpreadsheet/Calculation/MathTrig.php +++ b/src/PhpSpreadsheet/Calculation/MathTrig.php @@ -142,6 +142,49 @@ public static function ATAN2($xCoordinate = null, $yCoordinate = null) return Functions::VALUE(); } + /** + * BASE. + * + * Converts a number into a text representation with the given radix (base). + * + * Excel Function: + * BASE(Number, Radix [Min_length]) + * + * @category Mathematical and Trigonometric Functions + * + * @param float $number + * @param float $radix + * @param int $minLength + * + * @return string the text representation with the given radix (base) + */ + public static function BASE($number, $radix, $minLength = null) + { + $number = Functions::flattenSingleValue($number); + $radix = Functions::flattenSingleValue($radix); + $minLength = Functions::flattenSingleValue($minLength); + + if (is_numeric($number) && is_numeric($radix) && ($minLength === null || is_numeric($minLength))) { + // Truncate to an integer + $number = (int) $number; + $radix = (int) $radix; + $minLength = (int) $minLength; + + if ($number < 0 || $number >= 2 ** 53 || $radix < 2 || $radix > 36) { + return Functions::NAN(); // Numeric range constraints + } + + $outcome = strtoupper((string) base_convert($number, 10, $radix)); + if ($minLength !== null) { + $outcome = str_pad($outcome, $minLength, '0', STR_PAD_LEFT); // String padding + } + + return $outcome; + } + + return Functions::VALUE(); + } + /** * CEILING. * diff --git a/src/PhpSpreadsheet/Calculation/functionlist.txt b/src/PhpSpreadsheet/Calculation/functionlist.txt index 66523f4fb1..7776e6ead4 100644 --- a/src/PhpSpreadsheet/Calculation/functionlist.txt +++ b/src/PhpSpreadsheet/Calculation/functionlist.txt @@ -23,6 +23,7 @@ AVERAGEA AVERAGEIF AVERAGEIFS BAHTTEXT +BASE BESSELI BESSELJ BESSELK diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/BaseTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/BaseTest.php new file mode 100644 index 0000000000..3aaf68b5bf --- /dev/null +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/BaseTest.php @@ -0,0 +1,31 @@ +assertEquals($expectedResult, $result); + } + + public function providerBASE() + { + return require 'data/Calculation/MathTrig/BASE.php'; + } +} diff --git a/tests/data/Calculation/MathTrig/BASE.php b/tests/data/Calculation/MathTrig/BASE.php new file mode 100644 index 0000000000..c2802dd9f2 --- /dev/null +++ b/tests/data/Calculation/MathTrig/BASE.php @@ -0,0 +1,59 @@ + Date: Wed, 19 Feb 2020 11:22:31 -0800 Subject: [PATCH 2/7] Changes to WEEKNUM and YEARFRAC (#1316) * Changes to WEEKNUM and YEARFRAC The optional second parameter for WEEKNUM can take any of 10 values (1, 2, 11-17, and 21), but currently only 1 and 2 are supported. This change adds support for the other 8 possibilities. YEARFRAC in Excel does not require that end date be before start date, but PhpSpreadsheet was returning an error in that situation. YEARFRAC third parameter (method) of 1 was not correctly implemented. I was able to find a description of the algorithm, and documented that location in the code, and implemented according to that spec. PHPExcel had a (failing) test to assert the result of YEARFRAC("1960-12-19", "2008-06-28", 1). This test had been dropped from PhpSpreadsheet, and is now restored; several new tests have been added, and verified against Excel. * Add YEARFRAC Tests Scrutinizer reported a very mysterious failure with no details. project.metric_change("scrutinizer.test_coverage", < 0), without even a link to explain what it is reporting. It is possible that it was a complaint about code coverage. If so, I have added some tests which will, I hope, eliminate the problem. * Make Array Constant Responding to review from Mark Baker. * Merge with PR 1362 Bugfix 1161 Travis CI reported problem with Calculation.php (which is not part of this change). That was changed in master a few days ago (delete some unused code). Perhaps the lack of that change is the problem here. Merging it manually. --- src/PhpSpreadsheet/Calculation/DateTime.php | 134 +++++++++----- tests/data/Calculation/DateTime/WEEKNUM.php | 112 ++++++++++++ tests/data/Calculation/DateTime/YEARFRAC.php | 175 +++++++++++++++++++ 3 files changed, 376 insertions(+), 45 deletions(-) diff --git a/src/PhpSpreadsheet/Calculation/DateTime.php b/src/PhpSpreadsheet/Calculation/DateTime.php index 55740fc152..4f85edeb9c 100644 --- a/src/PhpSpreadsheet/Calculation/DateTime.php +++ b/src/PhpSpreadsheet/Calculation/DateTime.php @@ -878,6 +878,8 @@ public static function DAYS360($startDate = 0, $endDate = 0, $method = false) * * Excel Function: * YEARFRAC(startDate,endDate[,method]) + * See https://lists.oasis-open.org/archives/office-formula/200806/msg00039.html + * for description of algorithm used in Excel * * @category Date/Time Functions * @@ -906,6 +908,11 @@ public static function YEARFRAC($startDate = 0, $endDate = 0, $method = 0) if (is_string($endDate = self::getDateValue($endDate))) { return Functions::VALUE(); } + if ($startDate > $endDate) { + $temp = $startDate; + $startDate = $endDate; + $endDate = $temp; + } if (((is_numeric($method)) && (!is_string($method))) || ($method == '')) { switch ($method) { @@ -916,46 +923,43 @@ public static function YEARFRAC($startDate = 0, $endDate = 0, $method = 0) $startYear = self::YEAR($startDate); $endYear = self::YEAR($endDate); $years = $endYear - $startYear + 1; - $leapDays = 0; + $startMonth = self::MONTHOFYEAR($startDate); + $startDay = self::DAYOFMONTH($startDate); + $endMonth = self::MONTHOFYEAR($endDate); + $endDay = self::DAYOFMONTH($endDate); + $startMonthDay = 100 * $startMonth + $startDay; + $endMonthDay = 100 * $endMonth + $endDay; if ($years == 1) { if (self::isLeapYear($endYear)) { - $startMonth = self::MONTHOFYEAR($startDate); - $endMonth = self::MONTHOFYEAR($endDate); - $endDay = self::DAYOFMONTH($endDate); - if (($startMonth < 3) || - (($endMonth * 100 + $endDay) >= (2 * 100 + 29))) { - $leapDays += 1; - } + $tmpCalcAnnualBasis = 366; + } else { + $tmpCalcAnnualBasis = 365; } - } else { - for ($year = $startYear; $year <= $endYear; ++$year) { - if ($year == $startYear) { - $startMonth = self::MONTHOFYEAR($startDate); - $startDay = self::DAYOFMONTH($startDate); - if ($startMonth < 3) { - $leapDays += (self::isLeapYear($year)) ? 1 : 0; - } - } elseif ($year == $endYear) { - $endMonth = self::MONTHOFYEAR($endDate); - $endDay = self::DAYOFMONTH($endDate); - if (($endMonth * 100 + $endDay) >= (2 * 100 + 29)) { - $leapDays += (self::isLeapYear($year)) ? 1 : 0; - } + } elseif ($years == 2 && $startMonthDay >= $endMonthDay) { + if (self::isLeapYear($startYear)) { + if ($startMonthDay <= 229) { + $tmpCalcAnnualBasis = 366; } else { - $leapDays += (self::isLeapYear($year)) ? 1 : 0; + $tmpCalcAnnualBasis = 365; } - } - if ($years == 2) { - if (($leapDays == 0) && (self::isLeapYear($startYear)) && ($days > 365)) { - $leapDays = 1; - } elseif ($days < 366) { - $years = 1; + } elseif (self::isLeapYear($endYear)) { + if ($endMonthDay >= 229) { + $tmpCalcAnnualBasis = 366; + } else { + $tmpCalcAnnualBasis = 365; } + } else { + $tmpCalcAnnualBasis = 365; } - $leapDays /= $years; + } else { + $tmpCalcAnnualBasis = 0; + for ($year = $startYear; $year <= $endYear; ++$year) { + $tmpCalcAnnualBasis += self::isLeapYear($year) ? 366 : 365; + } + $tmpCalcAnnualBasis /= $years; } - return $days / (365 + $leapDays); + return $days / $tmpCalcAnnualBasis; case 2: return self::DATEDIF($startDate, $endDate) / 360; case 3: @@ -1273,6 +1277,36 @@ public static function WEEKDAY($dateValue = 1, $style = 1) return $DoW; } + const STARTWEEK_SUNDAY = 1; + const STARTWEEK_MONDAY = 2; + const STARTWEEK_MONDAY_ALT = 11; + const STARTWEEK_TUESDAY = 12; + const STARTWEEK_WEDNESDAY = 13; + const STARTWEEK_THURSDAY = 14; + const STARTWEEK_FRIDAY = 15; + const STARTWEEK_SATURDAY = 16; + const STARTWEEK_SUNDAY_ALT = 17; + const DOW_SUNDAY = 1; + const DOW_MONDAY = 2; + const DOW_TUESDAY = 3; + const DOW_WEDNESDAY = 4; + const DOW_THURSDAY = 5; + const DOW_FRIDAY = 6; + const DOW_SATURDAY = 7; + const STARTWEEK_MONDAY_ISO = 21; + const METHODARR = [ + self::STARTWEEK_SUNDAY => self::DOW_SUNDAY, + self::DOW_MONDAY, + self::STARTWEEK_MONDAY_ALT => self::DOW_MONDAY, + self::DOW_TUESDAY, + self::DOW_WEDNESDAY, + self::DOW_THURSDAY, + self::DOW_FRIDAY, + self::DOW_SATURDAY, + self::DOW_SUNDAY, + self::STARTWEEK_MONDAY_ISO => self::STARTWEEK_MONDAY_ISO, + ]; + /** * WEEKNUM. * @@ -1291,41 +1325,51 @@ public static function WEEKDAY($dateValue = 1, $style = 1) * @param int $method Week begins on Sunday or Monday * 1 or omitted Week begins on Sunday. * 2 Week begins on Monday. + * 11 Week begins on Monday. + * 12 Week begins on Tuesday. + * 13 Week begins on Wednesday. + * 14 Week begins on Thursday. + * 15 Week begins on Friday. + * 16 Week begins on Saturday. + * 17 Week begins on Sunday. + * 21 ISO (Jan. 4 is week 1, begins on Monday). * * @return int|string Week Number */ - public static function WEEKNUM($dateValue = 1, $method = 1) + public static function WEEKNUM($dateValue = 1, $method = self::STARTWEEK_SUNDAY) { $dateValue = Functions::flattenSingleValue($dateValue); $method = Functions::flattenSingleValue($method); if (!is_numeric($method)) { return Functions::VALUE(); - } elseif (($method < 1) || ($method > 2)) { - return Functions::NAN(); } - $method = floor($method); + $method = (int) $method; + if (!array_key_exists($method, self::METHODARR)) { + return Functions::NaN(); + } + $method = self::METHODARR[$method]; - if ($dateValue === null) { - $dateValue = 1; - } elseif (is_string($dateValue = self::getDateValue($dateValue))) { + $dateValue = self::getDateValue($dateValue); + if (is_string($dateValue)) { return Functions::VALUE(); - } elseif ($dateValue < 0.0) { + } + if ($dateValue < 0.0) { return Functions::NAN(); } // Execute function $PHPDateObject = Date::excelToDateTimeObject($dateValue); + if ($method == self::STARTWEEK_MONDAY_ISO) { + return (int) $PHPDateObject->format('W'); + } $dayOfYear = $PHPDateObject->format('z'); $PHPDateObject->modify('-' . $dayOfYear . ' days'); $firstDayOfFirstWeek = $PHPDateObject->format('w'); $daysInFirstWeek = (6 - $firstDayOfFirstWeek + $method) % 7; - $interval = $dayOfYear - $daysInFirstWeek; - $weekOfYear = floor($interval / 7) + 1; - - if ($daysInFirstWeek) { - ++$weekOfYear; - } + $daysInFirstWeek += 7 * !$daysInFirstWeek; + $endFirstWeek = $daysInFirstWeek - 1; + $weekOfYear = floor(($dayOfYear - $endFirstWeek + 13) / 7); return (int) $weekOfYear; } diff --git a/tests/data/Calculation/DateTime/WEEKNUM.php b/tests/data/Calculation/DateTime/WEEKNUM.php index ceb843155a..d73ee463ae 100644 --- a/tests/data/Calculation/DateTime/WEEKNUM.php +++ b/tests/data/Calculation/DateTime/WEEKNUM.php @@ -53,6 +53,10 @@ '#NUM!', '3/7/1977', 0, ], + [ + '#NUM!', + '3/7/1977', -1, + ], [ '#VALUE!', 'Invalid', 1, @@ -61,4 +65,112 @@ '#NUM!', -1, ], + [ + 53, + '2019-12-29', 1, + ], + [ + 52, + '2019-12-29', 2, + ], + [ + '#NUM!', + '2019-12-29', 3, + ], + [ + '#NUM!', + '2019-12-29', 10, + ], + [ + 52, + '2019-12-29', 11, + ], + [ + 52, + '2019-12-29', 12, + ], + [ + 53, + '2019-12-29', 13, + ], + [ + 53, + '2019-12-29', 14, + ], + [ + 53, + '2019-12-29', 15, + ], + [ + 53, + '2019-12-29', 16, + ], + [ + 53, + '2019-12-29', 17, + ], + [ + '#NUM!', + '2019-12-29', 18, + ], + [ + '#NUM!', + '2019-12-29', 20, + ], + [ + '#NUM!', + '2019-12-29', 22, + ], + [ + 52, + '2019-12-29', 21, + ], + [ + 53, + '2020-12-29', 21, + ], + [ + 52, + '2021-12-29', 21, + ], + [ + 52, + '2022-12-29', 21, + ], + [ + 1, + '2020-01-01', 21, + ], + [ + 53, + '2021-01-01', 21, + ], + [ + 52, + '2022-01-01', 21, + ], + [ + 52, + '2023-01-01', 21, + ], + [ + 2, + '2020-01-08', 21, + ], + [ + 1, + '2021-01-08', 21, + ], + [ + 1, + '2022-01-08', 21, + ], + [ + 1, + '2023-01-08', 21, + ], + [ + 1, + '2025-12-29', 21, + ], ]; diff --git a/tests/data/Calculation/DateTime/YEARFRAC.php b/tests/data/Calculation/DateTime/YEARFRAC.php index 9cb7005a6f..3e76087c6b 100644 --- a/tests/data/Calculation/DateTime/YEARFRAC.php +++ b/tests/data/Calculation/DateTime/YEARFRAC.php @@ -7,6 +7,12 @@ '2007-1-10', 0, ], + [ + 0.025, + '2007-1-10', + '2007-1-1', + 0, + ], [ 0.024657534246580001, '2007-1-1', @@ -337,6 +343,12 @@ '2008-6-28', 0, ], + [ + 47.52162252765670, + '1960-12-19', + '2008-6-28', + 1, + ], [ 48.216666666666697, '1960-12-19', @@ -385,4 +397,167 @@ '2008-6-28', 4, ], + [ + 0.163934426, + '1960-01-01', + '1960-03-01', + 1, + ], + [ + 0.161643836, + '1961-01-01', + '1961-03-01', + 1, + ], + [ + 0.161643836, + '1963-03-01', + '1963-01-01', + 1, + ], + [ + 1.086183311, + '1960-01-01', + '1961-02-01', + 1, + ], + [ + 1.084931507, + '1961-01-01', + '1962-02-01', + 1, + ], + [ + 1.083447332, + '1963-01-01', + '1964-02-01', + 1, + ], + [ + 1.162790698, + '1963-01-01', + '1964-03-01', + 1, + ], + [ + 0.841530055, + '2020-02-28', + '2021-01-01', + 1, + ], + [ + 0.764383562, + '2020-03-28', + '2021-01-01', + 1, + ], + [ + 0.841530055, + '2023-04-28', + '2024-03-01', + 1, + ], + [ + 0.838797814, + '2023-04-28', + '2024-02-29', + 1, + ], + [ + 0.838356164, + '2023-04-28', + '2024-02-28', + 1, + ], + [ + 0.753424658, + '2023-04-28', + '2024-01-28', + 1, + ], + [ + 0.753424658, + '2022-04-28', + '2023-01-28', + 1, + ], + [ + 1.0, + '2020-01-01', + '2021-01-01', + 1, + ], + [ + 0.99726776, + '2020-02-28', + '2021-02-27', + 1, + ], + [ + 0.764383562, + '2020-03-28', + '2021-01-01', + 1, + ], + [ + 0.841530055, + '2023-04-28', + '2024-03-01', + 1, + ], + [ + 0.838797814, + '2023-04-28', + '2024-02-29', + 1, + ], + [ + 0.838356164, + '2023-04-28', + '2024-02-28', + 1, + ], + [ + 0.753424658, + '2023-04-28', + '2024-01-28', + 1, + ], + [ + 0.753424658, + '2022-04-28', + '2023-01-28', + 1, + ], + [ + 1.082191781, + '2022-04-28', + '2023-05-28', + 1, + ], + [ + 1.002739726, + '2022-04-27', + '2023-04-28', + 1, + ], + [ + 0.084699454, + '2024-04-27', + '2024-05-28', + 1, + ], + [ + 0.084931507, + '2023-04-27', + '2023-05-28', + 1, + ], + [ + 2.085766423, + '2023-04-27', + '2025-05-28', + 1, + ], + ]; From 06d9dc03e90cda33dbed0a0c00f8816e81e7d308 Mon Sep 17 00:00:00 2001 From: Jimmy4o4 Date: Mon, 25 Nov 2019 08:41:55 +0100 Subject: [PATCH 3/7] Fix for Xls writer wrong selected cells and active sheet --- CHANGELOG.md | 6 ++ src/PhpSpreadsheet/Writer/Xls/Worksheet.php | 15 +++- .../Functional/ActiveSheetTest.php | 68 +++++++++++++++++++ .../Functional/SelectedCellsTest.php | 57 ++++++++++++++++ 4 files changed, 143 insertions(+), 3 deletions(-) create mode 100644 tests/PhpSpreadsheetTests/Functional/ActiveSheetTest.php create mode 100644 tests/PhpSpreadsheetTests/Functional/SelectedCellsTest.php diff --git a/CHANGELOG.md b/CHANGELOG.md index c2931dcab3..541e9279ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,13 +7,19 @@ and this project adheres to [Semantic Versioning](https://semver.org). ## [Unreleased] +### Added + - Added support for the BASE function - Added support for the ARABIC function - Conditionals - Extend Support for (NOT)CONTAINSBLANKS [#1278](/~https://github.com/PHPOffice/PhpSpreadsheet/pull/1278) + +### Fixed + - Handle Error in Formula Processing Better for Xls [#1267](/~https://github.com/PHPOffice/PhpSpreadsheet/pull/1267) - Handle ConditionalStyle NumberFormat When Reading Xlsx File [#1296](/~https://github.com/PHPOffice/PhpSpreadsheet/pull/1296) - Fix Xlsx Writer's handling of decimal commas [#1282](/~https://github.com/PHPOffice/PhpSpreadsheet/pull/1282) - Fix for issue by removing test code mistakenly left in [#1328](/~https://github.com/PHPOffice/PhpSpreadsheet/pull/1328) +- Fix for Xls writer wrong selected cells and active sheet [#1256](/~https://github.com/PHPOffice/PhpSpreadsheet/pull/1256) ## [1.10.1] - 2019-12-02 diff --git a/src/PhpSpreadsheet/Writer/Xls/Worksheet.php b/src/PhpSpreadsheet/Writer/Xls/Worksheet.php index baa45345ca..5a6fa61ac9 100644 --- a/src/PhpSpreadsheet/Writer/Xls/Worksheet.php +++ b/src/PhpSpreadsheet/Writer/Xls/Worksheet.php @@ -281,6 +281,10 @@ public function close() { $phpSheet = $this->phpSheet; + // Storing selected cells and active sheet because it changes while parsing cells with formulas. + $selectedCells = $this->phpSheet->getSelectedCells(); + $activeSheetIndex = $this->phpSheet->getParent()->getActiveSheetIndex(); + // Write BOF record $this->storeBof(0x0010); @@ -481,6 +485,9 @@ public function close() // Append $this->writeMsoDrawing(); + // Restoring active sheet. + $this->phpSheet->getParent()->setActiveSheetIndex($activeSheetIndex); + // Write WINDOW2 record $this->writeWindow2(); @@ -493,6 +500,9 @@ public function close() $this->writePanes(); } + // Restoring selected cells. + $this->phpSheet->setSelectedCells($selectedCells); + // Write SELECTION record $this->writeSelection(); @@ -1250,7 +1260,6 @@ private function writeWindow2() $fFrozenNoSplit = 0; // 0 - bit // no support in PhpSpreadsheet for selected sheet, therefore sheet is only selected if it is the active sheet $fSelected = ($this->phpSheet === $this->phpSheet->getParent()->getActiveSheet()) ? 1 : 0; - $fPaged = 1; // 2 $fPageBreakPreview = $this->phpSheet->getSheetView()->getView() === SheetView::SHEETVIEW_PAGE_BREAK_PREVIEW; $grbit = $fDspFmla; @@ -1262,8 +1271,8 @@ private function writeWindow2() $grbit |= $fArabic << 6; $grbit |= $fDspGuts << 7; $grbit |= $fFrozenNoSplit << 8; - $grbit |= $fSelected << 9; - $grbit |= $fPaged << 10; + $grbit |= $fSelected << 9; // Selected sheets. + $grbit |= $fSelected << 10; // Active sheet. $grbit |= $fPageBreakPreview << 11; $header = pack('vv', $record, $length); diff --git a/tests/PhpSpreadsheetTests/Functional/ActiveSheetTest.php b/tests/PhpSpreadsheetTests/Functional/ActiveSheetTest.php new file mode 100644 index 0000000000..9274e9c4b1 --- /dev/null +++ b/tests/PhpSpreadsheetTests/Functional/ActiveSheetTest.php @@ -0,0 +1,68 @@ +setActiveSheetIndex(0) + ->setTitle('Test1') + ->setCellValue('D1', 1) + ->setCellValue('D2', 2) + ->setCellValue('D3', 3) + ->setCellValue('D4', 4) + ->setCellValue('D5', '=SUM(D1:D4)') + ->setSelectedCell('B2'); + + $spreadsheet->createSheet(1); + + $spreadsheet->setActiveSheetIndex(1) + ->setTitle('Test2') + ->setCellValue('D1', 4) + ->setCellValue('E1', 3) + ->setCellValue('F1', 2) + ->setCellValue('G1', 1) + ->setCellValue('H1', '=SUM(D1:G4)') + ->setSelectedCells('A1:B2'); + + $spreadsheet->createSheet(2); + + $spreadsheet->setActiveSheetIndex(2) + ->setTitle('Test3') + ->setCellValue('A1', 4) + ->setCellValue('B1', 3) + ->setCellValue('C1', 2) + ->setCellValue('D1', 1) + ->setCellValue('E1', '=SUM(A1:D4)') + ->setSelectedCells('A1:D1'); + + $spreadsheet->setActiveSheetIndex(1); + + $reloadedSpreadsheet = $this->writeAndReload($spreadsheet, $format); + + // Original object. + self::assertSame(1, $spreadsheet->getActiveSheetIndex()); + + // Saved and reloaded file. + self::assertSame(1, $reloadedSpreadsheet->getActiveSheetIndex()); + } +} diff --git a/tests/PhpSpreadsheetTests/Functional/SelectedCellsTest.php b/tests/PhpSpreadsheetTests/Functional/SelectedCellsTest.php new file mode 100644 index 0000000000..03d4be9f87 --- /dev/null +++ b/tests/PhpSpreadsheetTests/Functional/SelectedCellsTest.php @@ -0,0 +1,57 @@ +setActiveSheetIndex(0) + ->setTitle('Test1') + ->setCellValue('D1', 1) + ->setCellValue('D2', 2) + ->setCellValue('D3', 3) + ->setCellValue('D4', 4) + ->setCellValue('D5', '=SUM(D1:D4)') + ->setSelectedCell('B2'); + + $spreadsheet->createSheet(1); + + $spreadsheet->setActiveSheetIndex(1) + ->setTitle('Test2') + ->setCellValue('D1', 4) + ->setCellValue('E1', 3) + ->setCellValue('F1', 2) + ->setCellValue('G1', 1) + ->setCellValue('H1', '=SUM(D1:G4)') + ->setSelectedCells('A1:B2'); + + $reloadedSpreadsheet = $this->writeAndReload($spreadsheet, $format); + + // Original object. + self::assertSame('B2', $spreadsheet->setActiveSheetIndex(0)->getSelectedCells()); + self::assertSame('A1:B2', $spreadsheet->setActiveSheetIndex(1)->getSelectedCells()); + + // Saved and reloaded file. + self::assertSame('B2', $reloadedSpreadsheet->setActiveSheetIndex(0)->getSelectedCells()); + self::assertSame('A1:B2', $reloadedSpreadsheet->setActiveSheetIndex(1)->getSelectedCells()); + } +} From fb379385e07a8500792694ca0c7ec4f5ff43aa0a Mon Sep 17 00:00:00 2001 From: Owen Leibman Date: Tue, 14 Jan 2020 19:44:06 -0800 Subject: [PATCH 4/7] Fix active cell when freeze pane is used When freeze pane is in use on a worksheet, PhpSpreadsheet saves to Xlsx in such a way that the active cell is always set to the top left cell below the freeze pane. I find it difficult to understand why: 1. You have given users the setSelectedCells function, but then choose to ignore it. 2. Excel itself does not act in this manner. 3. PHPExcel did not act in this manner. 4. PhpSpreadsheet when writing to Xls does not act in this manner. This is especially emphasized because the one test in FreezePaneTest which would expose the difference is the only test in that member which is not made for both Xls and Xlsx. 5. It is *really* useful to be able to open a spreadsheet anywhere, even when it has header rows. Closes #1323 --- CHANGELOG.md | 1 + src/PhpSpreadsheet/Writer/Xlsx/Worksheet.php | 2 - .../Functional/FreezePaneTest.php | 69 ++++++++++++++++--- 3 files changed, 61 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 541e9279ab..4286fa9c73 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org). - Fix Xlsx Writer's handling of decimal commas [#1282](/~https://github.com/PHPOffice/PhpSpreadsheet/pull/1282) - Fix for issue by removing test code mistakenly left in [#1328](/~https://github.com/PHPOffice/PhpSpreadsheet/pull/1328) - Fix for Xls writer wrong selected cells and active sheet [#1256](/~https://github.com/PHPOffice/PhpSpreadsheet/pull/1256) +- Fix active cell when freeze pane is used [#1323](/~https://github.com/PHPOffice/PhpSpreadsheet/pull/1323) ## [1.10.1] - 2019-12-02 diff --git a/src/PhpSpreadsheet/Writer/Xlsx/Worksheet.php b/src/PhpSpreadsheet/Writer/Xlsx/Worksheet.php index bf811bdcd4..1d5a995a8b 100644 --- a/src/PhpSpreadsheet/Writer/Xlsx/Worksheet.php +++ b/src/PhpSpreadsheet/Writer/Xlsx/Worksheet.php @@ -262,8 +262,6 @@ private function writeSheetViews(XMLWriter $objWriter, PhpspreadsheetWorksheet $ --$ySplit; $topLeftCell = $pSheet->getTopLeftCell(); - $activeCell = $topLeftCell; - $sqref = $topLeftCell; // pane $pane = 'topRight'; diff --git a/tests/PhpSpreadsheetTests/Functional/FreezePaneTest.php b/tests/PhpSpreadsheetTests/Functional/FreezePaneTest.php index fda67231bb..3870971644 100644 --- a/tests/PhpSpreadsheetTests/Functional/FreezePaneTest.php +++ b/tests/PhpSpreadsheetTests/Functional/FreezePaneTest.php @@ -38,15 +38,8 @@ public function testFreezePane($format) self::assertSame($topLeftCell, $actualTopLeftCell, 'should be able to set the top left cell'); } - public function providerFormatsInvalidSelectedCells() - { - return [ - ['Xlsx'], - ]; - } - /** - * @dataProvider providerFormatsInvalidSelectedCells + * @dataProvider providerFormats * * @param string $format */ @@ -70,6 +63,64 @@ public function testFreezePaneWithInvalidSelectedCells($format) self::assertSame($cellSplit, $actualCellSplit, 'should be able to set freeze pane'); self::assertSame($topLeftCell, $actualTopLeftCell, 'should be able to set the top left cell'); - self::assertSame('A24', $reloadedActive->getSelectedCells(), 'selected cell should default to be first cell after the freeze pane'); + self::assertSame('F5', $reloadedActive->getSelectedCells()); + } + + /** + * @dataProvider providerFormats + * + * @param string $format + */ + public function testFreezePaneUserSelectedCell($format) + { + $spreadsheet = new Spreadsheet(); + $worksheet = $spreadsheet->getActiveSheet(); + $worksheet->setCellValue('A1', 'Header1'); + $worksheet->setCellValue('B1', 'Header2'); + $worksheet->setCellValue('C1', 'Header3'); + $worksheet->setCellValue('A2', 'Data1'); + $worksheet->setCellValue('B2', 'Data2'); + $worksheet->setCellValue('C2', 'Data3'); + $worksheet->setCellValue('A3', 'Data4'); + $worksheet->setCellValue('B3', 'Data5'); + $worksheet->setCellValue('C3', 'Data6'); + $worksheet->freezePane('A2'); + $worksheet->setSelectedCells('C3'); + + $reloadedSpreadsheet = $this->writeAndReload($spreadsheet, $format); + // Read written file + $reloadedActive = $reloadedSpreadsheet->getActiveSheet(); + + $expected = 'C3'; + self::assertSame($expected, $reloadedActive->getSelectedCells()); + } + + /** + * @dataProvider providerFormats + * + * @param string $format + */ + public function testNoFreezePaneUserSelectedCell($format) + { + $spreadsheet = new Spreadsheet(); + $worksheet = $spreadsheet->getActiveSheet(); + $worksheet->setCellValue('A1', 'Header1'); + $worksheet->setCellValue('B1', 'Header2'); + $worksheet->setCellValue('C1', 'Header3'); + $worksheet->setCellValue('A2', 'Data1'); + $worksheet->setCellValue('B2', 'Data2'); + $worksheet->setCellValue('C2', 'Data3'); + $worksheet->setCellValue('A3', 'Data4'); + $worksheet->setCellValue('B3', 'Data5'); + $worksheet->setCellValue('C3', 'Data6'); + //$worksheet->freezePane('A2'); + $worksheet->setSelectedCells('C3'); + + $reloadedSpreadsheet = $this->writeAndReload($spreadsheet, $format); + // Read written file + $reloadedActive = $reloadedSpreadsheet->getActiveSheet(); + + $expected = 'C3'; + self::assertSame($expected, $reloadedActive->getSelectedCells()); } } From 9f5a4724268557344043384ffceb884892dfef5a Mon Sep 17 00:00:00 2001 From: Stronati Andrea Date: Wed, 15 Jan 2020 15:49:24 +0100 Subject: [PATCH 5/7] Fix XLSX file loading with autofilter containing '$' The `setRange` method of the `Xlsx/AutoFilter` class expects a filter range format like "A1:E10". The returned value from `$this->worksheetXml->autoFilter['ref']` could contain "$" and returning a value like "$A$1:$E$10". Fixes #687 Fixes #1325 Closes #1326 --- CHANGELOG.md | 1 + src/PhpSpreadsheet/Reader/Xlsx/AutoFilter.php | 3 +- .../Reader/Xlsx/AutoFilterTest.php | 69 +++++++++++++++++++ 3 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 tests/PhpSpreadsheetTests/Reader/Xlsx/AutoFilterTest.php diff --git a/CHANGELOG.md b/CHANGELOG.md index 4286fa9c73..354ec8d102 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org). - Fix for issue by removing test code mistakenly left in [#1328](/~https://github.com/PHPOffice/PhpSpreadsheet/pull/1328) - Fix for Xls writer wrong selected cells and active sheet [#1256](/~https://github.com/PHPOffice/PhpSpreadsheet/pull/1256) - Fix active cell when freeze pane is used [#1323](/~https://github.com/PHPOffice/PhpSpreadsheet/pull/1323) +- Fix XLSX file loading with autofilter containing '$' [#1326](/~https://github.com/PHPOffice/PhpSpreadsheet/pull/1326) ## [1.10.1] - 2019-12-02 diff --git a/src/PhpSpreadsheet/Reader/Xlsx/AutoFilter.php b/src/PhpSpreadsheet/Reader/Xlsx/AutoFilter.php index 6929758dfe..69d5f69e0a 100644 --- a/src/PhpSpreadsheet/Reader/Xlsx/AutoFilter.php +++ b/src/PhpSpreadsheet/Reader/Xlsx/AutoFilter.php @@ -20,7 +20,8 @@ public function __construct(Worksheet $workSheet, \SimpleXMLElement $worksheetXm public function load() { - $autoFilterRange = (string) $this->worksheetXml->autoFilter['ref']; + // Remove all "$" in the auto filter range + $autoFilterRange = preg_replace('/\$/', '', $this->worksheetXml->autoFilter['ref']); if (strpos($autoFilterRange, ':') !== false) { $this->readAutoFilter($autoFilterRange, $this->worksheetXml); } diff --git a/tests/PhpSpreadsheetTests/Reader/Xlsx/AutoFilterTest.php b/tests/PhpSpreadsheetTests/Reader/Xlsx/AutoFilterTest.php new file mode 100644 index 0000000000..90ea17aa0d --- /dev/null +++ b/tests/PhpSpreadsheetTests/Reader/Xlsx/AutoFilterTest.php @@ -0,0 +1,69 @@ +getMockBuilder(Worksheet::class) + ->disableOriginalConstructor() + ->getMock(); + } + + private function getXMLInstance($ref) + { + return new \SimpleXMLElement( + '' . + '' . + '' . + '' + ); + } + + private function getAutoFilterInstance() + { + $instance = $this->getMockBuilder(WorksheetAutoFilter::class) + ->disableOriginalConstructor() + ->getMock(); + + return $instance; + } + + public function loadDataProvider() + { + return [ + ['$B3$E8', 0, 'B3E8'], + ['$B3:$E8', 1, 'B3:E8'], + ]; + } + + /** + * @dataProvider loadDataProvider + * + * @param string $ref + * @param int $expectedReadAutoFilterCalled + * @param string $expectedRef + */ + public function testLoad($ref, $expectedReadAutoFilterCalled, $expectedRef) + { + $worksheetAutoFilter = $this->getAutoFilterInstance(); + $worksheetAutoFilter->expects($this->exactly($expectedReadAutoFilterCalled ? 1 : 0)) + ->method('setRange') + ->with($expectedRef); + + $worksheet = $this->getWorksheetInstance(); + $worksheet->expects($this->exactly($expectedReadAutoFilterCalled ? 1 : 0)) + ->method('getAutoFilter') + ->willReturn($worksheetAutoFilter); + + $autoFilter = new AutoFilter($worksheet, $this->getXMLInstance($ref)); + + $autoFilter->load(); + } +} From ffb0d21cec9a1ef9abf168ce7650e6ab846208e9 Mon Sep 17 00:00:00 2001 From: Claas Augner Date: Sun, 16 Feb 2020 21:51:20 +0100 Subject: [PATCH 6/7] PHPDoc: use @return $this for fluent methods Fluent methods, especially setters, return the object on which are called. This is documented in PHPDoc using the `$this` keyword, which is equivalent to `static` with the additional notion of object identity. This helps IDEs and static analysis tools provide more meaningful output. --- CHANGELOG.md | 1 + src/PhpSpreadsheet/Cell/Cell.php | 6 +- src/PhpSpreadsheet/Cell/DataValidation.php | 26 ++-- src/PhpSpreadsheet/Cell/Hyperlink.php | 4 +- src/PhpSpreadsheet/Chart/Axis.php | 16 +-- src/PhpSpreadsheet/Chart/Chart.php | 24 ++-- src/PhpSpreadsheet/Chart/DataSeries.php | 10 +- src/PhpSpreadsheet/Chart/DataSeriesValues.php | 12 +- src/PhpSpreadsheet/Chart/GridLines.php | 18 +-- src/PhpSpreadsheet/Chart/Layout.php | 28 ++--- src/PhpSpreadsheet/Chart/PlotArea.php | 2 +- src/PhpSpreadsheet/Chart/Title.php | 2 +- src/PhpSpreadsheet/Comment.php | 16 +-- src/PhpSpreadsheet/Document/Properties.php | 24 ++-- src/PhpSpreadsheet/Document/Security.php | 10 +- src/PhpSpreadsheet/NamedRange.php | 10 +- src/PhpSpreadsheet/Reader/Csv.php | 10 +- src/PhpSpreadsheet/Reader/Html.php | 4 +- src/PhpSpreadsheet/Reader/Slk.php | 4 +- src/PhpSpreadsheet/RichText/RichText.php | 4 +- src/PhpSpreadsheet/RichText/Run.php | 2 +- src/PhpSpreadsheet/RichText/TextElement.php | 2 +- src/PhpSpreadsheet/Shared/JAMA/Matrix.php | 10 +- src/PhpSpreadsheet/Spreadsheet.php | 2 +- src/PhpSpreadsheet/Style/Alignment.php | 16 +-- src/PhpSpreadsheet/Style/Border.php | 6 +- src/PhpSpreadsheet/Style/Borders.php | 4 +- src/PhpSpreadsheet/Style/Color.php | 8 +- src/PhpSpreadsheet/Style/Conditional.php | 14 +-- src/PhpSpreadsheet/Style/Fill.php | 10 +- src/PhpSpreadsheet/Style/Font.php | 20 +-- src/PhpSpreadsheet/Style/NumberFormat.php | 6 +- src/PhpSpreadsheet/Style/Protection.php | 6 +- src/PhpSpreadsheet/Style/Style.php | 8 +- src/PhpSpreadsheet/Style/Supervisor.php | 2 +- src/PhpSpreadsheet/Worksheet/AutoFilter.php | 12 +- .../Worksheet/AutoFilter/Column.php | 18 +-- .../Worksheet/AutoFilter/Column/Rule.php | 12 +- src/PhpSpreadsheet/Worksheet/BaseDrawing.php | 24 ++-- .../Worksheet/ColumnCellIterator.php | 6 +- .../Worksheet/ColumnDimension.php | 6 +- .../Worksheet/ColumnIterator.php | 6 +- src/PhpSpreadsheet/Worksheet/Dimension.php | 8 +- src/PhpSpreadsheet/Worksheet/Drawing.php | 2 +- .../Worksheet/Drawing/Shadow.php | 14 +-- src/PhpSpreadsheet/Worksheet/HeaderFooter.php | 26 ++-- .../Worksheet/MemoryDrawing.php | 6 +- src/PhpSpreadsheet/Worksheet/PageMargins.php | 12 +- src/PhpSpreadsheet/Worksheet/PageSetup.php | 38 +++--- src/PhpSpreadsheet/Worksheet/Protection.php | 34 ++--- .../Worksheet/RowCellIterator.php | 6 +- src/PhpSpreadsheet/Worksheet/RowDimension.php | 6 +- src/PhpSpreadsheet/Worksheet/RowIterator.php | 6 +- src/PhpSpreadsheet/Worksheet/SheetView.php | 6 +- src/PhpSpreadsheet/Worksheet/Worksheet.php | 118 +++++++++--------- src/PhpSpreadsheet/Writer/Csv.php | 14 +-- src/PhpSpreadsheet/Writer/Html.php | 14 ++- src/PhpSpreadsheet/Writer/Ods.php | 2 +- src/PhpSpreadsheet/Writer/Pdf.php | 2 +- src/PhpSpreadsheet/Writer/Xlsx.php | 4 +- 60 files changed, 376 insertions(+), 373 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 354ec8d102..64075749d9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ and this project adheres to [Semantic Versioning](https://semver.org). - Fix for Xls writer wrong selected cells and active sheet [#1256](/~https://github.com/PHPOffice/PhpSpreadsheet/pull/1256) - Fix active cell when freeze pane is used [#1323](/~https://github.com/PHPOffice/PhpSpreadsheet/pull/1323) - Fix XLSX file loading with autofilter containing '$' [#1326](/~https://github.com/PHPOffice/PhpSpreadsheet/pull/1326) +- PHPDoc - Use `@return $this` for fluent methods [#1362](/~https://github.com/PHPOffice/PhpSpreadsheet/pull/1362) ## [1.10.1] - 2019-12-02 diff --git a/src/PhpSpreadsheet/Cell/Cell.php b/src/PhpSpreadsheet/Cell/Cell.php index cdef901875..bae8261ef2 100644 --- a/src/PhpSpreadsheet/Cell/Cell.php +++ b/src/PhpSpreadsheet/Cell/Cell.php @@ -67,7 +67,7 @@ class Cell /** * Update the cell into the cell collection. * - * @return self + * @return $this */ public function updateInCollection() { @@ -177,7 +177,7 @@ public function getFormattedValue() * * @throws Exception * - * @return Cell + * @return $this */ public function setValue($pValue) { @@ -672,7 +672,7 @@ public function setXfIndex($pValue) * * @param mixed $pAttributes * - * @return Cell + * @return $this */ public function setFormulaAttributes($pAttributes) { diff --git a/src/PhpSpreadsheet/Cell/DataValidation.php b/src/PhpSpreadsheet/Cell/DataValidation.php index a041ea0e0a..dfeb024c92 100644 --- a/src/PhpSpreadsheet/Cell/DataValidation.php +++ b/src/PhpSpreadsheet/Cell/DataValidation.php @@ -142,7 +142,7 @@ public function getFormula1() * * @param string $value * - * @return DataValidation + * @return $this */ public function setFormula1($value) { @@ -166,7 +166,7 @@ public function getFormula2() * * @param string $value * - * @return DataValidation + * @return $this */ public function setFormula2($value) { @@ -190,7 +190,7 @@ public function getType() * * @param string $value * - * @return DataValidation + * @return $this */ public function setType($value) { @@ -214,7 +214,7 @@ public function getErrorStyle() * * @param string $value see self::STYLE_* * - * @return DataValidation + * @return $this */ public function setErrorStyle($value) { @@ -238,7 +238,7 @@ public function getOperator() * * @param string $value * - * @return DataValidation + * @return $this */ public function setOperator($value) { @@ -262,7 +262,7 @@ public function getAllowBlank() * * @param bool $value * - * @return DataValidation + * @return $this */ public function setAllowBlank($value) { @@ -286,7 +286,7 @@ public function getShowDropDown() * * @param bool $value * - * @return DataValidation + * @return $this */ public function setShowDropDown($value) { @@ -310,7 +310,7 @@ public function getShowInputMessage() * * @param bool $value * - * @return DataValidation + * @return $this */ public function setShowInputMessage($value) { @@ -334,7 +334,7 @@ public function getShowErrorMessage() * * @param bool $value * - * @return DataValidation + * @return $this */ public function setShowErrorMessage($value) { @@ -358,7 +358,7 @@ public function getErrorTitle() * * @param string $value * - * @return DataValidation + * @return $this */ public function setErrorTitle($value) { @@ -382,7 +382,7 @@ public function getError() * * @param string $value * - * @return DataValidation + * @return $this */ public function setError($value) { @@ -406,7 +406,7 @@ public function getPromptTitle() * * @param string $value * - * @return DataValidation + * @return $this */ public function setPromptTitle($value) { @@ -430,7 +430,7 @@ public function getPrompt() * * @param string $value * - * @return DataValidation + * @return $this */ public function setPrompt($value) { diff --git a/src/PhpSpreadsheet/Cell/Hyperlink.php b/src/PhpSpreadsheet/Cell/Hyperlink.php index e17c20d9be..003d51014d 100644 --- a/src/PhpSpreadsheet/Cell/Hyperlink.php +++ b/src/PhpSpreadsheet/Cell/Hyperlink.php @@ -46,7 +46,7 @@ public function getUrl() * * @param string $value * - * @return Hyperlink + * @return $this */ public function setUrl($value) { @@ -70,7 +70,7 @@ public function getTooltip() * * @param string $value * - * @return Hyperlink + * @return $this */ public function setTooltip($value) { diff --git a/src/PhpSpreadsheet/Chart/Axis.php b/src/PhpSpreadsheet/Chart/Axis.php index 3d1dd22262..66242e3409 100644 --- a/src/PhpSpreadsheet/Chart/Axis.php +++ b/src/PhpSpreadsheet/Chart/Axis.php @@ -354,7 +354,7 @@ public function setShadowProperties($sh_presets, $sh_color_value = null, $sh_col * * @param int $shadow_presets * - * @return Axis + * @return $this */ private function setShadowPresetsProperties($shadow_presets) { @@ -370,7 +370,7 @@ private function setShadowPresetsProperties($shadow_presets) * @param array $properties_map * @param mixed &$reference * - * @return Axis + * @return $this */ private function setShadowProperiesMapValues(array $properties_map, &$reference = null) { @@ -402,7 +402,7 @@ private function setShadowProperiesMapValues(array $properties_map, &$reference * @param int $alpha * @param string $type * - * @return Axis + * @return $this */ private function setShadowColor($color, $alpha, $type) { @@ -416,7 +416,7 @@ private function setShadowColor($color, $alpha, $type) * * @param float $blur * - * @return Axis + * @return $this */ private function setShadowBlur($blur) { @@ -432,7 +432,7 @@ private function setShadowBlur($blur) * * @param int $angle * - * @return Axis + * @return $this */ private function setShadowAngle($angle) { @@ -448,7 +448,7 @@ private function setShadowAngle($angle) * * @param float $distance * - * @return Axis + * @return $this */ private function setShadowDistance($distance) { @@ -506,7 +506,7 @@ public function getGlowProperty($property) * * @param float $size * - * @return Axis + * @return $this */ private function setGlowSize($size) { @@ -524,7 +524,7 @@ private function setGlowSize($size) * @param int $alpha * @param string $type * - * @return Axis + * @return $this */ private function setGlowColor($color, $alpha, $type) { diff --git a/src/PhpSpreadsheet/Chart/Chart.php b/src/PhpSpreadsheet/Chart/Chart.php index 921795da94..59c9ed5d67 100644 --- a/src/PhpSpreadsheet/Chart/Chart.php +++ b/src/PhpSpreadsheet/Chart/Chart.php @@ -197,7 +197,7 @@ public function getWorksheet() * * @param Worksheet $pValue * - * @return Chart + * @return $this */ public function setWorksheet(Worksheet $pValue = null) { @@ -221,7 +221,7 @@ public function getTitle() * * @param Title $title * - * @return Chart + * @return $this */ public function setTitle(Title $title) { @@ -245,7 +245,7 @@ public function getLegend() * * @param Legend $legend * - * @return Chart + * @return $this */ public function setLegend(Legend $legend) { @@ -269,7 +269,7 @@ public function getXAxisLabel() * * @param Title $label * - * @return Chart + * @return $this */ public function setXAxisLabel(Title $label) { @@ -293,7 +293,7 @@ public function getYAxisLabel() * * @param Title $label * - * @return Chart + * @return $this */ public function setYAxisLabel(Title $label) { @@ -327,7 +327,7 @@ public function getPlotVisibleOnly() * * @param bool $plotVisibleOnly * - * @return Chart + * @return $this */ public function setPlotVisibleOnly($plotVisibleOnly) { @@ -351,7 +351,7 @@ public function getDisplayBlanksAs() * * @param string $displayBlanksAs * - * @return Chart + * @return $this */ public function setDisplayBlanksAs($displayBlanksAs) { @@ -423,7 +423,7 @@ public function getMinorGridlines() * @param int $xOffset * @param int $yOffset * - * @return Chart + * @return $this */ public function setTopLeftPosition($cell, $xOffset = null, $yOffset = null) { @@ -467,7 +467,7 @@ public function getTopLeftCell() * * @param string $cell * - * @return Chart + * @return $this */ public function setTopLeftCell($cell) { @@ -482,7 +482,7 @@ public function setTopLeftCell($cell) * @param int $xOffset * @param int $yOffset * - * @return Chart + * @return $this */ public function setTopLeftOffset($xOffset, $yOffset) { @@ -541,7 +541,7 @@ public function getTopLeftYOffset() * @param int $xOffset * @param int $yOffset * - * @return Chart + * @return $this */ public function setBottomRightPosition($cell, $xOffset = null, $yOffset = null) { @@ -593,7 +593,7 @@ public function getBottomRightCell() * @param int $xOffset * @param int $yOffset * - * @return Chart + * @return $this */ public function setBottomRightOffset($xOffset, $yOffset) { diff --git a/src/PhpSpreadsheet/Chart/DataSeries.php b/src/PhpSpreadsheet/Chart/DataSeries.php index 8056bbeea2..c20efabe80 100644 --- a/src/PhpSpreadsheet/Chart/DataSeries.php +++ b/src/PhpSpreadsheet/Chart/DataSeries.php @@ -157,7 +157,7 @@ public function getPlotType() * * @param string $plotType * - * @return DataSeries + * @return $this */ public function setPlotType($plotType) { @@ -181,7 +181,7 @@ public function getPlotGrouping() * * @param string $groupingType * - * @return DataSeries + * @return $this */ public function setPlotGrouping($groupingType) { @@ -205,7 +205,7 @@ public function getPlotDirection() * * @param string $plotDirection * - * @return DataSeries + * @return $this */ public function setPlotDirection($plotDirection) { @@ -297,7 +297,7 @@ public function getPlotStyle() * * @param null|string $plotStyle * - * @return DataSeries + * @return $this */ public function setPlotStyle($plotStyle) { @@ -360,7 +360,7 @@ public function getSmoothLine() * * @param bool $smoothLine * - * @return DataSeries + * @return $this */ public function setSmoothLine($smoothLine) { diff --git a/src/PhpSpreadsheet/Chart/DataSeriesValues.php b/src/PhpSpreadsheet/Chart/DataSeriesValues.php index a568e3fa92..ec40cb8424 100644 --- a/src/PhpSpreadsheet/Chart/DataSeriesValues.php +++ b/src/PhpSpreadsheet/Chart/DataSeriesValues.php @@ -117,7 +117,7 @@ public function getDataType() * * @throws Exception * - * @return DataSeriesValues + * @return $this */ public function setDataType($dataType) { @@ -144,7 +144,7 @@ public function getDataSource() * * @param string $dataSource * - * @return DataSeriesValues + * @return $this */ public function setDataSource($dataSource) { @@ -168,7 +168,7 @@ public function getPointMarker() * * @param string $marker * - * @return DataSeriesValues + * @return $this */ public function setPointMarker($marker) { @@ -192,7 +192,7 @@ public function getFormatCode() * * @param string $formatCode * - * @return DataSeriesValues + * @return $this */ public function setFormatCode($formatCode) { @@ -275,7 +275,7 @@ public function getLineWidth() * * @param int $width * - * @return DataSeriesValues + * @return $this */ public function setLineWidth($width) { @@ -346,7 +346,7 @@ public function getDataValue() * * @param array $dataValues * - * @return DataSeriesValues + * @return $this */ public function setDataValues($dataValues) { diff --git a/src/PhpSpreadsheet/Chart/GridLines.php b/src/PhpSpreadsheet/Chart/GridLines.php index 8cc83e5540..b07fcae595 100644 --- a/src/PhpSpreadsheet/Chart/GridLines.php +++ b/src/PhpSpreadsheet/Chart/GridLines.php @@ -91,7 +91,7 @@ public function getObjectState() /** * Change Object State to True. * - * @return GridLines + * @return $this */ private function activateObject() { @@ -229,7 +229,7 @@ public function getGlowSize() * * @param float $size * - * @return GridLines + * @return $this */ private function setGlowSize($size) { @@ -245,7 +245,7 @@ private function setGlowSize($size) * @param int $alpha * @param string $type * - * @return GridLines + * @return $this */ private function setGlowColor($color, $alpha, $type) { @@ -305,7 +305,7 @@ public function setShadowProperties($sh_presets, $sh_color_value = null, $sh_col * * @param int $shadow_presets * - * @return GridLines + * @return $this */ private function setShadowPresetsProperties($shadow_presets) { @@ -321,7 +321,7 @@ private function setShadowPresetsProperties($shadow_presets) * @param array $properties_map * @param mixed &$reference * - * @return GridLines + * @return $this */ private function setShadowProperiesMapValues(array $properties_map, &$reference = null) { @@ -353,7 +353,7 @@ private function setShadowProperiesMapValues(array $properties_map, &$reference * @param int $alpha * @param string $type * - * @return GridLines + * @return $this */ private function setShadowColor($color, $alpha, $type) { @@ -375,7 +375,7 @@ private function setShadowColor($color, $alpha, $type) * * @param float $blur * - * @return GridLines + * @return $this */ private function setShadowBlur($blur) { @@ -391,7 +391,7 @@ private function setShadowBlur($blur) * * @param int $angle * - * @return GridLines + * @return $this */ private function setShadowAngle($angle) { @@ -407,7 +407,7 @@ private function setShadowAngle($angle) * * @param float $distance * - * @return GridLines + * @return $this */ private function setShadowDistance($distance) { diff --git a/src/PhpSpreadsheet/Chart/Layout.php b/src/PhpSpreadsheet/Chart/Layout.php index a8a96d2f1c..3e989c6d58 100644 --- a/src/PhpSpreadsheet/Chart/Layout.php +++ b/src/PhpSpreadsheet/Chart/Layout.php @@ -153,7 +153,7 @@ public function getLayoutTarget() * * @param string $value * - * @return Layout + * @return $this */ public function setLayoutTarget($value) { @@ -177,7 +177,7 @@ public function getXMode() * * @param string $value * - * @return Layout + * @return $this */ public function setXMode($value) { @@ -201,7 +201,7 @@ public function getYMode() * * @param string $value * - * @return Layout + * @return $this */ public function setYMode($value) { @@ -225,7 +225,7 @@ public function getXPosition() * * @param float $value * - * @return Layout + * @return $this */ public function setXPosition($value) { @@ -249,7 +249,7 @@ public function getYPosition() * * @param float $value * - * @return Layout + * @return $this */ public function setYPosition($value) { @@ -273,7 +273,7 @@ public function getWidth() * * @param float $value * - * @return Layout + * @return $this */ public function setWidth($value) { @@ -297,7 +297,7 @@ public function getHeight() * * @param float $value * - * @return Layout + * @return $this */ public function setHeight($value) { @@ -322,7 +322,7 @@ public function getShowLegendKey() * * @param bool $value Show legend key * - * @return Layout + * @return $this */ public function setShowLegendKey($value) { @@ -347,7 +347,7 @@ public function getShowVal() * * @param bool $value Show val * - * @return Layout + * @return $this */ public function setShowVal($value) { @@ -372,7 +372,7 @@ public function getShowCatName() * * @param bool $value Show cat name * - * @return Layout + * @return $this */ public function setShowCatName($value) { @@ -397,7 +397,7 @@ public function getShowSerName() * * @param bool $value Show series name * - * @return Layout + * @return $this */ public function setShowSerName($value) { @@ -422,7 +422,7 @@ public function getShowPercent() * * @param bool $value Show percentage * - * @return Layout + * @return $this */ public function setShowPercent($value) { @@ -447,7 +447,7 @@ public function getShowBubbleSize() * * @param bool $value Show bubble size * - * @return Layout + * @return $this */ public function setShowBubbleSize($value) { @@ -472,7 +472,7 @@ public function getShowLeaderLines() * * @param bool $value Show leader lines * - * @return Layout + * @return $this */ public function setShowLeaderLines($value) { diff --git a/src/PhpSpreadsheet/Chart/PlotArea.php b/src/PhpSpreadsheet/Chart/PlotArea.php index b98c638df7..9da4aa3297 100644 --- a/src/PhpSpreadsheet/Chart/PlotArea.php +++ b/src/PhpSpreadsheet/Chart/PlotArea.php @@ -94,7 +94,7 @@ public function getPlotGroupByIndex($index) * * @param DataSeries[] $plotSeries * - * @return PlotArea + * @return $this */ public function setPlotSeries(array $plotSeries) { diff --git a/src/PhpSpreadsheet/Chart/Title.php b/src/PhpSpreadsheet/Chart/Title.php index f53c6b37bd..650bcdc152 100644 --- a/src/PhpSpreadsheet/Chart/Title.php +++ b/src/PhpSpreadsheet/Chart/Title.php @@ -45,7 +45,7 @@ public function getCaption() * * @param string $caption * - * @return Title + * @return $this */ public function setCaption($caption) { diff --git a/src/PhpSpreadsheet/Comment.php b/src/PhpSpreadsheet/Comment.php index 1b5ab1fd2c..8041ddaf3e 100644 --- a/src/PhpSpreadsheet/Comment.php +++ b/src/PhpSpreadsheet/Comment.php @@ -96,7 +96,7 @@ public function getAuthor() * * @param string $author * - * @return Comment + * @return $this */ public function setAuthor($author) { @@ -120,7 +120,7 @@ public function getText() * * @param RichText $pValue * - * @return Comment + * @return $this */ public function setText(RichText $pValue) { @@ -144,7 +144,7 @@ public function getWidth() * * @param string $width * - * @return Comment + * @return $this */ public function setWidth($width) { @@ -168,7 +168,7 @@ public function getHeight() * * @param string $value * - * @return Comment + * @return $this */ public function setHeight($value) { @@ -192,7 +192,7 @@ public function getMarginLeft() * * @param string $value * - * @return Comment + * @return $this */ public function setMarginLeft($value) { @@ -216,7 +216,7 @@ public function getMarginTop() * * @param string $value * - * @return Comment + * @return $this */ public function setMarginTop($value) { @@ -240,7 +240,7 @@ public function getVisible() * * @param bool $value * - * @return Comment + * @return $this */ public function setVisible($value) { @@ -264,7 +264,7 @@ public function getFillColor() * * @param string $alignment see Style\Alignment::HORIZONTAL_* * - * @return Comment + * @return $this */ public function setAlignment($alignment) { diff --git a/src/PhpSpreadsheet/Document/Properties.php b/src/PhpSpreadsheet/Document/Properties.php index 1a432db049..58fd2ef60c 100644 --- a/src/PhpSpreadsheet/Document/Properties.php +++ b/src/PhpSpreadsheet/Document/Properties.php @@ -122,7 +122,7 @@ public function getCreator() * * @param string $creator * - * @return Properties + * @return $this */ public function setCreator($creator) { @@ -146,7 +146,7 @@ public function getLastModifiedBy() * * @param string $pValue * - * @return Properties + * @return $this */ public function setLastModifiedBy($pValue) { @@ -170,7 +170,7 @@ public function getCreated() * * @param int|string $time * - * @return Properties + * @return $this */ public function setCreated($time) { @@ -204,7 +204,7 @@ public function getModified() * * @param int|string $time * - * @return Properties + * @return $this */ public function setModified($time) { @@ -238,7 +238,7 @@ public function getTitle() * * @param string $title * - * @return Properties + * @return $this */ public function setTitle($title) { @@ -262,7 +262,7 @@ public function getDescription() * * @param string $description * - * @return Properties + * @return $this */ public function setDescription($description) { @@ -286,7 +286,7 @@ public function getSubject() * * @param string $subject * - * @return Properties + * @return $this */ public function setSubject($subject) { @@ -310,7 +310,7 @@ public function getKeywords() * * @param string $keywords * - * @return Properties + * @return $this */ public function setKeywords($keywords) { @@ -334,7 +334,7 @@ public function getCategory() * * @param string $category * - * @return Properties + * @return $this */ public function setCategory($category) { @@ -358,7 +358,7 @@ public function getCompany() * * @param string $company * - * @return Properties + * @return $this */ public function setCompany($company) { @@ -382,7 +382,7 @@ public function getManager() * * @param string $manager * - * @return Properties + * @return $this */ public function setManager($manager) { @@ -453,7 +453,7 @@ public function getCustomPropertyType($propertyName) * 'd' : Date/Time * 'b' : Boolean * - * @return Properties + * @return $this */ public function setCustomProperty($propertyName, $propertyValue = '', $propertyType = null) { diff --git a/src/PhpSpreadsheet/Document/Security.php b/src/PhpSpreadsheet/Document/Security.php index 1682678c2e..cef3db8c44 100644 --- a/src/PhpSpreadsheet/Document/Security.php +++ b/src/PhpSpreadsheet/Document/Security.php @@ -75,7 +75,7 @@ public function getLockRevision() * * @param bool $pValue * - * @return Security + * @return $this */ public function setLockRevision($pValue) { @@ -99,7 +99,7 @@ public function getLockStructure() * * @param bool $pValue * - * @return Security + * @return $this */ public function setLockStructure($pValue) { @@ -123,7 +123,7 @@ public function getLockWindows() * * @param bool $pValue * - * @return Security + * @return $this */ public function setLockWindows($pValue) { @@ -148,7 +148,7 @@ public function getRevisionsPassword() * @param string $pValue * @param bool $pAlreadyHashed If the password has already been hashed, set this to true * - * @return Security + * @return $this */ public function setRevisionsPassword($pValue, $pAlreadyHashed = false) { @@ -176,7 +176,7 @@ public function getWorkbookPassword() * @param string $pValue * @param bool $pAlreadyHashed If the password has already been hashed, set this to true * - * @return Security + * @return $this */ public function setWorkbookPassword($pValue, $pAlreadyHashed = false) { diff --git a/src/PhpSpreadsheet/NamedRange.php b/src/PhpSpreadsheet/NamedRange.php index 1f94d5a4ed..e539b7c530 100644 --- a/src/PhpSpreadsheet/NamedRange.php +++ b/src/PhpSpreadsheet/NamedRange.php @@ -82,7 +82,7 @@ public function getName() * * @param string $value * - * @return NamedRange + * @return $this */ public function setName($value) { @@ -123,7 +123,7 @@ public function getWorksheet() * * @param Worksheet $value * - * @return NamedRange + * @return $this */ public function setWorksheet(Worksheet $value = null) { @@ -149,7 +149,7 @@ public function getRange() * * @param string $value * - * @return NamedRange + * @return $this */ public function setRange($value) { @@ -175,7 +175,7 @@ public function getLocalOnly() * * @param bool $value * - * @return NamedRange + * @return $this */ public function setLocalOnly($value) { @@ -200,7 +200,7 @@ public function getScope() * * @param null|Worksheet $value * - * @return NamedRange + * @return $this */ public function setScope(Worksheet $value = null) { diff --git a/src/PhpSpreadsheet/Reader/Csv.php b/src/PhpSpreadsheet/Reader/Csv.php index 2125191335..4713409881 100644 --- a/src/PhpSpreadsheet/Reader/Csv.php +++ b/src/PhpSpreadsheet/Reader/Csv.php @@ -70,7 +70,7 @@ public function __construct() * * @param string $pValue Input encoding, eg: 'UTF-8' * - * @return Csv + * @return $this */ public function setInputEncoding($pValue) { @@ -415,7 +415,7 @@ public function getDelimiter() * * @param string $delimiter Delimiter, eg: ',' * - * @return CSV + * @return $this */ public function setDelimiter($delimiter) { @@ -439,7 +439,7 @@ public function getEnclosure() * * @param string $enclosure Enclosure, defaults to " * - * @return CSV + * @return $this */ public function setEnclosure($enclosure) { @@ -466,7 +466,7 @@ public function getSheetIndex() * * @param int $pValue Sheet index * - * @return CSV + * @return $this */ public function setSheetIndex($pValue) { @@ -480,7 +480,7 @@ public function setSheetIndex($pValue) * * @param bool $contiguous * - * @return Csv + * @return $this */ public function setContiguous($contiguous) { diff --git a/src/PhpSpreadsheet/Reader/Html.php b/src/PhpSpreadsheet/Reader/Html.php index b500d3ae3b..a255cfd9eb 100644 --- a/src/PhpSpreadsheet/Reader/Html.php +++ b/src/PhpSpreadsheet/Reader/Html.php @@ -223,7 +223,7 @@ public function load($pFilename) * * @param string $pValue Input encoding, eg: 'ANSI' * - * @return Html + * @return $this */ public function setInputEncoding($pValue) { @@ -669,7 +669,7 @@ public function getSheetIndex() * * @param int $pValue Sheet index * - * @return HTML + * @return $this */ public function setSheetIndex($pValue) { diff --git a/src/PhpSpreadsheet/Reader/Slk.php b/src/PhpSpreadsheet/Reader/Slk.php index d73f598cf9..9912e9376b 100644 --- a/src/PhpSpreadsheet/Reader/Slk.php +++ b/src/PhpSpreadsheet/Reader/Slk.php @@ -83,7 +83,7 @@ public function canRead($pFilename) * * @param string $pValue Input encoding, eg: 'ANSI' * - * @return Slk + * @return $this */ public function setInputEncoding($pValue) { @@ -485,7 +485,7 @@ public function getSheetIndex() * * @param int $pValue Sheet index * - * @return Slk + * @return $this */ public function setSheetIndex($pValue) { diff --git a/src/PhpSpreadsheet/RichText/RichText.php b/src/PhpSpreadsheet/RichText/RichText.php index 76a04d549f..6e90fa355f 100644 --- a/src/PhpSpreadsheet/RichText/RichText.php +++ b/src/PhpSpreadsheet/RichText/RichText.php @@ -47,7 +47,7 @@ public function __construct(Cell $pCell = null) * * @param ITextElement $pText Rich text element * - * @return RichText + * @return $this */ public function addText(ITextElement $pText) { @@ -133,7 +133,7 @@ public function getRichTextElements() * * @param ITextElement[] $textElements Array of elements * - * @return RichText + * @return $this */ public function setRichTextElements(array $textElements) { diff --git a/src/PhpSpreadsheet/RichText/Run.php b/src/PhpSpreadsheet/RichText/Run.php index b4996235f3..aa4a8e462d 100644 --- a/src/PhpSpreadsheet/RichText/Run.php +++ b/src/PhpSpreadsheet/RichText/Run.php @@ -40,7 +40,7 @@ public function getFont() * * @param Font $pFont Font * - * @return ITextElement + * @return $this */ public function setFont(Font $pFont = null) { diff --git a/src/PhpSpreadsheet/RichText/TextElement.php b/src/PhpSpreadsheet/RichText/TextElement.php index d9ad0d7f5e..f8be5d55b0 100644 --- a/src/PhpSpreadsheet/RichText/TextElement.php +++ b/src/PhpSpreadsheet/RichText/TextElement.php @@ -37,7 +37,7 @@ public function getText() * * @param $text string Text * - * @return ITextElement + * @return $this */ public function setText($text) { diff --git a/src/PhpSpreadsheet/Shared/JAMA/Matrix.php b/src/PhpSpreadsheet/Shared/JAMA/Matrix.php index 17f321077d..a67b6c2de5 100644 --- a/src/PhpSpreadsheet/Shared/JAMA/Matrix.php +++ b/src/PhpSpreadsheet/Shared/JAMA/Matrix.php @@ -524,7 +524,7 @@ public function plus(...$args) * * @param mixed $B Matrix/Array * - * @return Matrix Sum + * @return $this */ public function plusEquals(...$args) { @@ -628,7 +628,7 @@ public function minus(...$args) * * @param mixed $B Matrix/Array * - * @return Matrix Sum + * @return $this */ public function minusEquals(...$args) { @@ -734,7 +734,7 @@ public function arrayTimes(...$args) * * @param mixed $B Matrix/Array * - * @return Matrix Matrix Aij + * @return $this */ public function arrayTimesEquals(...$args) { @@ -1091,7 +1091,7 @@ public function times(...$args) * * @param mixed $B Matrix/Array * - * @return Matrix Sum + * @return $this */ public function power(...$args) { @@ -1150,7 +1150,7 @@ public function power(...$args) * * @param mixed $B Matrix/Array * - * @return Matrix Sum + * @return $this */ public function concat(...$args) { diff --git a/src/PhpSpreadsheet/Spreadsheet.php b/src/PhpSpreadsheet/Spreadsheet.php index 04a9f1df83..d33a98719f 100644 --- a/src/PhpSpreadsheet/Spreadsheet.php +++ b/src/PhpSpreadsheet/Spreadsheet.php @@ -955,7 +955,7 @@ public function getNamedRange($namedRange, Worksheet $pSheet = null) * @param string $namedRange * @param null|Worksheet $pSheet scope: use null for global scope * - * @return Spreadsheet + * @return $this */ public function removeNamedRange($namedRange, Worksheet $pSheet = null) { diff --git a/src/PhpSpreadsheet/Style/Alignment.php b/src/PhpSpreadsheet/Style/Alignment.php index b4df792b16..5eb7c2b0f4 100644 --- a/src/PhpSpreadsheet/Style/Alignment.php +++ b/src/PhpSpreadsheet/Style/Alignment.php @@ -140,7 +140,7 @@ public function getStyleArray($array) * * @throws PhpSpreadsheetException * - * @return Alignment + * @return $this */ public function applyFromArray(array $pStyles) { @@ -193,7 +193,7 @@ public function getHorizontal() * * @param string $pValue see self::HORIZONTAL_* * - * @return Alignment + * @return $this */ public function setHorizontal($pValue) { @@ -230,7 +230,7 @@ public function getVertical() * * @param string $pValue see self::VERTICAL_* * - * @return Alignment + * @return $this */ public function setVertical($pValue) { @@ -269,7 +269,7 @@ public function getTextRotation() * * @throws PhpSpreadsheetException * - * @return Alignment + * @return $this */ public function setTextRotation($pValue) { @@ -312,7 +312,7 @@ public function getWrapText() * * @param bool $pValue * - * @return Alignment + * @return $this */ public function setWrapText($pValue) { @@ -348,7 +348,7 @@ public function getShrinkToFit() * * @param bool $pValue * - * @return Alignment + * @return $this */ public function setShrinkToFit($pValue) { @@ -384,7 +384,7 @@ public function getIndent() * * @param int $pValue * - * @return Alignment + * @return $this */ public function setIndent($pValue) { @@ -424,7 +424,7 @@ public function getReadOrder() * * @param int $pValue * - * @return Alignment + * @return $this */ public function setReadOrder($pValue) { diff --git a/src/PhpSpreadsheet/Style/Border.php b/src/PhpSpreadsheet/Style/Border.php index c957cf595a..5fa0cae70d 100644 --- a/src/PhpSpreadsheet/Style/Border.php +++ b/src/PhpSpreadsheet/Style/Border.php @@ -127,7 +127,7 @@ public function getStyleArray($array) * * @throws PhpSpreadsheetException * - * @return Border + * @return $this */ public function applyFromArray(array $pStyles) { @@ -166,7 +166,7 @@ public function getBorderStyle() * When passing a boolean, FALSE equates Border::BORDER_NONE * and TRUE to Border::BORDER_MEDIUM * - * @return Border + * @return $this */ public function setBorderStyle($pValue) { @@ -202,7 +202,7 @@ public function getColor() * * @throws PhpSpreadsheetException * - * @return Border + * @return $this */ public function setColor(Color $pValue) { diff --git a/src/PhpSpreadsheet/Style/Borders.php b/src/PhpSpreadsheet/Style/Borders.php index a1d6759b93..8f005a9980 100644 --- a/src/PhpSpreadsheet/Style/Borders.php +++ b/src/PhpSpreadsheet/Style/Borders.php @@ -197,7 +197,7 @@ public function getStyleArray($array) * * @throws PhpSpreadsheetException * - * @return Borders + * @return $this */ public function applyFromArray(array $pStyles) { @@ -382,7 +382,7 @@ public function getDiagonalDirection() * * @param int $pValue see self::DIAGONAL_* * - * @return Borders + * @return $this */ public function setDiagonalDirection($pValue) { diff --git a/src/PhpSpreadsheet/Style/Color.php b/src/PhpSpreadsheet/Style/Color.php index 60e4a8ce75..ab22cbe324 100644 --- a/src/PhpSpreadsheet/Style/Color.php +++ b/src/PhpSpreadsheet/Style/Color.php @@ -106,7 +106,7 @@ public function getStyleArray($array) * * @throws PhpSpreadsheetException * - * @return Color + * @return $this */ public function applyFromArray(array $pStyles) { @@ -143,7 +143,7 @@ public function getARGB() * * @param string $pValue see self::COLOR_* * - * @return Color + * @return $this */ public function setARGB($pValue) { @@ -179,7 +179,7 @@ public function getRGB() * * @param string $pValue RGB value * - * @return Color + * @return $this */ public function setRGB($pValue) { @@ -312,7 +312,7 @@ public static function changeBrightness($hex, $adjustPercentage) * @param bool $background Flag to indicate whether default background or foreground colour * should be returned if the indexed colour doesn't exist * - * @return Color + * @return self */ public static function indexedColor($pIndex, $background = false) { diff --git a/src/PhpSpreadsheet/Style/Conditional.php b/src/PhpSpreadsheet/Style/Conditional.php index 48375937d3..ec8c858b03 100644 --- a/src/PhpSpreadsheet/Style/Conditional.php +++ b/src/PhpSpreadsheet/Style/Conditional.php @@ -94,7 +94,7 @@ public function getConditionType() * * @param string $pValue Condition type, see self::CONDITION_* * - * @return Conditional + * @return $this */ public function setConditionType($pValue) { @@ -118,7 +118,7 @@ public function getOperatorType() * * @param string $pValue Conditional operator type, see self::OPERATOR_* * - * @return Conditional + * @return $this */ public function setOperatorType($pValue) { @@ -142,7 +142,7 @@ public function getText() * * @param string $value * - * @return Conditional + * @return $this */ public function setText($value) { @@ -166,7 +166,7 @@ public function getStopIfTrue() * * @param bool $value * - * @return Conditional + * @return $this */ public function setStopIfTrue($value) { @@ -190,7 +190,7 @@ public function getConditions() * * @param string[] $pValue Condition * - * @return Conditional + * @return $this */ public function setConditions($pValue) { @@ -207,7 +207,7 @@ public function setConditions($pValue) * * @param string $pValue Condition * - * @return Conditional + * @return $this */ public function addCondition($pValue) { @@ -231,7 +231,7 @@ public function getStyle() * * @param Style $pValue * - * @return Conditional + * @return $this */ public function setStyle(Style $pValue = null) { diff --git a/src/PhpSpreadsheet/Style/Fill.php b/src/PhpSpreadsheet/Style/Fill.php index ce616c9d5d..1d6bace147 100644 --- a/src/PhpSpreadsheet/Style/Fill.php +++ b/src/PhpSpreadsheet/Style/Fill.php @@ -141,7 +141,7 @@ public function getStyleArray($array) * * @throws PhpSpreadsheetException * - * @return Fill + * @return $this */ public function applyFromArray(array $pStyles) { @@ -188,7 +188,7 @@ public function getFillType() * * @param string $pValue Fill type, see self::FILL_* * - * @return Fill + * @return $this */ public function setFillType($pValue) { @@ -221,7 +221,7 @@ public function getRotation() * * @param float $pValue * - * @return Fill + * @return $this */ public function setRotation($pValue) { @@ -252,7 +252,7 @@ public function getStartColor() * * @throws PhpSpreadsheetException * - * @return Fill + * @return $this */ public function setStartColor(Color $pValue) { @@ -286,7 +286,7 @@ public function getEndColor() * * @throws PhpSpreadsheetException * - * @return Fill + * @return $this */ public function setEndColor(Color $pValue) { diff --git a/src/PhpSpreadsheet/Style/Font.php b/src/PhpSpreadsheet/Style/Font.php index 6d8e23b195..0341cad0dc 100644 --- a/src/PhpSpreadsheet/Style/Font.php +++ b/src/PhpSpreadsheet/Style/Font.php @@ -161,7 +161,7 @@ public function getStyleArray($array) * * @throws PhpSpreadsheetException * - * @return Font + * @return $this */ public function applyFromArray(array $pStyles) { @@ -219,7 +219,7 @@ public function getName() * * @param string $pValue * - * @return Font + * @return $this */ public function setName($pValue) { @@ -255,7 +255,7 @@ public function getSize() * * @param float $pValue * - * @return Font + * @return $this */ public function setSize($pValue) { @@ -291,7 +291,7 @@ public function getBold() * * @param bool $pValue * - * @return Font + * @return $this */ public function setBold($pValue) { @@ -327,7 +327,7 @@ public function getItalic() * * @param bool $pValue * - * @return Font + * @return $this */ public function setItalic($pValue) { @@ -363,7 +363,7 @@ public function getSuperscript() * * @param bool $pValue * - * @return Font + * @return $this */ public function setSuperscript($pValue) { @@ -400,7 +400,7 @@ public function getSubscript() * * @param bool $pValue * - * @return Font + * @return $this */ public function setSubscript($pValue) { @@ -439,7 +439,7 @@ public function getUnderline() * If a boolean is passed, then TRUE equates to UNDERLINE_SINGLE, * false equates to UNDERLINE_NONE * - * @return Font + * @return $this */ public function setUnderline($pValue) { @@ -477,7 +477,7 @@ public function getStrikethrough() * * @param bool $pValue * - * @return Font + * @return $this */ public function setStrikethrough($pValue) { @@ -512,7 +512,7 @@ public function getColor() * * @throws PhpSpreadsheetException * - * @return Font + * @return $this */ public function setColor(Color $pValue) { diff --git a/src/PhpSpreadsheet/Style/NumberFormat.php b/src/PhpSpreadsheet/Style/NumberFormat.php index 5ea30b8864..df4ca76f4f 100644 --- a/src/PhpSpreadsheet/Style/NumberFormat.php +++ b/src/PhpSpreadsheet/Style/NumberFormat.php @@ -139,7 +139,7 @@ public function getStyleArray($array) * * @throws PhpSpreadsheetException * - * @return NumberFormat + * @return $this */ public function applyFromArray(array $pStyles) { @@ -176,7 +176,7 @@ public function getFormatCode() * * @param string $pValue see self::FORMAT_* * - * @return NumberFormat + * @return $this */ public function setFormatCode($pValue) { @@ -213,7 +213,7 @@ public function getBuiltInFormatCode() * * @param int $pValue * - * @return NumberFormat + * @return $this */ public function setBuiltInFormatCode($pValue) { diff --git a/src/PhpSpreadsheet/Style/Protection.php b/src/PhpSpreadsheet/Style/Protection.php index b5feb53486..8112bc6204 100644 --- a/src/PhpSpreadsheet/Style/Protection.php +++ b/src/PhpSpreadsheet/Style/Protection.php @@ -86,7 +86,7 @@ public function getStyleArray($array) * * @throws PhpSpreadsheetException * - * @return Protection + * @return $this */ public function applyFromArray(array $pStyles) { @@ -123,7 +123,7 @@ public function getLocked() * * @param string $pValue see self::PROTECTION_* * - * @return Protection + * @return $this */ public function setLocked($pValue) { @@ -156,7 +156,7 @@ public function getHidden() * * @param string $pValue see self::PROTECTION_* * - * @return Protection + * @return $this */ public function setHidden($pValue) { diff --git a/src/PhpSpreadsheet/Style/Style.php b/src/PhpSpreadsheet/Style/Style.php index 9cdfc1b1bc..a37d99b5f5 100644 --- a/src/PhpSpreadsheet/Style/Style.php +++ b/src/PhpSpreadsheet/Style/Style.php @@ -189,7 +189,7 @@ public function getStyleArray($array) * @param array $pStyles Array containing style information * @param bool $pAdvanced advanced mode for setting borders * - * @return Style + * @return $this */ public function applyFromArray(array $pStyles, $pAdvanced = true) { @@ -485,7 +485,7 @@ public function getFont() * * @param Font $font * - * @return Style + * @return $this */ public function setFont(Font $font) { @@ -539,7 +539,7 @@ public function getConditionalStyles() * * @param Conditional[] $pValue Array of conditional styles * - * @return Style + * @return $this */ public function setConditionalStyles(array $pValue) { @@ -577,7 +577,7 @@ public function getQuotePrefix() * * @param bool $pValue * - * @return Style + * @return $this */ public function setQuotePrefix($pValue) { diff --git a/src/PhpSpreadsheet/Style/Supervisor.php b/src/PhpSpreadsheet/Style/Supervisor.php index 2d1a27266b..1a700974b7 100644 --- a/src/PhpSpreadsheet/Style/Supervisor.php +++ b/src/PhpSpreadsheet/Style/Supervisor.php @@ -48,7 +48,7 @@ public function __construct($isSupervisor = false) * @param Spreadsheet|Style $parent * @param null|string $parentPropertyName * - * @return Supervisor + * @return $this */ public function bindParent($parent, $parentPropertyName = null) { diff --git a/src/PhpSpreadsheet/Worksheet/AutoFilter.php b/src/PhpSpreadsheet/Worksheet/AutoFilter.php index b44492546c..dcbc4da5b4 100644 --- a/src/PhpSpreadsheet/Worksheet/AutoFilter.php +++ b/src/PhpSpreadsheet/Worksheet/AutoFilter.php @@ -59,7 +59,7 @@ public function getParent() * * @param Worksheet $pSheet * - * @return AutoFilter + * @return $this */ public function setParent(Worksheet $pSheet = null) { @@ -85,7 +85,7 @@ public function getRange() * * @throws PhpSpreadsheetException * - * @return AutoFilter + * @return $this */ public function setRange($pRange) { @@ -210,7 +210,7 @@ public function getColumnByOffset($pColumnOffset) * * @throws PhpSpreadsheetException * - * @return AutoFilter + * @return $this */ public function setColumn($pColumn) { @@ -241,7 +241,7 @@ public function setColumn($pColumn) * * @throws PhpSpreadsheetException * - * @return AutoFilter + * @return $this */ public function clearColumn($pColumn) { @@ -264,7 +264,7 @@ public function clearColumn($pColumn) * @param string $fromColumn Column name (e.g. A) * @param string $toColumn Column name (e.g. B) * - * @return AutoFilter + * @return $this */ public function shiftColumn($fromColumn, $toColumn) { @@ -617,7 +617,7 @@ private function calculateTopTenValue($columnID, $startRow, $endRow, $ruleType, * * @throws PhpSpreadsheetException * - * @return AutoFilter + * @return $this */ public function showHideRows() { diff --git a/src/PhpSpreadsheet/Worksheet/AutoFilter/Column.php b/src/PhpSpreadsheet/Worksheet/AutoFilter/Column.php index 25ccffda8e..3ed7270a14 100644 --- a/src/PhpSpreadsheet/Worksheet/AutoFilter/Column.php +++ b/src/PhpSpreadsheet/Worksheet/AutoFilter/Column.php @@ -117,7 +117,7 @@ public function getColumnIndex() * * @throws PhpSpreadsheetException * - * @return Column + * @return $this */ public function setColumnIndex($pColumn) { @@ -147,7 +147,7 @@ public function getParent() * * @param AutoFilter $pParent * - * @return Column + * @return $this */ public function setParent(AutoFilter $pParent = null) { @@ -173,7 +173,7 @@ public function getFilterType() * * @throws PhpSpreadsheetException * - * @return Column + * @return $this */ public function setFilterType($pFilterType) { @@ -203,7 +203,7 @@ public function getJoin() * * @throws PhpSpreadsheetException * - * @return Column + * @return $this */ public function setJoin($pJoin) { @@ -223,7 +223,7 @@ public function setJoin($pJoin) * * @param string[] $attributes * - * @return Column + * @return $this */ public function setAttributes(array $attributes) { @@ -238,7 +238,7 @@ public function setAttributes(array $attributes) * @param string $pName Attribute Name * @param string $pValue Attribute Value * - * @return Column + * @return $this */ public function setAttribute($pName, $pValue) { @@ -316,7 +316,7 @@ public function createRule() * * @param Column\Rule $pRule * - * @return Column + * @return $this */ public function addRule(Column\Rule $pRule) { @@ -332,7 +332,7 @@ public function addRule(Column\Rule $pRule) * * @param int $pIndex Rule index in the ruleset array * - * @return Column + * @return $this */ public function deleteRule($pIndex) { @@ -350,7 +350,7 @@ public function deleteRule($pIndex) /** * Delete all AutoFilter Column Rules. * - * @return Column + * @return $this */ public function clearRules() { diff --git a/src/PhpSpreadsheet/Worksheet/AutoFilter/Column/Rule.php b/src/PhpSpreadsheet/Worksheet/AutoFilter/Column/Rule.php index 450bccdb6a..09a2bacdd9 100644 --- a/src/PhpSpreadsheet/Worksheet/AutoFilter/Column/Rule.php +++ b/src/PhpSpreadsheet/Worksheet/AutoFilter/Column/Rule.php @@ -262,7 +262,7 @@ public function getRuleType() * * @throws PhpSpreadsheetException * - * @return Rule + * @return $this */ public function setRuleType($pRuleType) { @@ -292,7 +292,7 @@ public function getValue() * * @throws PhpSpreadsheetException * - * @return Rule + * @return $this */ public function setValue($pValue) { @@ -336,7 +336,7 @@ public function getOperator() * * @throws PhpSpreadsheetException * - * @return Rule + * @return $this */ public function setOperator($pOperator) { @@ -369,7 +369,7 @@ public function getGrouping() * * @throws PhpSpreadsheetException * - * @return Rule + * @return $this */ public function setGrouping($pGrouping) { @@ -393,7 +393,7 @@ public function setGrouping($pGrouping) * * @throws PhpSpreadsheetException * - * @return Rule + * @return $this */ public function setRule($pOperator, $pValue, $pGrouping = null) { @@ -424,7 +424,7 @@ public function getParent() * * @param Column $pParent * - * @return Rule + * @return $this */ public function setParent(Column $pParent = null) { diff --git a/src/PhpSpreadsheet/Worksheet/BaseDrawing.php b/src/PhpSpreadsheet/Worksheet/BaseDrawing.php index 98b689729e..7d24e4496b 100644 --- a/src/PhpSpreadsheet/Worksheet/BaseDrawing.php +++ b/src/PhpSpreadsheet/Worksheet/BaseDrawing.php @@ -154,7 +154,7 @@ public function getName() * * @param string $pValue * - * @return BaseDrawing + * @return $this */ public function setName($pValue) { @@ -178,7 +178,7 @@ public function getDescription() * * @param string $description * - * @return BaseDrawing + * @return $this */ public function setDescription($description) { @@ -205,7 +205,7 @@ public function getWorksheet() * * @throws PhpSpreadsheetException * - * @return BaseDrawing + * @return $this */ public function setWorksheet(Worksheet $pValue = null, $pOverrideOld = false) { @@ -253,7 +253,7 @@ public function getCoordinates() * * @param string $pValue eg: 'A1' * - * @return BaseDrawing + * @return $this */ public function setCoordinates($pValue) { @@ -277,7 +277,7 @@ public function getOffsetX() * * @param int $pValue * - * @return BaseDrawing + * @return $this */ public function setOffsetX($pValue) { @@ -301,7 +301,7 @@ public function getOffsetY() * * @param int $pValue * - * @return BaseDrawing + * @return $this */ public function setOffsetY($pValue) { @@ -325,7 +325,7 @@ public function getWidth() * * @param int $pValue * - * @return BaseDrawing + * @return $this */ public function setWidth($pValue) { @@ -356,7 +356,7 @@ public function getHeight() * * @param int $pValue * - * @return BaseDrawing + * @return $this */ public function setHeight($pValue) { @@ -386,7 +386,7 @@ public function setHeight($pValue) * @param int $width * @param int $height * - * @return BaseDrawing + * @return $this */ public function setWidthAndHeight($width, $height) { @@ -423,7 +423,7 @@ public function getResizeProportional() * * @param bool $pValue * - * @return BaseDrawing + * @return $this */ public function setResizeProportional($pValue) { @@ -447,7 +447,7 @@ public function getRotation() * * @param int $pValue * - * @return BaseDrawing + * @return $this */ public function setRotation($pValue) { @@ -471,7 +471,7 @@ public function getShadow() * * @param Drawing\Shadow $pValue * - * @return BaseDrawing + * @return $this */ public function setShadow(Drawing\Shadow $pValue = null) { diff --git a/src/PhpSpreadsheet/Worksheet/ColumnCellIterator.php b/src/PhpSpreadsheet/Worksheet/ColumnCellIterator.php index 7e8f040d26..d75da89881 100644 --- a/src/PhpSpreadsheet/Worksheet/ColumnCellIterator.php +++ b/src/PhpSpreadsheet/Worksheet/ColumnCellIterator.php @@ -59,7 +59,7 @@ public function __construct(Worksheet $subject = null, $columnIndex = 'A', $star * * @throws PhpSpreadsheetException * - * @return ColumnCellIterator + * @return $this */ public function resetStart($startRow = 1) { @@ -77,7 +77,7 @@ public function resetStart($startRow = 1) * * @throws PhpSpreadsheetException * - * @return ColumnCellIterator + * @return $this */ public function resetEnd($endRow = null) { @@ -94,7 +94,7 @@ public function resetEnd($endRow = null) * * @throws PhpSpreadsheetException * - * @return ColumnCellIterator + * @return $this */ public function seek($row = 1) { diff --git a/src/PhpSpreadsheet/Worksheet/ColumnDimension.php b/src/PhpSpreadsheet/Worksheet/ColumnDimension.php index e9586a6081..4e87a344c8 100644 --- a/src/PhpSpreadsheet/Worksheet/ColumnDimension.php +++ b/src/PhpSpreadsheet/Worksheet/ColumnDimension.php @@ -56,7 +56,7 @@ public function getColumnIndex() * * @param string $pValue * - * @return ColumnDimension + * @return $this */ public function setColumnIndex($pValue) { @@ -80,7 +80,7 @@ public function getWidth() * * @param float $pValue * - * @return ColumnDimension + * @return $this */ public function setWidth($pValue) { @@ -104,7 +104,7 @@ public function getAutoSize() * * @param bool $pValue * - * @return ColumnDimension + * @return $this */ public function setAutoSize($pValue) { diff --git a/src/PhpSpreadsheet/Worksheet/ColumnIterator.php b/src/PhpSpreadsheet/Worksheet/ColumnIterator.php index d2b57aad2f..c8913cc164 100644 --- a/src/PhpSpreadsheet/Worksheet/ColumnIterator.php +++ b/src/PhpSpreadsheet/Worksheet/ColumnIterator.php @@ -66,7 +66,7 @@ public function __destruct() * * @throws Exception * - * @return ColumnIterator + * @return $this */ public function resetStart($startColumn = 'A') { @@ -89,7 +89,7 @@ public function resetStart($startColumn = 'A') * * @param string $endColumn The column address at which to stop iterating * - * @return ColumnIterator + * @return $this */ public function resetEnd($endColumn = null) { @@ -106,7 +106,7 @@ public function resetEnd($endColumn = null) * * @throws PhpSpreadsheetException * - * @return ColumnIterator + * @return $this */ public function seek($column = 'A') { diff --git a/src/PhpSpreadsheet/Worksheet/Dimension.php b/src/PhpSpreadsheet/Worksheet/Dimension.php index 697fc97efc..ce40cf57f7 100644 --- a/src/PhpSpreadsheet/Worksheet/Dimension.php +++ b/src/PhpSpreadsheet/Worksheet/Dimension.php @@ -60,7 +60,7 @@ public function getVisible() * * @param bool $pValue * - * @return Dimension + * @return $this */ public function setVisible($pValue) { @@ -87,7 +87,7 @@ public function getOutlineLevel() * * @throws PhpSpreadsheetException * - * @return Dimension + * @return $this */ public function setOutlineLevel($pValue) { @@ -115,7 +115,7 @@ public function getCollapsed() * * @param bool $pValue * - * @return Dimension + * @return $this */ public function setCollapsed($pValue) { @@ -139,7 +139,7 @@ public function getXfIndex() * * @param int $pValue * - * @return Dimension + * @return $this */ public function setXfIndex($pValue) { diff --git a/src/PhpSpreadsheet/Worksheet/Drawing.php b/src/PhpSpreadsheet/Worksheet/Drawing.php index 8194da31e7..da492b4c30 100644 --- a/src/PhpSpreadsheet/Worksheet/Drawing.php +++ b/src/PhpSpreadsheet/Worksheet/Drawing.php @@ -78,7 +78,7 @@ public function getPath() * * @throws PhpSpreadsheetException * - * @return Drawing + * @return $this */ public function setPath($pValue, $pVerifyFile = true) { diff --git a/src/PhpSpreadsheet/Worksheet/Drawing/Shadow.php b/src/PhpSpreadsheet/Worksheet/Drawing/Shadow.php index a1e05d6000..c7594dae92 100644 --- a/src/PhpSpreadsheet/Worksheet/Drawing/Shadow.php +++ b/src/PhpSpreadsheet/Worksheet/Drawing/Shadow.php @@ -100,7 +100,7 @@ public function getVisible() * * @param bool $pValue * - * @return Shadow + * @return $this */ public function setVisible($pValue) { @@ -124,7 +124,7 @@ public function getBlurRadius() * * @param int $pValue * - * @return Shadow + * @return $this */ public function setBlurRadius($pValue) { @@ -148,7 +148,7 @@ public function getDistance() * * @param int $pValue * - * @return Shadow + * @return $this */ public function setDistance($pValue) { @@ -172,7 +172,7 @@ public function getDirection() * * @param int $pValue * - * @return Shadow + * @return $this */ public function setDirection($pValue) { @@ -196,7 +196,7 @@ public function getAlignment() * * @param int $pValue * - * @return Shadow + * @return $this */ public function setAlignment($pValue) { @@ -220,7 +220,7 @@ public function getColor() * * @param Color $pValue * - * @return Shadow + * @return $this */ public function setColor(Color $pValue = null) { @@ -244,7 +244,7 @@ public function getAlpha() * * @param int $pValue * - * @return Shadow + * @return $this */ public function setAlpha($pValue) { diff --git a/src/PhpSpreadsheet/Worksheet/HeaderFooter.php b/src/PhpSpreadsheet/Worksheet/HeaderFooter.php index a78f4fccae..be19abbd27 100644 --- a/src/PhpSpreadsheet/Worksheet/HeaderFooter.php +++ b/src/PhpSpreadsheet/Worksheet/HeaderFooter.php @@ -172,7 +172,7 @@ public function getOddHeader() * * @param string $pValue * - * @return HeaderFooter + * @return $this */ public function setOddHeader($pValue) { @@ -196,7 +196,7 @@ public function getOddFooter() * * @param string $pValue * - * @return HeaderFooter + * @return $this */ public function setOddFooter($pValue) { @@ -220,7 +220,7 @@ public function getEvenHeader() * * @param string $pValue * - * @return HeaderFooter + * @return $this */ public function setEvenHeader($pValue) { @@ -244,7 +244,7 @@ public function getEvenFooter() * * @param string $pValue * - * @return HeaderFooter + * @return $this */ public function setEvenFooter($pValue) { @@ -268,7 +268,7 @@ public function getFirstHeader() * * @param string $pValue * - * @return HeaderFooter + * @return $this */ public function setFirstHeader($pValue) { @@ -292,7 +292,7 @@ public function getFirstFooter() * * @param string $pValue * - * @return HeaderFooter + * @return $this */ public function setFirstFooter($pValue) { @@ -316,7 +316,7 @@ public function getDifferentOddEven() * * @param bool $pValue * - * @return HeaderFooter + * @return $this */ public function setDifferentOddEven($pValue) { @@ -340,7 +340,7 @@ public function getDifferentFirst() * * @param bool $pValue * - * @return HeaderFooter + * @return $this */ public function setDifferentFirst($pValue) { @@ -364,7 +364,7 @@ public function getScaleWithDocument() * * @param bool $pValue * - * @return HeaderFooter + * @return $this */ public function setScaleWithDocument($pValue) { @@ -388,7 +388,7 @@ public function getAlignWithMargins() * * @param bool $pValue * - * @return HeaderFooter + * @return $this */ public function setAlignWithMargins($pValue) { @@ -403,7 +403,7 @@ public function setAlignWithMargins($pValue) * @param HeaderFooterDrawing $image * @param string $location * - * @return HeaderFooter + * @return $this */ public function addImage(HeaderFooterDrawing $image, $location = self::IMAGE_HEADER_LEFT) { @@ -417,7 +417,7 @@ public function addImage(HeaderFooterDrawing $image, $location = self::IMAGE_HEA * * @param string $location * - * @return HeaderFooter + * @return $this */ public function removeImage($location = self::IMAGE_HEADER_LEFT) { @@ -433,7 +433,7 @@ public function removeImage($location = self::IMAGE_HEADER_LEFT) * * @param HeaderFooterDrawing[] $images * - * @return HeaderFooter + * @return $this */ public function setImages(array $images) { diff --git a/src/PhpSpreadsheet/Worksheet/MemoryDrawing.php b/src/PhpSpreadsheet/Worksheet/MemoryDrawing.php index 6012e93e6e..f0935585da 100644 --- a/src/PhpSpreadsheet/Worksheet/MemoryDrawing.php +++ b/src/PhpSpreadsheet/Worksheet/MemoryDrawing.php @@ -74,7 +74,7 @@ public function getImageResource() * * @param resource $value * - * @return MemoryDrawing + * @return $this */ public function setImageResource($value) { @@ -104,7 +104,7 @@ public function getRenderingFunction() * * @param string $value see self::RENDERING_* * - * @return MemoryDrawing + * @return $this */ public function setRenderingFunction($value) { @@ -128,7 +128,7 @@ public function getMimeType() * * @param string $value see self::MIMETYPE_* * - * @return MemoryDrawing + * @return $this */ public function setMimeType($value) { diff --git a/src/PhpSpreadsheet/Worksheet/PageMargins.php b/src/PhpSpreadsheet/Worksheet/PageMargins.php index eb44a1094c..9ebfb6488b 100644 --- a/src/PhpSpreadsheet/Worksheet/PageMargins.php +++ b/src/PhpSpreadsheet/Worksheet/PageMargins.php @@ -68,7 +68,7 @@ public function getLeft() * * @param float $pValue * - * @return PageMargins + * @return $this */ public function setLeft($pValue) { @@ -92,7 +92,7 @@ public function getRight() * * @param float $pValue * - * @return PageMargins + * @return $this */ public function setRight($pValue) { @@ -116,7 +116,7 @@ public function getTop() * * @param float $pValue * - * @return PageMargins + * @return $this */ public function setTop($pValue) { @@ -140,7 +140,7 @@ public function getBottom() * * @param float $pValue * - * @return PageMargins + * @return $this */ public function setBottom($pValue) { @@ -164,7 +164,7 @@ public function getHeader() * * @param float $pValue * - * @return PageMargins + * @return $this */ public function setHeader($pValue) { @@ -188,7 +188,7 @@ public function getFooter() * * @param float $pValue * - * @return PageMargins + * @return $this */ public function setFooter($pValue) { diff --git a/src/PhpSpreadsheet/Worksheet/PageSetup.php b/src/PhpSpreadsheet/Worksheet/PageSetup.php index ab007f61d5..fa1810f3bd 100644 --- a/src/PhpSpreadsheet/Worksheet/PageSetup.php +++ b/src/PhpSpreadsheet/Worksheet/PageSetup.php @@ -272,7 +272,7 @@ public function getPaperSize() * * @param int $pValue see self::PAPERSIZE_* * - * @return PageSetup + * @return $this */ public function setPaperSize($pValue) { @@ -296,7 +296,7 @@ public function getOrientation() * * @param string $pValue see self::ORIENTATION_* * - * @return PageSetup + * @return $this */ public function setOrientation($pValue) { @@ -325,7 +325,7 @@ public function getScale() * * @throws PhpSpreadsheetException * - * @return PageSetup + * @return $this */ public function setScale($pValue, $pUpdate = true) { @@ -358,7 +358,7 @@ public function getFitToPage() * * @param bool $pValue * - * @return PageSetup + * @return $this */ public function setFitToPage($pValue) { @@ -383,7 +383,7 @@ public function getFitToHeight() * @param null|int $pValue * @param bool $pUpdate Update fitToPage so it applies rather than scaling * - * @return PageSetup + * @return $this */ public function setFitToHeight($pValue, $pUpdate = true) { @@ -411,7 +411,7 @@ public function getFitToWidth() * @param null|int $pValue * @param bool $pUpdate Update fitToPage so it applies rather than scaling * - * @return PageSetup + * @return $this */ public function setFitToWidth($pValue, $pUpdate = true) { @@ -454,7 +454,7 @@ public function getColumnsToRepeatAtLeft() * * @param array $pValue Containing start column and end column, empty array if option unset * - * @return PageSetup + * @return $this */ public function setColumnsToRepeatAtLeft(array $pValue) { @@ -469,7 +469,7 @@ public function setColumnsToRepeatAtLeft(array $pValue) * @param string $pStart eg: 'A' * @param string $pEnd eg: 'B' * - * @return PageSetup + * @return $this */ public function setColumnsToRepeatAtLeftByStartAndEnd($pStart, $pEnd) { @@ -509,7 +509,7 @@ public function getRowsToRepeatAtTop() * * @param array $pValue Containing start column and end column, empty array if option unset * - * @return PageSetup + * @return $this */ public function setRowsToRepeatAtTop(array $pValue) { @@ -524,7 +524,7 @@ public function setRowsToRepeatAtTop(array $pValue) * @param int $pStart eg: 1 * @param int $pEnd eg: 1 * - * @return PageSetup + * @return $this */ public function setRowsToRepeatAtTopByStartAndEnd($pStart, $pEnd) { @@ -548,7 +548,7 @@ public function getHorizontalCentered() * * @param bool $value * - * @return PageSetup + * @return $this */ public function setHorizontalCentered($value) { @@ -572,7 +572,7 @@ public function getVerticalCentered() * * @param bool $value * - * @return PageSetup + * @return $this */ public function setVerticalCentered($value) { @@ -634,7 +634,7 @@ public function isPrintAreaSet($index = 0) * Otherwise, the range identified by the value of $index will be removed from the series * Print areas are numbered from 1 * - * @return PageSetup + * @return $this */ public function clearPrintArea($index = 0) { @@ -671,7 +671,7 @@ public function clearPrintArea($index = 0) * * @throws PhpSpreadsheetException * - * @return PageSetup + * @return $this */ public function setPrintArea($value, $index = 0, $method = self::SETPRINTRANGE_OVERWRITE) { @@ -732,7 +732,7 @@ public function setPrintArea($value, $index = 0, $method = self::SETPRINTRANGE_O * * @throws PhpSpreadsheetException * - * @return PageSetup + * @return $this */ public function addPrintArea($value, $index = -1) { @@ -762,7 +762,7 @@ public function addPrintArea($value, $index = -1) * * @throws PhpSpreadsheetException * - * @return PageSetup + * @return $this */ public function setPrintAreaByColumnAndRow($column1, $row1, $column2, $row2, $index = 0, $method = self::SETPRINTRANGE_OVERWRITE) { @@ -789,7 +789,7 @@ public function setPrintAreaByColumnAndRow($column1, $row1, $column2, $row2, $in * * @throws PhpSpreadsheetException * - * @return PageSetup + * @return $this */ public function addPrintAreaByColumnAndRow($column1, $row1, $column2, $row2, $index = -1) { @@ -815,7 +815,7 @@ public function getFirstPageNumber() * * @param int $value * - * @return PageSetup + * @return $this */ public function setFirstPageNumber($value) { @@ -827,7 +827,7 @@ public function setFirstPageNumber($value) /** * Reset first page number. * - * @return PageSetup + * @return $this */ public function resetFirstPageNumber() { diff --git a/src/PhpSpreadsheet/Worksheet/Protection.php b/src/PhpSpreadsheet/Worksheet/Protection.php index 1815f45bf0..2fd3e9195e 100644 --- a/src/PhpSpreadsheet/Worksheet/Protection.php +++ b/src/PhpSpreadsheet/Worksheet/Protection.php @@ -172,7 +172,7 @@ public function getSheet() * * @param bool $pValue * - * @return Protection + * @return $this */ public function setSheet($pValue) { @@ -196,7 +196,7 @@ public function getObjects() * * @param bool $pValue * - * @return Protection + * @return $this */ public function setObjects($pValue) { @@ -220,7 +220,7 @@ public function getScenarios() * * @param bool $pValue * - * @return Protection + * @return $this */ public function setScenarios($pValue) { @@ -244,7 +244,7 @@ public function getFormatCells() * * @param bool $pValue * - * @return Protection + * @return $this */ public function setFormatCells($pValue) { @@ -268,7 +268,7 @@ public function getFormatColumns() * * @param bool $pValue * - * @return Protection + * @return $this */ public function setFormatColumns($pValue) { @@ -292,7 +292,7 @@ public function getFormatRows() * * @param bool $pValue * - * @return Protection + * @return $this */ public function setFormatRows($pValue) { @@ -316,7 +316,7 @@ public function getInsertColumns() * * @param bool $pValue * - * @return Protection + * @return $this */ public function setInsertColumns($pValue) { @@ -340,7 +340,7 @@ public function getInsertRows() * * @param bool $pValue * - * @return Protection + * @return $this */ public function setInsertRows($pValue) { @@ -364,7 +364,7 @@ public function getInsertHyperlinks() * * @param bool $pValue * - * @return Protection + * @return $this */ public function setInsertHyperlinks($pValue) { @@ -388,7 +388,7 @@ public function getDeleteColumns() * * @param bool $pValue * - * @return Protection + * @return $this */ public function setDeleteColumns($pValue) { @@ -412,7 +412,7 @@ public function getDeleteRows() * * @param bool $pValue * - * @return Protection + * @return $this */ public function setDeleteRows($pValue) { @@ -436,7 +436,7 @@ public function getSelectLockedCells() * * @param bool $pValue * - * @return Protection + * @return $this */ public function setSelectLockedCells($pValue) { @@ -460,7 +460,7 @@ public function getSort() * * @param bool $pValue * - * @return Protection + * @return $this */ public function setSort($pValue) { @@ -484,7 +484,7 @@ public function getAutoFilter() * * @param bool $pValue * - * @return Protection + * @return $this */ public function setAutoFilter($pValue) { @@ -508,7 +508,7 @@ public function getPivotTables() * * @param bool $pValue * - * @return Protection + * @return $this */ public function setPivotTables($pValue) { @@ -532,7 +532,7 @@ public function getSelectUnlockedCells() * * @param bool $pValue * - * @return Protection + * @return $this */ public function setSelectUnlockedCells($pValue) { @@ -557,7 +557,7 @@ public function getPassword() * @param string $pValue * @param bool $pAlreadyHashed If the password has already been hashed, set this to true * - * @return Protection + * @return $this */ public function setPassword($pValue, $pAlreadyHashed = false) { diff --git a/src/PhpSpreadsheet/Worksheet/RowCellIterator.php b/src/PhpSpreadsheet/Worksheet/RowCellIterator.php index 8510d402a3..9746d6403d 100644 --- a/src/PhpSpreadsheet/Worksheet/RowCellIterator.php +++ b/src/PhpSpreadsheet/Worksheet/RowCellIterator.php @@ -59,7 +59,7 @@ public function __construct(Worksheet $worksheet = null, $rowIndex = 1, $startCo * * @throws PhpSpreadsheetException * - * @return RowCellIterator + * @return $this */ public function resetStart($startColumn = 'A') { @@ -77,7 +77,7 @@ public function resetStart($startColumn = 'A') * * @throws PhpSpreadsheetException * - * @return RowCellIterator + * @return $this */ public function resetEnd($endColumn = null) { @@ -95,7 +95,7 @@ public function resetEnd($endColumn = null) * * @throws PhpSpreadsheetException * - * @return RowCellIterator + * @return $this */ public function seek($column = 'A') { diff --git a/src/PhpSpreadsheet/Worksheet/RowDimension.php b/src/PhpSpreadsheet/Worksheet/RowDimension.php index e4346404d2..c4a87bdb55 100644 --- a/src/PhpSpreadsheet/Worksheet/RowDimension.php +++ b/src/PhpSpreadsheet/Worksheet/RowDimension.php @@ -56,7 +56,7 @@ public function getRowIndex() * * @param int $pValue * - * @return RowDimension + * @return $this */ public function setRowIndex($pValue) { @@ -80,7 +80,7 @@ public function getRowHeight() * * @param float $pValue * - * @return RowDimension + * @return $this */ public function setRowHeight($pValue) { @@ -104,7 +104,7 @@ public function getZeroHeight() * * @param bool $pValue * - * @return RowDimension + * @return $this */ public function setZeroHeight($pValue) { diff --git a/src/PhpSpreadsheet/Worksheet/RowIterator.php b/src/PhpSpreadsheet/Worksheet/RowIterator.php index 433cea6a12..3b9d0e2653 100644 --- a/src/PhpSpreadsheet/Worksheet/RowIterator.php +++ b/src/PhpSpreadsheet/Worksheet/RowIterator.php @@ -64,7 +64,7 @@ public function __destruct() * * @throws PhpSpreadsheetException * - * @return RowIterator + * @return $this */ public function resetStart($startRow = 1) { @@ -86,7 +86,7 @@ public function resetStart($startRow = 1) * * @param int $endRow The row number at which to stop iterating * - * @return RowIterator + * @return $this */ public function resetEnd($endRow = null) { @@ -102,7 +102,7 @@ public function resetEnd($endRow = null) * * @throws PhpSpreadsheetException * - * @return RowIterator + * @return $this */ public function seek($row = 1) { diff --git a/src/PhpSpreadsheet/Worksheet/SheetView.php b/src/PhpSpreadsheet/Worksheet/SheetView.php index 0a95f2139d..fa85bd27d6 100644 --- a/src/PhpSpreadsheet/Worksheet/SheetView.php +++ b/src/PhpSpreadsheet/Worksheet/SheetView.php @@ -79,7 +79,7 @@ public function getZoomScale() * * @throws PhpSpreadsheetException * - * @return SheetView + * @return $this */ public function setZoomScale($pValue) { @@ -112,7 +112,7 @@ public function getZoomScaleNormal() * * @throws PhpSpreadsheetException * - * @return SheetView + * @return $this */ public function setZoomScaleNormal($pValue) { @@ -165,7 +165,7 @@ public function getView() * * @throws PhpSpreadsheetException * - * @return SheetView + * @return $this */ public function setView($pValue) { diff --git a/src/PhpSpreadsheet/Worksheet/Worksheet.php b/src/PhpSpreadsheet/Worksheet/Worksheet.php index f01632bce9..f3a5b4da78 100644 --- a/src/PhpSpreadsheet/Worksheet/Worksheet.php +++ b/src/PhpSpreadsheet/Worksheet/Worksheet.php @@ -647,7 +647,7 @@ public function getChartByName($chartName) /** * Refresh column dimensions. * - * @return Worksheet + * @return $this */ public function refreshColumnDimensions() { @@ -666,7 +666,7 @@ public function refreshColumnDimensions() /** * Refresh row dimensions. * - * @return Worksheet + * @return $this */ public function refreshRowDimensions() { @@ -707,7 +707,7 @@ public function calculateWorksheetDataDimension() /** * Calculate widths for auto-size columns. * - * @return Worksheet; + * @return $this */ public function calculateColumnWidths() { @@ -797,7 +797,7 @@ public function getParent() * * @param Spreadsheet $parent * - * @return Worksheet + * @return $this */ public function rebindParent(Spreadsheet $parent) { @@ -838,7 +838,7 @@ public function getTitle() * @param bool $validate False to skip validation of new title. WARNING: This should only be set * at parse time (by Readers), where titles can be assumed to be valid. * - * @return Worksheet + * @return $this */ public function setTitle($pValue, $updateFormulaCellReferences = true, $validate = true) { @@ -913,7 +913,7 @@ public function getSheetState() * * @param string $value Sheet state (visible, hidden, veryHidden) * - * @return Worksheet + * @return $this */ public function setSheetState($value) { @@ -937,7 +937,7 @@ public function getPageSetup() * * @param PageSetup $pValue * - * @return Worksheet + * @return $this */ public function setPageSetup(PageSetup $pValue) { @@ -961,7 +961,7 @@ public function getPageMargins() * * @param PageMargins $pValue * - * @return Worksheet + * @return $this */ public function setPageMargins(PageMargins $pValue) { @@ -985,7 +985,7 @@ public function getHeaderFooter() * * @param HeaderFooter $pValue * - * @return Worksheet + * @return $this */ public function setHeaderFooter(HeaderFooter $pValue) { @@ -1009,7 +1009,7 @@ public function getSheetView() * * @param SheetView $pValue * - * @return Worksheet + * @return $this */ public function setSheetView(SheetView $pValue) { @@ -1033,7 +1033,7 @@ public function getProtection() * * @param Protection $pValue * - * @return Worksheet + * @return $this */ public function setProtection(Protection $pValue) { @@ -1119,7 +1119,7 @@ public function getHighestRowAndColumn() * @param string $pCoordinate Coordinate of the cell, eg: 'A1' * @param mixed $pValue Value of the cell * - * @return Worksheet + * @return $this */ public function setCellValue($pCoordinate, $pValue) { @@ -1135,7 +1135,7 @@ public function setCellValue($pCoordinate, $pValue) * @param int $row Numeric row coordinate of the cell * @param mixed $value Value of the cell * - * @return Worksheet + * @return $this */ public function setCellValueByColumnAndRow($columnIndex, $row, $value) { @@ -1151,7 +1151,7 @@ public function setCellValueByColumnAndRow($columnIndex, $row, $value) * @param mixed $pValue Value of the cell * @param string $pDataType Explicit data type, see DataType::TYPE_* * - * @return Worksheet + * @return $this */ public function setCellValueExplicit($pCoordinate, $pValue, $pDataType) { @@ -1169,7 +1169,7 @@ public function setCellValueExplicit($pCoordinate, $pValue, $pDataType) * @param mixed $value Value of the cell * @param string $dataType Explicit data type, see DataType::TYPE_* * - * @return Worksheet + * @return $this */ public function setCellValueExplicitByColumnAndRow($columnIndex, $row, $value, $dataType) { @@ -1480,7 +1480,7 @@ public function conditionalStylesExists($pCoordinate) * * @param string $pCoordinate eg: 'A1' * - * @return Worksheet + * @return $this */ public function removeConditionalStyles($pCoordinate) { @@ -1505,7 +1505,7 @@ public function getConditionalStylesCollection() * @param string $pCoordinate eg: 'A1' * @param $pValue Conditional[] * - * @return Worksheet + * @return $this */ public function setConditionalStyles($pCoordinate, $pValue) { @@ -1545,7 +1545,7 @@ public function getStyleByColumnAndRow($columnIndex1, $row1, $columnIndex2 = nul * * @throws Exception * - * @return Worksheet + * @return $this */ public function duplicateStyle(Style $pCellStyle, $pRange) { @@ -1590,7 +1590,7 @@ public function duplicateStyle(Style $pCellStyle, $pRange) * * @throws Exception * - * @return Worksheet + * @return $this */ public function duplicateConditionalStyle(array $pCellStyle, $pRange = '') { @@ -1628,7 +1628,7 @@ public function duplicateConditionalStyle(array $pCellStyle, $pRange = '') * * @throws Exception * - * @return Worksheet + * @return $this */ public function setBreak($pCoordinate, $pBreak) { @@ -1657,7 +1657,7 @@ public function setBreak($pCoordinate, $pBreak) * @param int $row Numeric row coordinate of the cell * @param int $break Break type (type of Worksheet::BREAK_*) * - * @return Worksheet + * @return $this */ public function setBreakByColumnAndRow($columnIndex, $row, $break) { @@ -1681,7 +1681,7 @@ public function getBreaks() * * @throws Exception * - * @return Worksheet + * @return $this */ public function mergeCells($pRange) { @@ -1726,7 +1726,7 @@ public function mergeCells($pRange) * * @throws Exception * - * @return Worksheet + * @return $this */ public function mergeCellsByColumnAndRow($columnIndex1, $row1, $columnIndex2, $row2) { @@ -1742,7 +1742,7 @@ public function mergeCellsByColumnAndRow($columnIndex1, $row1, $columnIndex2, $r * * @throws Exception * - * @return Worksheet + * @return $this */ public function unmergeCells($pRange) { @@ -1772,7 +1772,7 @@ public function unmergeCells($pRange) * * @throws Exception * - * @return Worksheet + * @return $this */ public function unmergeCellsByColumnAndRow($columnIndex1, $row1, $columnIndex2, $row2) { @@ -1797,7 +1797,7 @@ public function getMergeCells() * * @param array $pValue * - * @return Worksheet + * @return $this */ public function setMergeCells(array $pValue) { @@ -1813,7 +1813,7 @@ public function setMergeCells(array $pValue) * @param string $pPassword Password to unlock the protection * @param bool $pAlreadyHashed If the password has already been hashed, set this to true * - * @return Worksheet + * @return $this */ public function protectCells($pRange, $pPassword, $pAlreadyHashed = false) { @@ -1838,7 +1838,7 @@ public function protectCells($pRange, $pPassword, $pAlreadyHashed = false) * @param string $password Password to unlock the protection * @param bool $alreadyHashed If the password has already been hashed, set this to true * - * @return Worksheet + * @return $this */ public function protectCellsByColumnAndRow($columnIndex1, $row1, $columnIndex2, $row2, $password, $alreadyHashed = false) { @@ -1854,7 +1854,7 @@ public function protectCellsByColumnAndRow($columnIndex1, $row1, $columnIndex2, * * @throws Exception * - * @return Worksheet + * @return $this */ public function unprotectCells($pRange) { @@ -1880,7 +1880,7 @@ public function unprotectCells($pRange) * * @throws Exception * - * @return Worksheet + * @return $this */ public function unprotectCellsByColumnAndRow($columnIndex1, $row1, $columnIndex2, $row2) { @@ -1917,7 +1917,7 @@ public function getAutoFilter() * * @throws Exception * - * @return Worksheet + * @return $this */ public function setAutoFilter($pValue) { @@ -1940,7 +1940,7 @@ public function setAutoFilter($pValue) * * @throws Exception * - * @return Worksheet + * @return $this */ public function setAutoFilterByColumnAndRow($columnIndex1, $row1, $columnIndex2, $row2) { @@ -1954,7 +1954,7 @@ public function setAutoFilterByColumnAndRow($columnIndex1, $row1, $columnIndex2, /** * Remove autofilter. * - * @return Worksheet + * @return $this */ public function removeAutoFilter() { @@ -1987,7 +1987,7 @@ public function getFreezePane() * * @throws Exception * - * @return Worksheet + * @return $this */ public function freezePane($cell, $topLeftCell = null) { @@ -2012,7 +2012,7 @@ public function freezePane($cell, $topLeftCell = null) * @param int $columnIndex Numeric column coordinate of the cell * @param int $row Numeric row coordinate of the cell * - * @return Worksheet + * @return $this */ public function freezePaneByColumnAndRow($columnIndex, $row) { @@ -2022,7 +2022,7 @@ public function freezePaneByColumnAndRow($columnIndex, $row) /** * Unfreeze Pane. * - * @return Worksheet + * @return $this */ public function unfreezePane() { @@ -2047,7 +2047,7 @@ public function getTopLeftCell() * * @throws Exception * - * @return Worksheet + * @return $this */ public function insertNewRowBefore($pBefore, $pNumRows = 1) { @@ -2069,7 +2069,7 @@ public function insertNewRowBefore($pBefore, $pNumRows = 1) * * @throws Exception * - * @return Worksheet + * @return $this */ public function insertNewColumnBefore($pBefore, $pNumCols = 1) { @@ -2091,7 +2091,7 @@ public function insertNewColumnBefore($pBefore, $pNumCols = 1) * * @throws Exception * - * @return Worksheet + * @return $this */ public function insertNewColumnBeforeByIndex($beforeColumnIndex, $pNumCols = 1) { @@ -2110,7 +2110,7 @@ public function insertNewColumnBeforeByIndex($beforeColumnIndex, $pNumCols = 1) * * @throws Exception * - * @return Worksheet + * @return $this */ public function removeRow($pRow, $pNumRows = 1) { @@ -2141,7 +2141,7 @@ public function removeRow($pRow, $pNumRows = 1) * * @throws Exception * - * @return Worksheet + * @return $this */ public function removeColumn($pColumn, $pNumCols = 1) { @@ -2181,7 +2181,7 @@ public function removeColumn($pColumn, $pNumCols = 1) * * @throws Exception * - * @return Worksheet + * @return $this */ public function removeColumnByIndex($columnIndex, $numColumns = 1) { @@ -2207,7 +2207,7 @@ public function getShowGridlines() * * @param bool $pValue Show gridlines (true/false) * - * @return Worksheet + * @return $this */ public function setShowGridlines($pValue) { @@ -2231,7 +2231,7 @@ public function getPrintGridlines() * * @param bool $pValue Print gridlines (true/false) * - * @return Worksheet + * @return $this */ public function setPrintGridlines($pValue) { @@ -2255,7 +2255,7 @@ public function getShowRowColHeaders() * * @param bool $pValue Show row and column headers (true/false) * - * @return Worksheet + * @return $this */ public function setShowRowColHeaders($pValue) { @@ -2279,7 +2279,7 @@ public function getShowSummaryBelow() * * @param bool $pValue Show summary below (true/false) * - * @return Worksheet + * @return $this */ public function setShowSummaryBelow($pValue) { @@ -2303,7 +2303,7 @@ public function getShowSummaryRight() * * @param bool $pValue Show summary right (true/false) * - * @return Worksheet + * @return $this */ public function setShowSummaryRight($pValue) { @@ -2327,7 +2327,7 @@ public function getComments() * * @param Comment[] $pValue * - * @return Worksheet + * @return $this */ public function setComments(array $pValue) { @@ -2408,7 +2408,7 @@ public function getSelectedCells() * * @param string $pCoordinate Cell (i.e. A1) * - * @return Worksheet + * @return $this */ public function setSelectedCell($pCoordinate) { @@ -2420,7 +2420,7 @@ public function setSelectedCell($pCoordinate) * * @param string $pCoordinate Cell range, examples: 'A1', 'B2:G5', 'A:C', '3:6' * - * @return Worksheet + * @return $this */ public function setSelectedCells($pCoordinate) { @@ -2458,7 +2458,7 @@ public function setSelectedCells($pCoordinate) * * @throws Exception * - * @return Worksheet + * @return $this */ public function setSelectedCellByColumnAndRow($columnIndex, $row) { @@ -2480,7 +2480,7 @@ public function getRightToLeft() * * @param bool $value Right-to-left true/false * - * @return Worksheet + * @return $this */ public function setRightToLeft($value) { @@ -2499,7 +2499,7 @@ public function setRightToLeft($value) * * @throws Exception * - * @return Worksheet + * @return $this */ public function fromArray(array $source, $nullValue = null, $startCell = 'A1', $strictNullComparison = false) { @@ -2684,7 +2684,7 @@ public function getColumnIterator($startColumn = 'A', $endColumn = null) /** * Run PhpSpreadsheet garbage collector. * - * @return Worksheet + * @return $this */ public function garbageCollect() { @@ -2784,7 +2784,7 @@ public function getHyperlink($pCellCoordinate) * @param string $pCellCoordinate Cell coordinate to insert hyperlink, eg: 'A1' * @param null|Hyperlink $pHyperlink * - * @return Worksheet + * @return $this */ public function setHyperlink($pCellCoordinate, Hyperlink $pHyperlink = null) { @@ -2845,7 +2845,7 @@ public function getDataValidation($pCellCoordinate) * @param string $pCellCoordinate Cell coordinate to insert data validation, eg: 'A1' * @param null|DataValidation $pDataValidation * - * @return Worksheet + * @return $this */ public function setDataValidation($pCellCoordinate, DataValidation $pDataValidation = null) { @@ -2933,7 +2933,7 @@ public function getTabColor() /** * Reset tab color. * - * @return Worksheet + * @return $this */ public function resetTabColor() { @@ -2956,7 +2956,7 @@ public function isTabColorSet() /** * Copy worksheet (!= clone!). * - * @return Worksheet + * @return static */ public function copy() { @@ -3007,7 +3007,7 @@ public function __clone() * * @throws Exception * - * @return Worksheet + * @return $this */ public function setCodeName($pValue, $validate = true) { diff --git a/src/PhpSpreadsheet/Writer/Csv.php b/src/PhpSpreadsheet/Writer/Csv.php index ae38ab7321..1166bd25b1 100644 --- a/src/PhpSpreadsheet/Writer/Csv.php +++ b/src/PhpSpreadsheet/Writer/Csv.php @@ -147,7 +147,7 @@ public function getDelimiter() * * @param string $pValue Delimiter, defaults to ',' * - * @return CSV + * @return $this */ public function setDelimiter($pValue) { @@ -171,7 +171,7 @@ public function getEnclosure() * * @param string $pValue Enclosure, defaults to " * - * @return CSV + * @return $this */ public function setEnclosure($pValue) { @@ -198,7 +198,7 @@ public function getLineEnding() * * @param string $pValue Line ending, defaults to OS line ending (PHP_EOL) * - * @return CSV + * @return $this */ public function setLineEnding($pValue) { @@ -222,7 +222,7 @@ public function getUseBOM() * * @param bool $pValue Use UTF-8 byte-order mark? Defaults to false * - * @return CSV + * @return $this */ public function setUseBOM($pValue) { @@ -246,7 +246,7 @@ public function getIncludeSeparatorLine() * * @param bool $pValue Use separator line? Defaults to false * - * @return CSV + * @return $this */ public function setIncludeSeparatorLine($pValue) { @@ -271,7 +271,7 @@ public function getExcelCompatibility() * @param bool $pValue Set the file to be written as a fully Excel compatible csv file * Note that this overrides other settings such as useBOM, enclosure and delimiter * - * @return CSV + * @return $this */ public function setExcelCompatibility($pValue) { @@ -295,7 +295,7 @@ public function getSheetIndex() * * @param int $pValue Sheet index * - * @return CSV + * @return $this */ public function setSheetIndex($pValue) { diff --git a/src/PhpSpreadsheet/Writer/Html.php b/src/PhpSpreadsheet/Writer/Html.php index 0f55f2f403..37d68e912e 100644 --- a/src/PhpSpreadsheet/Writer/Html.php +++ b/src/PhpSpreadsheet/Writer/Html.php @@ -297,7 +297,7 @@ public function getSheetIndex() * * @param int $pValue Sheet index * - * @return HTML + * @return $this */ public function setSheetIndex($pValue) { @@ -321,7 +321,7 @@ public function getGenerateSheetNavigationBlock() * * @param bool $pValue Flag indicating whether the sheet navigation block should be generated or not * - * @return HTML + * @return $this */ public function setGenerateSheetNavigationBlock($pValue) { @@ -332,6 +332,8 @@ public function setGenerateSheetNavigationBlock($pValue) /** * Write all sheets (resets sheetIndex to NULL). + * + * @return $this */ public function writeAllSheets() { @@ -1438,7 +1440,7 @@ public function getImagesRoot() * * @param string $pValue * - * @return HTML + * @return $this */ public function setImagesRoot($pValue) { @@ -1462,7 +1464,7 @@ public function getEmbedImages() * * @param bool $pValue * - * @return HTML + * @return $this */ public function setEmbedImages($pValue) { @@ -1486,7 +1488,7 @@ public function getUseInlineCss() * * @param bool $pValue * - * @return HTML + * @return $this */ public function setUseInlineCss($pValue) { @@ -1510,7 +1512,7 @@ public function getUseEmbeddedCSS() * * @param bool $pValue * - * @return HTML + * @return $this */ public function setUseEmbeddedCSS($pValue) { diff --git a/src/PhpSpreadsheet/Writer/Ods.php b/src/PhpSpreadsheet/Writer/Ods.php index 83fc2931db..43659fa08e 100644 --- a/src/PhpSpreadsheet/Writer/Ods.php +++ b/src/PhpSpreadsheet/Writer/Ods.php @@ -167,7 +167,7 @@ public function getSpreadsheet() * * @param Spreadsheet $spreadsheet PhpSpreadsheet object * - * @return self + * @return $this */ public function setSpreadsheet(Spreadsheet $spreadsheet) { diff --git a/src/PhpSpreadsheet/Writer/Pdf.php b/src/PhpSpreadsheet/Writer/Pdf.php index b80083ae46..d91845603a 100644 --- a/src/PhpSpreadsheet/Writer/Pdf.php +++ b/src/PhpSpreadsheet/Writer/Pdf.php @@ -150,7 +150,7 @@ public function getFont() * * @param string $fontName * - * @return Pdf + * @return $this */ public function setFont($fontName) { diff --git a/src/PhpSpreadsheet/Writer/Xlsx.php b/src/PhpSpreadsheet/Writer/Xlsx.php index 5889763902..1fa59e51c7 100644 --- a/src/PhpSpreadsheet/Writer/Xlsx.php +++ b/src/PhpSpreadsheet/Writer/Xlsx.php @@ -443,7 +443,7 @@ public function getSpreadsheet() * * @param Spreadsheet $spreadsheet PhpSpreadsheet object * - * @return Xlsx + * @return $this */ public function setSpreadsheet(Spreadsheet $spreadsheet) { @@ -547,7 +547,7 @@ public function getOffice2003Compatibility() * * @param bool $pValue Office2003 compatibility? * - * @return Xlsx + * @return $this */ public function setOffice2003Compatibility($pValue) { From c2a205e82f9cf1cc9fab86b79e808d86dd680470 Mon Sep 17 00:00:00 2001 From: Adrien Crivelli Date: Mon, 2 Mar 2020 20:09:03 +0700 Subject: [PATCH 7/7] 1.10.1 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 64075749d9..bcbe3532e6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com) and this project adheres to [Semantic Versioning](https://semver.org). -## [Unreleased] +## [1.11.0] - 2020-03-02 ### Added