Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.
Common duplication problems, and corresponding solutions are:
Complex classes like PHPExcel_Worksheet often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes. You can also have a look at the cohesion graph to spot any un-connected, or weakly-connected components.
Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.
While breaking up the class, it is a good idea to analyze how other classes use PHPExcel_Worksheet, and based on these observations, apply Extract Interface, too.
| 1 | <?php |
||
| 36 | class PHPExcel_Worksheet implements PHPExcel_IComparable |
||
| 37 | { |
||
| 38 | /* Break types */ |
||
| 39 | const BREAK_NONE = 0; |
||
| 40 | const BREAK_ROW = 1; |
||
| 41 | const BREAK_COLUMN = 2; |
||
| 42 | |||
| 43 | /* Sheet state */ |
||
| 44 | const SHEETSTATE_VISIBLE = 'visible'; |
||
| 45 | const SHEETSTATE_HIDDEN = 'hidden'; |
||
| 46 | const SHEETSTATE_VERYHIDDEN = 'veryHidden'; |
||
| 47 | |||
| 48 | /** |
||
| 49 | * Invalid characters in sheet title |
||
| 50 | * |
||
| 51 | * @var array |
||
| 52 | */ |
||
| 53 | private static $_invalidCharacters = array('*', ':', '/', '\\', '?', '[', ']'); |
||
| 54 | |||
| 55 | /** |
||
| 56 | * Parent spreadsheet |
||
| 57 | * |
||
| 58 | * @var PHPExcel |
||
| 59 | */ |
||
| 60 | private $_parent; |
||
| 61 | |||
| 62 | /** |
||
| 63 | * Cacheable collection of cells |
||
| 64 | * |
||
| 65 | * @var PHPExcel_CachedObjectStorage_xxx |
||
| 66 | */ |
||
| 67 | private $_cellCollection = null; |
||
| 68 | |||
| 69 | /** |
||
| 70 | * Collection of row dimensions |
||
| 71 | * |
||
| 72 | * @var PHPExcel_Worksheet_RowDimension[] |
||
| 73 | */ |
||
| 74 | private $_rowDimensions = array(); |
||
| 75 | |||
| 76 | /** |
||
| 77 | * Default row dimension |
||
| 78 | * |
||
| 79 | * @var PHPExcel_Worksheet_RowDimension |
||
| 80 | */ |
||
| 81 | private $_defaultRowDimension = null; |
||
| 82 | |||
| 83 | /** |
||
| 84 | * Collection of column dimensions |
||
| 85 | * |
||
| 86 | * @var PHPExcel_Worksheet_ColumnDimension[] |
||
| 87 | */ |
||
| 88 | private $_columnDimensions = array(); |
||
| 89 | |||
| 90 | /** |
||
| 91 | * Default column dimension |
||
| 92 | * |
||
| 93 | * @var PHPExcel_Worksheet_ColumnDimension |
||
| 94 | */ |
||
| 95 | private $_defaultColumnDimension = null; |
||
| 96 | |||
| 97 | /** |
||
| 98 | * Collection of drawings |
||
| 99 | * |
||
| 100 | * @var PHPExcel_Worksheet_BaseDrawing[] |
||
| 101 | */ |
||
| 102 | private $_drawingCollection = null; |
||
| 103 | |||
| 104 | /** |
||
| 105 | * Collection of Chart objects |
||
| 106 | * |
||
| 107 | * @var PHPExcel_Chart[] |
||
| 108 | */ |
||
| 109 | private $_chartCollection = array(); |
||
| 110 | |||
| 111 | /** |
||
| 112 | * Worksheet title |
||
| 113 | * |
||
| 114 | * @var string |
||
| 115 | */ |
||
| 116 | private $_title; |
||
| 117 | |||
| 118 | /** |
||
| 119 | * Sheet state |
||
| 120 | * |
||
| 121 | * @var string |
||
| 122 | */ |
||
| 123 | private $_sheetState; |
||
| 124 | |||
| 125 | /** |
||
| 126 | * Page setup |
||
| 127 | * |
||
| 128 | * @var PHPExcel_Worksheet_PageSetup |
||
| 129 | */ |
||
| 130 | private $_pageSetup; |
||
| 131 | |||
| 132 | /** |
||
| 133 | * Page margins |
||
| 134 | * |
||
| 135 | * @var PHPExcel_Worksheet_PageMargins |
||
| 136 | */ |
||
| 137 | private $_pageMargins; |
||
| 138 | |||
| 139 | /** |
||
| 140 | * Page header/footer |
||
| 141 | * |
||
| 142 | * @var PHPExcel_Worksheet_HeaderFooter |
||
| 143 | */ |
||
| 144 | private $_headerFooter; |
||
| 145 | |||
| 146 | /** |
||
| 147 | * Sheet view |
||
| 148 | * |
||
| 149 | * @var PHPExcel_Worksheet_SheetView |
||
| 150 | */ |
||
| 151 | private $_sheetView; |
||
| 152 | |||
| 153 | /** |
||
| 154 | * Protection |
||
| 155 | * |
||
| 156 | * @var PHPExcel_Worksheet_Protection |
||
| 157 | */ |
||
| 158 | private $_protection; |
||
| 159 | |||
| 160 | /** |
||
| 161 | * Collection of styles |
||
| 162 | * |
||
| 163 | * @var PHPExcel_Style[] |
||
| 164 | */ |
||
| 165 | private $_styles = array(); |
||
| 166 | |||
| 167 | /** |
||
| 168 | * Conditional styles. Indexed by cell coordinate, e.g. 'A1' |
||
| 169 | * |
||
| 170 | * @var array |
||
| 171 | */ |
||
| 172 | private $_conditionalStylesCollection = array(); |
||
| 173 | |||
| 174 | /** |
||
| 175 | * Is the current cell collection sorted already? |
||
| 176 | * |
||
| 177 | * @var boolean |
||
| 178 | */ |
||
| 179 | private $_cellCollectionIsSorted = false; |
||
| 180 | |||
| 181 | /** |
||
| 182 | * Collection of breaks |
||
| 183 | * |
||
| 184 | * @var array |
||
| 185 | */ |
||
| 186 | private $_breaks = array(); |
||
| 187 | |||
| 188 | /** |
||
| 189 | * Collection of merged cell ranges |
||
| 190 | * |
||
| 191 | * @var array |
||
| 192 | */ |
||
| 193 | private $_mergeCells = array(); |
||
| 194 | |||
| 195 | /** |
||
| 196 | * Collection of protected cell ranges |
||
| 197 | * |
||
| 198 | * @var array |
||
| 199 | */ |
||
| 200 | private $_protectedCells = array(); |
||
| 201 | |||
| 202 | /** |
||
| 203 | * Autofilter Range |
||
| 204 | * |
||
| 205 | * @var string |
||
| 206 | */ |
||
| 207 | private $_autoFilter = ''; |
||
| 208 | |||
| 209 | /** |
||
| 210 | * Freeze pane |
||
| 211 | * |
||
| 212 | * @var string |
||
| 213 | */ |
||
| 214 | private $_freezePane = ''; |
||
| 215 | |||
| 216 | /** |
||
| 217 | * Show gridlines? |
||
| 218 | * |
||
| 219 | * @var boolean |
||
| 220 | */ |
||
| 221 | private $_showGridlines = true; |
||
| 222 | |||
| 223 | /** |
||
| 224 | * Print gridlines? |
||
| 225 | * |
||
| 226 | * @var boolean |
||
| 227 | */ |
||
| 228 | private $_printGridlines = false; |
||
| 229 | |||
| 230 | /** |
||
| 231 | * Show row and column headers? |
||
| 232 | * |
||
| 233 | * @var boolean |
||
| 234 | */ |
||
| 235 | private $_showRowColHeaders = true; |
||
| 236 | |||
| 237 | /** |
||
| 238 | * Show summary below? (Row/Column outline) |
||
| 239 | * |
||
| 240 | * @var boolean |
||
| 241 | */ |
||
| 242 | private $_showSummaryBelow = true; |
||
| 243 | |||
| 244 | /** |
||
| 245 | * Show summary right? (Row/Column outline) |
||
| 246 | * |
||
| 247 | * @var boolean |
||
| 248 | */ |
||
| 249 | private $_showSummaryRight = true; |
||
| 250 | |||
| 251 | /** |
||
| 252 | * Collection of comments |
||
| 253 | * |
||
| 254 | * @var PHPExcel_Comment[] |
||
| 255 | */ |
||
| 256 | private $_comments = array(); |
||
| 257 | |||
| 258 | /** |
||
| 259 | * Active cell. (Only one!) |
||
| 260 | * |
||
| 261 | * @var string |
||
| 262 | */ |
||
| 263 | private $_activeCell = 'A1'; |
||
| 264 | |||
| 265 | /** |
||
| 266 | * Selected cells |
||
| 267 | * |
||
| 268 | * @var string |
||
| 269 | */ |
||
| 270 | private $_selectedCells = 'A1'; |
||
| 271 | |||
| 272 | /** |
||
| 273 | * Cached highest column |
||
| 274 | * |
||
| 275 | * @var string |
||
| 276 | */ |
||
| 277 | private $_cachedHighestColumn = 'A'; |
||
| 278 | |||
| 279 | /** |
||
| 280 | * Cached highest row |
||
| 281 | * |
||
| 282 | * @var int |
||
| 283 | */ |
||
| 284 | private $_cachedHighestRow = 1; |
||
| 285 | |||
| 286 | /** |
||
| 287 | * Right-to-left? |
||
| 288 | * |
||
| 289 | * @var boolean |
||
| 290 | */ |
||
| 291 | private $_rightToLeft = false; |
||
| 292 | |||
| 293 | /** |
||
| 294 | * Hyperlinks. Indexed by cell coordinate, e.g. 'A1' |
||
| 295 | * |
||
| 296 | * @var array |
||
| 297 | */ |
||
| 298 | private $_hyperlinkCollection = array(); |
||
| 299 | |||
| 300 | /** |
||
| 301 | * Data validation objects. Indexed by cell coordinate, e.g. 'A1' |
||
| 302 | * |
||
| 303 | * @var array |
||
| 304 | */ |
||
| 305 | private $_dataValidationCollection = array(); |
||
| 306 | |||
| 307 | /** |
||
| 308 | * Tab color |
||
| 309 | * |
||
| 310 | * @var PHPExcel_Style_Color |
||
| 311 | */ |
||
| 312 | private $_tabColor; |
||
| 313 | |||
| 314 | /** |
||
| 315 | * Dirty flag |
||
| 316 | * |
||
| 317 | * @var boolean |
||
| 318 | */ |
||
| 319 | private $_dirty = true; |
||
| 320 | |||
| 321 | /** |
||
| 322 | * Hash |
||
| 323 | * |
||
| 324 | * @var string |
||
| 325 | */ |
||
| 326 | private $_hash = null; |
||
| 327 | |||
| 328 | /** |
||
| 329 | * Create a new worksheet |
||
| 330 | * |
||
| 331 | * @param PHPExcel $pParent |
||
| 332 | * @param string $pTitle |
||
| 333 | */ |
||
| 334 | public function __construct(PHPExcel $pParent = null, $pTitle = 'Worksheet') |
||
| 370 | |||
| 371 | |||
| 372 | /** |
||
| 373 | * Disconnect all cells from this PHPExcel_Worksheet object, |
||
| 374 | * typically so that the worksheet object can be unset |
||
| 375 | * |
||
| 376 | */ |
||
| 377 | public function disconnectCells() { |
||
| 384 | |||
| 385 | /** |
||
| 386 | * Return the cache controller for the cell collection |
||
| 387 | * |
||
| 388 | * @return PHPExcel_CachedObjectStorage_xxx |
||
| 389 | */ |
||
| 390 | public function getCellCacheController() { |
||
| 393 | |||
| 394 | |||
| 395 | /** |
||
| 396 | * Get array of invalid characters for sheet title |
||
| 397 | * |
||
| 398 | * @return array |
||
| 399 | */ |
||
| 400 | public static function getInvalidCharacters() |
||
| 404 | |||
| 405 | /** |
||
| 406 | * Check sheet title for valid Excel syntax |
||
| 407 | * |
||
| 408 | * @param string $pValue The string to check |
||
| 409 | * @return string The valid string |
||
| 410 | * @throws Exception |
||
| 411 | */ |
||
| 412 | private static function _checkSheetTitle($pValue) |
||
| 426 | |||
| 427 | /** |
||
| 428 | * Get collection of cells |
||
| 429 | * |
||
| 430 | * @param boolean $pSorted Also sort the cell collection? |
||
| 431 | * @return PHPExcel_Cell[] |
||
| 432 | */ |
||
| 433 | public function getCellCollection($pSorted = true) |
||
| 444 | |||
| 445 | /** |
||
| 446 | * Sort collection of cells |
||
| 447 | * |
||
| 448 | * @return PHPExcel_Worksheet |
||
| 449 | */ |
||
| 450 | public function sortCellCollection() |
||
| 457 | |||
| 458 | /** |
||
| 459 | * Get collection of row dimensions |
||
| 460 | * |
||
| 461 | * @return PHPExcel_Worksheet_RowDimension[] |
||
| 462 | */ |
||
| 463 | public function getRowDimensions() |
||
| 467 | |||
| 468 | /** |
||
| 469 | * Get default row dimension |
||
| 470 | * |
||
| 471 | * @return PHPExcel_Worksheet_RowDimension |
||
| 472 | */ |
||
| 473 | public function getDefaultRowDimension() |
||
| 477 | |||
| 478 | /** |
||
| 479 | * Get collection of column dimensions |
||
| 480 | * |
||
| 481 | * @return PHPExcel_Worksheet_ColumnDimension[] |
||
| 482 | */ |
||
| 483 | public function getColumnDimensions() |
||
| 487 | |||
| 488 | /** |
||
| 489 | * Get default column dimension |
||
| 490 | * |
||
| 491 | * @return PHPExcel_Worksheet_ColumnDimension |
||
| 492 | */ |
||
| 493 | public function getDefaultColumnDimension() |
||
| 497 | |||
| 498 | /** |
||
| 499 | * Get collection of drawings |
||
| 500 | * |
||
| 501 | * @return PHPExcel_Worksheet_BaseDrawing[] |
||
| 502 | */ |
||
| 503 | public function getDrawingCollection() |
||
| 507 | |||
| 508 | /** |
||
| 509 | * Get collection of charts |
||
| 510 | * |
||
| 511 | * @return PHPExcel_Chart[] |
||
| 512 | */ |
||
| 513 | public function getChartCollection() |
||
| 517 | |||
| 518 | /** |
||
| 519 | * Add chart |
||
| 520 | * |
||
| 521 | * @param PHPExcel_Chart $pChart |
||
| 522 | * @param int|null $iChartIndex Index where chart should go (0,1,..., or null for last) |
||
| 523 | * @return PHPExcel_Chart |
||
| 524 | * @throws Exception |
||
| 525 | */ |
||
| 526 | public function addChart(PHPExcel_Chart $pChart = null, $iChartIndex = null) |
||
| 537 | |||
| 538 | /** |
||
| 539 | * Return the count of charts on this worksheet |
||
| 540 | * |
||
| 541 | * @return int The number of charts |
||
| 542 | * @throws Exception |
||
| 543 | */ |
||
| 544 | public function getChartCount() |
||
| 548 | |||
| 549 | /** |
||
| 550 | * Get a chart by its index position |
||
| 551 | * |
||
| 552 | * @param string $index Chart index position |
||
| 553 | * @return false|PHPExcel_Chart |
||
| 554 | * @throws Exception |
||
| 555 | */ |
||
| 556 | public function getChartByIndex($index = null) |
||
| 571 | |||
| 572 | /** |
||
| 573 | * Return an array of the names of charts on this worksheet |
||
| 574 | * |
||
| 575 | * @return string[] The names of charts |
||
| 576 | * @throws Exception |
||
| 577 | */ |
||
| 578 | public function getChartNames() |
||
| 586 | |||
| 587 | /** |
||
| 588 | * Get a chart by name |
||
| 589 | * |
||
| 590 | * @param string $chartName Chart name |
||
| 591 | * @return false|PHPExcel_Chart |
||
| 592 | * @throws Exception |
||
| 593 | */ |
||
| 594 | public function getChartByName($chartName = '') |
||
| 607 | |||
| 608 | /** |
||
| 609 | * Refresh column dimensions |
||
| 610 | * |
||
| 611 | * @return PHPExcel_Worksheet |
||
| 612 | */ |
||
| 613 | public function refreshColumnDimensions() |
||
| 626 | |||
| 627 | /** |
||
| 628 | * Refresh row dimensions |
||
| 629 | * |
||
| 630 | * @return PHPExcel_Worksheet |
||
| 631 | */ |
||
| 632 | public function refreshRowDimensions() |
||
| 645 | |||
| 646 | /** |
||
| 647 | * Calculate worksheet dimension |
||
| 648 | * |
||
| 649 | * @return string String containing the dimension of this worksheet |
||
| 650 | */ |
||
| 651 | public function calculateWorksheetDimension() |
||
| 656 | |||
| 657 | /** |
||
| 658 | * Calculate worksheet data dimension |
||
| 659 | * |
||
| 660 | * @return string String containing the dimension of this worksheet that actually contain data |
||
| 661 | */ |
||
| 662 | public function calculateWorksheetDataDimension() |
||
| 667 | |||
| 668 | /** |
||
| 669 | * Calculate widths for auto-size columns |
||
| 670 | * |
||
| 671 | * @param boolean $calculateMergeCells Calculate merge cell width |
||
| 672 | * @return PHPExcel_Worksheet; |
||
| 673 | */ |
||
| 674 | public function calculateColumnWidths($calculateMergeCells = false) |
||
| 729 | |||
| 730 | /** |
||
| 731 | * Get parent |
||
| 732 | * |
||
| 733 | * @return PHPExcel |
||
| 734 | */ |
||
| 735 | public function getParent() { |
||
| 738 | |||
| 739 | /** |
||
| 740 | * Re-bind parent |
||
| 741 | * |
||
| 742 | * @param PHPExcel $parent |
||
| 743 | * @return PHPExcel_Worksheet |
||
| 744 | */ |
||
| 745 | public function rebindParent(PHPExcel $parent) { |
||
| 758 | |||
| 759 | /** |
||
| 760 | * Get title |
||
| 761 | * |
||
| 762 | * @return string |
||
| 763 | */ |
||
| 764 | public function getTitle() |
||
| 768 | |||
| 769 | /** |
||
| 770 | * Set title |
||
| 771 | * |
||
| 772 | * @param string $pValue String containing the dimension of this worksheet |
||
| 773 | * @param string $updateFormulaCellReferences boolean Flag indicating whether cell references in formulae should |
||
| 774 | * be updated to reflect the new sheet name. |
||
| 775 | * This should be left as the default true, unless you are |
||
| 776 | * certain that no formula cells on any worksheet contain |
||
| 777 | * references to this worksheet |
||
| 778 | * @return PHPExcel_Worksheet |
||
| 779 | */ |
||
| 780 | public function setTitle($pValue = 'Worksheet', $updateFormulaCellReferences = true) |
||
| 829 | |||
| 830 | /** |
||
| 831 | * Get sheet state |
||
| 832 | * |
||
| 833 | * @return string Sheet state (visible, hidden, veryHidden) |
||
| 834 | */ |
||
| 835 | public function getSheetState() { |
||
| 838 | |||
| 839 | /** |
||
| 840 | * Set sheet state |
||
| 841 | * |
||
| 842 | * @param string $value Sheet state (visible, hidden, veryHidden) |
||
| 843 | * @return PHPExcel_Worksheet |
||
| 844 | */ |
||
| 845 | public function setSheetState($value = PHPExcel_Worksheet::SHEETSTATE_VISIBLE) { |
||
| 849 | |||
| 850 | /** |
||
| 851 | * Get page setup |
||
| 852 | * |
||
| 853 | * @return PHPExcel_Worksheet_PageSetup |
||
| 854 | */ |
||
| 855 | public function getPageSetup() |
||
| 859 | |||
| 860 | /** |
||
| 861 | * Set page setup |
||
| 862 | * |
||
| 863 | * @param PHPExcel_Worksheet_PageSetup $pValue |
||
| 864 | * @return PHPExcel_Worksheet |
||
| 865 | */ |
||
| 866 | public function setPageSetup(PHPExcel_Worksheet_PageSetup $pValue) |
||
| 871 | |||
| 872 | /** |
||
| 873 | * Get page margins |
||
| 874 | * |
||
| 875 | * @return PHPExcel_Worksheet_PageMargins |
||
| 876 | */ |
||
| 877 | public function getPageMargins() |
||
| 881 | |||
| 882 | /** |
||
| 883 | * Set page margins |
||
| 884 | * |
||
| 885 | * @param PHPExcel_Worksheet_PageMargins $pValue |
||
| 886 | * @return PHPExcel_Worksheet |
||
| 887 | */ |
||
| 888 | public function setPageMargins(PHPExcel_Worksheet_PageMargins $pValue) |
||
| 893 | |||
| 894 | /** |
||
| 895 | * Get page header/footer |
||
| 896 | * |
||
| 897 | * @return PHPExcel_Worksheet_HeaderFooter |
||
| 898 | */ |
||
| 899 | public function getHeaderFooter() |
||
| 903 | |||
| 904 | /** |
||
| 905 | * Set page header/footer |
||
| 906 | * |
||
| 907 | * @param PHPExcel_Worksheet_HeaderFooter $pValue |
||
| 908 | * @return PHPExcel_Worksheet |
||
| 909 | */ |
||
| 910 | public function setHeaderFooter(PHPExcel_Worksheet_HeaderFooter $pValue) |
||
| 915 | |||
| 916 | /** |
||
| 917 | * Get sheet view |
||
| 918 | * |
||
| 919 | * @return PHPExcel_Worksheet_HeaderFooter |
||
| 920 | */ |
||
| 921 | public function getSheetView() |
||
| 925 | |||
| 926 | /** |
||
| 927 | * Set sheet view |
||
| 928 | * |
||
| 929 | * @param PHPExcel_Worksheet_SheetView $pValue |
||
| 930 | * @return PHPExcel_Worksheet |
||
| 931 | */ |
||
| 932 | public function setSheetView(PHPExcel_Worksheet_SheetView $pValue) |
||
| 937 | |||
| 938 | /** |
||
| 939 | * Get Protection |
||
| 940 | * |
||
| 941 | * @return PHPExcel_Worksheet_Protection |
||
| 942 | */ |
||
| 943 | public function getProtection() |
||
| 947 | |||
| 948 | /** |
||
| 949 | * Set Protection |
||
| 950 | * |
||
| 951 | * @param PHPExcel_Worksheet_Protection $pValue |
||
| 952 | * @return PHPExcel_Worksheet |
||
| 953 | */ |
||
| 954 | public function setProtection(PHPExcel_Worksheet_Protection $pValue) |
||
| 961 | |||
| 962 | /** |
||
| 963 | * Get highest worksheet column |
||
| 964 | * |
||
| 965 | * @return string Highest column name |
||
| 966 | */ |
||
| 967 | public function getHighestColumn() |
||
| 971 | |||
| 972 | /** |
||
| 973 | * Get highest worksheet column that contains data |
||
| 974 | * |
||
| 975 | * @return string Highest column name that contains data |
||
| 976 | */ |
||
| 977 | public function getHighestDataColumn() |
||
| 981 | |||
| 982 | /** |
||
| 983 | * Get highest worksheet row |
||
| 984 | * |
||
| 985 | * @return int Highest row number |
||
| 986 | */ |
||
| 987 | public function getHighestRow() |
||
| 991 | |||
| 992 | /** |
||
| 993 | * Get highest worksheet row that contains data |
||
| 994 | * |
||
| 995 | * @return string Highest row number that contains data |
||
| 996 | */ |
||
| 997 | public function getHighestDataRow() |
||
| 1001 | |||
| 1002 | /** |
||
| 1003 | * Get highest worksheet column and highest row that have cell records |
||
| 1004 | * |
||
| 1005 | * @return array Highest column name and highest row number |
||
| 1006 | */ |
||
| 1007 | public function getHighestRowAndColumn() |
||
| 1011 | |||
| 1012 | /** |
||
| 1013 | * Set a cell value |
||
| 1014 | * |
||
| 1015 | * @param string $pCoordinate Coordinate of the cell |
||
| 1016 | * @param mixed $pValue Value of the cell |
||
| 1017 | * @param bool $returnCell Return the worksheet (false, default) or the cell (true) |
||
| 1018 | * @return PHPExcel_Worksheet|PHPExcel_Cell Depending on the last parameter being specified |
||
| 1019 | */ |
||
| 1020 | public function setCellValue($pCoordinate = 'A1', $pValue = null, $returnCell = false) |
||
| 1029 | |||
| 1030 | /** |
||
| 1031 | * Set a cell value by using numeric cell coordinates |
||
| 1032 | * |
||
| 1033 | * @param string $pColumn Numeric column coordinate of the cell |
||
| 1034 | * @param string $pRow Numeric row coordinate of the cell |
||
| 1035 | * @param mixed $pValue Value of the cell |
||
| 1036 | * @param bool $returnCell Return the worksheet (false, default) or the cell (true) |
||
| 1037 | * @return PHPExcel_Worksheet|PHPExcel_Cell Depending on the last parameter being specified |
||
| 1038 | */ |
||
| 1039 | public function setCellValueByColumnAndRow($pColumn = 0, $pRow = 1, $pValue = null, $returnCell = false) |
||
| 1048 | |||
| 1049 | /** |
||
| 1050 | * Set a cell value |
||
| 1051 | * |
||
| 1052 | * @param string $pCoordinate Coordinate of the cell |
||
| 1053 | * @param mixed $pValue Value of the cell |
||
| 1054 | * @param string $pDataType Explicit data type |
||
| 1055 | * @return PHPExcel_Worksheet |
||
| 1056 | */ |
||
| 1057 | public function setCellValueExplicit($pCoordinate = 'A1', $pValue = null, $pDataType = PHPExcel_Cell_DataType::TYPE_STRING) |
||
| 1063 | |||
| 1064 | /** |
||
| 1065 | * Set a cell value by using numeric cell coordinates |
||
| 1066 | * |
||
| 1067 | * @param string $pColumn Numeric column coordinate of the cell |
||
| 1068 | * @param string $pRow Numeric row coordinate of the cell |
||
| 1069 | * @param mixed $pValue Value of the cell |
||
| 1070 | * @param string $pDataType Explicit data type |
||
| 1071 | * @return PHPExcel_Worksheet |
||
| 1072 | */ |
||
| 1073 | public function setCellValueExplicitByColumnAndRow($pColumn = 0, $pRow = 1, $pValue = null, $pDataType = PHPExcel_Cell_DataType::TYPE_STRING) |
||
| 1077 | |||
| 1078 | /** |
||
| 1079 | * Get cell at a specific coordinate |
||
| 1080 | * |
||
| 1081 | * @param string $pCoordinate Coordinate of the cell |
||
| 1082 | * @throws Exception |
||
| 1083 | * @return PHPExcel_Cell Cell that was found |
||
| 1084 | */ |
||
| 1085 | public function getCell($pCoordinate = 'A1') |
||
| 1147 | |||
| 1148 | /** |
||
| 1149 | * Get cell at a specific coordinate by using numeric cell coordinates |
||
| 1150 | * |
||
| 1151 | * @param string $pColumn Numeric column coordinate of the cell |
||
| 1152 | * @param string $pRow Numeric row coordinate of the cell |
||
| 1153 | * @return PHPExcel_Cell Cell that was found |
||
| 1154 | */ |
||
| 1155 | public function getCellByColumnAndRow($pColumn = 0, $pRow = 1) |
||
| 1174 | |||
| 1175 | /** |
||
| 1176 | * Cell at a specific coordinate exists? |
||
| 1177 | * |
||
| 1178 | * @param string $pCoordinate Coordinate of the cell |
||
| 1179 | * @throws Exception |
||
| 1180 | * @return boolean |
||
| 1181 | */ |
||
| 1182 | public function cellExists($pCoordinate = 'A1') |
||
| 1221 | |||
| 1222 | /** |
||
| 1223 | * Cell at a specific coordinate by using numeric cell coordinates exists? |
||
| 1224 | * |
||
| 1225 | * @param string $pColumn Numeric column coordinate of the cell |
||
| 1226 | * @param string $pRow Numeric row coordinate of the cell |
||
| 1227 | * @return boolean |
||
| 1228 | */ |
||
| 1229 | public function cellExistsByColumnAndRow($pColumn = 0, $pRow = 1) |
||
| 1233 | |||
| 1234 | /** |
||
| 1235 | * Get row dimension at a specific row |
||
| 1236 | * |
||
| 1237 | * @param int $pRow Numeric index of the row |
||
| 1238 | * @return PHPExcel_Worksheet_RowDimension |
||
| 1239 | */ |
||
| 1240 | public function getRowDimension($pRow = 1) |
||
| 1253 | |||
| 1254 | /** |
||
| 1255 | * Get column dimension at a specific column |
||
| 1256 | * |
||
| 1257 | * @param string $pColumn String index of the column |
||
| 1258 | * @return PHPExcel_Worksheet_ColumnDimension |
||
| 1259 | */ |
||
| 1260 | public function getColumnDimension($pColumn = 'A') |
||
| 1274 | |||
| 1275 | /** |
||
| 1276 | * Get column dimension at a specific column by using numeric cell coordinates |
||
| 1277 | * |
||
| 1278 | * @param string $pColumn Numeric column coordinate of the cell |
||
| 1279 | * @return PHPExcel_Worksheet_ColumnDimension |
||
| 1280 | */ |
||
| 1281 | public function getColumnDimensionByColumn($pColumn = 0) |
||
| 1285 | |||
| 1286 | /** |
||
| 1287 | * Get styles |
||
| 1288 | * |
||
| 1289 | * @return PHPExcel_Style[] |
||
| 1290 | */ |
||
| 1291 | public function getStyles() |
||
| 1295 | |||
| 1296 | /** |
||
| 1297 | * Get default style of workbork. |
||
| 1298 | * |
||
| 1299 | * @deprecated |
||
| 1300 | * @return PHPExcel_Style |
||
| 1301 | * @throws Exception |
||
| 1302 | */ |
||
| 1303 | public function getDefaultStyle() |
||
| 1307 | |||
| 1308 | /** |
||
| 1309 | * Set default style - should only be used by PHPExcel_IReader implementations! |
||
| 1310 | * |
||
| 1311 | * @deprecated |
||
| 1312 | * @param PHPExcel_Style $pValue |
||
| 1313 | * @throws Exception |
||
| 1314 | * @return PHPExcel_Worksheet |
||
| 1315 | */ |
||
| 1316 | public function setDefaultStyle(PHPExcel_Style $pValue) |
||
| 1326 | |||
| 1327 | /** |
||
| 1328 | * Get style for cell |
||
| 1329 | * |
||
| 1330 | * @param string $pCellCoordinate Cell coordinate to get style for |
||
| 1331 | * @return PHPExcel_Style |
||
| 1332 | * @throws Exception |
||
| 1333 | */ |
||
| 1334 | public function getStyle($pCellCoordinate = 'A1') |
||
| 1344 | |||
| 1345 | /** |
||
| 1346 | * Get conditional styles for a cell |
||
| 1347 | * |
||
| 1348 | * @param string $pCoordinate |
||
| 1349 | * @return PHPExcel_Style_Conditional[] |
||
| 1350 | */ |
||
| 1351 | public function getConditionalStyles($pCoordinate = 'A1') |
||
| 1358 | |||
| 1359 | /** |
||
| 1360 | * Do conditional styles exist for this cell? |
||
| 1361 | * |
||
| 1362 | * @param string $pCoordinate |
||
| 1363 | * @return boolean |
||
| 1364 | */ |
||
| 1365 | public function conditionalStylesExists($pCoordinate = 'A1') |
||
| 1372 | |||
| 1373 | /** |
||
| 1374 | * Removes conditional styles for a cell |
||
| 1375 | * |
||
| 1376 | * @param string $pCoordinate |
||
| 1377 | * @return PHPExcel_Worksheet |
||
| 1378 | */ |
||
| 1379 | public function removeConditionalStyles($pCoordinate = 'A1') |
||
| 1384 | |||
| 1385 | /** |
||
| 1386 | * Get collection of conditional styles |
||
| 1387 | * |
||
| 1388 | * @return array |
||
| 1389 | */ |
||
| 1390 | public function getConditionalStylesCollection() |
||
| 1394 | |||
| 1395 | /** |
||
| 1396 | * Set conditional styles |
||
| 1397 | * |
||
| 1398 | * @param $pCoordinate string E.g. 'A1' |
||
| 1399 | * @param $pValue PHPExcel_Style_Conditional[] |
||
| 1400 | * @return PHPExcel_Worksheet |
||
| 1401 | */ |
||
| 1402 | public function setConditionalStyles($pCoordinate = 'A1', $pValue) |
||
| 1407 | |||
| 1408 | /** |
||
| 1409 | * Get style for cell by using numeric cell coordinates |
||
| 1410 | * |
||
| 1411 | * @param int $pColumn Numeric column coordinate of the cell |
||
| 1412 | * @param int $pRow Numeric row coordinate of the cell |
||
| 1413 | * @return PHPExcel_Style |
||
| 1414 | */ |
||
| 1415 | public function getStyleByColumnAndRow($pColumn = 0, $pRow = 1) |
||
| 1419 | |||
| 1420 | /** |
||
| 1421 | * Set shared cell style to a range of cells |
||
| 1422 | * |
||
| 1423 | * Please note that this will overwrite existing cell styles for cells in range! |
||
| 1424 | * |
||
| 1425 | * @deprecated |
||
| 1426 | * @param PHPExcel_Style $pSharedCellStyle Cell style to share |
||
| 1427 | * @param string $pRange Range of cells (i.e. "A1:B10"), or just one cell (i.e. "A1") |
||
| 1428 | * @throws Exception |
||
| 1429 | * @return PHPExcel_Worksheet |
||
| 1430 | */ |
||
| 1431 | public function setSharedStyle(PHPExcel_Style $pSharedCellStyle = null, $pRange = '') |
||
| 1436 | |||
| 1437 | /** |
||
| 1438 | * Duplicate cell style to a range of cells |
||
| 1439 | * |
||
| 1440 | * Please note that this will overwrite existing cell styles for cells in range! |
||
| 1441 | * |
||
| 1442 | * @param PHPExcel_Style $pCellStyle Cell style to duplicate |
||
| 1443 | * @param string $pRange Range of cells (i.e. "A1:B10"), or just one cell (i.e. "A1") |
||
| 1444 | * @throws Exception |
||
| 1445 | * @return PHPExcel_Worksheet |
||
| 1446 | */ |
||
| 1447 | public function duplicateStyle(PHPExcel_Style $pCellStyle = null, $pRange = '') |
||
| 1500 | |||
| 1501 | /** |
||
| 1502 | * Duplicate conditional style to a range of cells |
||
| 1503 | * |
||
| 1504 | * Please note that this will overwrite existing cell styles for cells in range! |
||
| 1505 | * |
||
| 1506 | * @param array of PHPExcel_Style_Conditional $pCellStyle Cell style to duplicate |
||
| 1507 | * @param string $pRange Range of cells (i.e. "A1:B10"), or just one cell (i.e. "A1") |
||
| 1508 | * @throws Exception |
||
| 1509 | * @return PHPExcel_Worksheet |
||
| 1510 | */ |
||
| 1511 | public function duplicateConditionalStyle(array $pCellStyle = null, $pRange = '') |
||
| 1556 | |||
| 1557 | /** |
||
| 1558 | * Duplicate cell style array to a range of cells |
||
| 1559 | * |
||
| 1560 | * Please note that this will overwrite existing cell styles for cells in range, |
||
| 1561 | * if they are in the styles array. For example, if you decide to set a range of |
||
| 1562 | * cells to font bold, only include font bold in the styles array. |
||
| 1563 | * |
||
| 1564 | * @deprecated |
||
| 1565 | * @param array $pStyles Array containing style information |
||
| 1566 | * @param string $pRange Range of cells (i.e. "A1:B10"), or just one cell (i.e. "A1") |
||
| 1567 | * @param boolean $pAdvanced Advanced mode for setting borders. |
||
| 1568 | * @throws Exception |
||
| 1569 | * @return PHPExcel_Worksheet |
||
| 1570 | */ |
||
| 1571 | public function duplicateStyleArray($pStyles = null, $pRange = '', $pAdvanced = true) |
||
| 1576 | |||
| 1577 | /** |
||
| 1578 | * Set break on a cell |
||
| 1579 | * |
||
| 1580 | * @param string $pCell Cell coordinate (e.g. A1) |
||
| 1581 | * @param int $pBreak Break type (type of PHPExcel_Worksheet::BREAK_*) |
||
| 1582 | * @throws Exception |
||
| 1583 | * @return PHPExcel_Worksheet |
||
| 1584 | */ |
||
| 1585 | public function setBreak($pCell = 'A1', $pBreak = PHPExcel_Worksheet::BREAK_NONE) |
||
| 1598 | |||
| 1599 | /** |
||
| 1600 | * Set break on a cell by using numeric cell coordinates |
||
| 1601 | * |
||
| 1602 | * @param integer $pColumn Numeric column coordinate of the cell |
||
| 1603 | * @param integer $pRow Numeric row coordinate of the cell |
||
| 1604 | * @param integer $pBreak Break type (type of PHPExcel_Worksheet::BREAK_*) |
||
| 1605 | * @throws Exception |
||
| 1606 | * @return PHPExcel_Worksheet |
||
| 1607 | */ |
||
| 1608 | public function setBreakByColumnAndRow($pColumn = 0, $pRow = 1, $pBreak = PHPExcel_Worksheet::BREAK_NONE) |
||
| 1612 | |||
| 1613 | /** |
||
| 1614 | * Get breaks |
||
| 1615 | * |
||
| 1616 | * @return array[] |
||
| 1617 | */ |
||
| 1618 | public function getBreaks() |
||
| 1622 | |||
| 1623 | /** |
||
| 1624 | * Set merge on a cell range |
||
| 1625 | * |
||
| 1626 | * @param string $pRange Cell range (e.g. A1:E1) |
||
| 1627 | * @throws Exception |
||
| 1628 | * @return PHPExcel_Worksheet |
||
| 1629 | */ |
||
| 1630 | public function mergeCells($pRange = 'A1:A1') |
||
| 1661 | |||
| 1662 | /** |
||
| 1663 | * Set merge on a cell range by using numeric cell coordinates |
||
| 1664 | * |
||
| 1665 | * @param int $pColumn1 Numeric column coordinate of the first cell |
||
| 1666 | * @param int $pRow1 Numeric row coordinate of the first cell |
||
| 1667 | * @param int $pColumn2 Numeric column coordinate of the last cell |
||
| 1668 | * @param int $pRow2 Numeric row coordinate of the last cell |
||
| 1669 | * @throws Exception |
||
| 1670 | * @return PHPExcel_Worksheet |
||
| 1671 | */ |
||
| 1672 | public function mergeCellsByColumnAndRow($pColumn1 = 0, $pRow1 = 1, $pColumn2 = 0, $pRow2 = 1) |
||
| 1677 | |||
| 1678 | /** |
||
| 1679 | * Remove merge on a cell range |
||
| 1680 | * |
||
| 1681 | * @param string $pRange Cell range (e.g. A1:E1) |
||
| 1682 | * @throws Exception |
||
| 1683 | * @return PHPExcel_Worksheet |
||
| 1684 | */ |
||
| 1685 | public function unmergeCells($pRange = 'A1:A1') |
||
| 1702 | |||
| 1703 | /** |
||
| 1704 | * Remove merge on a cell range by using numeric cell coordinates |
||
| 1705 | * |
||
| 1706 | * @param int $pColumn1 Numeric column coordinate of the first cell |
||
| 1707 | * @param int $pRow1 Numeric row coordinate of the first cell |
||
| 1708 | * @param int $pColumn2 Numeric column coordinate of the last cell |
||
| 1709 | * @param int $pRow2 Numeric row coordinate of the last cell |
||
| 1710 | * @throws Exception |
||
| 1711 | * @return PHPExcel_Worksheet |
||
| 1712 | */ |
||
| 1713 | public function unmergeCellsByColumnAndRow($pColumn1 = 0, $pRow1 = 1, $pColumn2 = 0, $pRow2 = 1) |
||
| 1718 | |||
| 1719 | /** |
||
| 1720 | * Get merge cells array. |
||
| 1721 | * |
||
| 1722 | * @return array[] |
||
| 1723 | */ |
||
| 1724 | public function getMergeCells() |
||
| 1728 | |||
| 1729 | /** |
||
| 1730 | * Set merge cells array for the entire sheet. Use instead mergeCells() to merge |
||
| 1731 | * a single cell range. |
||
| 1732 | * |
||
| 1733 | * @param array |
||
| 1734 | */ |
||
| 1735 | public function setMergeCells($pValue = array()) |
||
| 1741 | |||
| 1742 | /** |
||
| 1743 | * Set protection on a cell range |
||
| 1744 | * |
||
| 1745 | * @param string $pRange Cell (e.g. A1) or cell range (e.g. A1:E1) |
||
| 1746 | * @param string $pPassword Password to unlock the protection |
||
| 1747 | * @param boolean $pAlreadyHashed If the password has already been hashed, set this to true |
||
| 1748 | * @throws Exception |
||
| 1749 | * @return PHPExcel_Worksheet |
||
| 1750 | */ |
||
| 1751 | public function protectCells($pRange = 'A1', $pPassword = '', $pAlreadyHashed = false) |
||
| 1763 | |||
| 1764 | /** |
||
| 1765 | * Set protection on a cell range by using numeric cell coordinates |
||
| 1766 | * |
||
| 1767 | * @param int $pColumn1 Numeric column coordinate of the first cell |
||
| 1768 | * @param int $pRow1 Numeric row coordinate of the first cell |
||
| 1769 | * @param int $pColumn2 Numeric column coordinate of the last cell |
||
| 1770 | * @param int $pRow2 Numeric row coordinate of the last cell |
||
| 1771 | * @param string $pPassword Password to unlock the protection |
||
| 1772 | * @param boolean $pAlreadyHashed If the password has already been hashed, set this to true |
||
| 1773 | * @throws Exception |
||
| 1774 | * @return PHPExcel_Worksheet |
||
| 1775 | */ |
||
| 1776 | public function protectCellsByColumnAndRow($pColumn1 = 0, $pRow1 = 1, $pColumn2 = 0, $pRow2 = 1, $pPassword = '', $pAlreadyHashed = false) |
||
| 1781 | |||
| 1782 | /** |
||
| 1783 | * Remove protection on a cell range |
||
| 1784 | * |
||
| 1785 | * @param string $pRange Cell (e.g. A1) or cell range (e.g. A1:E1) |
||
| 1786 | * @throws Exception |
||
| 1787 | * @return PHPExcel_Worksheet |
||
| 1788 | */ |
||
| 1789 | public function unprotectCells($pRange = 'A1') |
||
| 1801 | |||
| 1802 | /** |
||
| 1803 | * Remove protection on a cell range by using numeric cell coordinates |
||
| 1804 | * |
||
| 1805 | * @param int $pColumn1 Numeric column coordinate of the first cell |
||
| 1806 | * @param int $pRow1 Numeric row coordinate of the first cell |
||
| 1807 | * @param int $pColumn2 Numeric column coordinate of the last cell |
||
| 1808 | * @param int $pRow2 Numeric row coordinate of the last cell |
||
| 1809 | * @param string $pPassword Password to unlock the protection |
||
| 1810 | * @param boolean $pAlreadyHashed If the password has already been hashed, set this to true |
||
| 1811 | * @throws Exception |
||
| 1812 | * @return PHPExcel_Worksheet |
||
| 1813 | */ |
||
| 1814 | public function unprotectCellsByColumnAndRow($pColumn1 = 0, $pRow1 = 1, $pColumn2 = 0, $pRow2 = 1, $pPassword = '', $pAlreadyHashed = false) |
||
| 1819 | |||
| 1820 | /** |
||
| 1821 | * Get protected cells |
||
| 1822 | * |
||
| 1823 | * @return array[] |
||
| 1824 | */ |
||
| 1825 | public function getProtectedCells() |
||
| 1829 | |||
| 1830 | /** |
||
| 1831 | * Get Autofilter Range |
||
| 1832 | * |
||
| 1833 | * @return string |
||
| 1834 | */ |
||
| 1835 | public function getAutoFilter() |
||
| 1839 | |||
| 1840 | /** |
||
| 1841 | * Set Autofilter Range |
||
| 1842 | * |
||
| 1843 | * @param string $pRange Cell range (i.e. A1:E10) |
||
| 1844 | * @throws Exception |
||
| 1845 | * @return PHPExcel_Worksheet |
||
| 1846 | */ |
||
| 1847 | public function setAutoFilter($pRange = '') |
||
| 1860 | |||
| 1861 | /** |
||
| 1862 | * Set Autofilter Range by using numeric cell coordinates |
||
| 1863 | * |
||
| 1864 | * @param int $pColumn1 Numeric column coordinate of the first cell |
||
| 1865 | * @param int $pRow1 Numeric row coordinate of the first cell |
||
| 1866 | * @param int $pColumn2 Numeric column coordinate of the second cell |
||
| 1867 | * @param int $pRow2 Numeric row coordinate of the second cell |
||
| 1868 | * @throws Exception |
||
| 1869 | * @return PHPExcel_Worksheet |
||
| 1870 | */ |
||
| 1871 | public function setAutoFilterByColumnAndRow($pColumn1 = 0, $pRow1 = 1, $pColumn2 = 0, $pRow2 = 1) |
||
| 1879 | |||
| 1880 | /** |
||
| 1881 | * Remove autofilter |
||
| 1882 | * |
||
| 1883 | * @return PHPExcel_Worksheet |
||
| 1884 | */ |
||
| 1885 | public function removeAutoFilter() |
||
| 1890 | |||
| 1891 | /** |
||
| 1892 | * Get Freeze Pane |
||
| 1893 | * |
||
| 1894 | * @return string |
||
| 1895 | */ |
||
| 1896 | public function getFreezePane() |
||
| 1900 | |||
| 1901 | /** |
||
| 1902 | * Freeze Pane |
||
| 1903 | * |
||
| 1904 | * @param string $pCell Cell (i.e. A1) |
||
| 1905 | * @throws Exception |
||
| 1906 | * @return PHPExcel_Worksheet |
||
| 1907 | */ |
||
| 1908 | public function freezePane($pCell = '') |
||
| 1920 | |||
| 1921 | /** |
||
| 1922 | * Freeze Pane by using numeric cell coordinates |
||
| 1923 | * |
||
| 1924 | * @param int $pColumn Numeric column coordinate of the cell |
||
| 1925 | * @param int $pRow Numeric row coordinate of the cell |
||
| 1926 | * @throws Exception |
||
| 1927 | * @return PHPExcel_Worksheet |
||
| 1928 | */ |
||
| 1929 | public function freezePaneByColumnAndRow($pColumn = 0, $pRow = 1) |
||
| 1933 | |||
| 1934 | /** |
||
| 1935 | * Unfreeze Pane |
||
| 1936 | * |
||
| 1937 | * @return PHPExcel_Worksheet |
||
| 1938 | */ |
||
| 1939 | public function unfreezePane() |
||
| 1943 | |||
| 1944 | /** |
||
| 1945 | * Insert a new row, updating all possible related data |
||
| 1946 | * |
||
| 1947 | * @param int $pBefore Insert before this one |
||
| 1948 | * @param int $pNumRows Number of rows to insert |
||
| 1949 | * @throws Exception |
||
| 1950 | * @return PHPExcel_Worksheet |
||
| 1951 | */ |
||
| 1952 | View Code Duplication | public function insertNewRowBefore($pBefore = 1, $pNumRows = 1) { |
|
| 1961 | |||
| 1962 | /** |
||
| 1963 | * Insert a new column, updating all possible related data |
||
| 1964 | * |
||
| 1965 | * @param int $pBefore Insert before this one |
||
| 1966 | * @param int $pNumCols Number of columns to insert |
||
| 1967 | * @throws Exception |
||
| 1968 | * @return PHPExcel_Worksheet |
||
| 1969 | */ |
||
| 1970 | View Code Duplication | public function insertNewColumnBefore($pBefore = 'A', $pNumCols = 1) { |
|
| 1979 | |||
| 1980 | /** |
||
| 1981 | * Insert a new column, updating all possible related data |
||
| 1982 | * |
||
| 1983 | * @param int $pBefore Insert before this one (numeric column coordinate of the cell) |
||
| 1984 | * @param int $pNumCols Number of columns to insert |
||
| 1985 | * @throws Exception |
||
| 1986 | * @return PHPExcel_Worksheet |
||
| 1987 | */ |
||
| 1988 | public function insertNewColumnBeforeByIndex($pBefore = 0, $pNumCols = 1) { |
||
| 1995 | |||
| 1996 | /** |
||
| 1997 | * Delete a row, updating all possible related data |
||
| 1998 | * |
||
| 1999 | * @param int $pRow Remove starting with this one |
||
| 2000 | * @param int $pNumRows Number of rows to remove |
||
| 2001 | * @throws Exception |
||
| 2002 | * @return PHPExcel_Worksheet |
||
| 2003 | */ |
||
| 2004 | View Code Duplication | public function removeRow($pRow = 1, $pNumRows = 1) { |
|
| 2013 | |||
| 2014 | /** |
||
| 2015 | * Remove a column, updating all possible related data |
||
| 2016 | * |
||
| 2017 | * @param int $pColumn Remove starting with this one |
||
| 2018 | * @param int $pNumCols Number of columns to remove |
||
| 2019 | * @throws Exception |
||
| 2020 | * @return PHPExcel_Worksheet |
||
| 2021 | */ |
||
| 2022 | public function removeColumn($pColumn = 'A', $pNumCols = 1) { |
||
| 2032 | |||
| 2033 | /** |
||
| 2034 | * Remove a column, updating all possible related data |
||
| 2035 | * |
||
| 2036 | * @param int $pColumn Remove starting with this one (numeric column coordinate of the cell) |
||
| 2037 | * @param int $pNumCols Number of columns to remove |
||
| 2038 | * @throws Exception |
||
| 2039 | * @return PHPExcel_Worksheet |
||
| 2040 | */ |
||
| 2041 | public function removeColumnByIndex($pColumn = 0, $pNumCols = 1) { |
||
| 2048 | |||
| 2049 | /** |
||
| 2050 | * Show gridlines? |
||
| 2051 | * |
||
| 2052 | * @return boolean |
||
| 2053 | */ |
||
| 2054 | public function getShowGridlines() { |
||
| 2057 | |||
| 2058 | /** |
||
| 2059 | * Set show gridlines |
||
| 2060 | * |
||
| 2061 | * @param boolean $pValue Show gridlines (true/false) |
||
| 2062 | * @return PHPExcel_Worksheet |
||
| 2063 | */ |
||
| 2064 | public function setShowGridlines($pValue = false) { |
||
| 2068 | |||
| 2069 | /** |
||
| 2070 | * Print gridlines? |
||
| 2071 | * |
||
| 2072 | * @return boolean |
||
| 2073 | */ |
||
| 2074 | public function getPrintGridlines() { |
||
| 2077 | |||
| 2078 | /** |
||
| 2079 | * Set print gridlines |
||
| 2080 | * |
||
| 2081 | * @param boolean $pValue Print gridlines (true/false) |
||
| 2082 | * @return PHPExcel_Worksheet |
||
| 2083 | */ |
||
| 2084 | public function setPrintGridlines($pValue = false) { |
||
| 2088 | |||
| 2089 | /** |
||
| 2090 | * Show row and column headers? |
||
| 2091 | * |
||
| 2092 | * @return boolean |
||
| 2093 | */ |
||
| 2094 | public function getShowRowColHeaders() { |
||
| 2097 | |||
| 2098 | /** |
||
| 2099 | * Set show row and column headers |
||
| 2100 | * |
||
| 2101 | * @param boolean $pValue Show row and column headers (true/false) |
||
| 2102 | * @return PHPExcel_Worksheet |
||
| 2103 | */ |
||
| 2104 | public function setShowRowColHeaders($pValue = false) { |
||
| 2108 | |||
| 2109 | /** |
||
| 2110 | * Show summary below? (Row/Column outlining) |
||
| 2111 | * |
||
| 2112 | * @return boolean |
||
| 2113 | */ |
||
| 2114 | public function getShowSummaryBelow() { |
||
| 2117 | |||
| 2118 | /** |
||
| 2119 | * Set show summary below |
||
| 2120 | * |
||
| 2121 | * @param boolean $pValue Show summary below (true/false) |
||
| 2122 | * @return PHPExcel_Worksheet |
||
| 2123 | */ |
||
| 2124 | public function setShowSummaryBelow($pValue = true) { |
||
| 2128 | |||
| 2129 | /** |
||
| 2130 | * Show summary right? (Row/Column outlining) |
||
| 2131 | * |
||
| 2132 | * @return boolean |
||
| 2133 | */ |
||
| 2134 | public function getShowSummaryRight() { |
||
| 2137 | |||
| 2138 | /** |
||
| 2139 | * Set show summary right |
||
| 2140 | * |
||
| 2141 | * @param boolean $pValue Show summary right (true/false) |
||
| 2142 | * @return PHPExcel_Worksheet |
||
| 2143 | */ |
||
| 2144 | public function setShowSummaryRight($pValue = true) { |
||
| 2148 | |||
| 2149 | /** |
||
| 2150 | * Get comments |
||
| 2151 | * |
||
| 2152 | * @return PHPExcel_Comment[] |
||
| 2153 | */ |
||
| 2154 | public function getComments() |
||
| 2158 | |||
| 2159 | /** |
||
| 2160 | * Set comments array for the entire sheet. |
||
| 2161 | * |
||
| 2162 | * @param array of PHPExcel_Comment |
||
| 2163 | * @return PHPExcel_Worksheet |
||
| 2164 | */ |
||
| 2165 | public function setComments($pValue = array()) |
||
| 2171 | |||
| 2172 | /** |
||
| 2173 | * Get comment for cell |
||
| 2174 | * |
||
| 2175 | * @param string $pCellCoordinate Cell coordinate to get comment for |
||
| 2176 | * @return PHPExcel_Comment |
||
| 2177 | * @throws Exception |
||
| 2178 | */ |
||
| 2179 | public function getComment($pCellCoordinate = 'A1') |
||
| 2202 | |||
| 2203 | /** |
||
| 2204 | * Get comment for cell by using numeric cell coordinates |
||
| 2205 | * |
||
| 2206 | * @param int $pColumn Numeric column coordinate of the cell |
||
| 2207 | * @param int $pRow Numeric row coordinate of the cell |
||
| 2208 | * @return PHPExcel_Comment |
||
| 2209 | */ |
||
| 2210 | public function getCommentByColumnAndRow($pColumn = 0, $pRow = 1) |
||
| 2214 | |||
| 2215 | /** |
||
| 2216 | * Get selected cell |
||
| 2217 | * |
||
| 2218 | * @deprecated |
||
| 2219 | * @return string |
||
| 2220 | */ |
||
| 2221 | public function getSelectedCell() |
||
| 2225 | |||
| 2226 | /** |
||
| 2227 | * Get active cell |
||
| 2228 | * |
||
| 2229 | * @return string Example: 'A1' |
||
| 2230 | */ |
||
| 2231 | public function getActiveCell() |
||
| 2235 | |||
| 2236 | /** |
||
| 2237 | * Get selected cells |
||
| 2238 | * |
||
| 2239 | * @return string |
||
| 2240 | */ |
||
| 2241 | public function getSelectedCells() |
||
| 2245 | |||
| 2246 | /** |
||
| 2247 | * Selected cell |
||
| 2248 | * |
||
| 2249 | * @param string $pCoordinate Cell (i.e. A1) |
||
| 2250 | * @return PHPExcel_Worksheet |
||
| 2251 | */ |
||
| 2252 | public function setSelectedCell($pCoordinate = 'A1') |
||
| 2256 | |||
| 2257 | /** |
||
| 2258 | * Select a range of cells. |
||
| 2259 | * |
||
| 2260 | * @param string $pCoordinate Cell range, examples: 'A1', 'B2:G5', 'A:C', '3:6' |
||
| 2261 | * @throws Exception |
||
| 2262 | * @return PHPExcel_Worksheet |
||
| 2263 | */ |
||
| 2264 | public function setSelectedCells($pCoordinate = 'A1') |
||
| 2290 | |||
| 2291 | /** |
||
| 2292 | * Selected cell by using numeric cell coordinates |
||
| 2293 | * |
||
| 2294 | * @param int $pColumn Numeric column coordinate of the cell |
||
| 2295 | * @param int $pRow Numeric row coordinate of the cell |
||
| 2296 | * @throws Exception |
||
| 2297 | * @return PHPExcel_Worksheet |
||
| 2298 | */ |
||
| 2299 | public function setSelectedCellByColumnAndRow($pColumn = 0, $pRow = 1) |
||
| 2303 | |||
| 2304 | /** |
||
| 2305 | * Get right-to-left |
||
| 2306 | * |
||
| 2307 | * @return boolean |
||
| 2308 | */ |
||
| 2309 | public function getRightToLeft() { |
||
| 2312 | |||
| 2313 | /** |
||
| 2314 | * Set right-to-left |
||
| 2315 | * |
||
| 2316 | * @param boolean $value Right-to-left true/false |
||
| 2317 | * @return PHPExcel_Worksheet |
||
| 2318 | */ |
||
| 2319 | public function setRightToLeft($value = false) { |
||
| 2323 | |||
| 2324 | /** |
||
| 2325 | * Fill worksheet from values in array |
||
| 2326 | * |
||
| 2327 | * @param array $source Source array |
||
| 2328 | * @param mixed $nullValue Value in source array that stands for blank cell |
||
| 2329 | * @param string $startCell Insert array starting from this cell address as the top left coordinate |
||
| 2330 | * @param boolean $strictNullComparison Apply strict comparison when testing for null values in the array |
||
| 2331 | * @throws Exception |
||
| 2332 | * @return PHPExcel_Worksheet |
||
| 2333 | */ |
||
| 2334 | public function fromArray($source = null, $nullValue = null, $startCell = 'A1', $strictNullComparison = false) { |
||
| 2368 | |||
| 2369 | /** |
||
| 2370 | * Create array from a range of cells |
||
| 2371 | * |
||
| 2372 | * @param string $pRange Range of cells (i.e. "A1:B10"), or just one cell (i.e. "A1") |
||
| 2373 | * @param mixed $nullValue Value returned in the array entry if a cell doesn't exist |
||
| 2374 | * @param boolean $calculateFormulas Should formulas be calculated? |
||
| 2375 | * @param boolean $formatData Should formatting be applied to cell values? |
||
| 2376 | * @param boolean $returnCellRef False - Return a simple array of rows and columns indexed by number counting from zero |
||
| 2377 | * True - Return rows and columns indexed by their actual row and column IDs |
||
| 2378 | * @return array |
||
| 2379 | */ |
||
| 2380 | public function rangeToArray($pRange = 'A1', $nullValue = null, $calculateFormulas = true, $formatData = true, $returnCellRef = false) { |
||
| 2435 | |||
| 2436 | |||
| 2437 | /** |
||
| 2438 | * Create array from a range of cells |
||
| 2439 | * |
||
| 2440 | * @param string $pNamedRange Name of the Named Range |
||
| 2441 | * @param mixed $nullValue Value returned in the array entry if a cell doesn't exist |
||
| 2442 | * @param boolean $calculateFormulas Should formulas be calculated? |
||
| 2443 | * @param boolean $formatData Should formatting be applied to cell values? |
||
| 2444 | * @param boolean $returnCellRef False - Return a simple array of rows and columns indexed by number counting from zero |
||
| 2445 | * True - Return rows and columns indexed by their actual row and column IDs |
||
| 2446 | * @return array |
||
| 2447 | * @throws Exception |
||
| 2448 | */ |
||
| 2449 | public function namedRangeToArray($pNamedRange = '', $nullValue = null, $calculateFormulas = true, $formatData = true, $returnCellRef = false) { |
||
| 2461 | |||
| 2462 | |||
| 2463 | /** |
||
| 2464 | * Create array from worksheet |
||
| 2465 | * |
||
| 2466 | * @param mixed $nullValue Value returned in the array entry if a cell doesn't exist |
||
| 2467 | * @param boolean $calculateFormulas Should formulas be calculated? |
||
| 2468 | * @param boolean $formatData Should formatting be applied to cell values? |
||
| 2469 | * @param boolean $returnCellRef False - Return a simple array of rows and columns indexed by number counting from zero |
||
| 2470 | * True - Return rows and columns indexed by their actual row and column IDs |
||
| 2471 | * @return array |
||
| 2472 | */ |
||
| 2473 | public function toArray($nullValue = null, $calculateFormulas = true, $formatData = true, $returnCellRef = false) { |
||
| 2484 | |||
| 2485 | /** |
||
| 2486 | * Get row iterator |
||
| 2487 | * |
||
| 2488 | * @param integer $startRow The row number at which to start iterating |
||
| 2489 | * @return PHPExcel_Worksheet_RowIterator |
||
| 2490 | */ |
||
| 2491 | public function getRowIterator($startRow = 1) { |
||
| 2494 | |||
| 2495 | /** |
||
| 2496 | * Run PHPExcel garabage collector. |
||
| 2497 | * |
||
| 2498 | * @return PHPExcel_Worksheet |
||
| 2499 | */ |
||
| 2500 | public function garbageCollect() { |
||
| 2536 | |||
| 2537 | /** |
||
| 2538 | * Get hash code |
||
| 2539 | * |
||
| 2540 | * @return string Hash code |
||
| 2541 | */ |
||
| 2542 | public function getHashCode() { |
||
| 2553 | |||
| 2554 | /** |
||
| 2555 | * Extract worksheet title from range. |
||
| 2556 | * |
||
| 2557 | * Example: extractSheetTitle("testSheet!A1") ==> 'A1' |
||
| 2558 | * Example: extractSheetTitle("'testSheet 1'!A1", true) ==> array('testSheet 1', 'A1'); |
||
| 2559 | * |
||
| 2560 | * @param string $pRange Range to extract title from |
||
| 2561 | * @param bool $returnRange Return range? (see example) |
||
| 2562 | * @return mixed |
||
| 2563 | */ |
||
| 2564 | public static function extractSheetTitle($pRange, $returnRange = false) { |
||
| 2578 | |||
| 2579 | /** |
||
| 2580 | * Get hyperlink |
||
| 2581 | * |
||
| 2582 | * @param string $pCellCoordinate Cell coordinate to get hyperlink for |
||
| 2583 | */ |
||
| 2584 | View Code Duplication | public function getHyperlink($pCellCoordinate = 'A1') |
|
| 2595 | |||
| 2596 | /** |
||
| 2597 | * Set hyperlnk |
||
| 2598 | * |
||
| 2599 | * @param string $pCellCoordinate Cell coordinate to insert hyperlink |
||
| 2600 | * @param PHPExcel_Cell_Hyperlink $pHyperlink |
||
| 2601 | * @return PHPExcel_Worksheet |
||
| 2602 | */ |
||
| 2603 | public function setHyperlink($pCellCoordinate = 'A1', PHPExcel_Cell_Hyperlink $pHyperlink = null) |
||
| 2612 | |||
| 2613 | /** |
||
| 2614 | * Hyperlink at a specific coordinate exists? |
||
| 2615 | * |
||
| 2616 | * @param string $pCoordinate |
||
| 2617 | * @return boolean |
||
| 2618 | */ |
||
| 2619 | public function hyperlinkExists($pCoordinate = 'A1') |
||
| 2623 | |||
| 2624 | /** |
||
| 2625 | * Get collection of hyperlinks |
||
| 2626 | * |
||
| 2627 | * @return PHPExcel_Cell_Hyperlink[] |
||
| 2628 | */ |
||
| 2629 | public function getHyperlinkCollection() |
||
| 2633 | |||
| 2634 | /** |
||
| 2635 | * Get data validation |
||
| 2636 | * |
||
| 2637 | * @param string $pCellCoordinate Cell coordinate to get data validation for |
||
| 2638 | */ |
||
| 2639 | View Code Duplication | public function getDataValidation($pCellCoordinate = 'A1') |
|
| 2650 | |||
| 2651 | /** |
||
| 2652 | * Set data validation |
||
| 2653 | * |
||
| 2654 | * @param string $pCellCoordinate Cell coordinate to insert data validation |
||
| 2655 | * @param PHPExcel_Cell_DataValidation $pDataValidation |
||
| 2656 | * @return PHPExcel_Worksheet |
||
| 2657 | */ |
||
| 2658 | public function setDataValidation($pCellCoordinate = 'A1', PHPExcel_Cell_DataValidation $pDataValidation = null) |
||
| 2667 | |||
| 2668 | /** |
||
| 2669 | * Data validation at a specific coordinate exists? |
||
| 2670 | * |
||
| 2671 | * @param string $pCoordinate |
||
| 2672 | * @return boolean |
||
| 2673 | */ |
||
| 2674 | public function dataValidationExists($pCoordinate = 'A1') |
||
| 2678 | |||
| 2679 | /** |
||
| 2680 | * Get collection of data validations |
||
| 2681 | * |
||
| 2682 | * @return PHPExcel_Cell_DataValidation[] |
||
| 2683 | */ |
||
| 2684 | public function getDataValidationCollection() |
||
| 2688 | |||
| 2689 | /** |
||
| 2690 | * Accepts a range, returning it as a range that falls within the current highest row and column of the worksheet |
||
| 2691 | * |
||
| 2692 | * @param string $range |
||
| 2693 | * @return string Adjusted range value |
||
| 2694 | */ |
||
| 2695 | public function shrinkRangeToFit($range) { |
||
| 2715 | |||
| 2716 | |||
| 2717 | /** |
||
| 2718 | * Get tab color |
||
| 2719 | * |
||
| 2720 | * @return PHPExcel_Style_Color |
||
| 2721 | */ |
||
| 2722 | public function getTabColor() |
||
| 2729 | |||
| 2730 | /** |
||
| 2731 | * Reset tab color |
||
| 2732 | * |
||
| 2733 | * @return PHPExcel_Worksheet |
||
| 2734 | */ |
||
| 2735 | public function resetTabColor() |
||
| 2742 | |||
| 2743 | /** |
||
| 2744 | * Tab color set? |
||
| 2745 | * |
||
| 2746 | * @return boolean |
||
| 2747 | */ |
||
| 2748 | public function isTabColorSet() |
||
| 2752 | |||
| 2753 | /** |
||
| 2754 | * Copy worksheet (!= clone!) |
||
| 2755 | * |
||
| 2756 | * @return PHPExcel_Worksheet |
||
| 2757 | */ |
||
| 2758 | public function copy() { |
||
| 2763 | |||
| 2764 | /** |
||
| 2765 | * Implement PHP __clone to create a deep clone, not just a shallow copy. |
||
| 2766 | */ |
||
| 2767 | public function __clone() { |
||
| 2787 | } |
||
| 2788 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..