From c2f5bd844d4e803d07203853bb3b738c919d9b6e Mon Sep 17 00:00:00 2001 From: MarkBaker Date: Mon, 25 May 2015 17:28:50 +0100 Subject: [PATCH] A lot of namespacing work --- classes/Autoloader.php | 8 +- classes/src/Autoloader.php | 81 -- classes/src/CachedObjectStorage/APC.php | 32 +- classes/src/CachedObjectStorage/CacheBase.php | 39 +- classes/src/CachedObjectStorage/DiscISAM.php | 16 +- classes/src/CachedObjectStorage/ICache.php | 25 +- classes/src/CachedObjectStorage/Igbinary.php | 24 +- classes/src/CachedObjectStorage/Memcache.php | 28 +- classes/src/CachedObjectStorage/Memory.php | 18 +- .../src/CachedObjectStorage/MemoryGZip.php | 14 +- .../CachedObjectStorage/MemorySerialized.php | 14 +- classes/src/CachedObjectStorage/PHPTemp.php | 22 +- classes/src/CachedObjectStorage/SQLite.php | 30 +- classes/src/CachedObjectStorage/SQLite3.php | 22 +- classes/src/CachedObjectStorage/Wincache.php | 19 +- classes/src/CachedObjectStorageFactory.php | 139 +-- .../src/CalcEngine/CyclicReferenceStack.php | 4 +- classes/src/CalcEngine/Logger.php | 6 +- classes/src/Calculation.php | 884 +++++++++--------- classes/src/Calculation/Categories.php | 150 +++ classes/src/Calculation/Database.php | 11 +- classes/src/Calculation/DateTime.php | 11 +- classes/src/Calculation/Engineering.php | 11 +- classes/src/Calculation/Exception.php | 4 +- classes/src/Calculation/ExceptionHandler.php | 4 +- classes/src/Calculation/Financial.php | 11 +- classes/src/Calculation/FormulaParser.php | 45 +- classes/src/Calculation/FormulaToken.php | 46 +- classes/src/Calculation/Function.php | 4 +- classes/src/Calculation/Functions.php | 12 +- classes/src/Calculation/Logical.php | 9 +- classes/src/Calculation/LookupRef.php | 11 +- classes/src/Calculation/MathTrig.php | 11 +- classes/src/Calculation/Statistical.php | 12 +- classes/src/Calculation/TextData.php | 21 +- classes/src/Cell.php | 180 ++-- classes/src/Cell/AdvancedValueBinder.php | 13 +- classes/src/Cell/DataType.php | 10 +- classes/src/Cell/DataValidation.php | 44 +- classes/src/Cell/DefaultValueBinder.php | 45 +- classes/src/Cell/Hyperlink.php | 4 +- classes/src/Cell/IValueBinder.php | 17 +- classes/src/Chart.php | 14 +- classes/src/Chart/Axis.php | 4 +- classes/src/Chart/DataSeries.php | 14 +- classes/src/Chart/DataSeriesValues.php | 4 +- classes/src/Chart/Exception.php | 4 +- classes/src/Chart/GridLines.php | 4 +- classes/src/Chart/Layout.php | 16 +- classes/src/Chart/Legend.php | 4 +- classes/src/Chart/PlotArea.php | 6 +- classes/src/Chart/Properties.php | 5 +- classes/src/Chart/Renderer/jpgraph.php | 12 +- classes/src/Chart/Title.php | 16 +- classes/src/Comment.php | 4 +- classes/src/Document/Properties.php | 6 +- classes/src/Document/Security.php | 22 +- classes/src/Exception.php | 16 +- classes/src/HashTable.php | 38 +- classes/src/Helper/HTML.php | 8 +- classes/src/IOFactory.php | 11 +- classes/src/NamedRange.php | 4 +- classes/src/ReferenceHelper.php | 168 ++-- classes/src/RichText.php | 4 +- classes/src/RichText/ITextElement.php | 4 +- classes/src/RichText/Run.php | 4 +- classes/src/RichText/TextElement.php | 4 +- classes/src/Settings.php | 11 +- classes/src/Shared/CodePage.php | 4 +- classes/src/Shared/Date.php | 28 +- classes/src/Shared/Drawing.php | 14 +- classes/src/Shared/Escher.php | 4 +- classes/src/Shared/Excel5.php | 4 +- classes/src/Shared/File.php | 4 +- classes/src/Shared/Font.php | 16 +- classes/src/Shared/OLE.php | 5 +- classes/src/Shared/OLERead.php | 5 +- classes/src/Shared/PasswordHasher.php | 16 +- classes/src/Shared/String.php | 4 +- classes/src/Shared/TimeZone.php | 15 +- classes/src/Shared/XMLWriter.php | 4 +- classes/src/Shared/ZipArchive.php | 4 +- classes/src/Shared/ZipStreamWrapper.php | 4 +- classes/src/Spreadsheet.php | 40 +- classes/src/Style.php | 90 +- classes/src/Style/Alignment.php | 9 +- classes/src/Style/Border.php | 38 +- classes/src/Style/Borders.php | 80 +- classes/src/Style/Color.php | 4 +- classes/src/Style/Conditional.php | 16 +- classes/src/Style/Fill.php | 56 +- classes/src/Style/Font.php | 52 +- classes/src/Style/NumberFormat.php | 28 +- classes/src/Style/Protection.php | 4 +- classes/src/Style/Supervisor.php | 4 +- classes/src/Worksheet.php | 650 ++++++------- classes/src/Worksheet/AutoFilter.php | 8 +- classes/src/Worksheet/BaseDrawing.php | 4 +- classes/src/Worksheet/CellIterator.php | 4 +- classes/src/Worksheet/Column.php | 4 +- classes/src/Worksheet/ColumnCellIterator.php | 4 +- classes/src/Worksheet/ColumnDimension.php | 4 +- classes/src/Worksheet/ColumnIterator.php | 4 +- classes/src/Worksheet/Dimension.php | 4 +- classes/src/Worksheet/Drawing.php | 4 +- classes/src/Worksheet/HeaderFooter.php | 5 +- classes/src/Worksheet/HeaderFooterDrawing.php | 4 +- classes/src/Worksheet/MemoryDrawing.php | 4 +- classes/src/Worksheet/PageMargins.php | 16 +- classes/src/Worksheet/PageSetup.php | 70 +- classes/src/Worksheet/Protection.php | 16 +- classes/src/Worksheet/Row.php | 4 +- classes/src/Worksheet/RowCellIterator.php | 4 +- classes/src/Worksheet/RowDimension.php | 4 +- classes/src/Worksheet/RowIterator.php | 4 +- classes/src/Worksheet/SheetView.php | 4 +- 116 files changed, 1967 insertions(+), 1928 deletions(-) delete mode 100644 classes/src/Autoloader.php create mode 100644 classes/src/Calculation/Categories.php diff --git a/classes/Autoloader.php b/classes/Autoloader.php index db7f6acf..50854633 100644 --- a/classes/Autoloader.php +++ b/classes/Autoloader.php @@ -34,7 +34,8 @@ class Autoloader * Register the Autoloader with SPL * */ - public static function register() { + public static function register() + { if (function_exists('__autoload')) { // Register any existing autoloader function with SPL, so we don't get any clashes spl_autoload_register('__autoload'); @@ -49,7 +50,8 @@ class Autoloader * * @param string $className Name of the object to load */ - public static function load($className) { + public static function load($className) + { if ((class_exists($className, false)) || (strpos($className, 'PHPExcel\\') !== 0)) { // Either already loaded, or not a PHPExcel class request return false; @@ -66,4 +68,4 @@ class Autoloader } require($classFilePath); } -} \ No newline at end of file +} diff --git a/classes/src/Autoloader.php b/classes/src/Autoloader.php deleted file mode 100644 index c3b95a20..00000000 --- a/classes/src/Autoloader.php +++ /dev/null @@ -1,81 +0,0 @@ -= 0) { - return spl_autoload_register(array('PHPExcel_Autoloader', 'load'), true, true); - } else { - return spl_autoload_register(array('PHPExcel_Autoloader', 'load')); - } - } - - /** - * Autoload a class identified by name - * - * @param string $pClassName Name of the object to load - */ - public static function load($pClassName) - { - if ((class_exists($pClassName, false)) || (strpos($pClassName, 'PHPExcel') !== 0)) { - // Either already loaded, or not a PHPExcel class request - return false; - } - - $pClassFilePath = PHPEXCEL_ROOT . - str_replace('_', DIRECTORY_SEPARATOR, $pClassName) . - '.php'; - - if ((file_exists($pClassFilePath) === false) || (is_readable($pClassFilePath) === false)) { - // Can't load - return false; - } - - require($pClassFilePath); - } -} diff --git a/classes/src/CachedObjectStorage/APC.php b/classes/src/CachedObjectStorage/APC.php index c74b07fe..b354adda 100644 --- a/classes/src/CachedObjectStorage/APC.php +++ b/classes/src/CachedObjectStorage/APC.php @@ -1,5 +1,7 @@ cacheTime )) { $this->__destruct(); - throw new PHPExcel_Exception('Failed to store cell ' . $this->currentObjectID . ' in APC'); + throw new \PHPExcel\Exception('Failed to store cell ' . $this->currentObjectID . ' in APC'); } $this->currentCellIsDirty = false; } @@ -74,11 +75,11 @@ class PHPExcel_CachedObjectStorage_APC extends PHPExcel_CachedObjectStorage_Cach * * @access public * @param string $pCoord Coordinate address of the cell to update - * @param PHPExcel_Cell $cell Cell to update - * @return PHPExcel_Cell - * @throws PHPExcel_Exception + * @param \PHPExcel\Cell $cell Cell to update + * @return \PHPExcel\Cell + * @throws \PHPExcel\Exception */ - public function addCacheData($pCoord, PHPExcel_Cell $cell) + public function addCacheData($pCoord, \PHPExcel\Cell $cell) { if (($pCoord !== $this->currentObjectID) && ($this->currentObjectID !== null)) { $this->storeData(); @@ -97,7 +98,7 @@ class PHPExcel_CachedObjectStorage_APC extends PHPExcel_CachedObjectStorage_Cach * * @access public * @param string $pCoord Coordinate address of the cell to check - * @throws PHPExcel_Exception + * @throws \PHPExcel\Exception * @return boolean */ public function isDataSet($pCoord) @@ -112,7 +113,7 @@ class PHPExcel_CachedObjectStorage_APC extends PHPExcel_CachedObjectStorage_Cach if ($success === false) { // Entry no longer exists in APC, so clear it from the cache array parent::deleteCacheData($pCoord); - throw new PHPExcel_Exception('Cell entry '.$pCoord.' no longer exists in APC cache'); + throw new \PHPExcel\Exception('Cell entry '.$pCoord.' no longer exists in APC cache'); } return true; } @@ -191,11 +192,10 @@ class PHPExcel_CachedObjectStorage_APC extends PHPExcel_CachedObjectStorage_Cach * Clone the cell collection * * @access public - * @param PHPExcel_Worksheet $parent The new worksheet - * @throws PHPExcel_Exception - * @return void + * @param \PHPExcel\Worksheet $parent The new worksheet that we're copying to + * @throws \PHPExcel\Exception */ - public function copyCellCollection(PHPExcel_Worksheet $parent) + public function copyCellCollection(\PHPExcel\Worksheet $parent) { parent::copyCellCollection($parent); // Get a new id for the new file name @@ -208,11 +208,11 @@ class PHPExcel_CachedObjectStorage_APC extends PHPExcel_CachedObjectStorage_Cach if ($obj === false) { // Entry no longer exists in APC, so clear it from the cache array parent::deleteCacheData($cellID); - throw new PHPExcel_Exception('Cell entry ' . $cellID . ' no longer exists in APC'); + throw new \PHPExcel\Exception('Cell entry ' . $cellID . ' no longer exists in APC'); } if (!apc_store($newCachePrefix . $cellID . '.cache', $obj, $this->cacheTime)) { $this->__destruct(); - throw new PHPExcel_Exception('Failed to store cell ' . $cellID . ' in APC'); + throw new \PHPExcel\Exception('Failed to store cell ' . $cellID . ' in APC'); } } } diff --git a/classes/src/CachedObjectStorage/CacheBase.php b/classes/src/CachedObjectStorage/CacheBase.php index 9a12ec86..0e89f596 100644 --- a/classes/src/CachedObjectStorage/CacheBase.php +++ b/classes/src/CachedObjectStorage/CacheBase.php @@ -1,5 +1,7 @@ parent = $parent; } @@ -79,7 +81,7 @@ abstract class PHPExcel_CachedObjectStorage_CacheBase /** * Return the parent worksheet for this cell collection * - * @return PHPExcel_Worksheet + * @return \PHPExcel\Worksheet */ public function getParent() { @@ -87,7 +89,7 @@ abstract class PHPExcel_CachedObjectStorage_CacheBase } /** - * Is a value set in the current PHPExcel_CachedObjectStorage_ICache for an indexed cell? + * Is a value set in the current \PHPExcel\CachedObjectStorage\ICache for an indexed cell? * * @param string $pCoord Coordinate address of the cell to check * @return boolean @@ -125,11 +127,11 @@ abstract class PHPExcel_CachedObjectStorage_CacheBase /** * Add or Update a cell in cache * - * @param PHPExcel_Cell $cell Cell to update - * @return PHPExcel_Cell - * @throws PHPExcel_Exception + * @param \PHPExcel\Cell $cell Cell to update + * @return \PHPExcel\Cell + * @throws \PHPExcel\Exception */ - public function updateCacheData(PHPExcel_Cell $cell) + public function updateCacheData(\PHPExcel\Cell $cell) { return $this->addCacheData($cell->getCoordinate(), $cell); } @@ -138,7 +140,7 @@ abstract class PHPExcel_CachedObjectStorage_CacheBase * Delete a cell in cache identified by coordinate address * * @param string $pCoord Coordinate address of the cell to delete - * @throws PHPExcel_Exception + * @throws \PHPExcel\Exception */ public function deleteCacheData($pCoord) { @@ -260,9 +262,9 @@ abstract class PHPExcel_CachedObjectStorage_CacheBase if ($r != $row) { continue; } - $columnList[] = PHPExcel_Cell::columnIndexFromString($c); + $columnList[] = \PHPExcel\Cell::columnIndexFromString($c); } - return PHPExcel_Cell::stringFromColumnIndex(max($columnList) - 1); + return \PHPExcel\Cell::stringFromColumnIndex(max($columnList) - 1); } /** @@ -309,10 +311,9 @@ abstract class PHPExcel_CachedObjectStorage_CacheBase /** * Clone the cell collection * - * @param PHPExcel_Worksheet $parent The new worksheet - * @return void + * @param \PHPExcel\Worksheet $parent The new worksheet that we're copying to */ - public function copyCellCollection(PHPExcel_Worksheet $parent) + public function copyCellCollection(\PHPExcel\Worksheet $parent) { $this->currentCellIsDirty; $this->storeData(); @@ -321,7 +322,7 @@ abstract class PHPExcel_CachedObjectStorage_CacheBase if (($this->currentObject !== null) && (is_object($this->currentObject))) { $this->currentObject->attach($this); } - } // function copyCellCollection() + } /** * Remove a row, deleting all cells in that row diff --git a/classes/src/CachedObjectStorage/DiscISAM.php b/classes/src/CachedObjectStorage/DiscISAM.php index 13bc0337..1aa6b176 100644 --- a/classes/src/CachedObjectStorage/DiscISAM.php +++ b/classes/src/CachedObjectStorage/DiscISAM.php @@ -1,5 +1,7 @@ currentObjectID) && ($this->currentObjectID !== null)) { $this->storeData(); @@ -140,9 +142,9 @@ class PHPExcel_CachedObjectStorage_DiscISAM extends PHPExcel_CachedObjectStorage /** * Clone the cell collection * - * @param PHPExcel_Worksheet $parent The new worksheet + * @param \PHPExcel\Worksheet $parent The new worksheet that we're copying to */ - public function copyCellCollection(PHPExcel_Worksheet $parent) + public function copyCellCollection(\PHPExcel\Worksheet $parent) { parent::copyCellCollection($parent); // Get a new id for the new file name diff --git a/classes/src/CachedObjectStorage/ICache.php b/classes/src/CachedObjectStorage/ICache.php index aafef6e9..56d6226d 100644 --- a/classes/src/CachedObjectStorage/ICache.php +++ b/classes/src/CachedObjectStorage/ICache.php @@ -1,5 +1,7 @@ currentObjectID) && ($this->currentObjectID !== null)) { $this->storeData(); @@ -65,15 +67,15 @@ class PHPExcel_CachedObjectStorage_Igbinary extends PHPExcel_CachedObjectStorage $this->currentCellIsDirty = true; return $cell; - } // function addCacheData() + } /** * Get cell at a specific coordinate * * @param string $pCoord Coordinate of the cell - * @throws PHPExcel_Exception - * @return PHPExcel_Cell Cell that was found, or null if not found + * @throws \PHPExcel\Exception + * @return \PHPExcel\Cell Cell that was found, or null if not found */ public function getCacheData($pCoord) { diff --git a/classes/src/CachedObjectStorage/Memcache.php b/classes/src/CachedObjectStorage/Memcache.php index 07942cc3..1720803a 100644 --- a/classes/src/CachedObjectStorage/Memcache.php +++ b/classes/src/CachedObjectStorage/Memcache.php @@ -1,5 +1,7 @@ memcache->replace($this->cachePrefix . $this->currentObjectID . '.cache', $obj, null, $this->cacheTime)) { if (!$this->memcache->add($this->cachePrefix . $this->currentObjectID . '.cache', $obj, null, $this->cacheTime)) { $this->__destruct(); - throw new PHPExcel_Exception("Failed to store cell {$this->currentObjectID} in MemCache"); + throw new \PHPExcel\Exception("Failed to store cell {$this->currentObjectID} in MemCache"); } } $this->currentCellIsDirty = false; } $this->currentObjectID = $this->currentObject = null; - } // function _storeData() + } /** * Add or Update a cell in cache identified by coordinate address * - * @param string $pCoord Coordinate address of the cell to update - * @param PHPExcel_Cell $cell Cell to update - * @return PHPExcel_Cell - * @throws PHPExcel_Exception + * @param string $pCoord Coordinate address of the cell to update + * @param \PHPExcel\Cell $cell Cell to update + * @return \PHPExcel\Cell + * @throws \PHPExcel\Exception */ - public function addCacheData($pCoord, PHPExcel_Cell $cell) + public function addCacheData($pCoord, \PHPExcel\Cell $cell) { if (($pCoord !== $this->currentObjectID) && ($this->currentObjectID !== null)) { $this->storeData(); @@ -94,7 +95,7 @@ class PHPExcel_CachedObjectStorage_Memcache extends PHPExcel_CachedObjectStorage $this->currentCellIsDirty = true; return $cell; - } // function addCacheData() + } /** @@ -193,10 +194,9 @@ class PHPExcel_CachedObjectStorage_Memcache extends PHPExcel_CachedObjectStorage /** * Clone the cell collection * - * @param PHPExcel_Worksheet $parent The new worksheet - * @return void + * @param \PHPExcel\Worksheet $parent The new worksheet that we're copying to */ - public function copyCellCollection(PHPExcel_Worksheet $parent) + public function copyCellCollection(\PHPExcel\Worksheet $parent) { parent::copyCellCollection($parent); // Get a new id for the new file name diff --git a/classes/src/CachedObjectStorage/Memory.php b/classes/src/CachedObjectStorage/Memory.php index 0e2ea0b0..865a7f1f 100644 --- a/classes/src/CachedObjectStorage/Memory.php +++ b/classes/src/CachedObjectStorage/Memory.php @@ -1,5 +1,7 @@ cellCache[$pCoord] = $cell; @@ -82,9 +84,9 @@ class PHPExcel_CachedObjectStorage_Memory extends PHPExcel_CachedObjectStorage_C /** * Clone the cell collection * - * @param PHPExcel_Worksheet $parent The new worksheet + * @param \PHPExcel\Worksheet $parent The new worksheet that we're copying to */ - public function copyCellCollection(PHPExcel_Worksheet $parent) + public function copyCellCollection(\PHPExcel\Worksheet $parent) { parent::copyCellCollection($parent); diff --git a/classes/src/CachedObjectStorage/MemoryGZip.php b/classes/src/CachedObjectStorage/MemoryGZip.php index c06ec714..76c28fbd 100644 --- a/classes/src/CachedObjectStorage/MemoryGZip.php +++ b/classes/src/CachedObjectStorage/MemoryGZip.php @@ -1,5 +1,7 @@ currentObjectID) && ($this->currentObjectID !== null)) { $this->storeData(); diff --git a/classes/src/CachedObjectStorage/MemorySerialized.php b/classes/src/CachedObjectStorage/MemorySerialized.php index 13325149..aefad66b 100644 --- a/classes/src/CachedObjectStorage/MemorySerialized.php +++ b/classes/src/CachedObjectStorage/MemorySerialized.php @@ -1,5 +1,7 @@ currentObjectID) && ($this->currentObjectID !== null)) { $this->storeData(); diff --git a/classes/src/CachedObjectStorage/PHPTemp.php b/classes/src/CachedObjectStorage/PHPTemp.php index 43c78197..ed32935b 100644 --- a/classes/src/CachedObjectStorage/PHPTemp.php +++ b/classes/src/CachedObjectStorage/PHPTemp.php @@ -1,5 +1,7 @@ currentObjectID) && ($this->currentObjectID !== null)) { $this->storeData(); @@ -135,10 +136,9 @@ class PHPExcel_CachedObjectStorage_PHPTemp extends PHPExcel_CachedObjectStorage_ /** * Clone the cell collection * - * @param PHPExcel_Worksheet $parent The new worksheet - * @return void + * @param \PHPExcel\Worksheet $parent The new worksheet that we're copying to */ - public function copyCellCollection(PHPExcel_Worksheet $parent) + public function copyCellCollection(\PHPExcel\Worksheet $parent) { parent::copyCellCollection($parent); // Open a new stream for the cell cache data diff --git a/classes/src/CachedObjectStorage/SQLite.php b/classes/src/CachedObjectStorage/SQLite.php index e7b50c5b..891f76b5 100644 --- a/classes/src/CachedObjectStorage/SQLite.php +++ b/classes/src/CachedObjectStorage/SQLite.php @@ -1,5 +1,7 @@ currentObject->detach(); if (!$this->DBHandle->queryExec("INSERT OR REPLACE INTO kvp_".$this->TableName." VALUES('".$this->currentObjectID."','".sqlite_escape_string(serialize($this->currentObject))."')")) { - throw new PHPExcel_Exception(sqlite_error_string($this->DBHandle->lastError())); + throw new \PHPExcel\Exception(sqlite_error_string($this->DBHandle->lastError())); } $this->currentCellIsDirty = false; } @@ -64,12 +65,12 @@ class PHPExcel_CachedObjectStorage_SQLite extends PHPExcel_CachedObjectStorage_C /** * Add or Update a cell in cache identified by coordinate address * - * @param string $pCoord Coordinate address of the cell to update - * @param PHPExcel_Cell $cell Cell to update - * @return PHPExcel_Cell - * @throws PHPExcel_Exception + * @param string $pCoord Coordinate address of the cell to update + * @param \PHPExcel\Cell $cell Cell to update + * @return \PHPExcel\Cell + * @throws \PHPExcel\Exception */ - public function addCacheData($pCoord, PHPExcel_Cell $cell) + public function addCacheData($pCoord, \PHPExcel\Cell $cell) { if (($pCoord !== $this->currentObjectID) && ($this->currentObjectID !== null)) { $this->storeData(); @@ -85,9 +86,9 @@ class PHPExcel_CachedObjectStorage_SQLite extends PHPExcel_CachedObjectStorage_C /** * Get cell at a specific coordinate * - * @param string $pCoord Coordinate of the cell - * @throws PHPExcel_Exception - * @return PHPExcel_Cell Cell that was found, or null if not found + * @param string $pCoord Coordinate of the cell + * @throws \PHPExcel\Exception + * @return \PHPExcel\Cell Cell that was found, or null if not found */ public function getCacheData($pCoord) { @@ -219,10 +220,9 @@ class PHPExcel_CachedObjectStorage_SQLite extends PHPExcel_CachedObjectStorage_C /** * Clone the cell collection * - * @param PHPExcel_Worksheet $parent The new worksheet - * @return void + * @param \PHPExcel\Worksheet $parent The new worksheet that we're copying to */ - public function copyCellCollection(PHPExcel_Worksheet $parent) + public function copyCellCollection(\PHPExcel\Worksheet $parent) { $this->currentCellIsDirty; $this->storeData(); diff --git a/classes/src/CachedObjectStorage/SQLite3.php b/classes/src/CachedObjectStorage/SQLite3.php index 27473d6c..739e0da4 100644 --- a/classes/src/CachedObjectStorage/SQLite3.php +++ b/classes/src/CachedObjectStorage/SQLite3.php @@ -1,5 +1,7 @@ insertQuery->bindValue('data', serialize($this->currentObject), SQLITE3_BLOB); $result = $this->insertQuery->execute(); if ($result === false) { - throw new PHPExcel_Exception($this->DBHandle->lastErrorMsg()); + throw new \PHPExcel\Exception($this->DBHandle->lastErrorMsg()); } $this->currentCellIsDirty = false; } @@ -95,10 +96,10 @@ class PHPExcel_CachedObjectStorage_SQLite3 extends PHPExcel_CachedObjectStorage_ /** * Add or Update a cell in cache identified by coordinate address * - * @param string $pCoord Coordinate address of the cell to update - * @param PHPExcel_Cell $cell Cell to update - * @return PHPExcel_Cell - * @throws PHPExcel_Exception + * @param string $pCoord Coordinate address of the cell to update + * @param \PHPExcel\Cell $cell Cell to update + * @return \PHPExcel\Cell + * @throws \PHPExcel\Exception */ public function addCacheData($pCoord, PHPExcel_Cell $cell) { @@ -252,10 +253,9 @@ class PHPExcel_CachedObjectStorage_SQLite3 extends PHPExcel_CachedObjectStorage_ /** * Clone the cell collection * - * @param PHPExcel_Worksheet $parent The new worksheet - * @return void + * @param \PHPExcel\Worksheet $parent The new worksheet that we're copying to */ - public function copyCellCollection(PHPExcel_Worksheet $parent) + public function copyCellCollection(\PHPExcel\Worksheet $parent) { $this->currentCellIsDirty; $this->storeData(); diff --git a/classes/src/CachedObjectStorage/Wincache.php b/classes/src/CachedObjectStorage/Wincache.php index 1567874f..bcf6fa08 100644 --- a/classes/src/CachedObjectStorage/Wincache.php +++ b/classes/src/CachedObjectStorage/Wincache.php @@ -1,5 +1,7 @@ currentObjectID) && ($this->currentObjectID !== null)) { $this->storeData(); @@ -192,10 +194,9 @@ class PHPExcel_CachedObjectStorage_Wincache extends PHPExcel_CachedObjectStorage /** * Clone the cell collection * - * @param PHPExcel_Worksheet $parent The new worksheet - * @return void + * @param \PHPExcel\Worksheet $parent The new worksheet that we're copying to */ - public function copyCellCollection(PHPExcel_Worksheet $parent) + public function copyCellCollection(\PHPExcel\Worksheet $parent) { parent::copyCellCollection($parent); // Get a new id for the new file name diff --git a/classes/src/CachedObjectStorageFactory.php b/classes/src/CachedObjectStorageFactory.php index 0a969786..219c1944 100644 --- a/classes/src/CachedObjectStorageFactory.php +++ b/classes/src/CachedObjectStorageFactory.php @@ -1,5 +1,7 @@ array( - ), - self::cache_in_memory_gzip => array( - ), - self::cache_in_memory_serialized => array( - ), - self::cache_igbinary => array( - ), - self::cache_to_phpTemp => array( 'memoryCacheSize' => '1MB' - ), - self::cache_to_discISAM => array( 'dir' => null - ), - self::cache_to_apc => array( 'cacheTime' => 600 - ), - self::cache_to_memcache => array( 'memcacheServer' => 'localhost', - 'memcachePort' => 11211, - 'cacheTime' => 600 - ), - self::cache_to_wincache => array( 'cacheTime' => 600 - ), - self::cache_to_sqlite => array( - ), - self::cache_to_sqlite3 => array( - ), - ); + private static $storageMethodDefaultParameters = [ + self::CACHE_IN_MEMORY => [], + self::CACHE_IN_MEMORY_GZIP => [], + self::CACHE_IN_MEMORY_SERIALIZED => [], + self::CACHE_IGBINARY => [], + self::CACHE_TO_PHPTEMP => [ + 'memoryCacheSize' => '1MB', + ], + self::CACHE_TO_DISCISAM => [ + 'dir' => null, + ], + self::CACHE_TO_APC => [ + 'cacheTime' => 600, + ], + self::CACHE_TO_MEMCACHE => [ + 'memcacheServer' => 'localhost', + 'memcachePort' => 11211, + 'cacheTime' => 600, + ], + self::CACHE_TO_WINCACHE => [ + 'cacheTime' => 600, + ], + self::CACHE_TO_SQLITE => [], + self::CACHE_TO_SQLITE3 => [], + ]; /** * Arguments for the active cache storage method * - * @var array of mixed array + * @var mixed[] */ - private static $storageMethodParameters = array(); + private static $storageMethodParameters = []; + /** * Return the current cache storage method @@ -124,7 +126,7 @@ class PHPExcel_CachedObjectStorageFactory /** * Return the current cache storage class * - * @return PHPExcel_CachedObjectStorage_ICache|null + * @return \CachedObjectStorage\ICache|null **/ public static function getCacheStorageClass() { @@ -161,32 +163,31 @@ class PHPExcel_CachedObjectStorageFactory /** * Identify the cache storage method to use * - * @param string $method Name of the method to use for cell cacheing - * @param array of mixed $arguments Additional arguments to pass to the cell caching class + * @param string $method Name of the method to use for cell cacheing + * @param mixed[] $arguments Additional arguments to pass to the cell caching class * when instantiating * @return boolean **/ - public static function initialize($method = self::cache_in_memory, $arguments = array()) + public static function initialize($method = self::CACHE_IN_MEMORY, $arguments = []) { if (!in_array($method, self::$storageMethods)) { return false; } - $cacheStorageClass = 'PHPExcel_CachedObjectStorage_'.$method; - if (!call_user_func(array( $cacheStorageClass, - 'cacheMethodIsAvailable'))) { + $cacheStorageClass = '\\PHPExcel\\CachedObjectStorage\\'.$method; + if (!call_user_func([$cacheStorageClass, 'cacheMethodIsAvailable'])) { return false; } self::$storageMethodParameters[$method] = self::$storageMethodDefaultParameters[$method]; - foreach ($arguments as $k => $v) { - if (array_key_exists($k, self::$storageMethodParameters[$method])) { - self::$storageMethodParameters[$method][$k] = $v; + foreach ($arguments as $argument => $value) { + if (array_key_exists($argument, self::$storageMethodParameters[$method])) { + self::$storageMethodParameters[$method][$argument] = $value; } } if (self::$cacheStorageMethod === null) { - self::$cacheStorageClass = 'PHPExcel_CachedObjectStorage_' . $method; + self::$cacheStorageClass = '\\PHPExcel\\CachedObjectStorage\\' . $method; self::$cacheStorageMethod = $method; } return true; @@ -195,10 +196,10 @@ class PHPExcel_CachedObjectStorageFactory /** * Initialise the cache storage * - * @param PHPExcel_Worksheet $parent Enable cell caching for this worksheet - * @return PHPExcel_CachedObjectStorage_ICache + * @param Worksheet $parent Enable cell caching for this worksheet + * @return CachedObjectStorage\ICache **/ - public static function getInstance(PHPExcel_Worksheet $parent) + public static function getInstance(Worksheet $parent) { $cacheMethodIsAvailable = true; if (self::$cacheStorageMethod === null) { diff --git a/classes/src/CalcEngine/CyclicReferenceStack.php b/classes/src/CalcEngine/CyclicReferenceStack.php index 1072fc75..5ddb6290 100644 --- a/classes/src/CalcEngine/CyclicReferenceStack.php +++ b/classes/src/CalcEngine/CyclicReferenceStack.php @@ -1,5 +1,7 @@ cellStack = $stack; } diff --git a/classes/src/Calculation.php b/classes/src/Calculation.php index 49d6e460..378c3604 100644 --- a/classes/src/Calculation.php +++ b/classes/src/Calculation.php @@ -18,7 +18,7 @@ if (!defined('CALCULATION_REGEXP_CELLREF')) { } /** - * PHPExcel\Calculation (Multiton) + * \PHPExcel\Calculation (Multiton) * * Copyright (c) 2006 - 2015 PHPExcel * @@ -74,7 +74,7 @@ class Calculation * Instance of this class * * @access private - * @var PHPExcel_Calculation + * @var \PHPExcel\Calculation */ private static $instance; @@ -91,7 +91,7 @@ class Calculation * List of instances of the calculation engine that we've instantiated for individual spreadsheets * * @access private - * @var PHPExcel_Calculation[] + * @var \PHPExcel\Calculation[] */ private static $spreadsheetSets; @@ -265,1788 +265,1788 @@ class Calculation // PHPExcel functions private static $PHPExcelFunctions = array( 'ABS' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, 'functionCall' => 'abs', 'argumentCount' => '1' ), 'ACCRINT' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'category' => Calculation\Categories::CATEGORY_FINANCIAL, 'functionCall' => 'PHPExcel_Calculation_Financial::ACCRINT', 'argumentCount' => '4-7' ), 'ACCRINTM' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'category' => Calculation\Categories::CATEGORY_FINANCIAL, 'functionCall' => 'PHPExcel_Calculation_Financial::ACCRINTM', 'argumentCount' => '3-5' ), 'ACOS' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, 'functionCall' => 'acos', 'argumentCount' => '1' ), 'ACOSH' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, 'functionCall' => 'acosh', 'argumentCount' => '1' ), 'ADDRESS' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_LOOKUP_AND_REFERENCE, + 'category' => Calculation\Categories::CATEGORY_LOOKUP_AND_REFERENCE, 'functionCall' => 'PHPExcel_Calculation_LookupRef::CELL_ADDRESS', 'argumentCount' => '2-5' ), 'AMORDEGRC' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'category' => Calculation\Categories::CATEGORY_FINANCIAL, 'functionCall' => 'PHPExcel_Calculation_Financial::AMORDEGRC', 'argumentCount' => '6,7' ), 'AMORLINC' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'category' => Calculation\Categories::CATEGORY_FINANCIAL, 'functionCall' => 'PHPExcel_Calculation_Financial::AMORLINC', 'argumentCount' => '6,7' ), 'AND' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_LOGICAL, + 'category' => Calculation\Categories::CATEGORY_LOGICAL, 'functionCall' => 'PHPExcel_Calculation_Logical::LOGICAL_AND', 'argumentCount' => '1+' ), 'AREAS' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_LOOKUP_AND_REFERENCE, - 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', + 'category' => Calculation\Categories::CATEGORY_LOOKUP_AND_REFERENCE, + 'functionCall' => 'Calculation\Categoriess::DUMMY', 'argumentCount' => '1' ), 'ASC' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, - 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', + 'category' => Calculation\Categories::CATEGORY_TEXT_AND_DATA, + 'functionCall' => 'Calculation\Categoriess::DUMMY', 'argumentCount' => '1' ), 'ASIN' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, 'functionCall' => 'asin', 'argumentCount' => '1' ), 'ASINH' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, 'functionCall' => 'asinh', 'argumentCount' => '1' ), 'ATAN' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, 'functionCall' => 'atan', 'argumentCount' => '1' ), 'ATAN2' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, 'functionCall' => 'PHPExcel_Calculation_MathTrig::ATAN2', 'argumentCount' => '2' ), 'ATANH' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, 'functionCall' => 'atanh', 'argumentCount' => '1' ), 'AVEDEV' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'category' => Calculation\Categories::CATEGORY_STATISTICAL, 'functionCall' => 'PHPExcel_Calculation_Statistical::AVEDEV', 'argumentCount' => '1+' ), 'AVERAGE' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'category' => Calculation\Categories::CATEGORY_STATISTICAL, 'functionCall' => 'PHPExcel_Calculation_Statistical::AVERAGE', 'argumentCount' => '1+' ), 'AVERAGEA' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'category' => Calculation\Categories::CATEGORY_STATISTICAL, 'functionCall' => 'PHPExcel_Calculation_Statistical::AVERAGEA', 'argumentCount' => '1+' ), 'AVERAGEIF' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'category' => Calculation\Categories::CATEGORY_STATISTICAL, 'functionCall' => 'PHPExcel_Calculation_Statistical::AVERAGEIF', 'argumentCount' => '2,3' ), 'AVERAGEIFS' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', + 'category' => Calculation\Categories::CATEGORY_STATISTICAL, + 'functionCall' => 'Calculation\Categoriess::DUMMY', 'argumentCount' => '3+' ), 'BAHTTEXT' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, - 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', + 'category' => Calculation\Categories::CATEGORY_TEXT_AND_DATA, + 'functionCall' => 'Calculation\Categoriess::DUMMY', 'argumentCount' => '1' ), 'BESSELI' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, + 'category' => Calculation\Categories::CATEGORY_ENGINEERING, 'functionCall' => 'PHPExcel_Calculation_Engineering::BESSELI', 'argumentCount' => '2' ), 'BESSELJ' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, + 'category' => Calculation\Categories::CATEGORY_ENGINEERING, 'functionCall' => 'PHPExcel_Calculation_Engineering::BESSELJ', 'argumentCount' => '2' ), 'BESSELK' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, + 'category' => Calculation\Categories::CATEGORY_ENGINEERING, 'functionCall' => 'PHPExcel_Calculation_Engineering::BESSELK', 'argumentCount' => '2' ), 'BESSELY' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, + 'category' => Calculation\Categories::CATEGORY_ENGINEERING, 'functionCall' => 'PHPExcel_Calculation_Engineering::BESSELY', 'argumentCount' => '2' ), 'BETADIST' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'category' => Calculation\Categories::CATEGORY_STATISTICAL, 'functionCall' => 'PHPExcel_Calculation_Statistical::BETADIST', 'argumentCount' => '3-5' ), 'BETAINV' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'category' => Calculation\Categories::CATEGORY_STATISTICAL, 'functionCall' => 'PHPExcel_Calculation_Statistical::BETAINV', 'argumentCount' => '3-5' ), 'BIN2DEC' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, + 'category' => Calculation\Categories::CATEGORY_ENGINEERING, 'functionCall' => 'PHPExcel_Calculation_Engineering::BINTODEC', 'argumentCount' => '1' ), 'BIN2HEX' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, + 'category' => Calculation\Categories::CATEGORY_ENGINEERING, 'functionCall' => 'PHPExcel_Calculation_Engineering::BINTOHEX', 'argumentCount' => '1,2' ), 'BIN2OCT' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, + 'category' => Calculation\Categories::CATEGORY_ENGINEERING, 'functionCall' => 'PHPExcel_Calculation_Engineering::BINTOOCT', 'argumentCount' => '1,2' ), 'BINOMDIST' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'category' => Calculation\Categories::CATEGORY_STATISTICAL, 'functionCall' => 'PHPExcel_Calculation_Statistical::BINOMDIST', 'argumentCount' => '4' ), 'CEILING' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, 'functionCall' => 'PHPExcel_Calculation_MathTrig::CEILING', 'argumentCount' => '2' ), 'CELL' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_INFORMATION, - 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', + 'category' => Calculation\Categories::CATEGORY_INFORMATION, + 'functionCall' => 'Calculation\Categoriess::DUMMY', 'argumentCount' => '1,2' ), 'CHAR' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, + 'category' => Calculation\Categories::CATEGORY_TEXT_AND_DATA, 'functionCall' => 'PHPExcel_Calculation_TextData::CHARACTER', 'argumentCount' => '1' ), 'CHIDIST' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'category' => Calculation\Categories::CATEGORY_STATISTICAL, 'functionCall' => 'PHPExcel_Calculation_Statistical::CHIDIST', 'argumentCount' => '2' ), 'CHIINV' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'category' => Calculation\Categories::CATEGORY_STATISTICAL, 'functionCall' => 'PHPExcel_Calculation_Statistical::CHIINV', 'argumentCount' => '2' ), 'CHITEST' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', + 'category' => Calculation\Categories::CATEGORY_STATISTICAL, + 'functionCall' => 'Calculation\Categoriess::DUMMY', 'argumentCount' => '2' ), 'CHOOSE' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_LOOKUP_AND_REFERENCE, + 'category' => Calculation\Categories::CATEGORY_LOOKUP_AND_REFERENCE, 'functionCall' => 'PHPExcel_Calculation_LookupRef::CHOOSE', 'argumentCount' => '2+' ), 'CLEAN' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, + 'category' => Calculation\Categories::CATEGORY_TEXT_AND_DATA, 'functionCall' => 'PHPExcel_Calculation_TextData::TRIMNONPRINTABLE', 'argumentCount' => '1' ), 'CODE' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, + 'category' => Calculation\Categories::CATEGORY_TEXT_AND_DATA, 'functionCall' => 'PHPExcel_Calculation_TextData::ASCIICODE', 'argumentCount' => '1' ), 'COLUMN' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_LOOKUP_AND_REFERENCE, + 'category' => Calculation\Categories::CATEGORY_LOOKUP_AND_REFERENCE, 'functionCall' => 'PHPExcel_Calculation_LookupRef::COLUMN', 'argumentCount' => '-1', 'passByReference' => array(true) ), 'COLUMNS' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_LOOKUP_AND_REFERENCE, + 'category' => Calculation\Categories::CATEGORY_LOOKUP_AND_REFERENCE, 'functionCall' => 'PHPExcel_Calculation_LookupRef::COLUMNS', 'argumentCount' => '1' ), 'COMBIN' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, 'functionCall' => 'PHPExcel_Calculation_MathTrig::COMBIN', 'argumentCount' => '2' ), 'COMPLEX' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, + 'category' => Calculation\Categories::CATEGORY_ENGINEERING, 'functionCall' => 'PHPExcel_Calculation_Engineering::COMPLEX', 'argumentCount' => '2,3' ), 'CONCATENATE' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, + 'category' => Calculation\Categories::CATEGORY_TEXT_AND_DATA, 'functionCall' => 'PHPExcel_Calculation_TextData::CONCATENATE', 'argumentCount' => '1+' ), 'CONFIDENCE' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'category' => Calculation\Categories::CATEGORY_STATISTICAL, 'functionCall' => 'PHPExcel_Calculation_Statistical::CONFIDENCE', 'argumentCount' => '3' ), 'CONVERT' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, + 'category' => Calculation\Categories::CATEGORY_ENGINEERING, 'functionCall' => 'PHPExcel_Calculation_Engineering::CONVERTUOM', 'argumentCount' => '3' ), 'CORREL' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'category' => Calculation\Categories::CATEGORY_STATISTICAL, 'functionCall' => 'PHPExcel_Calculation_Statistical::CORREL', 'argumentCount' => '2' ), 'COS' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, 'functionCall' => 'cos', 'argumentCount' => '1' ), 'COSH' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, 'functionCall' => 'cosh', 'argumentCount' => '1' ), 'COUNT' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'category' => Calculation\Categories::CATEGORY_STATISTICAL, 'functionCall' => 'PHPExcel_Calculation_Statistical::COUNT', 'argumentCount' => '1+' ), 'COUNTA' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'category' => Calculation\Categories::CATEGORY_STATISTICAL, 'functionCall' => 'PHPExcel_Calculation_Statistical::COUNTA', 'argumentCount' => '1+' ), 'COUNTBLANK' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'category' => Calculation\Categories::CATEGORY_STATISTICAL, 'functionCall' => 'PHPExcel_Calculation_Statistical::COUNTBLANK', 'argumentCount' => '1' ), 'COUNTIF' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'category' => Calculation\Categories::CATEGORY_STATISTICAL, 'functionCall' => 'PHPExcel_Calculation_Statistical::COUNTIF', 'argumentCount' => '2' ), 'COUNTIFS' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', + 'category' => Calculation\Categories::CATEGORY_STATISTICAL, + 'functionCall' => 'Calculation\Categoriess::DUMMY', 'argumentCount' => '2' ), 'COUPDAYBS' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'category' => Calculation\Categories::CATEGORY_FINANCIAL, 'functionCall' => 'PHPExcel_Calculation_Financial::COUPDAYBS', 'argumentCount' => '3,4' ), 'COUPDAYS' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'category' => Calculation\Categories::CATEGORY_FINANCIAL, 'functionCall' => 'PHPExcel_Calculation_Financial::COUPDAYS', 'argumentCount' => '3,4' ), 'COUPDAYSNC' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'category' => Calculation\Categories::CATEGORY_FINANCIAL, 'functionCall' => 'PHPExcel_Calculation_Financial::COUPDAYSNC', 'argumentCount' => '3,4' ), 'COUPNCD' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'category' => Calculation\Categories::CATEGORY_FINANCIAL, 'functionCall' => 'PHPExcel_Calculation_Financial::COUPNCD', 'argumentCount' => '3,4' ), 'COUPNUM' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'category' => Calculation\Categories::CATEGORY_FINANCIAL, 'functionCall' => 'PHPExcel_Calculation_Financial::COUPNUM', 'argumentCount' => '3,4' ), 'COUPPCD' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'category' => Calculation\Categories::CATEGORY_FINANCIAL, 'functionCall' => 'PHPExcel_Calculation_Financial::COUPPCD', 'argumentCount' => '3,4' ), 'COVAR' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'category' => Calculation\Categories::CATEGORY_STATISTICAL, 'functionCall' => 'PHPExcel_Calculation_Statistical::COVAR', 'argumentCount' => '2' ), 'CRITBINOM' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'category' => Calculation\Categories::CATEGORY_STATISTICAL, 'functionCall' => 'PHPExcel_Calculation_Statistical::CRITBINOM', 'argumentCount' => '3' ), 'CUBEKPIMEMBER' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_CUBE, - 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', + 'category' => Calculation\Categories::CATEGORY_CUBE, + 'functionCall' => 'Calculation\Categoriess::DUMMY', 'argumentCount' => '?' ), 'CUBEMEMBER' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_CUBE, - 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', + 'category' => Calculation\Categories::CATEGORY_CUBE, + 'functionCall' => 'Calculation\Categoriess::DUMMY', 'argumentCount' => '?' ), 'CUBEMEMBERPROPERTY' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_CUBE, - 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', + 'category' => Calculation\Categories::CATEGORY_CUBE, + 'functionCall' => 'Calculation\Categoriess::DUMMY', 'argumentCount' => '?' ), 'CUBERANKEDMEMBER' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_CUBE, - 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', + 'category' => Calculation\Categories::CATEGORY_CUBE, + 'functionCall' => 'Calculation\Categoriess::DUMMY', 'argumentCount' => '?' ), 'CUBESET' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_CUBE, - 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', + 'category' => Calculation\Categories::CATEGORY_CUBE, + 'functionCall' => 'Calculation\Categoriess::DUMMY', 'argumentCount' => '?' ), 'CUBESETCOUNT' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_CUBE, - 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', + 'category' => Calculation\Categories::CATEGORY_CUBE, + 'functionCall' => 'Calculation\Categoriess::DUMMY', 'argumentCount' => '?' ), 'CUBEVALUE' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_CUBE, - 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', + 'category' => Calculation\Categories::CATEGORY_CUBE, + 'functionCall' => 'Calculation\Categoriess::DUMMY', 'argumentCount' => '?' ), 'CUMIPMT' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'category' => Calculation\Categories::CATEGORY_FINANCIAL, 'functionCall' => 'PHPExcel_Calculation_Financial::CUMIPMT', 'argumentCount' => '6' ), 'CUMPRINC' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'category' => Calculation\Categories::CATEGORY_FINANCIAL, 'functionCall' => 'PHPExcel_Calculation_Financial::CUMPRINC', 'argumentCount' => '6' ), 'DATE' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME, + 'category' => Calculation\Categories::CATEGORY_DATE_AND_TIME, 'functionCall' => 'PHPExcel_Calculation_DateTime::DATE', 'argumentCount' => '3' ), 'DATEDIF' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME, + 'category' => Calculation\Categories::CATEGORY_DATE_AND_TIME, 'functionCall' => 'PHPExcel_Calculation_DateTime::DATEDIF', 'argumentCount' => '2,3' ), 'DATEVALUE' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME, + 'category' => Calculation\Categories::CATEGORY_DATE_AND_TIME, 'functionCall' => 'PHPExcel_Calculation_DateTime::DATEVALUE', 'argumentCount' => '1' ), 'DAVERAGE' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_DATABASE, + 'category' => Calculation\Categories::CATEGORY_DATABASE, 'functionCall' => 'PHPExcel_Calculation_Database::DAVERAGE', 'argumentCount' => '3' ), 'DAY' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME, + 'category' => Calculation\Categories::CATEGORY_DATE_AND_TIME, 'functionCall' => 'PHPExcel_Calculation_DateTime::DAYOFMONTH', 'argumentCount' => '1' ), 'DAYS360' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME, + 'category' => Calculation\Categories::CATEGORY_DATE_AND_TIME, 'functionCall' => 'PHPExcel_Calculation_DateTime::DAYS360', 'argumentCount' => '2,3' ), 'DB' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'category' => Calculation\Categories::CATEGORY_FINANCIAL, 'functionCall' => 'PHPExcel_Calculation_Financial::DB', 'argumentCount' => '4,5' ), 'DCOUNT' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_DATABASE, + 'category' => Calculation\Categories::CATEGORY_DATABASE, 'functionCall' => 'PHPExcel_Calculation_Database::DCOUNT', 'argumentCount' => '3' ), 'DCOUNTA' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_DATABASE, + 'category' => Calculation\Categories::CATEGORY_DATABASE, 'functionCall' => 'PHPExcel_Calculation_Database::DCOUNTA', 'argumentCount' => '3' ), 'DDB' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'category' => Calculation\Categories::CATEGORY_FINANCIAL, 'functionCall' => 'PHPExcel_Calculation_Financial::DDB', 'argumentCount' => '4,5' ), 'DEC2BIN' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, + 'category' => Calculation\Categories::CATEGORY_ENGINEERING, 'functionCall' => 'PHPExcel_Calculation_Engineering::DECTOBIN', 'argumentCount' => '1,2' ), 'DEC2HEX' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, + 'category' => Calculation\Categories::CATEGORY_ENGINEERING, 'functionCall' => 'PHPExcel_Calculation_Engineering::DECTOHEX', 'argumentCount' => '1,2' ), 'DEC2OCT' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, + 'category' => Calculation\Categories::CATEGORY_ENGINEERING, 'functionCall' => 'PHPExcel_Calculation_Engineering::DECTOOCT', 'argumentCount' => '1,2' ), 'DEGREES' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, 'functionCall' => 'rad2deg', 'argumentCount' => '1' ), 'DELTA' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, + 'category' => Calculation\Categories::CATEGORY_ENGINEERING, 'functionCall' => 'PHPExcel_Calculation_Engineering::DELTA', 'argumentCount' => '1,2' ), 'DEVSQ' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'category' => Calculation\Categories::CATEGORY_STATISTICAL, 'functionCall' => 'PHPExcel_Calculation_Statistical::DEVSQ', 'argumentCount' => '1+' ), 'DGET' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_DATABASE, + 'category' => Calculation\Categories::CATEGORY_DATABASE, 'functionCall' => 'PHPExcel_Calculation_Database::DGET', 'argumentCount' => '3' ), 'DISC' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'category' => Calculation\Categories::CATEGORY_FINANCIAL, 'functionCall' => 'PHPExcel_Calculation_Financial::DISC', 'argumentCount' => '4,5' ), 'DMAX' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_DATABASE, + 'category' => Calculation\Categories::CATEGORY_DATABASE, 'functionCall' => 'PHPExcel_Calculation_Database::DMAX', 'argumentCount' => '3' ), 'DMIN' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_DATABASE, + 'category' => Calculation\Categories::CATEGORY_DATABASE, 'functionCall' => 'PHPExcel_Calculation_Database::DMIN', 'argumentCount' => '3' ), 'DOLLAR' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, + 'category' => Calculation\Categories::CATEGORY_TEXT_AND_DATA, 'functionCall' => 'PHPExcel_Calculation_TextData::DOLLAR', 'argumentCount' => '1,2' ), 'DOLLARDE' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'category' => Calculation\Categories::CATEGORY_FINANCIAL, 'functionCall' => 'PHPExcel_Calculation_Financial::DOLLARDE', 'argumentCount' => '2' ), 'DOLLARFR' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'category' => Calculation\Categories::CATEGORY_FINANCIAL, 'functionCall' => 'PHPExcel_Calculation_Financial::DOLLARFR', 'argumentCount' => '2' ), 'DPRODUCT' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_DATABASE, + 'category' => Calculation\Categories::CATEGORY_DATABASE, 'functionCall' => 'PHPExcel_Calculation_Database::DPRODUCT', 'argumentCount' => '3' ), 'DSTDEV' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_DATABASE, + 'category' => Calculation\Categories::CATEGORY_DATABASE, 'functionCall' => 'PHPExcel_Calculation_Database::DSTDEV', 'argumentCount' => '3' ), 'DSTDEVP' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_DATABASE, + 'category' => Calculation\Categories::CATEGORY_DATABASE, 'functionCall' => 'PHPExcel_Calculation_Database::DSTDEVP', 'argumentCount' => '3' ), 'DSUM' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_DATABASE, + 'category' => Calculation\Categories::CATEGORY_DATABASE, 'functionCall' => 'PHPExcel_Calculation_Database::DSUM', 'argumentCount' => '3' ), 'DURATION' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, - 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', + 'category' => Calculation\Categories::CATEGORY_FINANCIAL, + 'functionCall' => 'Calculation\Categoriess::DUMMY', 'argumentCount' => '5,6' ), 'DVAR' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_DATABASE, + 'category' => Calculation\Categories::CATEGORY_DATABASE, 'functionCall' => 'PHPExcel_Calculation_Database::DVAR', 'argumentCount' => '3' ), 'DVARP' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_DATABASE, + 'category' => Calculation\Categories::CATEGORY_DATABASE, 'functionCall' => 'PHPExcel_Calculation_Database::DVARP', 'argumentCount' => '3' ), 'EDATE' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME, + 'category' => Calculation\Categories::CATEGORY_DATE_AND_TIME, 'functionCall' => 'PHPExcel_Calculation_DateTime::EDATE', 'argumentCount' => '2' ), 'EFFECT' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'category' => Calculation\Categories::CATEGORY_FINANCIAL, 'functionCall' => 'PHPExcel_Calculation_Financial::EFFECT', 'argumentCount' => '2' ), 'EOMONTH' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME, + 'category' => Calculation\Categories::CATEGORY_DATE_AND_TIME, 'functionCall' => 'PHPExcel_Calculation_DateTime::EOMONTH', 'argumentCount' => '2' ), 'ERF' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, + 'category' => Calculation\Categories::CATEGORY_ENGINEERING, 'functionCall' => 'PHPExcel_Calculation_Engineering::ERF', 'argumentCount' => '1,2' ), 'ERFC' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, + 'category' => Calculation\Categories::CATEGORY_ENGINEERING, 'functionCall' => 'PHPExcel_Calculation_Engineering::ERFC', 'argumentCount' => '1' ), 'ERROR.TYPE' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_INFORMATION, - 'functionCall' => 'PHPExcel_Calculation_Functions::ERROR_TYPE', + 'category' => Calculation\Categories::CATEGORY_INFORMATION, + 'functionCall' => 'Calculation\Categoriess::ERROR_TYPE', 'argumentCount' => '1' ), 'EVEN' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, 'functionCall' => 'PHPExcel_Calculation_MathTrig::EVEN', 'argumentCount' => '1' ), 'EXACT' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, - 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', + 'category' => Calculation\Categories::CATEGORY_TEXT_AND_DATA, + 'functionCall' => 'Calculation\Categoriess::DUMMY', 'argumentCount' => '2' ), 'EXP' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, 'functionCall' => 'exp', 'argumentCount' => '1' ), 'EXPONDIST' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'category' => Calculation\Categories::CATEGORY_STATISTICAL, 'functionCall' => 'PHPExcel_Calculation_Statistical::EXPONDIST', 'argumentCount' => '3' ), 'FACT' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, 'functionCall' => 'PHPExcel_Calculation_MathTrig::FACT', 'argumentCount' => '1' ), 'FACTDOUBLE' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, 'functionCall' => 'PHPExcel_Calculation_MathTrig::FACTDOUBLE', 'argumentCount' => '1' ), 'FALSE' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_LOGICAL, + 'category' => Calculation\Categories::CATEGORY_LOGICAL, 'functionCall' => 'PHPExcel_Calculation_Logical::FALSE', 'argumentCount' => '0' ), 'FDIST' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', + 'category' => Calculation\Categories::CATEGORY_STATISTICAL, + 'functionCall' => 'Calculation\Categoriess::DUMMY', 'argumentCount' => '3' ), 'FIND' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, + 'category' => Calculation\Categories::CATEGORY_TEXT_AND_DATA, 'functionCall' => 'PHPExcel_Calculation_TextData::SEARCHSENSITIVE', 'argumentCount' => '2,3' ), 'FINDB' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, + 'category' => Calculation\Categories::CATEGORY_TEXT_AND_DATA, 'functionCall' => 'PHPExcel_Calculation_TextData::SEARCHSENSITIVE', 'argumentCount' => '2,3' ), 'FINV' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', + 'category' => Calculation\Categories::CATEGORY_STATISTICAL, + 'functionCall' => 'Calculation\Categoriess::DUMMY', 'argumentCount' => '3' ), 'FISHER' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'category' => Calculation\Categories::CATEGORY_STATISTICAL, 'functionCall' => 'PHPExcel_Calculation_Statistical::FISHER', 'argumentCount' => '1' ), 'FISHERINV' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'category' => Calculation\Categories::CATEGORY_STATISTICAL, 'functionCall' => 'PHPExcel_Calculation_Statistical::FISHERINV', 'argumentCount' => '1' ), 'FIXED' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, + 'category' => Calculation\Categories::CATEGORY_TEXT_AND_DATA, 'functionCall' => 'PHPExcel_Calculation_TextData::FIXEDFORMAT', 'argumentCount' => '1-3' ), 'FLOOR' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, 'functionCall' => 'PHPExcel_Calculation_MathTrig::FLOOR', 'argumentCount' => '2' ), 'FORECAST' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'category' => Calculation\Categories::CATEGORY_STATISTICAL, 'functionCall' => 'PHPExcel_Calculation_Statistical::FORECAST', 'argumentCount' => '3' ), 'FREQUENCY' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', + 'category' => Calculation\Categories::CATEGORY_STATISTICAL, + 'functionCall' => 'Calculation\Categoriess::DUMMY', 'argumentCount' => '2' ), 'FTEST' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', + 'category' => Calculation\Categories::CATEGORY_STATISTICAL, + 'functionCall' => 'Calculation\Categoriess::DUMMY', 'argumentCount' => '2' ), 'FV' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'category' => Calculation\Categories::CATEGORY_FINANCIAL, 'functionCall' => 'PHPExcel_Calculation_Financial::FV', 'argumentCount' => '3-5' ), 'FVSCHEDULE' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'category' => Calculation\Categories::CATEGORY_FINANCIAL, 'functionCall' => 'PHPExcel_Calculation_Financial::FVSCHEDULE', 'argumentCount' => '2' ), 'GAMMADIST' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'category' => Calculation\Categories::CATEGORY_STATISTICAL, 'functionCall' => 'PHPExcel_Calculation_Statistical::GAMMADIST', 'argumentCount' => '4' ), 'GAMMAINV' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'category' => Calculation\Categories::CATEGORY_STATISTICAL, 'functionCall' => 'PHPExcel_Calculation_Statistical::GAMMAINV', 'argumentCount' => '3' ), 'GAMMALN' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'category' => Calculation\Categories::CATEGORY_STATISTICAL, 'functionCall' => 'PHPExcel_Calculation_Statistical::GAMMALN', 'argumentCount' => '1' ), 'GCD' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, 'functionCall' => 'PHPExcel_Calculation_MathTrig::GCD', 'argumentCount' => '1+' ), 'GEOMEAN' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'category' => Calculation\Categories::CATEGORY_STATISTICAL, 'functionCall' => 'PHPExcel_Calculation_Statistical::GEOMEAN', 'argumentCount' => '1+' ), 'GESTEP' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, + 'category' => Calculation\Categories::CATEGORY_ENGINEERING, 'functionCall' => 'PHPExcel_Calculation_Engineering::GESTEP', 'argumentCount' => '1,2' ), 'GETPIVOTDATA' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_LOOKUP_AND_REFERENCE, - 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', + 'category' => Calculation\Categories::CATEGORY_LOOKUP_AND_REFERENCE, + 'functionCall' => 'Calculation\Categoriess::DUMMY', 'argumentCount' => '2+' ), 'GROWTH' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'category' => Calculation\Categories::CATEGORY_STATISTICAL, 'functionCall' => 'PHPExcel_Calculation_Statistical::GROWTH', 'argumentCount' => '1-4' ), 'HARMEAN' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'category' => Calculation\Categories::CATEGORY_STATISTICAL, 'functionCall' => 'PHPExcel_Calculation_Statistical::HARMEAN', 'argumentCount' => '1+' ), 'HEX2BIN' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, + 'category' => Calculation\Categories::CATEGORY_ENGINEERING, 'functionCall' => 'PHPExcel_Calculation_Engineering::HEXTOBIN', 'argumentCount' => '1,2' ), 'HEX2DEC' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, + 'category' => Calculation\Categories::CATEGORY_ENGINEERING, 'functionCall' => 'PHPExcel_Calculation_Engineering::HEXTODEC', 'argumentCount' => '1' ), 'HEX2OCT' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, + 'category' => Calculation\Categories::CATEGORY_ENGINEERING, 'functionCall' => 'PHPExcel_Calculation_Engineering::HEXTOOCT', 'argumentCount' => '1,2' ), 'HLOOKUP' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_LOOKUP_AND_REFERENCE, + 'category' => Calculation\Categories::CATEGORY_LOOKUP_AND_REFERENCE, 'functionCall' => 'PHPExcel_Calculation_LookupRef::HLOOKUP', 'argumentCount' => '3,4' ), 'HOUR' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME, + 'category' => Calculation\Categories::CATEGORY_DATE_AND_TIME, 'functionCall' => 'PHPExcel_Calculation_DateTime::HOUROFDAY', 'argumentCount' => '1' ), 'HYPERLINK' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_LOOKUP_AND_REFERENCE, + 'category' => Calculation\Categories::CATEGORY_LOOKUP_AND_REFERENCE, 'functionCall' => 'PHPExcel_Calculation_LookupRef::HYPERLINK', 'argumentCount' => '1,2', 'passCellReference' => true ), 'HYPGEOMDIST' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'category' => Calculation\Categories::CATEGORY_STATISTICAL, 'functionCall' => 'PHPExcel_Calculation_Statistical::HYPGEOMDIST', 'argumentCount' => '4' ), 'IF' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_LOGICAL, + 'category' => Calculation\Categories::CATEGORY_LOGICAL, 'functionCall' => 'PHPExcel_Calculation_Logical::STATEMENT_IF', 'argumentCount' => '1-3' ), 'IFERROR' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_LOGICAL, + 'category' => Calculation\Categories::CATEGORY_LOGICAL, 'functionCall' => 'PHPExcel_Calculation_Logical::IFERROR', 'argumentCount' => '2' ), 'IMABS' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, + 'category' => Calculation\Categories::CATEGORY_ENGINEERING, 'functionCall' => 'PHPExcel_Calculation_Engineering::IMABS', 'argumentCount' => '1' ), 'IMAGINARY' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, + 'category' => Calculation\Categories::CATEGORY_ENGINEERING, 'functionCall' => 'PHPExcel_Calculation_Engineering::IMAGINARY', 'argumentCount' => '1' ), 'IMARGUMENT' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, + 'category' => Calculation\Categories::CATEGORY_ENGINEERING, 'functionCall' => 'PHPExcel_Calculation_Engineering::IMARGUMENT', 'argumentCount' => '1' ), 'IMCONJUGATE' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, + 'category' => Calculation\Categories::CATEGORY_ENGINEERING, 'functionCall' => 'PHPExcel_Calculation_Engineering::IMCONJUGATE', 'argumentCount' => '1' ), 'IMCOS' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, + 'category' => Calculation\Categories::CATEGORY_ENGINEERING, 'functionCall' => 'PHPExcel_Calculation_Engineering::IMCOS', 'argumentCount' => '1' ), 'IMDIV' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, + 'category' => Calculation\Categories::CATEGORY_ENGINEERING, 'functionCall' => 'PHPExcel_Calculation_Engineering::IMDIV', 'argumentCount' => '2' ), 'IMEXP' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, + 'category' => Calculation\Categories::CATEGORY_ENGINEERING, 'functionCall' => 'PHPExcel_Calculation_Engineering::IMEXP', 'argumentCount' => '1' ), 'IMLN' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, + 'category' => Calculation\Categories::CATEGORY_ENGINEERING, 'functionCall' => 'PHPExcel_Calculation_Engineering::IMLN', 'argumentCount' => '1' ), 'IMLOG10' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, + 'category' => Calculation\Categories::CATEGORY_ENGINEERING, 'functionCall' => 'PHPExcel_Calculation_Engineering::IMLOG10', 'argumentCount' => '1' ), 'IMLOG2' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, + 'category' => Calculation\Categories::CATEGORY_ENGINEERING, 'functionCall' => 'PHPExcel_Calculation_Engineering::IMLOG2', 'argumentCount' => '1' ), 'IMPOWER' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, + 'category' => Calculation\Categories::CATEGORY_ENGINEERING, 'functionCall' => 'PHPExcel_Calculation_Engineering::IMPOWER', 'argumentCount' => '2' ), 'IMPRODUCT' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, + 'category' => Calculation\Categories::CATEGORY_ENGINEERING, 'functionCall' => 'PHPExcel_Calculation_Engineering::IMPRODUCT', 'argumentCount' => '1+' ), 'IMREAL' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, + 'category' => Calculation\Categories::CATEGORY_ENGINEERING, 'functionCall' => 'PHPExcel_Calculation_Engineering::IMREAL', 'argumentCount' => '1' ), 'IMSIN' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, + 'category' => Calculation\Categories::CATEGORY_ENGINEERING, 'functionCall' => 'PHPExcel_Calculation_Engineering::IMSIN', 'argumentCount' => '1' ), 'IMSQRT' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, + 'category' => Calculation\Categories::CATEGORY_ENGINEERING, 'functionCall' => 'PHPExcel_Calculation_Engineering::IMSQRT', 'argumentCount' => '1' ), 'IMSUB' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, + 'category' => Calculation\Categories::CATEGORY_ENGINEERING, 'functionCall' => 'PHPExcel_Calculation_Engineering::IMSUB', 'argumentCount' => '2' ), 'IMSUM' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, + 'category' => Calculation\Categories::CATEGORY_ENGINEERING, 'functionCall' => 'PHPExcel_Calculation_Engineering::IMSUM', 'argumentCount' => '1+' ), 'INDEX' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_LOOKUP_AND_REFERENCE, + 'category' => Calculation\Categories::CATEGORY_LOOKUP_AND_REFERENCE, 'functionCall' => 'PHPExcel_Calculation_LookupRef::INDEX', 'argumentCount' => '1-4' ), 'INDIRECT' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_LOOKUP_AND_REFERENCE, + 'category' => Calculation\Categories::CATEGORY_LOOKUP_AND_REFERENCE, 'functionCall' => 'PHPExcel_Calculation_LookupRef::INDIRECT', 'argumentCount' => '1,2', 'passCellReference' => true ), 'INFO' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_INFORMATION, - 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', + 'category' => Calculation\Categories::CATEGORY_INFORMATION, + 'functionCall' => 'Calculation\Categoriess::DUMMY', 'argumentCount' => '1' ), 'INT' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, 'functionCall' => 'PHPExcel_Calculation_MathTrig::INT', 'argumentCount' => '1' ), 'INTERCEPT' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'category' => Calculation\Categories::CATEGORY_STATISTICAL, 'functionCall' => 'PHPExcel_Calculation_Statistical::INTERCEPT', 'argumentCount' => '2' ), 'INTRATE' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'category' => Calculation\Categories::CATEGORY_FINANCIAL, 'functionCall' => 'PHPExcel_Calculation_Financial::INTRATE', 'argumentCount' => '4,5' ), 'IPMT' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'category' => Calculation\Categories::CATEGORY_FINANCIAL, 'functionCall' => 'PHPExcel_Calculation_Financial::IPMT', 'argumentCount' => '4-6' ), 'IRR' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'category' => Calculation\Categories::CATEGORY_FINANCIAL, 'functionCall' => 'PHPExcel_Calculation_Financial::IRR', 'argumentCount' => '1,2' ), 'ISBLANK' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_INFORMATION, - 'functionCall' => 'PHPExcel_Calculation_Functions::IS_BLANK', + 'category' => Calculation\Categories::CATEGORY_INFORMATION, + 'functionCall' => 'Calculation\Categoriess::IS_BLANK', 'argumentCount' => '1' ), 'ISERR' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_INFORMATION, - 'functionCall' => 'PHPExcel_Calculation_Functions::IS_ERR', + 'category' => Calculation\Categories::CATEGORY_INFORMATION, + 'functionCall' => 'Calculation\Categoriess::IS_ERR', 'argumentCount' => '1' ), 'ISERROR' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_INFORMATION, - 'functionCall' => 'PHPExcel_Calculation_Functions::IS_ERROR', + 'category' => Calculation\Categories::CATEGORY_INFORMATION, + 'functionCall' => 'Calculation\Categoriess::IS_ERROR', 'argumentCount' => '1' ), 'ISEVEN' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_INFORMATION, - 'functionCall' => 'PHPExcel_Calculation_Functions::IS_EVEN', + 'category' => Calculation\Categories::CATEGORY_INFORMATION, + 'functionCall' => 'Calculation\Categoriess::IS_EVEN', 'argumentCount' => '1' ), 'ISLOGICAL' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_INFORMATION, - 'functionCall' => 'PHPExcel_Calculation_Functions::IS_LOGICAL', + 'category' => Calculation\Categories::CATEGORY_INFORMATION, + 'functionCall' => 'Calculation\Categoriess::IS_LOGICAL', 'argumentCount' => '1' ), 'ISNA' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_INFORMATION, - 'functionCall' => 'PHPExcel_Calculation_Functions::IS_NA', + 'category' => Calculation\Categories::CATEGORY_INFORMATION, + 'functionCall' => 'Calculation\Categoriess::IS_NA', 'argumentCount' => '1' ), 'ISNONTEXT' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_INFORMATION, - 'functionCall' => 'PHPExcel_Calculation_Functions::IS_NONTEXT', + 'category' => Calculation\Categories::CATEGORY_INFORMATION, + 'functionCall' => 'Calculation\Categoriess::IS_NONTEXT', 'argumentCount' => '1' ), 'ISNUMBER' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_INFORMATION, - 'functionCall' => 'PHPExcel_Calculation_Functions::IS_NUMBER', + 'category' => Calculation\Categories::CATEGORY_INFORMATION, + 'functionCall' => 'Calculation\Categoriess::IS_NUMBER', 'argumentCount' => '1' ), 'ISODD' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_INFORMATION, - 'functionCall' => 'PHPExcel_Calculation_Functions::IS_ODD', + 'category' => Calculation\Categories::CATEGORY_INFORMATION, + 'functionCall' => 'Calculation\Categoriess::IS_ODD', 'argumentCount' => '1' ), 'ISPMT' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'category' => Calculation\Categories::CATEGORY_FINANCIAL, 'functionCall' => 'PHPExcel_Calculation_Financial::ISPMT', 'argumentCount' => '4' ), 'ISREF' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_INFORMATION, - 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', + 'category' => Calculation\Categories::CATEGORY_INFORMATION, + 'functionCall' => 'Calculation\Categoriess::DUMMY', 'argumentCount' => '1' ), 'ISTEXT' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_INFORMATION, - 'functionCall' => 'PHPExcel_Calculation_Functions::IS_TEXT', + 'category' => Calculation\Categories::CATEGORY_INFORMATION, + 'functionCall' => 'Calculation\Categoriess::IS_TEXT', 'argumentCount' => '1' ), 'JIS' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, - 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', + 'category' => Calculation\Categories::CATEGORY_TEXT_AND_DATA, + 'functionCall' => 'Calculation\Categoriess::DUMMY', 'argumentCount' => '1' ), 'KURT' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'category' => Calculation\Categories::CATEGORY_STATISTICAL, 'functionCall' => 'PHPExcel_Calculation_Statistical::KURT', 'argumentCount' => '1+' ), 'LARGE' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'category' => Calculation\Categories::CATEGORY_STATISTICAL, 'functionCall' => 'PHPExcel_Calculation_Statistical::LARGE', 'argumentCount' => '2' ), 'LCM' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, 'functionCall' => 'PHPExcel_Calculation_MathTrig::LCM', 'argumentCount' => '1+' ), 'LEFT' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, + 'category' => Calculation\Categories::CATEGORY_TEXT_AND_DATA, 'functionCall' => 'PHPExcel_Calculation_TextData::LEFT', 'argumentCount' => '1,2' ), 'LEFTB' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, + 'category' => Calculation\Categories::CATEGORY_TEXT_AND_DATA, 'functionCall' => 'PHPExcel_Calculation_TextData::LEFT', 'argumentCount' => '1,2' ), 'LEN' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, + 'category' => Calculation\Categories::CATEGORY_TEXT_AND_DATA, 'functionCall' => 'PHPExcel_Calculation_TextData::STRINGLENGTH', 'argumentCount' => '1' ), 'LENB' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, + 'category' => Calculation\Categories::CATEGORY_TEXT_AND_DATA, 'functionCall' => 'PHPExcel_Calculation_TextData::STRINGLENGTH', 'argumentCount' => '1' ), 'LINEST' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'category' => Calculation\Categories::CATEGORY_STATISTICAL, 'functionCall' => 'PHPExcel_Calculation_Statistical::LINEST', 'argumentCount' => '1-4' ), 'LN' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, 'functionCall' => 'log', 'argumentCount' => '1' ), 'LOG' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, 'functionCall' => 'PHPExcel_Calculation_MathTrig::LOG_BASE', 'argumentCount' => '1,2' ), 'LOG10' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, 'functionCall' => 'log10', 'argumentCount' => '1' ), 'LOGEST' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'category' => Calculation\Categories::CATEGORY_STATISTICAL, 'functionCall' => 'PHPExcel_Calculation_Statistical::LOGEST', 'argumentCount' => '1-4' ), 'LOGINV' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'category' => Calculation\Categories::CATEGORY_STATISTICAL, 'functionCall' => 'PHPExcel_Calculation_Statistical::LOGINV', 'argumentCount' => '3' ), 'LOGNORMDIST' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'category' => Calculation\Categories::CATEGORY_STATISTICAL, 'functionCall' => 'PHPExcel_Calculation_Statistical::LOGNORMDIST', 'argumentCount' => '3' ), 'LOOKUP' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_LOOKUP_AND_REFERENCE, + 'category' => Calculation\Categories::CATEGORY_LOOKUP_AND_REFERENCE, 'functionCall' => 'PHPExcel_Calculation_LookupRef::LOOKUP', 'argumentCount' => '2,3' ), 'LOWER' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, + 'category' => Calculation\Categories::CATEGORY_TEXT_AND_DATA, 'functionCall' => 'PHPExcel_Calculation_TextData::LOWERCASE', 'argumentCount' => '1' ), 'MATCH' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_LOOKUP_AND_REFERENCE, + 'category' => Calculation\Categories::CATEGORY_LOOKUP_AND_REFERENCE, 'functionCall' => 'PHPExcel_Calculation_LookupRef::MATCH', 'argumentCount' => '2,3' ), 'MAX' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'category' => Calculation\Categories::CATEGORY_STATISTICAL, 'functionCall' => 'PHPExcel_Calculation_Statistical::MAX', 'argumentCount' => '1+' ), 'MAXA' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'category' => Calculation\Categories::CATEGORY_STATISTICAL, 'functionCall' => 'PHPExcel_Calculation_Statistical::MAXA', 'argumentCount' => '1+' ), 'MAXIF' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'category' => Calculation\Categories::CATEGORY_STATISTICAL, 'functionCall' => 'PHPExcel_Calculation_Statistical::MAXIF', 'argumentCount' => '2+' ), 'MDETERM' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, 'functionCall' => 'PHPExcel_Calculation_MathTrig::MDETERM', 'argumentCount' => '1' ), 'MDURATION' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, - 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', + 'category' => Calculation\Categories::CATEGORY_FINANCIAL, + 'functionCall' => 'Calculation\Categoriess::DUMMY', 'argumentCount' => '5,6' ), 'MEDIAN' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'category' => Calculation\Categories::CATEGORY_STATISTICAL, 'functionCall' => 'PHPExcel_Calculation_Statistical::MEDIAN', 'argumentCount' => '1+' ), 'MEDIANIF' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', + 'category' => Calculation\Categories::CATEGORY_STATISTICAL, + 'functionCall' => 'Calculation\Categoriess::DUMMY', 'argumentCount' => '2+' ), 'MID' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, + 'category' => Calculation\Categories::CATEGORY_TEXT_AND_DATA, 'functionCall' => 'PHPExcel_Calculation_TextData::MID', 'argumentCount' => '3' ), 'MIDB' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, + 'category' => Calculation\Categories::CATEGORY_TEXT_AND_DATA, 'functionCall' => 'PHPExcel_Calculation_TextData::MID', 'argumentCount' => '3' ), 'MIN' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'category' => Calculation\Categories::CATEGORY_STATISTICAL, 'functionCall' => 'PHPExcel_Calculation_Statistical::MIN', 'argumentCount' => '1+' ), 'MINA' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'category' => Calculation\Categories::CATEGORY_STATISTICAL, 'functionCall' => 'PHPExcel_Calculation_Statistical::MINA', 'argumentCount' => '1+' ), 'MINIF' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'category' => Calculation\Categories::CATEGORY_STATISTICAL, 'functionCall' => 'PHPExcel_Calculation_Statistical::MINIF', 'argumentCount' => '2+' ), 'MINUTE' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME, + 'category' => Calculation\Categories::CATEGORY_DATE_AND_TIME, 'functionCall' => 'PHPExcel_Calculation_DateTime::MINUTEOFHOUR', 'argumentCount' => '1' ), 'MINVERSE' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, 'functionCall' => 'PHPExcel_Calculation_MathTrig::MINVERSE', 'argumentCount' => '1' ), 'MIRR' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'category' => Calculation\Categories::CATEGORY_FINANCIAL, 'functionCall' => 'PHPExcel_Calculation_Financial::MIRR', 'argumentCount' => '3' ), 'MMULT' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, 'functionCall' => 'PHPExcel_Calculation_MathTrig::MMULT', 'argumentCount' => '2' ), 'MOD' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, 'functionCall' => 'PHPExcel_Calculation_MathTrig::MOD', 'argumentCount' => '2' ), 'MODE' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'category' => Calculation\Categories::CATEGORY_STATISTICAL, 'functionCall' => 'PHPExcel_Calculation_Statistical::MODE', 'argumentCount' => '1+' ), 'MONTH' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME, + 'category' => Calculation\Categories::CATEGORY_DATE_AND_TIME, 'functionCall' => 'PHPExcel_Calculation_DateTime::MONTHOFYEAR', 'argumentCount' => '1' ), 'MROUND' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, 'functionCall' => 'PHPExcel_Calculation_MathTrig::MROUND', 'argumentCount' => '2' ), 'MULTINOMIAL' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, 'functionCall' => 'PHPExcel_Calculation_MathTrig::MULTINOMIAL', 'argumentCount' => '1+' ), 'N' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_INFORMATION, - 'functionCall' => 'PHPExcel_Calculation_Functions::N', + 'category' => Calculation\Categories::CATEGORY_INFORMATION, + 'functionCall' => 'Calculation\Categoriess::N', 'argumentCount' => '1' ), 'NA' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_INFORMATION, - 'functionCall' => 'PHPExcel_Calculation_Functions::NA', + 'category' => Calculation\Categories::CATEGORY_INFORMATION, + 'functionCall' => 'Calculation\Categoriess::NA', 'argumentCount' => '0' ), 'NEGBINOMDIST' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'category' => Calculation\Categories::CATEGORY_STATISTICAL, 'functionCall' => 'PHPExcel_Calculation_Statistical::NEGBINOMDIST', 'argumentCount' => '3' ), 'NETWORKDAYS' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME, + 'category' => Calculation\Categories::CATEGORY_DATE_AND_TIME, 'functionCall' => 'PHPExcel_Calculation_DateTime::NETWORKDAYS', 'argumentCount' => '2+' ), 'NOMINAL' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'category' => Calculation\Categories::CATEGORY_FINANCIAL, 'functionCall' => 'PHPExcel_Calculation_Financial::NOMINAL', 'argumentCount' => '2' ), 'NORMDIST' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'category' => Calculation\Categories::CATEGORY_STATISTICAL, 'functionCall' => 'PHPExcel_Calculation_Statistical::NORMDIST', 'argumentCount' => '4' ), 'NORMINV' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'category' => Calculation\Categories::CATEGORY_STATISTICAL, 'functionCall' => 'PHPExcel_Calculation_Statistical::NORMINV', 'argumentCount' => '3' ), 'NORMSDIST' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'category' => Calculation\Categories::CATEGORY_STATISTICAL, 'functionCall' => 'PHPExcel_Calculation_Statistical::NORMSDIST', 'argumentCount' => '1' ), 'NORMSINV' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'category' => Calculation\Categories::CATEGORY_STATISTICAL, 'functionCall' => 'PHPExcel_Calculation_Statistical::NORMSINV', 'argumentCount' => '1' ), 'NOT' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_LOGICAL, + 'category' => Calculation\Categories::CATEGORY_LOGICAL, 'functionCall' => 'PHPExcel_Calculation_Logical::NOT', 'argumentCount' => '1' ), 'NOW' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME, + 'category' => Calculation\Categories::CATEGORY_DATE_AND_TIME, 'functionCall' => 'PHPExcel_Calculation_DateTime::DATETIMENOW', 'argumentCount' => '0' ), 'NPER' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'category' => Calculation\Categories::CATEGORY_FINANCIAL, 'functionCall' => 'PHPExcel_Calculation_Financial::NPER', 'argumentCount' => '3-5' ), 'NPV' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'category' => Calculation\Categories::CATEGORY_FINANCIAL, 'functionCall' => 'PHPExcel_Calculation_Financial::NPV', 'argumentCount' => '2+' ), 'OCT2BIN' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, + 'category' => Calculation\Categories::CATEGORY_ENGINEERING, 'functionCall' => 'PHPExcel_Calculation_Engineering::OCTTOBIN', 'argumentCount' => '1,2' ), 'OCT2DEC' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, + 'category' => Calculation\Categories::CATEGORY_ENGINEERING, 'functionCall' => 'PHPExcel_Calculation_Engineering::OCTTODEC', 'argumentCount' => '1' ), 'OCT2HEX' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, + 'category' => Calculation\Categories::CATEGORY_ENGINEERING, 'functionCall' => 'PHPExcel_Calculation_Engineering::OCTTOHEX', 'argumentCount' => '1,2' ), 'ODD' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, 'functionCall' => 'PHPExcel_Calculation_MathTrig::ODD', 'argumentCount' => '1' ), 'ODDFPRICE' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, - 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', + 'category' => Calculation\Categories::CATEGORY_FINANCIAL, + 'functionCall' => 'Calculation\Categoriess::DUMMY', 'argumentCount' => '8,9' ), 'ODDFYIELD' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, - 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', + 'category' => Calculation\Categories::CATEGORY_FINANCIAL, + 'functionCall' => 'Calculation\Categoriess::DUMMY', 'argumentCount' => '8,9' ), 'ODDLPRICE' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, - 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', + 'category' => Calculation\Categories::CATEGORY_FINANCIAL, + 'functionCall' => 'Calculation\Categoriess::DUMMY', 'argumentCount' => '7,8' ), 'ODDLYIELD' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, - 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', + 'category' => Calculation\Categories::CATEGORY_FINANCIAL, + 'functionCall' => 'Calculation\Categoriess::DUMMY', 'argumentCount' => '7,8' ), 'OFFSET' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_LOOKUP_AND_REFERENCE, + 'category' => Calculation\Categories::CATEGORY_LOOKUP_AND_REFERENCE, 'functionCall' => 'PHPExcel_Calculation_LookupRef::OFFSET', 'argumentCount' => '3,5', 'passCellReference' => true, 'passByReference' => array(true) ), 'OR' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_LOGICAL, + 'category' => Calculation\Categories::CATEGORY_LOGICAL, 'functionCall' => 'PHPExcel_Calculation_Logical::LOGICAL_OR', 'argumentCount' => '1+' ), 'PEARSON' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'category' => Calculation\Categories::CATEGORY_STATISTICAL, 'functionCall' => 'PHPExcel_Calculation_Statistical::CORREL', 'argumentCount' => '2' ), 'PERCENTILE' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'category' => Calculation\Categories::CATEGORY_STATISTICAL, 'functionCall' => 'PHPExcel_Calculation_Statistical::PERCENTILE', 'argumentCount' => '2' ), 'PERCENTRANK' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'category' => Calculation\Categories::CATEGORY_STATISTICAL, 'functionCall' => 'PHPExcel_Calculation_Statistical::PERCENTRANK', 'argumentCount' => '2,3' ), 'PERMUT' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'category' => Calculation\Categories::CATEGORY_STATISTICAL, 'functionCall' => 'PHPExcel_Calculation_Statistical::PERMUT', 'argumentCount' => '2' ), 'PHONETIC' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, - 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', + 'category' => Calculation\Categories::CATEGORY_TEXT_AND_DATA, + 'functionCall' => 'Calculation\Categoriess::DUMMY', 'argumentCount' => '1' ), 'PI' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, 'functionCall' => 'pi', 'argumentCount' => '0' ), 'PMT' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'category' => Calculation\Categories::CATEGORY_FINANCIAL, 'functionCall' => 'PHPExcel_Calculation_Financial::PMT', 'argumentCount' => '3-5' ), 'POISSON' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'category' => Calculation\Categories::CATEGORY_STATISTICAL, 'functionCall' => 'PHPExcel_Calculation_Statistical::POISSON', 'argumentCount' => '3' ), 'POWER' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, 'functionCall' => 'PHPExcel_Calculation_MathTrig::POWER', 'argumentCount' => '2' ), 'PPMT' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'category' => Calculation\Categories::CATEGORY_FINANCIAL, 'functionCall' => 'PHPExcel_Calculation_Financial::PPMT', 'argumentCount' => '4-6' ), 'PRICE' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'category' => Calculation\Categories::CATEGORY_FINANCIAL, 'functionCall' => 'PHPExcel_Calculation_Financial::PRICE', 'argumentCount' => '6,7' ), 'PRICEDISC' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'category' => Calculation\Categories::CATEGORY_FINANCIAL, 'functionCall' => 'PHPExcel_Calculation_Financial::PRICEDISC', 'argumentCount' => '4,5' ), 'PRICEMAT' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'category' => Calculation\Categories::CATEGORY_FINANCIAL, 'functionCall' => 'PHPExcel_Calculation_Financial::PRICEMAT', 'argumentCount' => '5,6' ), 'PROB' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', + 'category' => Calculation\Categories::CATEGORY_STATISTICAL, + 'functionCall' => 'Calculation\Categoriess::DUMMY', 'argumentCount' => '3,4' ), 'PRODUCT' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, 'functionCall' => 'PHPExcel_Calculation_MathTrig::PRODUCT', 'argumentCount' => '1+' ), 'PROPER' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, + 'category' => Calculation\Categories::CATEGORY_TEXT_AND_DATA, 'functionCall' => 'PHPExcel_Calculation_TextData::PROPERCASE', 'argumentCount' => '1' ), 'PV' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'category' => Calculation\Categories::CATEGORY_FINANCIAL, 'functionCall' => 'PHPExcel_Calculation_Financial::PV', 'argumentCount' => '3-5' ), 'QUARTILE' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'category' => Calculation\Categories::CATEGORY_STATISTICAL, 'functionCall' => 'PHPExcel_Calculation_Statistical::QUARTILE', 'argumentCount' => '2' ), 'QUOTIENT' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, 'functionCall' => 'PHPExcel_Calculation_MathTrig::QUOTIENT', 'argumentCount' => '2' ), 'RADIANS' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, 'functionCall' => 'deg2rad', 'argumentCount' => '1' ), 'RAND' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, 'functionCall' => 'PHPExcel_Calculation_MathTrig::RAND', 'argumentCount' => '0' ), 'RANDBETWEEN' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, 'functionCall' => 'PHPExcel_Calculation_MathTrig::RAND', 'argumentCount' => '2' ), 'RANK' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'category' => Calculation\Categories::CATEGORY_STATISTICAL, 'functionCall' => 'PHPExcel_Calculation_Statistical::RANK', 'argumentCount' => '2,3' ), 'RATE' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'category' => Calculation\Categories::CATEGORY_FINANCIAL, 'functionCall' => 'PHPExcel_Calculation_Financial::RATE', 'argumentCount' => '3-6' ), 'RECEIVED' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'category' => Calculation\Categories::CATEGORY_FINANCIAL, 'functionCall' => 'PHPExcel_Calculation_Financial::RECEIVED', 'argumentCount' => '4-5' ), 'REPLACE' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, + 'category' => Calculation\Categories::CATEGORY_TEXT_AND_DATA, 'functionCall' => 'PHPExcel_Calculation_TextData::REPLACE', 'argumentCount' => '4' ), 'REPLACEB' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, + 'category' => Calculation\Categories::CATEGORY_TEXT_AND_DATA, 'functionCall' => 'PHPExcel_Calculation_TextData::REPLACE', 'argumentCount' => '4' ), 'REPT' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, + 'category' => Calculation\Categories::CATEGORY_TEXT_AND_DATA, 'functionCall' => 'str_repeat', 'argumentCount' => '2' ), 'RIGHT' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, + 'category' => Calculation\Categories::CATEGORY_TEXT_AND_DATA, 'functionCall' => 'PHPExcel_Calculation_TextData::RIGHT', 'argumentCount' => '1,2' ), 'RIGHTB' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, + 'category' => Calculation\Categories::CATEGORY_TEXT_AND_DATA, 'functionCall' => 'PHPExcel_Calculation_TextData::RIGHT', 'argumentCount' => '1,2' ), 'ROMAN' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, 'functionCall' => 'PHPExcel_Calculation_MathTrig::ROMAN', 'argumentCount' => '1,2' ), 'ROUND' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, 'functionCall' => 'round', 'argumentCount' => '2' ), 'ROUNDDOWN' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, 'functionCall' => 'PHPExcel_Calculation_MathTrig::ROUNDDOWN', 'argumentCount' => '2' ), 'ROUNDUP' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, 'functionCall' => 'PHPExcel_Calculation_MathTrig::ROUNDUP', 'argumentCount' => '2' ), 'ROW' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_LOOKUP_AND_REFERENCE, + 'category' => Calculation\Categories::CATEGORY_LOOKUP_AND_REFERENCE, 'functionCall' => 'PHPExcel_Calculation_LookupRef::ROW', 'argumentCount' => '-1', 'passByReference' => array(true) ), 'ROWS' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_LOOKUP_AND_REFERENCE, + 'category' => Calculation\Categories::CATEGORY_LOOKUP_AND_REFERENCE, 'functionCall' => 'PHPExcel_Calculation_LookupRef::ROWS', 'argumentCount' => '1' ), 'RSQ' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'category' => Calculation\Categories::CATEGORY_STATISTICAL, 'functionCall' => 'PHPExcel_Calculation_Statistical::RSQ', 'argumentCount' => '2' ), 'RTD' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_LOOKUP_AND_REFERENCE, - 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', + 'category' => Calculation\Categories::CATEGORY_LOOKUP_AND_REFERENCE, + 'functionCall' => 'Calculation\Categoriess::DUMMY', 'argumentCount' => '1+' ), 'SEARCH' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, + 'category' => Calculation\Categories::CATEGORY_TEXT_AND_DATA, 'functionCall' => 'PHPExcel_Calculation_TextData::SEARCHINSENSITIVE', 'argumentCount' => '2,3' ), 'SEARCHB' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, + 'category' => Calculation\Categories::CATEGORY_TEXT_AND_DATA, 'functionCall' => 'PHPExcel_Calculation_TextData::SEARCHINSENSITIVE', 'argumentCount' => '2,3' ), 'SECOND' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME, + 'category' => Calculation\Categories::CATEGORY_DATE_AND_TIME, 'functionCall' => 'PHPExcel_Calculation_DateTime::SECONDOFMINUTE', 'argumentCount' => '1' ), 'SERIESSUM' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, 'functionCall' => 'PHPExcel_Calculation_MathTrig::SERIESSUM', 'argumentCount' => '4' ), 'SIGN' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, 'functionCall' => 'PHPExcel_Calculation_MathTrig::SIGN', 'argumentCount' => '1' ), 'SIN' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, 'functionCall' => 'sin', 'argumentCount' => '1' ), 'SINH' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, 'functionCall' => 'sinh', 'argumentCount' => '1' ), 'SKEW' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'category' => Calculation\Categories::CATEGORY_STATISTICAL, 'functionCall' => 'PHPExcel_Calculation_Statistical::SKEW', 'argumentCount' => '1+' ), 'SLN' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'category' => Calculation\Categories::CATEGORY_FINANCIAL, 'functionCall' => 'PHPExcel_Calculation_Financial::SLN', 'argumentCount' => '3' ), 'SLOPE' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'category' => Calculation\Categories::CATEGORY_STATISTICAL, 'functionCall' => 'PHPExcel_Calculation_Statistical::SLOPE', 'argumentCount' => '2' ), 'SMALL' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'category' => Calculation\Categories::CATEGORY_STATISTICAL, 'functionCall' => 'PHPExcel_Calculation_Statistical::SMALL', 'argumentCount' => '2' ), 'SQRT' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, 'functionCall' => 'sqrt', 'argumentCount' => '1' ), 'SQRTPI' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, 'functionCall' => 'PHPExcel_Calculation_MathTrig::SQRTPI', 'argumentCount' => '1' ), 'STANDARDIZE' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'category' => Calculation\Categories::CATEGORY_STATISTICAL, 'functionCall' => 'PHPExcel_Calculation_Statistical::STANDARDIZE', 'argumentCount' => '3' ), 'STDEV' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'category' => Calculation\Categories::CATEGORY_STATISTICAL, 'functionCall' => 'PHPExcel_Calculation_Statistical::STDEV', 'argumentCount' => '1+' ), 'STDEVA' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'category' => Calculation\Categories::CATEGORY_STATISTICAL, 'functionCall' => 'PHPExcel_Calculation_Statistical::STDEVA', 'argumentCount' => '1+' ), 'STDEVP' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'category' => Calculation\Categories::CATEGORY_STATISTICAL, 'functionCall' => 'PHPExcel_Calculation_Statistical::STDEVP', 'argumentCount' => '1+' ), 'STDEVPA' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'category' => Calculation\Categories::CATEGORY_STATISTICAL, 'functionCall' => 'PHPExcel_Calculation_Statistical::STDEVPA', 'argumentCount' => '1+' ), 'STEYX' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'category' => Calculation\Categories::CATEGORY_STATISTICAL, 'functionCall' => 'PHPExcel_Calculation_Statistical::STEYX', 'argumentCount' => '2' ), 'SUBSTITUTE' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, + 'category' => Calculation\Categories::CATEGORY_TEXT_AND_DATA, 'functionCall' => 'PHPExcel_Calculation_TextData::SUBSTITUTE', 'argumentCount' => '3,4' ), 'SUBTOTAL' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, 'functionCall' => 'PHPExcel_Calculation_MathTrig::SUBTOTAL', 'argumentCount' => '2+' ), 'SUM' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, 'functionCall' => 'PHPExcel_Calculation_MathTrig::SUM', 'argumentCount' => '1+' ), 'SUMIF' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, 'functionCall' => 'PHPExcel_Calculation_MathTrig::SUMIF', 'argumentCount' => '2,3' ), 'SUMIFS' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, - 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', + 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, + 'functionCall' => 'Calculation\Categoriess::DUMMY', 'argumentCount' => '?' ), 'SUMPRODUCT' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, 'functionCall' => 'PHPExcel_Calculation_MathTrig::SUMPRODUCT', 'argumentCount' => '1+' ), 'SUMSQ' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, 'functionCall' => 'PHPExcel_Calculation_MathTrig::SUMSQ', 'argumentCount' => '1+' ), 'SUMX2MY2' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, 'functionCall' => 'PHPExcel_Calculation_MathTrig::SUMX2MY2', 'argumentCount' => '2' ), 'SUMX2PY2' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, 'functionCall' => 'PHPExcel_Calculation_MathTrig::SUMX2PY2', 'argumentCount' => '2' ), 'SUMXMY2' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, 'functionCall' => 'PHPExcel_Calculation_MathTrig::SUMXMY2', 'argumentCount' => '2' ), 'SYD' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'category' => Calculation\Categories::CATEGORY_FINANCIAL, 'functionCall' => 'PHPExcel_Calculation_Financial::SYD', 'argumentCount' => '4' ), 'T' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, + 'category' => Calculation\Categories::CATEGORY_TEXT_AND_DATA, 'functionCall' => 'PHPExcel_Calculation_TextData::RETURNSTRING', 'argumentCount' => '1' ), 'TAN' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, 'functionCall' => 'tan', 'argumentCount' => '1' ), 'TANH' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, 'functionCall' => 'tanh', 'argumentCount' => '1' ), 'TBILLEQ' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'category' => Calculation\Categories::CATEGORY_FINANCIAL, 'functionCall' => 'PHPExcel_Calculation_Financial::TBILLEQ', 'argumentCount' => '3' ), 'TBILLPRICE' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'category' => Calculation\Categories::CATEGORY_FINANCIAL, 'functionCall' => 'PHPExcel_Calculation_Financial::TBILLPRICE', 'argumentCount' => '3' ), 'TBILLYIELD' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'category' => Calculation\Categories::CATEGORY_FINANCIAL, 'functionCall' => 'PHPExcel_Calculation_Financial::TBILLYIELD', 'argumentCount' => '3' ), 'TDIST' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'category' => Calculation\Categories::CATEGORY_STATISTICAL, 'functionCall' => 'PHPExcel_Calculation_Statistical::TDIST', 'argumentCount' => '3' ), 'TEXT' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, + 'category' => Calculation\Categories::CATEGORY_TEXT_AND_DATA, 'functionCall' => 'PHPExcel_Calculation_TextData::TEXTFORMAT', 'argumentCount' => '2' ), 'TIME' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME, + 'category' => Calculation\Categories::CATEGORY_DATE_AND_TIME, 'functionCall' => 'PHPExcel_Calculation_DateTime::TIME', 'argumentCount' => '3' ), 'TIMEVALUE' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME, + 'category' => Calculation\Categories::CATEGORY_DATE_AND_TIME, 'functionCall' => 'PHPExcel_Calculation_DateTime::TIMEVALUE', 'argumentCount' => '1' ), 'TINV' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'category' => Calculation\Categories::CATEGORY_STATISTICAL, 'functionCall' => 'PHPExcel_Calculation_Statistical::TINV', 'argumentCount' => '2' ), 'TODAY' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME, + 'category' => Calculation\Categories::CATEGORY_DATE_AND_TIME, 'functionCall' => 'PHPExcel_Calculation_DateTime::DATENOW', 'argumentCount' => '0' ), 'TRANSPOSE' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_LOOKUP_AND_REFERENCE, + 'category' => Calculation\Categories::CATEGORY_LOOKUP_AND_REFERENCE, 'functionCall' => 'PHPExcel_Calculation_LookupRef::TRANSPOSE', 'argumentCount' => '1' ), 'TREND' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'category' => Calculation\Categories::CATEGORY_STATISTICAL, 'functionCall' => 'PHPExcel_Calculation_Statistical::TREND', 'argumentCount' => '1-4' ), 'TRIM' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, + 'category' => Calculation\Categories::CATEGORY_TEXT_AND_DATA, 'functionCall' => 'PHPExcel_Calculation_TextData::TRIMSPACES', 'argumentCount' => '1' ), 'TRIMMEAN' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'category' => Calculation\Categories::CATEGORY_STATISTICAL, 'functionCall' => 'PHPExcel_Calculation_Statistical::TRIMMEAN', 'argumentCount' => '2' ), 'TRUE' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_LOGICAL, + 'category' => Calculation\Categories::CATEGORY_LOGICAL, 'functionCall' => 'PHPExcel_Calculation_Logical::TRUE', 'argumentCount' => '0' ), 'TRUNC' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, + 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, 'functionCall' => 'PHPExcel_Calculation_MathTrig::TRUNC', 'argumentCount' => '1,2' ), 'TTEST' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', + 'category' => Calculation\Categories::CATEGORY_STATISTICAL, + 'functionCall' => 'Calculation\Categoriess::DUMMY', 'argumentCount' => '4' ), 'TYPE' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_INFORMATION, - 'functionCall' => 'PHPExcel_Calculation_Functions::TYPE', + 'category' => Calculation\Categories::CATEGORY_INFORMATION, + 'functionCall' => 'Calculation\Categoriess::TYPE', 'argumentCount' => '1' ), 'UPPER' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, + 'category' => Calculation\Categories::CATEGORY_TEXT_AND_DATA, 'functionCall' => 'PHPExcel_Calculation_TextData::UPPERCASE', 'argumentCount' => '1' ), 'USDOLLAR' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, - 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', + 'category' => Calculation\Categories::CATEGORY_FINANCIAL, + 'functionCall' => 'Calculation\Categoriess::DUMMY', 'argumentCount' => '2' ), 'VALUE' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, + 'category' => Calculation\Categories::CATEGORY_TEXT_AND_DATA, 'functionCall' => 'PHPExcel_Calculation_TextData::VALUE', 'argumentCount' => '1' ), 'VAR' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'category' => Calculation\Categories::CATEGORY_STATISTICAL, 'functionCall' => 'PHPExcel_Calculation_Statistical::VARFunc', 'argumentCount' => '1+' ), 'VARA' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'category' => Calculation\Categories::CATEGORY_STATISTICAL, 'functionCall' => 'PHPExcel_Calculation_Statistical::VARA', 'argumentCount' => '1+' ), 'VARP' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'category' => Calculation\Categories::CATEGORY_STATISTICAL, 'functionCall' => 'PHPExcel_Calculation_Statistical::VARP', 'argumentCount' => '1+' ), 'VARPA' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'category' => Calculation\Categories::CATEGORY_STATISTICAL, 'functionCall' => 'PHPExcel_Calculation_Statistical::VARPA', 'argumentCount' => '1+' ), 'VDB' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, - 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', + 'category' => Calculation\Categories::CATEGORY_FINANCIAL, + 'functionCall' => 'Calculation\Categoriess::DUMMY', 'argumentCount' => '5-7' ), 'VERSION' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_INFORMATION, - 'functionCall' => 'PHPExcel_Calculation_Functions::VERSION', + 'category' => Calculation\Categories::CATEGORY_INFORMATION, + 'functionCall' => 'Calculation\Categoriess::VERSION', 'argumentCount' => '0' ), 'VLOOKUP' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_LOOKUP_AND_REFERENCE, + 'category' => Calculation\Categories::CATEGORY_LOOKUP_AND_REFERENCE, 'functionCall' => 'PHPExcel_Calculation_LookupRef::VLOOKUP', 'argumentCount' => '3,4' ), 'WEEKDAY' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME, + 'category' => Calculation\Categories::CATEGORY_DATE_AND_TIME, 'functionCall' => 'PHPExcel_Calculation_DateTime::DAYOFWEEK', 'argumentCount' => '1,2' ), 'WEEKNUM' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME, + 'category' => Calculation\Categories::CATEGORY_DATE_AND_TIME, 'functionCall' => 'PHPExcel_Calculation_DateTime::WEEKOFYEAR', 'argumentCount' => '1,2' ), 'WEIBULL' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'category' => Calculation\Categories::CATEGORY_STATISTICAL, 'functionCall' => 'PHPExcel_Calculation_Statistical::WEIBULL', 'argumentCount' => '4' ), 'WORKDAY' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME, + 'category' => Calculation\Categories::CATEGORY_DATE_AND_TIME, 'functionCall' => 'PHPExcel_Calculation_DateTime::WORKDAY', 'argumentCount' => '2+' ), 'XIRR' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'category' => Calculation\Categories::CATEGORY_FINANCIAL, 'functionCall' => 'PHPExcel_Calculation_Financial::XIRR', 'argumentCount' => '2,3' ), 'XNPV' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'category' => Calculation\Categories::CATEGORY_FINANCIAL, 'functionCall' => 'PHPExcel_Calculation_Financial::XNPV', 'argumentCount' => '3' ), 'YEAR' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME, + 'category' => Calculation\Categories::CATEGORY_DATE_AND_TIME, 'functionCall' => 'PHPExcel_Calculation_DateTime::YEAR', 'argumentCount' => '1' ), 'YEARFRAC' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME, + 'category' => Calculation\Categories::CATEGORY_DATE_AND_TIME, 'functionCall' => 'PHPExcel_Calculation_DateTime::YEARFRAC', 'argumentCount' => '2,3' ), 'YIELD' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, - 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', + 'category' => Calculation\Categories::CATEGORY_FINANCIAL, + 'functionCall' => 'Calculation\Categoriess::DUMMY', 'argumentCount' => '6,7' ), 'YIELDDISC' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'category' => Calculation\Categories::CATEGORY_FINANCIAL, 'functionCall' => 'PHPExcel_Calculation_Financial::YIELDDISC', 'argumentCount' => '4,5' ), 'YIELDMAT' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, + 'category' => Calculation\Categories::CATEGORY_FINANCIAL, 'functionCall' => 'PHPExcel_Calculation_Financial::YIELDMAT', 'argumentCount' => '5,6' ), 'ZTEST' => array( - 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, + 'category' => Calculation\Categories::CATEGORY_STATISTICAL, 'functionCall' => 'PHPExcel_Calculation_Statistical::ZTEST', 'argumentCount' => '2-3' ) @@ -2061,7 +2061,7 @@ class Calculation ); - private function __construct(PHPExcel $spreadsheet = null) + private function __construct(Spreadsheet $spreadsheet = null) { $setPrecision = (PHP_INT_SIZE == 4) ? 14 : 16; $this->savedPrecision = ini_get('precision'); @@ -2075,8 +2075,8 @@ class Calculation } $this->spreadsheet = $spreadsheet; - $this->cyclicReferenceStack = new PHPExcel_CalcEngine_CyclicReferenceStack(); - $this->_debugLog = new PHPExcel_CalcEngine_Logger($this->cyclicReferenceStack); + $this->cyclicReferenceStack = new CalcEngine\CyclicReferenceStack(); + $this->_debugLog = new CalcEngine\Logger($this->cyclicReferenceStack); } @@ -2112,7 +2112,7 @@ class Calculation if (isset(self::$spreadsheetSets[$spreadsheet->getID()])) { return self::$spreadsheetSets[$spreadsheet->getID()]; } - return new PHPExcel_Calculation($spreadsheet); + return new Calculation($spreadsheet); } if (!isset(self::$instance) || (self::$instance === null)) { @@ -2547,7 +2547,7 @@ class Calculation return '"'.$value.'"'; // Convert numeric errors to NaN error } elseif ((is_float($value)) && ((is_nan($value)) || (is_infinite($value)))) { - return PHPExcel_Calculation_Functions::NaN(); + return Calculation\Categoriess::NaN(); } return $value; @@ -2568,7 +2568,7 @@ class Calculation } // Convert numeric errors to NaN error } elseif ((is_float($value)) && ((is_nan($value)) || (is_infinite($value)))) { - return PHPExcel_Calculation_Functions::NaN(); + return Calculation\Categoriess::NaN(); } return $value; } @@ -2638,9 +2638,9 @@ class Calculation if ((is_array($result)) && (self::$returnArrayAsType != self::RETURN_ARRAY_AS_ARRAY)) { self::$returnArrayAsType = $returnArrayAsType; - $testResult = PHPExcel_Calculation_Functions::flattenArray($result); + $testResult = Calculation\Categoriess::flattenArray($result); if (self::$returnArrayAsType == self::RETURN_ARRAY_AS_ERROR) { - return PHPExcel_Calculation_Functions::VALUE(); + return Calculation\Categoriess::VALUE(); } // If there's only a single cell in the array, then we allow it if (count($testResult) != 1) { @@ -2648,13 +2648,13 @@ class Calculation $r = array_keys($result); $r = array_shift($r); if (!is_numeric($r)) { - return PHPExcel_Calculation_Functions::VALUE(); + return Calculation\Categoriess::VALUE(); } if (is_array($result[$r])) { $c = array_keys($result[$r]); $c = array_shift($c); if (!is_numeric($c)) { - return PHPExcel_Calculation_Functions::VALUE(); + return Calculation\Categoriess::VALUE(); } } } @@ -2666,7 +2666,7 @@ class Calculation if ($result === null) { return 0; } elseif ((is_float($result)) && ((is_nan($result)) || (is_infinite($result)))) { - return PHPExcel_Calculation_Functions::NaN(); + return Calculation\Categoriess::NaN(); } return $result; } @@ -2984,7 +2984,7 @@ class Calculation private function showValue($value) { if ($this->_debugLog->getWriteDebugLog()) { - $testArray = PHPExcel_Calculation_Functions::flattenArray($value); + $testArray = Calculation\Categoriess::flattenArray($value); if (count($testArray) == 1) { $value = array_pop($testArray); } @@ -3007,7 +3007,7 @@ class Calculation return ($value) ? self::$localeBoolean['TRUE'] : self::$localeBoolean['FALSE']; } } - return PHPExcel_Calculation_Functions::flattenSingleValue($value); + return Calculation\Categoriess::flattenSingleValue($value); } @@ -3020,7 +3020,7 @@ class Calculation private function showTypeDetails($value) { if ($this->_debugLog->getWriteDebugLog()) { - $testArray = PHPExcel_Calculation_Functions::flattenArray($value); + $testArray = Calculation\Categoriess::flattenArray($value); if (count($testArray) == 1) { $value = array_pop($testArray); } @@ -3610,7 +3610,7 @@ class Calculation } $stack->push('Cell Reference', $cellValue, $cellRef); } else { - $stack->push('Error', PHPExcel_Calculation_Functions::REF(), null); + $stack->push('Error', Calculation\Categoriess::REF(), null); } break; case '+': // Addition @@ -3712,7 +3712,7 @@ class Calculation // echo 'Reference is a Range of cells
'; if ($pCell === null) { // We can't access the range, so return a REF error - $cellValue = PHPExcel_Calculation_Functions::REF(); + $cellValue = Calculation\Categoriess::REF(); } else { $cellRef = $matches[6].$matches[7].':'.$matches[9].$matches[10]; if ($matches[2] > '') { @@ -3746,7 +3746,7 @@ class Calculation // echo 'Reference is a single Cell
'; if ($pCell === null) { // We can't access the cell, so return a REF error - $cellValue = PHPExcel_Calculation_Functions::REF(); + $cellValue = Calculation\Categoriess::REF(); } else { $cellRef = $matches[6].$matches[7]; if ($matches[2] > '') { @@ -3843,7 +3843,7 @@ class Calculation if ($functionName != 'MKMATRIX') { if ($this->_debugLog->getWriteDebugLog()) { krsort($argArrayVals); - $this->_debugLog->writeDebugLog('Evaluating ', self::localeFunc($functionName), '( ', implode(self::$localeArgumentSeparator.' ', PHPExcel_Calculation_Functions::flattenArray($argArrayVals)), ' )'); + $this->_debugLog->writeDebugLog('Evaluating ', self::localeFunc($functionName), '( ', implode(self::$localeArgumentSeparator.' ', Calculation\Categoriess::flattenArray($argArrayVals)), ' )'); } } // Process each argument in turn, building the return value as an array @@ -3877,7 +3877,7 @@ class Calculation $result = call_user_func_array(explode('::', $functionCall), $args); } else { foreach ($args as &$arg) { - $arg = PHPExcel_Calculation_Functions::flattenSingleValue($arg); + $arg = Calculation\Categoriess::flattenSingleValue($arg); } unset($arg); $result = call_user_func_array($functionCall, $args); @@ -3921,7 +3921,7 @@ class Calculation $output = $output['value']; // if ((is_array($output)) && (self::$returnArrayAsType != self::RETURN_ARRAY_AS_ARRAY)) { -// return array_shift(PHPExcel_Calculation_Functions::flattenArray($output)); +// return array_shift(Calculation\Categoriess::flattenArray($output)); // } return $output; } @@ -4010,7 +4010,7 @@ class Calculation } // Use case insensitive comparaison if not OpenOffice mode - if (PHPExcel_Calculation_Functions::getCompatibilityMode() != PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE) { + if (Calculation\Categoriess::getCompatibilityMode() != Calculation\Categoriess::COMPATIBILITY_OPENOFFICE) { if (is_string($operand1)) { $operand1 = strtoupper($operand1); } @@ -4019,7 +4019,7 @@ class Calculation } } - $useLowercaseFirstComparison = is_string($operand1) && is_string($operand2) && PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE; + $useLowercaseFirstComparison = is_string($operand1) && is_string($operand2) && Calculation\Categoriess::getCompatibilityMode() == Calculation\Categoriess::COMPATIBILITY_OPENOFFICE; // execute the necessary operation switch ($operation) { @@ -4126,10 +4126,10 @@ class Calculation $result = '#VALUE!'; } } else { - if ((PHPExcel_Calculation_Functions::getCompatibilityMode() != PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE) && + if ((Calculation\Categoriess::getCompatibilityMode() != Calculation\Categoriess::COMPATIBILITY_OPENOFFICE) && ((is_string($operand1) && !is_numeric($operand1) && strlen($operand1)>0) || (is_string($operand2) && !is_numeric($operand2) && strlen($operand2)>0))) { - $result = PHPExcel_Calculation_Functions::VALUE(); + $result = Calculation\Categoriess::VALUE(); } else { // If we're dealing with non-matrix operations, execute the necessary operation switch ($operation) { @@ -4292,7 +4292,7 @@ class Calculation // } // } } else { - return PHPExcel_Calculation_Functions::REF(); + return Calculation\Categoriess::REF(); } // Extract range @@ -4339,7 +4339,7 @@ class Calculation { $pFunction = strtoupper($pFunction); if (isset(self::$PHPExcelFunctions[$pFunction])) { - return (self::$PHPExcelFunctions[$pFunction]['functionCall'] != 'PHPExcel_Calculation_Functions::DUMMY'); + return (self::$PHPExcelFunctions[$pFunction]['functionCall'] != 'Calculation\Categoriess::DUMMY'); } else { return false; } @@ -4349,15 +4349,15 @@ class Calculation /** * Get a list of all implemented functions as an array of function objects * - * @return array of PHPExcel_Calculation_Function + * @return array of Calculation\Categories */ public function listFunctions() { $returnValue = array(); foreach (self::$PHPExcelFunctions as $functionName => $function) { - if ($function['functionCall'] != 'PHPExcel_Calculation_Functions::DUMMY') { - $returnValue[$functionName] = new PHPExcel_Calculation_Function( + if ($function['functionCall'] != 'Calculation\Categoriess::DUMMY') { + $returnValue[$functionName] = new Calculation\Categories( $function['category'], $functionName, $function['functionCall'] @@ -4388,7 +4388,7 @@ class Calculation { $returnValue = array(); foreach (self::$PHPExcelFunctions as $functionName => $function) { - if ($function['functionCall'] != 'PHPExcel_Calculation_Functions::DUMMY') { + if ($function['functionCall'] != 'Calculation\Categoriess::DUMMY') { $returnValue[] = $functionName; } } diff --git a/classes/src/Calculation/Categories.php b/classes/src/Calculation/Categories.php new file mode 100644 index 00000000..19e6069f --- /dev/null +++ b/classes/src/Calculation/Categories.php @@ -0,0 +1,150 @@ +category = $pCategory; + $this->excelName = $pExcelName; + $this->phpExcelName = $pPHPExcelName; + } else { + throw new PHPExcel_Calculation_Exception("Invalid parameters passed."); + } + } + + /** + * Get Category (represented by CATEGORY_*) + * + * @return string + */ + public function getCategory() + { + return $this->category; + } + + /** + * Set Category (represented by CATEGORY_*) + * + * @param string $value + * @throws PHPExcel_Calculation_Exception + */ + public function setCategory($value = null) + { + if (!is_null($value)) { + $this->category = $value; + } else { + throw new PHPExcel_Calculation_Exception("Invalid parameter passed."); + } + } + + /** + * Get Excel name + * + * @return string + */ + public function getExcelName() + { + return $this->excelName; + } + + /** + * Set Excel name + * + * @param string $value + */ + public function setExcelName($value) + { + $this->excelName = $value; + } + + /** + * Get PHPExcel name + * + * @return string + */ + public function getPHPExcelName() + { + return $this->phpExcelName; + } + + /** + * Set PHPExcel name + * + * @param string $value + */ + public function setPHPExcelName($value) + { + $this->phpExcelName = $value; + } +} diff --git a/classes/src/Calculation/Database.php b/classes/src/Calculation/Database.php index b8d91cb6..0ac2370d 100644 --- a/classes/src/Calculation/Database.php +++ b/classes/src/Calculation/Database.php @@ -1,13 +1,6 @@ parent = null; } - public function attach(PHPExcel_CachedObjectStorage_CacheBase $parent) + public function attach(CachedObjectStorage\CacheBase $parent) { $this->parent = $parent; } @@ -116,10 +118,10 @@ class PHPExcel_Cell * * @param mixed $pValue * @param string $pDataType - * @param PHPExcel_Worksheet $pSheet - * @throws PHPExcel_Exception + * @param Worksheet $pSheet + * @throws Exception */ - public function __construct($pValue = null, $pDataType = null, PHPExcel_Worksheet $pSheet = null) + public function __construct($pValue = null, $pDataType = null, Worksheet $pSheet = null) { // Initialise cell value $this->value = $pValue; @@ -129,12 +131,12 @@ class PHPExcel_Cell // Set datatype? if ($pDataType !== null) { - if ($pDataType == PHPExcel_Cell_DataType::TYPE_STRING2) { - $pDataType = PHPExcel_Cell_DataType::TYPE_STRING; + if ($pDataType == Cell\DataType::TYPE_STRING2) { + $pDataType = Cell\DataType::TYPE_STRING; } $this->dataType = $pDataType; } elseif (!self::getValueBinder()->bindValue($this, $pValue)) { - throw new PHPExcel_Exception("Value could not be bound to cell."); + throw new Exception("Value could not be bound to cell."); } } @@ -185,7 +187,7 @@ class PHPExcel_Cell */ public function getFormattedValue() { - return (string) PHPExcel_Style_NumberFormat::toFormattedString( + return (string) Style\NumberFormat::toFormattedString( $this->getCalculatedValue(), $this->getStyle() ->getNumberFormat()->getFormatCode() @@ -198,13 +200,13 @@ class PHPExcel_Cell * Sets the value for a cell, automatically determining the datatype using the value binder * * @param mixed $pValue Value - * @return PHPExcel_Cell - * @throws PHPExcel_Exception + * @return Cell + * @throws Exception */ public function setValue($pValue = null) { if (!self::getValueBinder()->bindValue($this, $pValue)) { - throw new PHPExcel_Exception("Value could not be bound to cell."); + throw new Exception("Value could not be bound to cell."); } return $this; } @@ -214,39 +216,39 @@ class PHPExcel_Cell * * @param mixed $pValue Value * @param string $pDataType Explicit data type - * @return PHPExcel_Cell - * @throws PHPExcel_Exception + * @return Cell + * @throws Exception */ - public function setValueExplicit($pValue = null, $pDataType = PHPExcel_Cell_DataType::TYPE_STRING) + public function setValueExplicit($pValue = null, $pDataType = Cell\DataType::TYPE_STRING) { // set the value according to data type switch ($pDataType) { - case PHPExcel_Cell_DataType::TYPE_NULL: + case Cell\DataType::TYPE_NULL: $this->value = $pValue; break; - case PHPExcel_Cell_DataType::TYPE_STRING2: - $pDataType = PHPExcel_Cell_DataType::TYPE_STRING; + case Cell\DataType::TYPE_STRING2: + $pDataType = Cell\DataType::TYPE_STRING; // no break - case PHPExcel_Cell_DataType::TYPE_STRING: + case Cell\DataType::TYPE_STRING: // Synonym for string - case PHPExcel_Cell_DataType::TYPE_INLINE: + case Cell\DataType::TYPE_INLINE: // Rich text - $this->value = PHPExcel_Cell_DataType::checkString($pValue); + $this->value = Cell\DataType::checkString($pValue); break; - case PHPExcel_Cell_DataType::TYPE_NUMERIC: + case Cell\DataType::TYPE_NUMERIC: $this->value = (float) $pValue; break; - case PHPExcel_Cell_DataType::TYPE_FORMULA: + case Cell\DataType::TYPE_FORMULA: $this->value = (string) $pValue; break; - case PHPExcel_Cell_DataType::TYPE_BOOL: + case Cell\DataType::TYPE_BOOL: $this->value = (bool) $pValue; break; - case PHPExcel_Cell_DataType::TYPE_ERROR: - $this->value = PHPExcel_Cell_DataType::checkErrorCode($pValue); + case Cell\DataType::TYPE_ERROR: + $this->value = Cell\DataType::checkErrorCode($pValue); break; default: - throw new PHPExcel_Exception('Invalid datatype: ' . $pDataType); + throw new Exception('Invalid datatype: ' . $pDataType); break; } @@ -263,15 +265,15 @@ class PHPExcel_Cell * * @param boolean $resetLog Whether the calculation engine logger should be reset or not * @return mixed - * @throws PHPExcel_Exception + * @throws Exception */ public function getCalculatedValue($resetLog = true) { //echo 'Cell '.$this->getCoordinate().' value is a '.$this->dataType.' with a value of '.$this->getValue().PHP_EOL; - if ($this->dataType == PHPExcel_Cell_DataType::TYPE_FORMULA) { + if ($this->dataType == Cell\DataType::TYPE_FORMULA) { try { //echo 'Cell value for '.$this->getCoordinate().' is a formula: Calculating value'.PHP_EOL; - $result = PHPExcel_Calculation::getInstance( + $result = Calculation::getInstance( $this->getWorksheet()->getParent() )->calculateCellValue($this, $resetLog); //echo $this->getCoordinate().' calculation result is '.$result.PHP_EOL; @@ -281,14 +283,14 @@ class PHPExcel_Cell $result = array_pop($result); } } - } catch (PHPExcel_Exception $ex) { + } catch (Exception $ex) { if (($ex->getMessage() === 'Unable to access External Workbook') && ($this->calculatedValue !== null)) { //echo 'Returning fallback value of '.$this->calculatedValue.' for cell '.$this->getCoordinate().PHP_EOL; return $this->calculatedValue; // Fallback for calculations referencing external files. } //echo 'Calculation Exception: '.$ex->getMessage().PHP_EOL; $result = '#N/A'; - throw new PHPExcel_Calculation_Exception( + throw new Calculation\Exception( $this->getWorksheet()->getTitle().'!'.$this->getCoordinate().' -> '.$ex->getMessage() ); } @@ -299,7 +301,7 @@ class PHPExcel_Cell } //echo 'Returning calculated value of '.$result.' for cell '.$this->getCoordinate().PHP_EOL; return $result; - } elseif ($this->value instanceof PHPExcel_RichText) { + } elseif ($this->value instanceof RichText) { // echo 'Cell value for '.$this->getCoordinate().' is rich text: Returning data value of '.$this->value.'
'; return $this->value->getPlainText(); } @@ -311,7 +313,7 @@ class PHPExcel_Cell * Set old calculated value (cached) * * @param mixed $pValue Value - * @return PHPExcel_Cell + * @return Cell */ public function setCalculatedValue($pValue = null) { @@ -351,12 +353,12 @@ class PHPExcel_Cell * Set cell data type * * @param string $pDataType - * @return PHPExcel_Cell + * @return Cell */ - public function setDataType($pDataType = PHPExcel_Cell_DataType::TYPE_STRING) + public function setDataType($pDataType = Cell\DataType::TYPE_STRING) { - if ($pDataType == PHPExcel_Cell_DataType::TYPE_STRING2) { - $pDataType = PHPExcel_Cell_DataType::TYPE_STRING; + if ($pDataType == Cell\DataType::TYPE_STRING2) { + $pDataType = Cell\DataType::TYPE_STRING; } $this->dataType = $pDataType; @@ -370,19 +372,19 @@ class PHPExcel_Cell */ public function isFormula() { - return $this->dataType == PHPExcel_Cell_DataType::TYPE_FORMULA; + return $this->dataType == Cell\DataType::TYPE_FORMULA; } /** * Does this cell contain Data validation rules? * * @return boolean - * @throws PHPExcel_Exception + * @throws Exception */ public function hasDataValidation() { if (!isset($this->parent)) { - throw new PHPExcel_Exception('Cannot check for data validation when cell is not bound to a worksheet'); + throw new Exception('Cannot check for data validation when cell is not bound to a worksheet'); } return $this->getWorksheet()->dataValidationExists($this->getCoordinate()); @@ -391,13 +393,13 @@ class PHPExcel_Cell /** * Get Data validation rules * - * @return PHPExcel_Cell_DataValidation - * @throws PHPExcel_Exception + * @return Cell\DataValidation + * @throws Exception */ public function getDataValidation() { if (!isset($this->parent)) { - throw new PHPExcel_Exception('Cannot get data validation for cell that is not bound to a worksheet'); + throw new Exception('Cannot get data validation for cell that is not bound to a worksheet'); } return $this->getWorksheet()->getDataValidation($this->getCoordinate()); @@ -406,14 +408,14 @@ class PHPExcel_Cell /** * Set Data validation rules * - * @param PHPExcel_Cell_DataValidation $pDataValidation - * @return PHPExcel_Cell - * @throws PHPExcel_Exception + * @param Cell\DataValidation $pDataValidation + * @return Cell + * @throws Exception */ - public function setDataValidation(PHPExcel_Cell_DataValidation $pDataValidation = null) + public function setDataValidation(Cell\DataValidation $pDataValidation = null) { if (!isset($this->parent)) { - throw new PHPExcel_Exception('Cannot set data validation for cell that is not bound to a worksheet'); + throw new Exception('Cannot set data validation for cell that is not bound to a worksheet'); } $this->getWorksheet()->setDataValidation($this->getCoordinate(), $pDataValidation); @@ -425,12 +427,12 @@ class PHPExcel_Cell * Does this cell contain a Hyperlink? * * @return boolean - * @throws PHPExcel_Exception + * @throws Exception */ public function hasHyperlink() { if (!isset($this->parent)) { - throw new PHPExcel_Exception('Cannot check for hyperlink when cell is not bound to a worksheet'); + throw new Exception('Cannot check for hyperlink when cell is not bound to a worksheet'); } return $this->getWorksheet()->hyperlinkExists($this->getCoordinate()); @@ -439,13 +441,13 @@ class PHPExcel_Cell /** * Get Hyperlink * - * @return PHPExcel_Cell_Hyperlink - * @throws PHPExcel_Exception + * @return Cell\Hyperlink + * @throws Exception */ public function getHyperlink() { if (!isset($this->parent)) { - throw new PHPExcel_Exception('Cannot get hyperlink for cell that is not bound to a worksheet'); + throw new Exception('Cannot get hyperlink for cell that is not bound to a worksheet'); } return $this->getWorksheet()->getHyperlink($this->getCoordinate()); @@ -454,14 +456,14 @@ class PHPExcel_Cell /** * Set Hyperlink * - * @param PHPExcel_Cell_Hyperlink $pHyperlink - * @return PHPExcel_Cell - * @throws PHPExcel_Exception + * @param Cell\Hyperlink $pHyperlink + * @return Cell + * @throws Exception */ - public function setHyperlink(PHPExcel_Cell_Hyperlink $pHyperlink = null) + public function setHyperlink(Cell\Hyperlink $pHyperlink = null) { if (!isset($this->parent)) { - throw new PHPExcel_Exception('Cannot set hyperlink for cell that is not bound to a worksheet'); + throw new Exception('Cannot set hyperlink for cell that is not bound to a worksheet'); } $this->getWorksheet()->setHyperlink($this->getCoordinate(), $pHyperlink); @@ -472,7 +474,7 @@ class PHPExcel_Cell /** * Get parent worksheet * - * @return PHPExcel_CachedObjectStorage_CacheBase + * @return CachedObjectStorage\CacheBase */ public function getParent() { @@ -482,7 +484,7 @@ class PHPExcel_Cell /** * Get parent worksheet * - * @return PHPExcel_Worksheet + * @return Worksheet */ public function getWorksheet() { @@ -507,7 +509,7 @@ class PHPExcel_Cell public function isMergeRangeValueCell() { if ($mergeRange = $this->getMergeRange()) { - $mergeRange = PHPExcel_Cell::splitRange($mergeRange); + $mergeRange = Cell::splitRange($mergeRange); list($startCell) = $mergeRange[0]; if ($this->getCoordinate() === $startCell) { return true; @@ -534,7 +536,7 @@ class PHPExcel_Cell /** * Get cell style * - * @return PHPExcel_Style + * @return Style */ public function getStyle() { @@ -544,10 +546,10 @@ class PHPExcel_Cell /** * Re-bind parent * - * @param PHPExcel_Worksheet $parent - * @return PHPExcel_Cell + * @param Worksheet $parent + * @return Cell */ - public function rebindParent(PHPExcel_Worksheet $parent) + public function rebindParent(Worksheet $parent) { $this->parent = $parent->getCellCacheController(); @@ -579,19 +581,19 @@ class PHPExcel_Cell * * @param string $pCoordinateString * @return array Array containing column and row (indexes 0 and 1) - * @throws PHPExcel_Exception + * @throws Exception */ public static function coordinateFromString($pCoordinateString = 'A1') { if (preg_match("/^([$]?[A-Z]{1,3})([$]?\d{1,7})$/", $pCoordinateString, $matches)) { return array($matches[1],$matches[2]); } elseif ((strpos($pCoordinateString, ':') !== false) || (strpos($pCoordinateString, ',') !== false)) { - throw new PHPExcel_Exception('Cell coordinate string can not be a range of cells'); + throw new Exception('Cell coordinate string can not be a range of cells'); } elseif ($pCoordinateString == '') { - throw new PHPExcel_Exception('Cell coordinate can not be zero-length string'); + throw new Exception('Cell coordinate can not be zero-length string'); } - throw new PHPExcel_Exception('Invalid cell coordinate '.$pCoordinateString); + throw new Exception('Invalid cell coordinate '.$pCoordinateString); } /** @@ -600,7 +602,7 @@ class PHPExcel_Cell * @param string $pCoordinateString e.g. 'A' or '1' or 'A1' * Note that this value can be a row or column reference as well as a cell reference * @return string Absolute coordinate e.g. '$A' or '$1' or '$A$1' - * @throws PHPExcel_Exception + * @throws Exception */ public static function absoluteReference($pCoordinateString = 'A1') { @@ -624,7 +626,7 @@ class PHPExcel_Cell return $worksheet . self::absoluteCoordinate($pCoordinateString); } - throw new PHPExcel_Exception('Cell coordinate string can not be a range of cells'); + throw new Exception('Cell coordinate string can not be a range of cells'); } /** @@ -632,7 +634,7 @@ class PHPExcel_Cell * * @param string $pCoordinateString e.g. 'A1' * @return string Absolute coordinate e.g. '$A$1' - * @throws PHPExcel_Exception + * @throws Exception */ public static function absoluteCoordinate($pCoordinateString = 'A1') { @@ -654,7 +656,7 @@ class PHPExcel_Cell return $worksheet . '$' . $column . '$' . $row; } - throw new PHPExcel_Exception('Cell coordinate string can not be a range of cells'); + throw new Exception('Cell coordinate string can not be a range of cells'); } /** @@ -685,13 +687,13 @@ class PHPExcel_Cell * * @param array $pRange Array containg one or more arrays containing one or two coordinate strings * @return string String representation of $pRange - * @throws PHPExcel_Exception + * @throws Exception */ public static function buildRange($pRange) { // Verify range if (!is_array($pRange) || empty($pRange) || !is_array($pRange[0])) { - throw new PHPExcel_Exception('Range does not contain any information'); + throw new Exception('Range does not contain any information'); } // Build range @@ -821,7 +823,7 @@ class PHPExcel_Cell return $_indexCache[$pString]; } } - throw new PHPExcel_Exception("Column string index can not be " . ((isset($pString{0})) ? "longer than 3 characters" : "empty")); + throw new Exception("Column string index can not be " . ((isset($pString{0})) ? "longer than 3 characters" : "empty")); } /** @@ -919,11 +921,11 @@ class PHPExcel_Cell /** * Compare 2 cells * - * @param PHPExcel_Cell $a Cell a - * @param PHPExcel_Cell $b Cell b + * @param Cell $a Cell a + * @param Cell $b Cell b * @return int Result of comparison (always -1 or 1, never zero!) */ - public static function compareCells(PHPExcel_Cell $a, PHPExcel_Cell $b) + public static function compareCells(Cell $a, Cell $b) { if ($a->getRow() < $b->getRow()) { return -1; @@ -939,12 +941,12 @@ class PHPExcel_Cell /** * Get value binder to use * - * @return PHPExcel_Cell_IValueBinder + * @return Cell\IValueBinder */ public static function getValueBinder() { if (self::$valueBinder === null) { - self::$valueBinder = new PHPExcel_Cell_DefaultValueBinder(); + self::$valueBinder = new Cell\DefaultValueBinder(); } return self::$valueBinder; @@ -953,13 +955,13 @@ class PHPExcel_Cell /** * Set value binder to use * - * @param PHPExcel_Cell_IValueBinder $binder - * @throws PHPExcel_Exception + * @param Cell\IValueBinder $binder + * @throws Exception */ - public static function setValueBinder(PHPExcel_Cell_IValueBinder $binder = null) + public static function setValueBinder(Cell\IValueBinder $binder = null) { if ($binder === null) { - throw new PHPExcel_Exception("A PHPExcel_Cell_IValueBinder is required for PHPExcel to function correctly."); + throw new Exception("A \\PHPExcel\\Cell\\IValueBinder is required for PHPExcel to function correctly."); } self::$valueBinder = $binder; @@ -994,7 +996,7 @@ class PHPExcel_Cell * Set index to cellXf * * @param int $pValue - * @return PHPExcel_Cell + * @return Cell */ public function setXfIndex($pValue = 0) { diff --git a/classes/src/Cell/AdvancedValueBinder.php b/classes/src/Cell/AdvancedValueBinder.php index 061d04eb..fc1aa9ae 100644 --- a/classes/src/Cell/AdvancedValueBinder.php +++ b/classes/src/Cell/AdvancedValueBinder.php @@ -1,13 +1,6 @@ formula1 = ''; - $this->formula2 = ''; - $this->type = PHPExcel_Cell_DataValidation::TYPE_NONE; - $this->errorStyle = PHPExcel_Cell_DataValidation::STYLE_STOP; - $this->operator = ''; - $this->allowBlank = false; - $this->showDropDown = false; - $this->showInputMessage = false; - $this->showErrorMessage = false; - $this->errorTitle = ''; - $this->error = ''; - $this->promptTitle = ''; - $this->prompt = ''; } /** diff --git a/classes/src/Cell/DefaultValueBinder.php b/classes/src/Cell/DefaultValueBinder.php index dc19e6c4..3ad0541f 100644 --- a/classes/src/Cell/DefaultValueBinder.php +++ b/classes/src/Cell/DefaultValueBinder.php @@ -1,13 +1,6 @@ format('Y-m-d H:i:s'); - } elseif (!($value instanceof PHPExcel_RichText)) { + } elseif (!($value instanceof \PHPExcel\RichText)) { $value = (string) $value; } } @@ -74,29 +67,29 @@ class PHPExcel_Cell_DefaultValueBinder implements PHPExcel_Cell_IValueBinder { // Match the value against a few data types if ($pValue === null) { - return PHPExcel_Cell_DataType::TYPE_NULL; + return DataType::TYPE_NULL; } elseif ($pValue === '') { - return PHPExcel_Cell_DataType::TYPE_STRING; - } elseif ($pValue instanceof PHPExcel_RichText) { - return PHPExcel_Cell_DataType::TYPE_INLINE; + return DataType::TYPE_STRING; + } elseif ($pValue instanceof \PHPExcel\RichText) { + return DataType::TYPE_INLINE; } elseif ($pValue{0} === '=' && strlen($pValue) > 1) { - return PHPExcel_Cell_DataType::TYPE_FORMULA; + return DataType::TYPE_FORMULA; } elseif (is_bool($pValue)) { - return PHPExcel_Cell_DataType::TYPE_BOOL; + return DataType::TYPE_BOOL; } elseif (is_float($pValue) || is_int($pValue)) { - return PHPExcel_Cell_DataType::TYPE_NUMERIC; + return DataType::TYPE_NUMERIC; } elseif (preg_match('/^[\+\-]?([0-9]+\\.?[0-9]*|[0-9]*\\.?[0-9]+)([Ee][\-\+]?[0-2]?\d{1,3})?$/', $pValue)) { $tValue = ltrim($pValue, '+-'); if (is_string($pValue) && $tValue{0} === '0' && strlen($tValue) > 1 && $tValue{1} !== '.') { - return PHPExcel_Cell_DataType::TYPE_STRING; + return DataType::TYPE_STRING; } elseif ((strpos($pValue, '.') === false) && ($pValue > PHP_INT_MAX)) { - return PHPExcel_Cell_DataType::TYPE_STRING; + return DataType::TYPE_STRING; } - return PHPExcel_Cell_DataType::TYPE_NUMERIC; - } elseif (is_string($pValue) && array_key_exists($pValue, PHPExcel_Cell_DataType::getErrorCodes())) { - return PHPExcel_Cell_DataType::TYPE_ERROR; + return DataType::TYPE_NUMERIC; + } elseif (is_string($pValue) && array_key_exists($pValue, DataType::getErrorCodes())) { + return DataType::TYPE_ERROR; } - return PHPExcel_Cell_DataType::TYPE_STRING; + return DataType::TYPE_STRING; } } diff --git a/classes/src/Cell/Hyperlink.php b/classes/src/Cell/Hyperlink.php index daab54c8..b60c2a4e 100644 --- a/classes/src/Cell/Hyperlink.php +++ b/classes/src/Cell/Hyperlink.php @@ -1,5 +1,7 @@ layout = $layout; $this->plotSeries = $plotSeries; diff --git a/classes/src/Chart/Properties.php b/classes/src/Chart/Properties.php index 9bb6e933..5bc19fb8 100644 --- a/classes/src/Chart/Properties.php +++ b/classes/src/Chart/Properties.php @@ -1,4 +1,7 @@ MARK_DIAMOND, 'square' => MARK_SQUARE, 'triangle' => MARK_UTRIANGLE, @@ -51,7 +53,7 @@ class PHPExcel_Chart_Renderer_jpgraph 'dash' => MARK_DTRIANGLE, 'circle' => MARK_CIRCLE, 'plus' => MARK_CROSS - ); + ]; private $chart; diff --git a/classes/src/Chart/Title.php b/classes/src/Chart/Title.php index d8dc14f2..b83659ed 100644 --- a/classes/src/Chart/Title.php +++ b/classes/src/Chart/Title.php @@ -1,5 +1,7 @@ caption = $caption; $this->layout = $layout; diff --git a/classes/src/Comment.php b/classes/src/Comment.php index d55363fd..228a1f49 100644 --- a/classes/src/Comment.php +++ b/classes/src/Comment.php @@ -1,5 +1,7 @@ lockRevision = false; - $this->lockStructure = false; - $this->lockWindows = false; - $this->revisionsPassword = ''; - $this->workbookPassword = ''; } /** diff --git a/classes/src/Exception.php b/classes/src/Exception.php index b27750ea..782a66dc 100644 --- a/classes/src/Exception.php +++ b/classes/src/Exception.php @@ -1,6 +1,9 @@ 'f0f8ff', 'antiquewhite' => 'faebd7', 'antiquewhite1' => 'ffefdb', @@ -520,7 +522,7 @@ class PHPExcel_Helper_HTML 'yellow3' => 'cdcd00', 'yellow4' => '8b8b00', 'yellowgreen' => '9acd32', - ); + ]; protected $face; protected $size; diff --git a/classes/src/IOFactory.php b/classes/src/IOFactory.php index 3ecda177..50453b51 100644 --- a/classes/src/IOFactory.php +++ b/classes/src/IOFactory.php @@ -1,13 +1,6 @@ = ($beforeRow + $pNumRows)) && @@ -156,32 +158,32 @@ class PHPExcel_ReferenceHelper /** * Update page breaks when inserting/deleting rows/columns * - * @param PHPExcel_Worksheet $pSheet The worksheet that we're editing + * @param Worksheet $pSheet The worksheet that we're editing * @param string $pBefore Insert/Delete before this cell address (e.g. 'A1') * @param integer $beforeColumnIndex Index number of the column we're inserting/deleting before * @param integer $pNumCols Number of columns to insert/delete (negative values indicate deletion) * @param integer $beforeRow Number of the row we're inserting/deleting before * @param integer $pNumRows Number of rows to insert/delete (negative values indicate deletion) */ - protected function adjustPageBreaks(PHPExcel_Worksheet $pSheet, $pBefore, $beforeColumnIndex, $pNumCols, $beforeRow, $pNumRows) + protected function adjustPageBreaks(Worksheet $pSheet, $pBefore, $beforeColumnIndex, $pNumCols, $beforeRow, $pNumRows) { $aBreaks = $pSheet->getBreaks(); ($pNumCols > 0 || $pNumRows > 0) ? - uksort($aBreaks, array('PHPExcel_ReferenceHelper','cellReverseSort')) : - uksort($aBreaks, array('PHPExcel_ReferenceHelper','cellSort')); + uksort($aBreaks, array('self','cellReverseSort')) : + uksort($aBreaks, array('self','cellSort')); foreach ($aBreaks as $key => $value) { if (self::cellAddressInDeleteRange($key, $beforeRow, $pNumRows, $beforeColumnIndex, $pNumCols)) { // If we're deleting, then clear any defined breaks that are within the range // of rows/columns that we're deleting - $pSheet->setBreak($key, PHPExcel_Worksheet::BREAK_NONE); + $pSheet->setBreak($key, Worksheet::BREAK_NONE); } else { // Otherwise update any affected breaks by inserting a new break at the appropriate point // and removing the old affected break $newReference = $this->updateCellReference($key, $pBefore, $pNumCols, $pNumRows); if ($key != $newReference) { $pSheet->setBreak($newReference, $value) - ->setBreak($key, PHPExcel_Worksheet::BREAK_NONE); + ->setBreak($key, Worksheet::BREAK_NONE); } } } @@ -190,7 +192,7 @@ class PHPExcel_ReferenceHelper /** * Update cell comments when inserting/deleting rows/columns * - * @param PHPExcel_Worksheet $pSheet The worksheet that we're editing + * @param Worksheet $pSheet The worksheet that we're editing * @param string $pBefore Insert/Delete before this cell address (e.g. 'A1') * @param integer $beforeColumnIndex Index number of the column we're inserting/deleting before * @param integer $pNumCols Number of columns to insert/delete (negative values indicate deletion) @@ -217,7 +219,7 @@ class PHPExcel_ReferenceHelper /** * Update hyperlinks when inserting/deleting rows/columns * - * @param PHPExcel_Worksheet $pSheet The worksheet that we're editing + * @param Worksheet $pSheet The worksheet that we're editing * @param string $pBefore Insert/Delete before this cell address (e.g. 'A1') * @param integer $beforeColumnIndex Index number of the column we're inserting/deleting before * @param integer $pNumCols Number of columns to insert/delete (negative values indicate deletion) @@ -227,7 +229,9 @@ class PHPExcel_ReferenceHelper protected function adjustHyperlinks($pSheet, $pBefore, $beforeColumnIndex, $pNumCols, $beforeRow, $pNumRows) { $aHyperlinkCollection = $pSheet->getHyperlinkCollection(); - ($pNumCols > 0 || $pNumRows > 0) ? uksort($aHyperlinkCollection, array('PHPExcel_ReferenceHelper','cellReverseSort')) : uksort($aHyperlinkCollection, array('PHPExcel_ReferenceHelper','cellSort')); + ($pNumCols > 0 || $pNumRows > 0) ? + uksort($aHyperlinkCollection, array('self','cellReverseSort')) : + uksort($aHyperlinkCollection, array('self','cellSort')); foreach ($aHyperlinkCollection as $key => $value) { $newReference = $this->updateCellReference($key, $pBefore, $pNumCols, $pNumRows); @@ -241,7 +245,7 @@ class PHPExcel_ReferenceHelper /** * Update data validations when inserting/deleting rows/columns * - * @param PHPExcel_Worksheet $pSheet The worksheet that we're editing + * @param Worksheet $pSheet The worksheet that we're editing * @param string $pBefore Insert/Delete before this cell address (e.g. 'A1') * @param integer $beforeColumnIndex Index number of the column we're inserting/deleting before * @param integer $pNumCols Number of columns to insert/delete (negative values indicate deletion) @@ -251,7 +255,9 @@ class PHPExcel_ReferenceHelper protected function adjustDataValidations($pSheet, $pBefore, $beforeColumnIndex, $pNumCols, $beforeRow, $pNumRows) { $aDataValidationCollection = $pSheet->getDataValidationCollection(); - ($pNumCols > 0 || $pNumRows > 0) ? uksort($aDataValidationCollection, array('PHPExcel_ReferenceHelper','cellReverseSort')) : uksort($aDataValidationCollection, array('PHPExcel_ReferenceHelper','cellSort')); + ($pNumCols > 0 || $pNumRows > 0) ? + uksort($aDataValidationCollection, array('self','cellReverseSort')) : + uksort($aDataValidationCollection, array('self','cellSort')); foreach ($aDataValidationCollection as $key => $value) { $newReference = $this->updateCellReference($key, $pBefore, $pNumCols, $pNumRows); @@ -265,7 +271,7 @@ class PHPExcel_ReferenceHelper /** * Update merged cells when inserting/deleting rows/columns * - * @param PHPExcel_Worksheet $pSheet The worksheet that we're editing + * @param Worksheet $pSheet The worksheet that we're editing * @param string $pBefore Insert/Delete before this cell address (e.g. 'A1') * @param integer $beforeColumnIndex Index number of the column we're inserting/deleting before * @param integer $pNumCols Number of columns to insert/delete (negative values indicate deletion) @@ -286,7 +292,7 @@ class PHPExcel_ReferenceHelper /** * Update protected cells when inserting/deleting rows/columns * - * @param PHPExcel_Worksheet $pSheet The worksheet that we're editing + * @param Worksheet $pSheet The worksheet that we're editing * @param string $pBefore Insert/Delete before this cell address (e.g. 'A1') * @param integer $beforeColumnIndex Index number of the column we're inserting/deleting before * @param integer $pNumCols Number of columns to insert/delete (negative values indicate deletion) @@ -297,8 +303,8 @@ class PHPExcel_ReferenceHelper { $aProtectedCells = $pSheet->getProtectedCells(); ($pNumCols > 0 || $pNumRows > 0) ? - uksort($aProtectedCells, array('PHPExcel_ReferenceHelper','cellReverseSort')) : - uksort($aProtectedCells, array('PHPExcel_ReferenceHelper','cellSort')); + uksort($aProtectedCells, array('self','cellReverseSort')) : + uksort($aProtectedCells, array('self','cellSort')); foreach ($aProtectedCells as $key => $value) { $newReference = $this->updateCellReference($key, $pBefore, $pNumCols, $pNumRows); if ($key != $newReference) { @@ -311,7 +317,7 @@ class PHPExcel_ReferenceHelper /** * Update column dimensions when inserting/deleting rows/columns * - * @param PHPExcel_Worksheet $pSheet The worksheet that we're editing + * @param Worksheet $pSheet The worksheet that we're editing * @param string $pBefore Insert/Delete before this cell address (e.g. 'A1') * @param integer $beforeColumnIndex Index number of the column we're inserting/deleting before * @param integer $pNumCols Number of columns to insert/delete (negative values indicate deletion) @@ -324,7 +330,7 @@ class PHPExcel_ReferenceHelper if (!empty($aColumnDimensions)) { foreach ($aColumnDimensions as $objColumnDimension) { $newReference = $this->updateCellReference($objColumnDimension->getColumnIndex() . '1', $pBefore, $pNumCols, $pNumRows); - list($newReference) = PHPExcel_Cell::coordinateFromString($newReference); + list($newReference) = Cell::coordinateFromString($newReference); if ($objColumnDimension->getColumnIndex() != $newReference) { $objColumnDimension->setColumnIndex($newReference); } @@ -336,7 +342,7 @@ class PHPExcel_ReferenceHelper /** * Update row dimensions when inserting/deleting rows/columns * - * @param PHPExcel_Worksheet $pSheet The worksheet that we're editing + * @param Worksheet $pSheet The worksheet that we're editing * @param string $pBefore Insert/Delete before this cell address (e.g. 'A1') * @param integer $beforeColumnIndex Index number of the column we're inserting/deleting before * @param integer $pNumCols Number of columns to insert/delete (negative values indicate deletion) @@ -349,7 +355,7 @@ class PHPExcel_ReferenceHelper if (!empty($aRowDimensions)) { foreach ($aRowDimensions as $objRowDimension) { $newReference = $this->updateCellReference('A' . $objRowDimension->getRowIndex(), $pBefore, $pNumCols, $pNumRows); - list(, $newReference) = PHPExcel_Cell::coordinateFromString($newReference); + list(, $newReference) = Cell::coordinateFromString($newReference); if ($objRowDimension->getRowIndex() != $newReference) { $objRowDimension->setRowIndex($newReference); } @@ -373,10 +379,10 @@ class PHPExcel_ReferenceHelper * @param string $pBefore Insert before this cell address (e.g. 'A1') * @param integer $pNumCols Number of columns to insert/delete (negative values indicate deletion) * @param integer $pNumRows Number of rows to insert/delete (negative values indicate deletion) - * @param PHPExcel_Worksheet $pSheet The worksheet that we're editing - * @throws PHPExcel_Exception + * @param Worksheet $pSheet The worksheet that we're editing + * @throws Exception */ - public function insertNewBefore($pBefore = 'A1', $pNumCols = 0, $pNumRows = 0, PHPExcel_Worksheet $pSheet = null) + public function insertNewBefore($pBefore = 'A1', $pNumCols = 0, $pNumRows = 0, Worksheet $pSheet = null) { $remove = ($pNumCols < 0 || $pNumRows < 0); $aCellCollection = $pSheet->getCellCollection(); @@ -384,8 +390,8 @@ class PHPExcel_ReferenceHelper // Get coordinates of $pBefore $beforeColumn = 'A'; $beforeRow = 1; - list($beforeColumn, $beforeRow) = PHPExcel_Cell::coordinateFromString($pBefore); - $beforeColumnIndex = PHPExcel_Cell::columnIndexFromString($beforeColumn); + list($beforeColumn, $beforeRow) = Cell::coordinateFromString($pBefore); + $beforeColumnIndex = Cell::columnIndexFromString($beforeColumn); // Clear cells if we are removing columns or rows $highestColumn = $pSheet->getHighestColumn(); @@ -395,10 +401,10 @@ class PHPExcel_ReferenceHelper if ($pNumCols < 0 && $beforeColumnIndex - 2 + $pNumCols > 0) { for ($i = 1; $i <= $highestRow - 1; ++$i) { for ($j = $beforeColumnIndex - 1 + $pNumCols; $j <= $beforeColumnIndex - 2; ++$j) { - $coordinate = PHPExcel_Cell::stringFromColumnIndex($j) . $i; + $coordinate = Cell::stringFromColumnIndex($j) . $i; $pSheet->removeConditionalStyles($coordinate); if ($pSheet->cellExists($coordinate)) { - $pSheet->getCell($coordinate)->setValueExplicit('', PHPExcel_Cell_DataType::TYPE_NULL); + $pSheet->getCell($coordinate)->setValueExplicit('', Cell\DataType::TYPE_NULL); $pSheet->getCell($coordinate)->setXfIndex(0); } } @@ -407,12 +413,12 @@ class PHPExcel_ReferenceHelper // 2. Clear row strips if we are removing rows if ($pNumRows < 0 && $beforeRow - 1 + $pNumRows > 0) { - for ($i = $beforeColumnIndex - 1; $i <= PHPExcel_Cell::columnIndexFromString($highestColumn) - 1; ++$i) { + for ($i = $beforeColumnIndex - 1; $i <= Cell::columnIndexFromString($highestColumn) - 1; ++$i) { for ($j = $beforeRow + $pNumRows; $j <= $beforeRow - 1; ++$j) { - $coordinate = PHPExcel_Cell::stringFromColumnIndex($i) . $j; + $coordinate = Cell::stringFromColumnIndex($i) . $j; $pSheet->removeConditionalStyles($coordinate); if ($pSheet->cellExists($coordinate)) { - $pSheet->getCell($coordinate)->setValueExplicit('', PHPExcel_Cell_DataType::TYPE_NULL); + $pSheet->getCell($coordinate)->setValueExplicit('', Cell\DataType::TYPE_NULL); $pSheet->getCell($coordinate)->setXfIndex(0); } } @@ -426,14 +432,14 @@ class PHPExcel_ReferenceHelper } while ($cellID = array_pop($aCellCollection)) { $cell = $pSheet->getCell($cellID); - $cellIndex = PHPExcel_Cell::columnIndexFromString($cell->getColumn()); + $cellIndex = Cell::columnIndexFromString($cell->getColumn()); if ($cellIndex-1 + $pNumCols < 0) { continue; } // New coordinates - $newCoordinates = PHPExcel_Cell::stringFromColumnIndex($cellIndex-1 + $pNumCols) . ($cell->getRow() + $pNumRows); + $newCoordinates = Cell::stringFromColumnIndex($cellIndex-1 + $pNumCols) . ($cell->getRow() + $pNumRows); // Should the cell be updated? Move value and cellXf index from one cell to another. if (($cellIndex >= $beforeColumnIndex) && ($cell->getRow() >= $beforeRow)) { @@ -441,7 +447,7 @@ class PHPExcel_ReferenceHelper $pSheet->getCell($newCoordinates)->setXfIndex($cell->getXfIndex()); // Insert this cell at its new location - if ($cell->getDataType() == PHPExcel_Cell_DataType::TYPE_FORMULA) { + if ($cell->getDataType() == Cell\DataType::TYPE_FORMULA) { // Formula should be adjusted $pSheet->getCell($newCoordinates) ->setValue($this->updateFormulaReferences($cell->getValue(), $pBefore, $pNumCols, $pNumRows, $pSheet->getTitle())); @@ -455,7 +461,7 @@ class PHPExcel_ReferenceHelper } else { /* We don't need to update styles for rows/columns before our insertion position, but we do still need to adjust any formulae in those cells */ - if ($cell->getDataType() == PHPExcel_Cell_DataType::TYPE_FORMULA) { + if ($cell->getDataType() == Cell\DataType::TYPE_FORMULA) { // Formula should be adjusted $cell->setValue($this->updateFormulaReferences($cell->getValue(), $pBefore, $pNumCols, $pNumRows, $pSheet->getTitle())); } @@ -470,7 +476,7 @@ class PHPExcel_ReferenceHelper if ($pNumCols > 0 && $beforeColumnIndex - 2 > 0) { for ($i = $beforeRow; $i <= $highestRow - 1; ++$i) { // Style - $coordinate = PHPExcel_Cell::stringFromColumnIndex($beforeColumnIndex - 2) . $i; + $coordinate = Cell::stringFromColumnIndex($beforeColumnIndex - 2) . $i; if ($pSheet->cellExists($coordinate)) { $xfIndex = $pSheet->getCell($coordinate)->getXfIndex(); $conditionalStyles = $pSheet->conditionalStylesExists($coordinate) ? @@ -482,7 +488,7 @@ class PHPExcel_ReferenceHelper foreach ($conditionalStyles as $conditionalStyle) { $cloned[] = clone $conditionalStyle; } - $pSheet->setConditionalStyles(PHPExcel_Cell::stringFromColumnIndex($j) . $i, $cloned); + $pSheet->setConditionalStyles(Cell::stringFromColumnIndex($j) . $i, $cloned); } } } @@ -491,21 +497,21 @@ class PHPExcel_ReferenceHelper } if ($pNumRows > 0 && $beforeRow - 1 > 0) { - for ($i = $beforeColumnIndex - 1; $i <= PHPExcel_Cell::columnIndexFromString($highestColumn) - 1; ++$i) { + for ($i = $beforeColumnIndex - 1; $i <= Cell::columnIndexFromString($highestColumn) - 1; ++$i) { // Style - $coordinate = PHPExcel_Cell::stringFromColumnIndex($i) . ($beforeRow - 1); + $coordinate = Cell::stringFromColumnIndex($i) . ($beforeRow - 1); if ($pSheet->cellExists($coordinate)) { $xfIndex = $pSheet->getCell($coordinate)->getXfIndex(); $conditionalStyles = $pSheet->conditionalStylesExists($coordinate) ? $pSheet->getConditionalStyles($coordinate) : false; for ($j = $beforeRow; $j <= $beforeRow - 1 + $pNumRows; ++$j) { - $pSheet->getCell(PHPExcel_Cell::stringFromColumnIndex($i) . $j)->setXfIndex($xfIndex); + $pSheet->getCell(Cell::stringFromColumnIndex($i) . $j)->setXfIndex($xfIndex); if ($conditionalStyles) { $cloned = array(); foreach ($conditionalStyles as $conditionalStyle) { $cloned[] = clone $conditionalStyle; } - $pSheet->setConditionalStyles(PHPExcel_Cell::stringFromColumnIndex($i) . $j, $cloned); + $pSheet->setConditionalStyles(Cell::stringFromColumnIndex($i) . $j, $cloned); } } } @@ -544,8 +550,8 @@ class PHPExcel_ReferenceHelper $autoFilterColumns = array_keys($autoFilter->getColumns()); if (count($autoFilterColumns) > 0) { sscanf($pBefore, '%[A-Z]%d', $column, $row); - $columnIndex = PHPExcel_Cell::columnIndexFromString($column); - list($rangeStart, $rangeEnd) = PHPExcel_Cell::rangeBoundaries($autoFilterRange); + $columnIndex = Cell::columnIndexFromString($column); + list($rangeStart, $rangeEnd) = Cell::rangeBoundaries($autoFilterRange); if ($columnIndex <= $rangeEnd[0]) { if ($pNumCols < 0) { // If we're actually deleting any columns that fall within the autofilter range, @@ -553,8 +559,8 @@ class PHPExcel_ReferenceHelper $deleteColumn = $columnIndex + $pNumCols - 1; $deleteCount = abs($pNumCols); for ($i = 1; $i <= $deleteCount; ++$i) { - if (in_array(PHPExcel_Cell::stringFromColumnIndex($deleteColumn), $autoFilterColumns)) { - $autoFilter->clearColumn(PHPExcel_Cell::stringFromColumnIndex($deleteColumn)); + if (in_array(Cell::stringFromColumnIndex($deleteColumn), $autoFilterColumns)) { + $autoFilter->clearColumn(Cell::stringFromColumnIndex($deleteColumn)); } ++$deleteColumn; } @@ -564,24 +570,24 @@ class PHPExcel_ReferenceHelper // Shuffle columns in autofilter range if ($pNumCols > 0) { // For insert, we shuffle from end to beginning to avoid overwriting - $startColID = PHPExcel_Cell::stringFromColumnIndex($startCol-1); - $toColID = PHPExcel_Cell::stringFromColumnIndex($startCol+$pNumCols-1); - $endColID = PHPExcel_Cell::stringFromColumnIndex($rangeEnd[0]); + $startColID = Cell::stringFromColumnIndex($startCol-1); + $toColID = Cell::stringFromColumnIndex($startCol+$pNumCols-1); + $endColID = Cell::stringFromColumnIndex($rangeEnd[0]); $startColRef = $startCol; $endColRef = $rangeEnd[0]; $toColRef = $rangeEnd[0]+$pNumCols; do { - $autoFilter->shiftColumn(PHPExcel_Cell::stringFromColumnIndex($endColRef-1), PHPExcel_Cell::stringFromColumnIndex($toColRef-1)); + $autoFilter->shiftColumn(Cell::stringFromColumnIndex($endColRef-1), Cell::stringFromColumnIndex($toColRef-1)); --$endColRef; --$toColRef; } while ($startColRef <= $endColRef); } else { // For delete, we shuffle from beginning to end to avoid overwriting - $startColID = PHPExcel_Cell::stringFromColumnIndex($startCol-1); - $toColID = PHPExcel_Cell::stringFromColumnIndex($startCol+$pNumCols-1); - $endColID = PHPExcel_Cell::stringFromColumnIndex($rangeEnd[0]); + $startColID = Cell::stringFromColumnIndex($startCol-1); + $toColID = Cell::stringFromColumnIndex($startCol+$pNumCols-1); + $endColID = Cell::stringFromColumnIndex($rangeEnd[0]); do { $autoFilter->shiftColumn($startColID, $toColID); ++$startColID; @@ -635,7 +641,7 @@ class PHPExcel_ReferenceHelper * @param int $pNumRows Number of rows to insert * @param string $sheetName Worksheet name/title * @return string Updated formula - * @throws PHPExcel_Exception + * @throws Exception */ public function updateFormulaReferences($pFormula = '', $pBefore = 'A1', $pNumCols = 0, $pNumRows = 0, $sheetName = '') { @@ -686,7 +692,7 @@ class PHPExcel_ReferenceHelper $toString = ($match[2] > '') ? $match[2].'!' : ''; $toString .= $modified3.':'.$modified4; // Max worksheet size is 1,048,576 rows by 16,384 columns in Excel 2007, so our adjustments need to be at least one digit more - $column = PHPExcel_Cell::columnIndexFromString(trim($match[3], '$')) + 100000; + $column = Cell::columnIndexFromString(trim($match[3], '$')) + 100000; $row = 10000000; $cellIndex = $column.$row; @@ -710,9 +716,9 @@ class PHPExcel_ReferenceHelper if (($match[2] == '') || (trim($match[2], "'") == $sheetName)) { $toString = ($match[2] > '') ? $match[2].'!' : ''; $toString .= $modified3.':'.$modified4; - list($column, $row) = PHPExcel_Cell::coordinateFromString($match[3]); + list($column, $row) = Cell::coordinateFromString($match[3]); // Max worksheet size is 1,048,576 rows by 16,384 columns in Excel 2007, so our adjustments need to be at least one digit more - $column = PHPExcel_Cell::columnIndexFromString(trim($column, '$')) + 100000; + $column = Cell::columnIndexFromString(trim($column, '$')) + 100000; $row = trim($row, '$') + 10000000; $cellIndex = $column.$row; @@ -736,9 +742,9 @@ class PHPExcel_ReferenceHelper if (($match[2] == '') || (trim($match[2], "'") == $sheetName)) { $toString = ($match[2] > '') ? $match[2].'!' : ''; $toString .= $modified3; - list($column, $row) = PHPExcel_Cell::coordinateFromString($match[3]); + list($column, $row) = Cell::coordinateFromString($match[3]); // Max worksheet size is 1,048,576 rows by 16,384 columns in Excel 2007, so our adjustments need to be at least one digit more - $column = PHPExcel_Cell::columnIndexFromString(trim($column, '$')) + 100000; + $column = Cell::columnIndexFromString(trim($column, '$')) + 100000; $row = trim($row, '$') + 10000000; $cellIndex = $row . $column; @@ -775,7 +781,7 @@ class PHPExcel_ReferenceHelper * @param int $pNumCols Number of columns to increment * @param int $pNumRows Number of rows to increment * @return string Updated cell range - * @throws PHPExcel_Exception + * @throws Exception */ public function updateCellReference($pCellRange = 'A1', $pBefore = 'A1', $pNumCols = 0, $pNumRows = 0) { @@ -802,7 +808,7 @@ class PHPExcel_ReferenceHelper * @param string $oldName Old name (name to replace) * @param string $newName New name */ - public function updateNamedFormulas(PHPExcel $pPhpExcel, $oldName = '', $newName = '') + public function updateNamedFormulas(Spreadsheet $pPhpExcel, $oldName = '', $newName = '') { if ($oldName == '') { return; @@ -811,12 +817,12 @@ class PHPExcel_ReferenceHelper foreach ($pPhpExcel->getWorksheetIterator() as $sheet) { foreach ($sheet->getCellCollection(false) as $cellID) { $cell = $sheet->getCell($cellID); - if (($cell !== null) && ($cell->getDataType() == PHPExcel_Cell_DataType::TYPE_FORMULA)) { + if (($cell !== null) && ($cell->getDataType() == Cell\DataType::TYPE_FORMULA)) { $formula = $cell->getValue(); if (strpos($formula, $oldName) !== false) { $formula = str_replace("'" . $oldName . "'!", "'" . $newName . "'!", $formula); $formula = str_replace($oldName . "!", $newName . "!", $formula); - $cell->setValueExplicit($formula, PHPExcel_Cell_DataType::TYPE_FORMULA); + $cell->setValueExplicit($formula, Cell\DataType::TYPE_FORMULA); } } } @@ -831,22 +837,22 @@ class PHPExcel_ReferenceHelper * @param int $pNumCols Number of columns to increment * @param int $pNumRows Number of rows to increment * @return string Updated cell range - * @throws PHPExcel_Exception + * @throws Exception */ private function updateCellRange($pCellRange = 'A1:A1', $pBefore = 'A1', $pNumCols = 0, $pNumRows = 0) { if (strpos($pCellRange, ':') !== false || strpos($pCellRange, ',') !== false) { // Update range - $range = PHPExcel_Cell::splitRange($pCellRange); + $range = Cell::splitRange($pCellRange); $ic = count($range); for ($i = 0; $i < $ic; ++$i) { $jc = count($range[$i]); for ($j = 0; $j < $jc; ++$j) { if (ctype_alpha($range[$i][$j])) { - $r = PHPExcel_Cell::coordinateFromString($this->updateSingleCellReference($range[$i][$j].'1', $pBefore, $pNumCols, $pNumRows)); + $r = Cell::coordinateFromString($this->updateSingleCellReference($range[$i][$j].'1', $pBefore, $pNumCols, $pNumRows)); $range[$i][$j] = $r[0]; } elseif (ctype_digit($range[$i][$j])) { - $r = PHPExcel_Cell::coordinateFromString($this->updateSingleCellReference('A'.$range[$i][$j], $pBefore, $pNumCols, $pNumRows)); + $r = Cell::coordinateFromString($this->updateSingleCellReference('A'.$range[$i][$j], $pBefore, $pNumCols, $pNumRows)); $range[$i][$j] = $r[1]; } else { $range[$i][$j] = $this->updateSingleCellReference($range[$i][$j], $pBefore, $pNumCols, $pNumRows); @@ -855,9 +861,9 @@ class PHPExcel_ReferenceHelper } // Recreate range string - return PHPExcel_Cell::buildRange($range); + return Cell::buildRange($range); } else { - throw new PHPExcel_Exception("Only cell ranges may be passed to this method."); + throw new Exception("Only cell ranges may be passed to this method."); } } @@ -869,24 +875,24 @@ class PHPExcel_ReferenceHelper * @param int $pNumCols Number of columns to increment * @param int $pNumRows Number of rows to increment * @return string Updated cell reference - * @throws PHPExcel_Exception + * @throws Exception */ private function updateSingleCellReference($pCellReference = 'A1', $pBefore = 'A1', $pNumCols = 0, $pNumRows = 0) { if (strpos($pCellReference, ':') === false && strpos($pCellReference, ',') === false) { // Get coordinates of $pBefore - list($beforeColumn, $beforeRow) = PHPExcel_Cell::coordinateFromString($pBefore); + list($beforeColumn, $beforeRow) = Cell::coordinateFromString($pBefore); // Get coordinates of $pCellReference - list($newColumn, $newRow) = PHPExcel_Cell::coordinateFromString($pCellReference); + list($newColumn, $newRow) = Cell::coordinateFromString($pCellReference); // Verify which parts should be updated - $updateColumn = (($newColumn{0} != '$') && ($beforeColumn{0} != '$') && (PHPExcel_Cell::columnIndexFromString($newColumn) >= PHPExcel_Cell::columnIndexFromString($beforeColumn))); + $updateColumn = (($newColumn{0} != '$') && ($beforeColumn{0} != '$') && (Cell::columnIndexFromString($newColumn) >= Cell::columnIndexFromString($beforeColumn))); $updateRow = (($newRow{0} != '$') && ($beforeRow{0} != '$') && $newRow >= $beforeRow); // Create new column reference if ($updateColumn) { - $newColumn = PHPExcel_Cell::stringFromColumnIndex(PHPExcel_Cell::columnIndexFromString($newColumn) - 1 + $pNumCols); + $newColumn = Cell::stringFromColumnIndex(Cell::columnIndexFromString($newColumn) - 1 + $pNumCols); } // Create new row reference @@ -897,17 +903,17 @@ class PHPExcel_ReferenceHelper // Return new reference return $newColumn . $newRow; } else { - throw new PHPExcel_Exception("Only single cell references may be passed to this method."); + throw new Exception("Only single cell references may be passed to this method."); } } /** * __clone implementation. Cloning should not be allowed in a Singleton! * - * @throws PHPExcel_Exception + * @throws Exception */ final public function __clone() { - throw new PHPExcel_Exception("Cloning a Singleton is not allowed!"); + throw new Exception("Cloning a Singleton is not allowed!"); } } diff --git a/classes/src/RichText.php b/classes/src/RichText.php index 74a3534a..bdccdd27 100644 --- a/classes/src/RichText.php +++ b/classes/src/RichText.php @@ -1,5 +1,7 @@ 'January', 'Feb' => 'February', 'Mar' => 'March', @@ -51,7 +53,7 @@ class PHPExcel_Shared_Date 'Oct' => 'October', 'Nov' => 'November', 'Dec' => 'December', - ); + ]; /* * Names of the months of the year, indexed by shortname @@ -60,12 +62,12 @@ class PHPExcel_Shared_Date * @public * @var string[] */ - public static $numberSuffixes = array( + public static $numberSuffixes = [ 'st', 'nd', 'rd', 'th', - ); + ]; /* * Base calendar year to use for calculations @@ -150,7 +152,7 @@ class PHPExcel_Shared_Date * Convert a date from Excel to a PHP Date/Time object * * @param integer $dateValue Excel date/time value - * @return DateTime PHP date/time object + * @return \DateTime PHP date/time object */ public static function ExcelToPHPObject($dateValue = 0) { @@ -183,7 +185,7 @@ class PHPExcel_Shared_Date $saveTimeZone = date_default_timezone_get(); date_default_timezone_set('UTC'); $retValue = false; - if ((is_object($dateValue)) && ($dateValue instanceof DateTime)) { + if ((is_object($dateValue)) && ($dateValue instanceof \DateTime)) { $retValue = self::FormattedPHPToExcel($dateValue->format('Y'), $dateValue->format('m'), $dateValue->format('d'), $dateValue->format('H'), $dateValue->format('i'), $dateValue->format('s')); } elseif (is_numeric($dateValue)) { $retValue = self::FormattedPHPToExcel(date('Y', $dateValue), date('m', $dateValue), date('d', $dateValue), date('H', $dateValue), date('i', $dateValue), date('s', $dateValue)); @@ -247,7 +249,7 @@ class PHPExcel_Shared_Date * @param PHPExcel_Cell $pCell * @return boolean */ - public static function isDateTime(PHPExcel_Cell $pCell) + public static function isDateTime(\PHPExcel\Cell $pCell) { return self::isDateTimeFormat( $pCell->getWorksheet()->getStyle( @@ -263,7 +265,7 @@ class PHPExcel_Shared_Date * @param PHPExcel_Style_NumberFormat $pFormat * @return boolean */ - public static function isDateTimeFormat(PHPExcel_Style_NumberFormat $pFormat) + public static function isDateTimeFormat(\PHPExcel\Style\NumberFormat $pFormat) { return self::isDateTimeFormatCode($pFormat->getFormatCode()); } @@ -358,15 +360,15 @@ class PHPExcel_Shared_Date return false; } - $dateValueNew = PHPExcel_Calculation_DateTime::DATEVALUE($dateValue); + $dateValueNew = \PHPExcel\Calculation\DateTime::DATEVALUE($dateValue); - if ($dateValueNew === PHPExcel_Calculation_Functions::VALUE()) { + if ($dateValueNew === \PHPExcel\Calculation\Functions::VALUE()) { return false; } if (strpos($dateValue, ':') !== false) { - $timeValue = PHPExcel_Calculation_DateTime::TIMEVALUE($dateValue); - if ($timeValue === PHPExcel_Calculation_Functions::VALUE()) { + $timeValue = \PHPExcel\Calculation\DateTime::TIMEVALUE($dateValue); + if ($timeValue === \PHPExcel\Calculation\Functions::VALUE()) { return false; } $dateValueNew += $timeValue; diff --git a/classes/src/Shared/Drawing.php b/classes/src/Shared/Drawing.php index 3e027b4a..67515eb1 100644 --- a/classes/src/Shared/Drawing.php +++ b/classes/src/Shared/Drawing.php @@ -1,6 +1,9 @@ macrosCode=$MacrosCode; - $this->setHasMacros(!is_null($MacrosCode)); + $this->macrosCode = $macroCode; + $this->setHasMacros(!is_null($macroCode)); } /** @@ -180,9 +180,9 @@ class Spreadsheet * * @param string|null $Certificate */ - public function setMacrosCertificate($Certificate = null) + public function setMacrosCertificate($certificate = null) { - $this->macrosCertificate=$Certificate; + $this->macrosCertificate = $certificate; } /** @@ -211,19 +211,19 @@ class Spreadsheet */ public function discardMacros() { - $this->hasMacros=false; - $this->macrosCode=null; - $this->macrosCertificate=null; + $this->hasMacros = false; + $this->macrosCode = null; + $this->macrosCertificate = null; } /** * set ribbon XML data * */ - public function setRibbonXMLData($Target = null, $XMLData = null) + public function setRibbonXMLData($target = null, $xmlData = null) { - if (!is_null($Target) && !is_null($XMLData)) { - $this->ribbonXMLData = array('target' => $Target, 'data' => $XMLData); + if (!is_null($target) && !is_null($xmlData)) { + $this->ribbonXMLData = array('target' => $target, 'data' => $xmlData); } else { $this->ribbonXMLData = null; } @@ -234,23 +234,23 @@ class Spreadsheet * * return string|null|array */ - public function getRibbonXMLData($What = 'all') //we need some constants here... + public function getRibbonXMLData($what = 'all') //we need some constants here... { - $ReturnData = null; - $What = strtolower($What); - switch ($What){ + $returnData = null; + $what = strtolower($what); + switch ($what){ case 'all': - $ReturnData = $this->ribbonXMLData; + $returnData = $this->ribbonXMLData; break; case 'target': case 'data': - if (is_array($this->ribbonXMLData) && array_key_exists($What, $this->ribbonXMLData)) { - $ReturnData = $this->ribbonXMLData[$What]; + if (is_array($this->ribbonXMLData) && array_key_exists($what, $this->ribbonXMLData)) { + $returnData = $this->ribbonXMLData[$what]; } break; } - return $ReturnData; + return $returnData; } /** diff --git a/classes/src/Style.php b/classes/src/Style.php index 6b952ef9..e12cb46d 100644 --- a/classes/src/Style.php +++ b/classes/src/Style.php @@ -1,5 +1,7 @@ conditionalStyles = array(); - $this->font = new PHPExcel_Style_Font($isSupervisor, $isConditional); - $this->fill = new PHPExcel_Style_Fill($isSupervisor, $isConditional); - $this->borders = new PHPExcel_Style_Borders($isSupervisor, $isConditional); - $this->alignment = new PHPExcel_Style_Alignment($isSupervisor, $isConditional); - $this->numberFormat = new PHPExcel_Style_NumberFormat($isSupervisor, $isConditional); - $this->protection = new PHPExcel_Style_Protection($isSupervisor, $isConditional); + $this->font = new Style\Font($isSupervisor, $isConditional); + $this->fill = new Style\Fill($isSupervisor, $isConditional); + $this->borders = new Style\Borders($isSupervisor, $isConditional); + $this->alignment = new Style\Alignment($isSupervisor, $isConditional); + $this->numberFormat = new Style\NumberFormat($isSupervisor, $isConditional); + $this->protection = new Style\Protection($isSupervisor, $isConditional); // bind parent if we are a supervisor if ($isSupervisor) { @@ -129,7 +131,7 @@ class PHPExcel_Style extends PHPExcel_Style_Supervisor implements PHPExcel_IComp * Get the shared style component for the currently active cell in currently active sheet. * Only used for style supervisor * - * @return PHPExcel_Style + * @return Style */ public function getSharedComponent() { @@ -176,7 +178,7 @@ class PHPExcel_Style extends PHPExcel_Style_Supervisor implements PHPExcel_IComp * 'name' => 'Arial', * 'bold' => true, * 'italic' => false, - * 'underline' => PHPExcel_Style_Font::UNDERLINE_DOUBLE, + * 'underline' => \PHPExcel\Style\Font::UNDERLINE_DOUBLE, * 'strike' => false, * 'color' => array( * 'rgb' => '808080' @@ -184,13 +186,13 @@ class PHPExcel_Style extends PHPExcel_Style_Supervisor implements PHPExcel_IComp * ), * 'borders' => array( * 'bottom' => array( - * 'style' => PHPExcel_Style_Border::BORDER_DASHDOT, + * 'style' => \PHPExcel\Style\Border::BORDER_DASHDOT, * 'color' => array( * 'rgb' => '808080' * ) * ), * 'top' => array( - * 'style' => PHPExcel_Style_Border::BORDER_DASHDOT, + * 'style' => \PHPExcel\Style\Border::BORDER_DASHDOT, * 'color' => array( * 'rgb' => '808080' * ) @@ -201,10 +203,10 @@ class PHPExcel_Style extends PHPExcel_Style_Supervisor implements PHPExcel_IComp * ); * * - * @param array $pStyles Array containing style information - * @param boolean $pAdvanced Advanced mode for setting borders. - * @throws PHPExcel_Exception - * @return PHPExcel_Style + * @param array $pStyles Array containing style information + * @param boolean $pAdvanced Advanced mode for setting borders. + * @throws Exception + * @return Style */ public function applyFromArray($pStyles = null, $pAdvanced = true) { @@ -224,12 +226,12 @@ class PHPExcel_Style extends PHPExcel_Style_Supervisor implements PHPExcel_IComp } // Calculate range outer borders - $rangeStart = PHPExcel_Cell::coordinateFromString($rangeA); - $rangeEnd = PHPExcel_Cell::coordinateFromString($rangeB); + $rangeStart = Cell::coordinateFromString($rangeA); + $rangeEnd = Cell::coordinateFromString($rangeB); // Translate column into index - $rangeStart[0] = PHPExcel_Cell::columnIndexFromString($rangeStart[0]) - 1; - $rangeEnd[0] = PHPExcel_Cell::columnIndexFromString($rangeEnd[0]) - 1; + $rangeStart[0] = Cell::columnIndexFromString($rangeStart[0]) - 1; + $rangeEnd[0] = Cell::columnIndexFromString($rangeEnd[0]) - 1; // Make sure we can loop upwards on rows and columns if ($rangeStart[0] > $rangeEnd[0] && $rangeStart[1] > $rangeEnd[1]) { @@ -278,12 +280,12 @@ class PHPExcel_Style extends PHPExcel_Style_Supervisor implements PHPExcel_IComp for ($x = 1; $x <= $xMax; ++$x) { // start column index for region $colStart = ($x == 3) ? - PHPExcel_Cell::stringFromColumnIndex($rangeEnd[0]) - : PHPExcel_Cell::stringFromColumnIndex($rangeStart[0] + $x - 1); + Cell::stringFromColumnIndex($rangeEnd[0]) + : Cell::stringFromColumnIndex($rangeStart[0] + $x - 1); // end column index for region $colEnd = ($x == 1) ? - PHPExcel_Cell::stringFromColumnIndex($rangeStart[0]) - : PHPExcel_Cell::stringFromColumnIndex($rangeEnd[0] - $xMax + $x); + Cell::stringFromColumnIndex($rangeStart[0]) + : Cell::stringFromColumnIndex($rangeEnd[0] - $xMax + $x); for ($y = 1; $y <= $yMax; ++$y) { // which edges are touching the region @@ -464,7 +466,7 @@ class PHPExcel_Style extends PHPExcel_Style_Supervisor implements PHPExcel_IComp } } } else { - throw new PHPExcel_Exception("Invalid style array passed."); + throw new Exception("Invalid style array passed."); } return $this; } @@ -472,7 +474,7 @@ class PHPExcel_Style extends PHPExcel_Style_Supervisor implements PHPExcel_IComp /** * Get Fill * - * @return PHPExcel_Style_Fill + * @return Style\Fill */ public function getFill() { @@ -482,7 +484,7 @@ class PHPExcel_Style extends PHPExcel_Style_Supervisor implements PHPExcel_IComp /** * Get Font * - * @return PHPExcel_Style_Font + * @return Style\Font */ public function getFont() { @@ -492,10 +494,10 @@ class PHPExcel_Style extends PHPExcel_Style_Supervisor implements PHPExcel_IComp /** * Set font * - * @param PHPExcel_Style_Font $font - * @return PHPExcel_Style + * @param Style\Font $font + * @return Style */ - public function setFont(PHPExcel_Style_Font $font) + public function setFont(Style\Font $font) { $this->font = $font; return $this; @@ -504,7 +506,7 @@ class PHPExcel_Style extends PHPExcel_Style_Supervisor implements PHPExcel_IComp /** * Get Borders * - * @return PHPExcel_Style_Borders + * @return Style\Borders */ public function getBorders() { @@ -514,7 +516,7 @@ class PHPExcel_Style extends PHPExcel_Style_Supervisor implements PHPExcel_IComp /** * Get Alignment * - * @return PHPExcel_Style_Alignment + * @return Style\Alignment */ public function getAlignment() { @@ -524,7 +526,7 @@ class PHPExcel_Style extends PHPExcel_Style_Supervisor implements PHPExcel_IComp /** * Get Number Format * - * @return PHPExcel_Style_NumberFormat + * @return Style\NumberFormat */ public function getNumberFormat() { @@ -534,7 +536,7 @@ class PHPExcel_Style extends PHPExcel_Style_Supervisor implements PHPExcel_IComp /** * Get Conditional Styles. Only used on supervisor. * - * @return PHPExcel_Style_Conditional[] + * @return Style\Conditional[] */ public function getConditionalStyles() { @@ -544,8 +546,8 @@ class PHPExcel_Style extends PHPExcel_Style_Supervisor implements PHPExcel_IComp /** * Set Conditional Styles. Only used on supervisor. * - * @param PHPExcel_Style_Conditional[] $pValue Array of condtional styles - * @return PHPExcel_Style + * @param Style\Conditional[] $pValue Array of condtional styles + * @return Style */ public function setConditionalStyles($pValue = null) { @@ -558,7 +560,7 @@ class PHPExcel_Style extends PHPExcel_Style_Supervisor implements PHPExcel_IComp /** * Get Protection * - * @return PHPExcel_Style_Protection + * @return Style\Protection */ public function getProtection() { diff --git a/classes/src/Style/Alignment.php b/classes/src/Style/Alignment.php index bfc49477..280e1a88 100644 --- a/classes/src/Style/Alignment.php +++ b/classes/src/Style/Alignment.php @@ -1,4 +1,7 @@ color = new PHPExcel_Style_Color(PHPExcel_Style_Color::COLOR_BLACK, $isSupervisor); + $this->color = new Color(Color::COLOR_BLACK, $isSupervisor); // bind parent if we are a supervisor if ($isSupervisor) { @@ -91,9 +93,9 @@ class PHPExcel_Style_Border extends PHPExcel_Style_Supervisor implements PHPExce /** * Bind parent. Only used for supervisor * - * @param PHPExcel_Style_Borders $parent + * @param Borders $parent * @param string $parentPropertyName - * @return PHPExcel_Style_Border + * @return Border */ public function bindParent($parent, $parentPropertyName = null) { @@ -106,7 +108,7 @@ class PHPExcel_Style_Border extends PHPExcel_Style_Supervisor implements PHPExce * Get the shared style component for the currently active cell in currently active sheet. * Only used for style supervisor * - * @return PHPExcel_Style_Border + * @return Border * @throws PHPExcel_Exception */ public function getSharedComponent() @@ -117,7 +119,7 @@ class PHPExcel_Style_Border extends PHPExcel_Style_Supervisor implements PHPExce case 'inside': case 'outline': case 'vertical': - throw new PHPExcel_Exception('Cannot get shared component for a pseudo-border.'); + throw new \PHPExcel\Exception('Cannot get shared component for a pseudo-border.'); break; case 'bottom': return $this->parent->getSharedComponent()->getBottom(); @@ -163,7 +165,7 @@ class PHPExcel_Style_Border extends PHPExcel_Style_Supervisor implements PHPExce * * $objPHPExcel->getActiveSheet()->getStyle('B2')->getBorders()->getTop()->applyFromArray( * array( - * 'style' => PHPExcel_Style_Border::BORDER_DASHDOT, + * 'style' => \PHPExcel\Style\Border::BORDER_DASHDOT, * 'color' => array( * 'rgb' => '808080' * ) @@ -173,7 +175,7 @@ class PHPExcel_Style_Border extends PHPExcel_Style_Supervisor implements PHPExce * * @param array $pStyles Array containing style information * @throws PHPExcel_Exception - * @return PHPExcel_Style_Border + * @return Border */ public function applyFromArray($pStyles = null) { @@ -189,7 +191,7 @@ class PHPExcel_Style_Border extends PHPExcel_Style_Supervisor implements PHPExce } } } else { - throw new PHPExcel_Exception("Invalid style array passed."); + throw new \PHPExcel\Exception("Invalid style array passed."); } return $this; } @@ -211,17 +213,17 @@ class PHPExcel_Style_Border extends PHPExcel_Style_Supervisor implements PHPExce * Set Border style * * @param string|boolean $pValue - * When passing a boolean, FALSE equates PHPExcel_Style_Border::BORDER_NONE - * and TRUE to PHPExcel_Style_Border::BORDER_MEDIUM - * @return PHPExcel_Style_Border + * When passing a boolean, FALSE equates Border::BORDER_NONE + * and TRUE to Border::BORDER_MEDIUM + * @return Border */ - public function setBorderStyle($pValue = PHPExcel_Style_Border::BORDER_NONE) + public function setBorderStyle($pValue = Border::BORDER_NONE) { if (empty($pValue)) { - $pValue = PHPExcel_Style_Border::BORDER_NONE; + $pValue = Border::BORDER_NONE; } elseif (is_bool($pValue) && $pValue) { - $pValue = PHPExcel_Style_Border::BORDER_MEDIUM; + $pValue = Border::BORDER_MEDIUM; } if ($this->isSupervisor) { $styleArray = $this->getStyleArray(array('style' => $pValue)); @@ -247,7 +249,7 @@ class PHPExcel_Style_Border extends PHPExcel_Style_Supervisor implements PHPExce * * @param PHPExcel_Style_Color $pValue * @throws PHPExcel_Exception - * @return PHPExcel_Style_Border + * @return Border */ public function setColor(PHPExcel_Style_Color $pValue = null) { diff --git a/classes/src/Style/Borders.php b/classes/src/Style/Borders.php index 27c40a48..960f27f4 100644 --- a/classes/src/Style/Borders.php +++ b/classes/src/Style/Borders.php @@ -1,5 +1,7 @@ left = new PHPExcel_Style_Border($isSupervisor, $isConditional); - $this->right = new PHPExcel_Style_Border($isSupervisor, $isConditional); - $this->top = new PHPExcel_Style_Border($isSupervisor, $isConditional); - $this->bottom = new PHPExcel_Style_Border($isSupervisor, $isConditional); - $this->diagonal = new PHPExcel_Style_Border($isSupervisor, $isConditional); - $this->diagonalDirection = PHPExcel_Style_Borders::DIAGONAL_NONE; + $this->left = new Border($isSupervisor, $isConditional); + $this->right = new Border($isSupervisor, $isConditional); + $this->top = new Border($isSupervisor, $isConditional); + $this->bottom = new Border($isSupervisor, $isConditional); + $this->diagonal = new Border($isSupervisor, $isConditional); + $this->diagonalDirection = self::DIAGONAL_NONE; // Specially for supervisor if ($isSupervisor) { // Initialize pseudo-borders - $this->allBorders = new PHPExcel_Style_Border(true); - $this->outline = new PHPExcel_Style_Border(true); - $this->inside = new PHPExcel_Style_Border(true); - $this->vertical = new PHPExcel_Style_Border(true); - $this->horizontal = new PHPExcel_Style_Border(true); + $this->allBorders = new Border(true); + $this->outline = new Border(true); + $this->inside = new Border(true); + $this->vertical = new Border(true); + $this->horizontal = new Border(true); // bind parent if we are a supervisor $this->left->bindParent($this, 'left'); @@ -160,7 +162,7 @@ class PHPExcel_Style_Borders extends PHPExcel_Style_Supervisor implements PHPExc * Get the shared style component for the currently active cell in currently active sheet. * Only used for style supervisor * - * @return PHPExcel_Style_Borders + * @return Borders */ public function getSharedComponent() { @@ -185,13 +187,13 @@ class PHPExcel_Style_Borders extends PHPExcel_Style_Supervisor implements PHPExc * $objPHPExcel->getActiveSheet()->getStyle('B2')->getBorders()->applyFromArray( * array( * 'bottom' => array( - * 'style' => PHPExcel_Style_Border::BORDER_DASHDOT, + * 'style' => \PHPExcel\Style\Border::BORDER_DASHDOT, * 'color' => array( * 'rgb' => '808080' * ) * ), * 'top' => array( - * 'style' => PHPExcel_Style_Border::BORDER_DASHDOT, + * 'style' => \PHPExcel\Style\Border::BORDER_DASHDOT, * 'color' => array( * 'rgb' => '808080' * ) @@ -203,7 +205,7 @@ class PHPExcel_Style_Borders extends PHPExcel_Style_Supervisor implements PHPExc * $objPHPExcel->getActiveSheet()->getStyle('B2')->getBorders()->applyFromArray( * array( * 'allborders' => array( - * 'style' => PHPExcel_Style_Border::BORDER_DASHDOT, + * 'style' => \PHPExcel\Style\Border::BORDER_DASHDOT, * 'color' => array( * 'rgb' => '808080' * ) @@ -214,7 +216,7 @@ class PHPExcel_Style_Borders extends PHPExcel_Style_Supervisor implements PHPExc * * @param array $pStyles Array containing style information * @throws PHPExcel_Exception - * @return PHPExcel_Style_Borders + * @return Borders */ public function applyFromArray($pStyles = null) { @@ -256,7 +258,7 @@ class PHPExcel_Style_Borders extends PHPExcel_Style_Supervisor implements PHPExc /** * Get Left * - * @return PHPExcel_Style_Border + * @return Border */ public function getLeft() { @@ -266,7 +268,7 @@ class PHPExcel_Style_Borders extends PHPExcel_Style_Supervisor implements PHPExc /** * Get Right * - * @return PHPExcel_Style_Border + * @return Border */ public function getRight() { @@ -276,7 +278,7 @@ class PHPExcel_Style_Borders extends PHPExcel_Style_Supervisor implements PHPExc /** * Get Top * - * @return PHPExcel_Style_Border + * @return Border */ public function getTop() { @@ -286,7 +288,7 @@ class PHPExcel_Style_Borders extends PHPExcel_Style_Supervisor implements PHPExc /** * Get Bottom * - * @return PHPExcel_Style_Border + * @return Border */ public function getBottom() { @@ -296,7 +298,7 @@ class PHPExcel_Style_Borders extends PHPExcel_Style_Supervisor implements PHPExc /** * Get Diagonal * - * @return PHPExcel_Style_Border + * @return Border */ public function getDiagonal() { @@ -306,7 +308,7 @@ class PHPExcel_Style_Borders extends PHPExcel_Style_Supervisor implements PHPExc /** * Get AllBorders (pseudo-border). Only applies to supervisor. * - * @return PHPExcel_Style_Border + * @return Border * @throws PHPExcel_Exception */ public function getAllBorders() @@ -348,7 +350,7 @@ class PHPExcel_Style_Borders extends PHPExcel_Style_Supervisor implements PHPExc /** * Get Vertical (pseudo-border). Only applies to supervisor. * - * @return PHPExcel_Style_Border + * @return Border * @throws PHPExcel_Exception */ public function getVertical() @@ -362,7 +364,7 @@ class PHPExcel_Style_Borders extends PHPExcel_Style_Supervisor implements PHPExc /** * Get Horizontal (pseudo-border). Only applies to supervisor. * - * @return PHPExcel_Style_Border + * @return Border * @throws PHPExcel_Exception */ public function getHorizontal() @@ -390,12 +392,12 @@ class PHPExcel_Style_Borders extends PHPExcel_Style_Supervisor implements PHPExc * Set DiagonalDirection * * @param int $pValue - * @return PHPExcel_Style_Borders + * @return Borders */ - public function setDiagonalDirection($pValue = PHPExcel_Style_Borders::DIAGONAL_NONE) + public function setDiagonalDirection($pValue = Borders::DIAGONAL_NONE) { if ($pValue == '') { - $pValue = PHPExcel_Style_Borders::DIAGONAL_NONE; + $pValue = Borders::DIAGONAL_NONE; } if ($this->isSupervisor) { $styleArray = $this->getStyleArray(array('diagonaldirection' => $pValue)); diff --git a/classes/src/Style/Color.php b/classes/src/Style/Color.php index 9c7790f0..bd476435 100644 --- a/classes/src/Style/Color.php +++ b/classes/src/Style/Color.php @@ -1,5 +1,7 @@ fillType = null; } - $this->startColor = new PHPExcel_Style_Color(PHPExcel_Style_Color::COLOR_WHITE, $isSupervisor, $isConditional); - $this->endColor = new PHPExcel_Style_Color(PHPExcel_Style_Color::COLOR_BLACK, $isSupervisor, $isConditional); + $this->startColor = new Color(Color::COLOR_WHITE, $isSupervisor, $isConditional); + $this->endColor = new Color(Color::COLOR_BLACK, $isSupervisor, $isConditional); // bind parent if we are a supervisor if ($isSupervisor) { @@ -111,7 +113,7 @@ class PHPExcel_Style_Fill extends PHPExcel_Style_Supervisor implements PHPExcel_ * Get the shared style component for the currently active cell in currently active sheet. * Only used for style supervisor * - * @return PHPExcel_Style_Fill + * @return Fill */ public function getSharedComponent() { @@ -135,7 +137,7 @@ class PHPExcel_Style_Fill extends PHPExcel_Style_Supervisor implements PHPExcel_ * * $objPHPExcel->getActiveSheet()->getStyle('B2')->getFill()->applyFromArray( * array( - * 'type' => PHPExcel_Style_Fill::FILL_GRADIENT_LINEAR, + * 'type' => \PHPExcel\Style\Fill::FILL_GRADIENT_LINEAR, * 'rotation' => 0, * 'startcolor' => array( * 'rgb' => '000000' @@ -147,9 +149,9 @@ class PHPExcel_Style_Fill extends PHPExcel_Style_Supervisor implements PHPExcel_ * ); * * - * @param array $pStyles Array containing style information - * @throws PHPExcel_Exception - * @return PHPExcel_Style_Fill + * @param array $pStyles Array containing style information + * @throws \PHPExcel\Exception + * @return Fill */ public function applyFromArray($pStyles = null) { @@ -174,7 +176,7 @@ class PHPExcel_Style_Fill extends PHPExcel_Style_Supervisor implements PHPExcel_ } } } else { - throw new PHPExcel_Exception("Invalid style array passed."); + throw new \PHPExcel\Exception("Invalid style array passed."); } return $this; } @@ -195,10 +197,10 @@ class PHPExcel_Style_Fill extends PHPExcel_Style_Supervisor implements PHPExcel_ /** * Set Fill Type * - * @param string $pValue PHPExcel_Style_Fill fill type - * @return PHPExcel_Style_Fill + * @param string $pValue Fill type + * @return Fill */ - public function setFillType($pValue = PHPExcel_Style_Fill::FILL_NONE) + public function setFillType($pValue = Fill::FILL_NONE) { if ($this->isSupervisor) { $styleArray = $this->getStyleArray(array('type' => $pValue)); @@ -226,7 +228,7 @@ class PHPExcel_Style_Fill extends PHPExcel_Style_Supervisor implements PHPExcel_ * Set Rotation * * @param double $pValue - * @return PHPExcel_Style_Fill + * @return Fill */ public function setRotation($pValue = 0) { @@ -242,7 +244,7 @@ class PHPExcel_Style_Fill extends PHPExcel_Style_Supervisor implements PHPExcel_ /** * Get Start Color * - * @return PHPExcel_Style_Color + * @return Color */ public function getStartColor() { @@ -252,11 +254,11 @@ class PHPExcel_Style_Fill extends PHPExcel_Style_Supervisor implements PHPExcel_ /** * Set Start Color * - * @param PHPExcel_Style_Color $pValue - * @throws PHPExcel_Exception - * @return PHPExcel_Style_Fill + * @param Color $pValue + * @throws \PHPExcel\Exception + * @return Fill */ - public function setStartColor(PHPExcel_Style_Color $pValue = null) + public function setStartColor(Color $pValue = null) { // make sure parameter is a real color and not a supervisor $color = $pValue->getIsSupervisor() ? $pValue->getSharedComponent() : $pValue; @@ -273,7 +275,7 @@ class PHPExcel_Style_Fill extends PHPExcel_Style_Supervisor implements PHPExcel_ /** * Get End Color * - * @return PHPExcel_Style_Color + * @return Color */ public function getEndColor() { @@ -283,11 +285,11 @@ class PHPExcel_Style_Fill extends PHPExcel_Style_Supervisor implements PHPExcel_ /** * Set End Color * - * @param PHPExcel_Style_Color $pValue - * @throws PHPExcel_Exception - * @return PHPExcel_Style_Fill + * @param Color $pValue + * @throws \PHPExcel\Exception + * @return Fill */ - public function setEndColor(PHPExcel_Style_Color $pValue = null) + public function setEndColor(Color $pValue = null) { // make sure parameter is a real color and not a supervisor $color = $pValue->getIsSupervisor() ? $pValue->getSharedComponent() : $pValue; diff --git a/classes/src/Style/Font.php b/classes/src/Style/Font.php index 9566e1df..45a3ef4b 100644 --- a/classes/src/Style/Font.php +++ b/classes/src/Style/Font.php @@ -1,5 +1,7 @@ subScript = null; $this->underline = null; $this->strikethrough = null; - $this->color = new PHPExcel_Style_Color(PHPExcel_Style_Color::COLOR_BLACK, $isSupervisor, $isConditional); + $this->color = new Color(Color::COLOR_BLACK, $isSupervisor, $isConditional); } else { - $this->color = new PHPExcel_Style_Color(PHPExcel_Style_Color::COLOR_BLACK, $isSupervisor); + $this->color = new Color(Color::COLOR_BLACK, $isSupervisor); } // bind parent if we are a supervisor if ($isSupervisor) { @@ -136,7 +138,7 @@ class PHPExcel_Style_Font extends PHPExcel_Style_Supervisor implements PHPExcel_ * Get the shared style component for the currently active cell in currently active sheet. * Only used for style supervisor * - * @return PHPExcel_Style_Font + * @return Font */ public function getSharedComponent() { @@ -163,7 +165,7 @@ class PHPExcel_Style_Font extends PHPExcel_Style_Supervisor implements PHPExcel_ * 'name' => 'Arial', * 'bold' => TRUE, * 'italic' => FALSE, - * 'underline' => PHPExcel_Style_Font::UNDERLINE_DOUBLE, + * 'underline' => \PHPExcel\Style\Font::UNDERLINE_DOUBLE, * 'strike' => FALSE, * 'color' => array( * 'rgb' => '808080' @@ -172,9 +174,9 @@ class PHPExcel_Style_Font extends PHPExcel_Style_Supervisor implements PHPExcel_ * ); * * - * @param array $pStyles Array containing style information - * @throws PHPExcel_Exception - * @return PHPExcel_Style_Font + * @param array $pStyles Array containing style information + * @throws \PHPExcel\Exception + * @return Font */ public function applyFromArray($pStyles = null) { @@ -211,7 +213,7 @@ class PHPExcel_Style_Font extends PHPExcel_Style_Supervisor implements PHPExcel_ } } } else { - throw new PHPExcel_Exception("Invalid style array passed."); + throw new \PHPExcel\Exception("Invalid style array passed."); } return $this; } @@ -233,7 +235,7 @@ class PHPExcel_Style_Font extends PHPExcel_Style_Supervisor implements PHPExcel_ * Set Name * * @param string $pValue - * @return PHPExcel_Style_Font + * @return Font */ public function setName($pValue = 'Calibri') { @@ -266,7 +268,7 @@ class PHPExcel_Style_Font extends PHPExcel_Style_Supervisor implements PHPExcel_ * Set Size * * @param double $pValue - * @return PHPExcel_Style_Font + * @return Font */ public function setSize($pValue = 10) { @@ -299,7 +301,7 @@ class PHPExcel_Style_Font extends PHPExcel_Style_Supervisor implements PHPExcel_ * Set Bold * * @param boolean $pValue - * @return PHPExcel_Style_Font + * @return Font */ public function setBold($pValue = false) { @@ -332,7 +334,7 @@ class PHPExcel_Style_Font extends PHPExcel_Style_Supervisor implements PHPExcel_ * Set Italic * * @param boolean $pValue - * @return PHPExcel_Style_Font + * @return Font */ public function setItalic($pValue = false) { @@ -365,7 +367,7 @@ class PHPExcel_Style_Font extends PHPExcel_Style_Supervisor implements PHPExcel_ * Set SuperScript * * @param boolean $pValue - * @return PHPExcel_Style_Font + * @return Font */ public function setSuperScript($pValue = false) { @@ -399,7 +401,7 @@ class PHPExcel_Style_Font extends PHPExcel_Style_Supervisor implements PHPExcel_ * Set SubScript * * @param boolean $pValue - * @return PHPExcel_Style_Font + * @return Font */ public function setSubScript($pValue = false) { @@ -432,10 +434,10 @@ class PHPExcel_Style_Font extends PHPExcel_Style_Supervisor implements PHPExcel_ /** * Set Underline * - * @param string|boolean $pValue PHPExcel_Style_Font underline type + * @param string|boolean $pValue \PHPExcel\Style\Font underline type * If a boolean is passed, then TRUE equates to UNDERLINE_SINGLE, * false equates to UNDERLINE_NONE - * @return PHPExcel_Style_Font + * @return Font */ public function setUnderline($pValue = self::UNDERLINE_NONE) { @@ -470,7 +472,7 @@ class PHPExcel_Style_Font extends PHPExcel_Style_Supervisor implements PHPExcel_ * Set Strikethrough * * @param boolean $pValue - * @return PHPExcel_Style_Font + * @return Font */ public function setStrikethrough($pValue = false) { @@ -489,7 +491,7 @@ class PHPExcel_Style_Font extends PHPExcel_Style_Supervisor implements PHPExcel_ /** * Get Color * - * @return PHPExcel_Style_Color + * @return Color */ public function getColor() { @@ -499,11 +501,11 @@ class PHPExcel_Style_Font extends PHPExcel_Style_Supervisor implements PHPExcel_ /** * Set Color * - * @param PHPExcel_Style_Color $pValue - * @throws PHPExcel_Exception - * @return PHPExcel_Style_Font + * @param Color $pValue + * @throws \PHPExcel\Exception + * @return Font */ - public function setColor(PHPExcel_Style_Color $pValue = null) + public function setColor(Color $pValue = null) { // make sure parameter is a real color and not a supervisor $color = $pValue->getIsSupervisor() ? $pValue->getSharedComponent() : $pValue; diff --git a/classes/src/Style/NumberFormat.php b/classes/src/Style/NumberFormat.php index 8b7f300d..0679381c 100644 --- a/classes/src/Style/NumberFormat.php +++ b/classes/src/Style/NumberFormat.php @@ -1,5 +1,7 @@ * $objPHPExcel->getActiveSheet()->getStyle('B2')->getNumberFormat()->applyFromArray( * array( - * 'code' => PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_EUR_SIMPLE + * 'code' => \PHPExcel\Style\NumberFormat::FORMAT_CURRENCY_EUR_SIMPLE * ) * ); * * * @param array $pStyles Array containing style information * @throws PHPExcel_Exception - * @return PHPExcel_Style_NumberFormat + * @return NumberFormat */ public function applyFromArray($pStyles = null) { @@ -189,12 +191,12 @@ class PHPExcel_Style_NumberFormat extends PHPExcel_Style_Supervisor implements P * Set Format Code * * @param string $pValue - * @return PHPExcel_Style_NumberFormat + * @return NumberFormat */ - public function setFormatCode($pValue = PHPExcel_Style_NumberFormat::FORMAT_GENERAL) + public function setFormatCode($pValue = NumberFormat::FORMAT_GENERAL) { if ($pValue == '') { - $pValue = PHPExcel_Style_NumberFormat::FORMAT_GENERAL; + $pValue = NumberFormat::FORMAT_GENERAL; } if ($this->isSupervisor) { $styleArray = $this->getStyleArray(array('code' => $pValue)); @@ -223,7 +225,7 @@ class PHPExcel_Style_NumberFormat extends PHPExcel_Style_Supervisor implements P * Set Built-In Format Code * * @param int $pValue - * @return PHPExcel_Style_NumberFormat + * @return NumberFormat */ public function setBuiltInFormatCode($pValue = 0) { @@ -248,7 +250,7 @@ class PHPExcel_Style_NumberFormat extends PHPExcel_Style_Supervisor implements P self::$builtInFormats = array(); // General - self::$builtInFormats[0] = PHPExcel_Style_NumberFormat::FORMAT_GENERAL; + self::$builtInFormats[0] = NumberFormat::FORMAT_GENERAL; self::$builtInFormats[1] = '0'; self::$builtInFormats[2] = '0.00'; self::$builtInFormats[3] = '#,##0'; @@ -538,7 +540,7 @@ class PHPExcel_Style_NumberFormat extends PHPExcel_Style_Supervisor implements P * @param array $callBack Callback function for additional formatting of string * @return string Formatted string */ - public static function toFormattedString($value = '0', $format = PHPExcel_Style_NumberFormat::FORMAT_GENERAL, $callBack = null) + public static function toFormattedString($value = '0', $format = NumberFormat::FORMAT_GENERAL, $callBack = null) { // For now we do not treat strings although section 4 of a format code affects strings if (!is_numeric($value)) { @@ -547,7 +549,7 @@ class PHPExcel_Style_NumberFormat extends PHPExcel_Style_Supervisor implements P // For 'General' format code, we just pass the value although this is not entirely the way Excel does it, // it seems to round numbers to a total of 10 digits. - if (($format === PHPExcel_Style_NumberFormat::FORMAT_GENERAL) || ($format === PHPExcel_Style_NumberFormat::FORMAT_TEXT)) { + if (($format === NumberFormat::FORMAT_GENERAL) || ($format === NumberFormat::FORMAT_TEXT)) { return $value; } diff --git a/classes/src/Style/Protection.php b/classes/src/Style/Protection.php index d5568f65..69fb5475 100644 --- a/classes/src/Style/Protection.php +++ b/classes/src/Style/Protection.php @@ -1,5 +1,7 @@ parent = $pParent; + $this->parent = $parent; $this->setTitle($pTitle, false); // setTitle can change $pTitle $this->setCodeName($this->getTitle()); - $this->setSheetState(PHPExcel_Worksheet::SHEETSTATE_VISIBLE); + $this->setSheetState(Worksheet::SHEETSTATE_VISIBLE); - $this->cellCollection = PHPExcel_CachedObjectStorageFactory::getInstance($this); + $this->cellCollection = CachedObjectStorageFactory::getInstance($this); // Set page setup - $this->pageSetup = new PHPExcel_Worksheet_PageSetup(); + $this->pageSetup = new Worksheet\PageSetup(); // Set page margins - $this->pageMargins = new PHPExcel_Worksheet_PageMargins(); + $this->pageMargins = new Worksheet\PageMargins(); // Set page header/footer - $this->headerFooter = new PHPExcel_Worksheet_HeaderFooter(); + $this->headerFooter = new Worksheet\HeaderFooter(); // Set sheet view - $this->sheetView = new PHPExcel_Worksheet_SheetView(); + $this->sheetView = new Worksheet\SheetView(); // Drawing collection - $this->drawingCollection = new ArrayObject(); + $this->drawingCollection = new \ArrayObject(); // Chart collection - $this->chartCollection = new ArrayObject(); + $this->chartCollection = new \ArrayObject(); // Protection - $this->protection = new PHPExcel_Worksheet_Protection(); + $this->protection = new Worksheet\Protection(); // Default row dimension - $this->defaultRowDimension = new PHPExcel_Worksheet_RowDimension(null); + $this->defaultRowDimension = new Worksheet\RowDimension(null); // Default column dimension - $this->defaultColumnDimension = new PHPExcel_Worksheet_ColumnDimension(null); - $this->autoFilter = new PHPExcel_Worksheet_AutoFilter(null, $this); + $this->defaultColumnDimension = new Worksheet\ColumnDimension(null); + $this->autoFilter = new Worksheet\AutoFilter(null, $this); } /** - * Disconnect all cells from this PHPExcel_Worksheet object, + * Disconnect all cells from this Worksheet object, * typically so that the worksheet object can be unset * */ @@ -385,7 +385,7 @@ class Worksheet implements IComparable */ public function __destruct() { - PHPExcel_Calculation::getInstance($this->parent)->clearCalculationCacheForWorksheet($this->title); + Calculation::getInstance($this->parent)->clearCalculationCacheForWorksheet($this->title); $this->disconnectCells(); } @@ -393,7 +393,7 @@ class Worksheet implements IComparable /** * Return the cache controller for the cell collection * - * @return PHPExcel_CachedObjectStorage_xxx + * @return CachedObjectStorage_xxx */ public function getCellCacheController() { @@ -420,20 +420,20 @@ class Worksheet implements IComparable */ private static function checkSheetCodeName($pValue) { - $CharCount = PHPExcel_Shared_String::CountCharacters($pValue); + $CharCount = Shared\String::CountCharacters($pValue); if ($CharCount == 0) { - throw new PHPExcel_Exception('Sheet code name cannot be empty.'); + throw new Exception('Sheet code name cannot be empty.'); } // Some of the printable ASCII characters are invalid: * : / \ ? [ ] and first and last characters cannot be a "'" if ((str_replace(self::$invalidCharacters, '', $pValue) !== $pValue) || - (PHPExcel_Shared_String::Substring($pValue, -1, 1)=='\'') || - (PHPExcel_Shared_String::Substring($pValue, 0, 1)=='\'')) { - throw new PHPExcel_Exception('Invalid character found in sheet code name'); + (Shared\String::Substring($pValue, -1, 1)=='\'') || + (Shared\String::Substring($pValue, 0, 1)=='\'')) { + throw new Exception('Invalid character found in sheet code name'); } // Maximum 31 characters allowed for sheet title if ($CharCount > 31) { - throw new PHPExcel_Exception('Maximum 31 characters allowed in sheet code name.'); + throw new Exception('Maximum 31 characters allowed in sheet code name.'); } return $pValue; @@ -444,18 +444,18 @@ class Worksheet implements IComparable * * @param string $pValue The string to check * @return string The valid string - * @throws PHPExcel_Exception + * @throws Exception */ private static function checkSheetTitle($pValue) { // Some of the printable ASCII characters are invalid: * : / \ ? [ ] if (str_replace(self::$invalidCharacters, '', $pValue) !== $pValue) { - throw new PHPExcel_Exception('Invalid character found in sheet title'); + throw new Exception('Invalid character found in sheet title'); } // Maximum 31 characters allowed for sheet title - if (PHPExcel_Shared_String::CountCharacters($pValue) > 31) { - throw new PHPExcel_Exception('Maximum 31 characters allowed in sheet title.'); + if (Shared\String::CountCharacters($pValue) > 31) { + throw new Exception('Maximum 31 characters allowed in sheet title.'); } return $pValue; @@ -465,7 +465,7 @@ class Worksheet implements IComparable * Get collection of cells * * @param boolean $pSorted Also sort the cell collection? - * @return PHPExcel_Cell[] + * @return Cell[] */ public function getCellCollection($pSorted = true) { @@ -482,7 +482,7 @@ class Worksheet implements IComparable /** * Sort collection of cells * - * @return PHPExcel_Worksheet + * @return Worksheet */ public function sortCellCollection() { @@ -495,7 +495,7 @@ class Worksheet implements IComparable /** * Get collection of row dimensions * - * @return PHPExcel_Worksheet_RowDimension[] + * @return Worksheet\RowDimension[] */ public function getRowDimensions() { @@ -505,7 +505,7 @@ class Worksheet implements IComparable /** * Get default row dimension * - * @return PHPExcel_Worksheet_RowDimension + * @return Worksheet\RowDimension */ public function getDefaultRowDimension() { @@ -515,7 +515,7 @@ class Worksheet implements IComparable /** * Get collection of column dimensions * - * @return PHPExcel_Worksheet_ColumnDimension[] + * @return Worksheet\ColumnDimension[] */ public function getColumnDimensions() { @@ -525,7 +525,7 @@ class Worksheet implements IComparable /** * Get default column dimension * - * @return PHPExcel_Worksheet_ColumnDimension + * @return Worksheet\ColumnDimension */ public function getDefaultColumnDimension() { @@ -535,7 +535,7 @@ class Worksheet implements IComparable /** * Get collection of drawings * - * @return PHPExcel_Worksheet_BaseDrawing[] + * @return Worksheet\BaseDrawing[] */ public function getDrawingCollection() { @@ -545,7 +545,7 @@ class Worksheet implements IComparable /** * Get collection of charts * - * @return PHPExcel_Chart[] + * @return Chart[] */ public function getChartCollection() { @@ -555,11 +555,11 @@ class Worksheet implements IComparable /** * Add chart * - * @param PHPExcel_Chart $pChart + * @param Chart $pChart * @param int|null $iChartIndex Index where chart should go (0,1,..., or null for last) - * @return PHPExcel_Chart + * @return Chart */ - public function addChart(PHPExcel_Chart $pChart = null, $iChartIndex = null) + public function addChart(Chart $pChart = null, $iChartIndex = null) { $pChart->setWorksheet($this); if (is_null($iChartIndex)) { @@ -586,8 +586,8 @@ class Worksheet implements IComparable * Get a chart by its index position * * @param string $index Chart index position - * @return false|PHPExcel_Chart - * @throws PHPExcel_Exception + * @return false|Chart + * @throws Exception */ public function getChartByIndex($index = null) { @@ -609,7 +609,7 @@ class Worksheet implements IComparable * Return an array of the names of charts on this worksheet * * @return string[] The names of charts - * @throws PHPExcel_Exception + * @throws Exception */ public function getChartNames() { @@ -624,8 +624,8 @@ class Worksheet implements IComparable * Get a chart by name * * @param string $chartName Chart name - * @return false|PHPExcel_Chart - * @throws PHPExcel_Exception + * @return false|Chart + * @throws Exception */ public function getChartByName($chartName = '') { @@ -644,7 +644,7 @@ class Worksheet implements IComparable /** * Refresh column dimensions * - * @return PHPExcel_Worksheet + * @return Worksheet */ public function refreshColumnDimensions() { @@ -663,7 +663,7 @@ class Worksheet implements IComparable /** * Refresh row dimensions * - * @return PHPExcel_Worksheet + * @return Worksheet */ public function refreshRowDimensions() { @@ -705,7 +705,7 @@ class Worksheet implements IComparable * Calculate widths for auto-size columns * * @param boolean $calculateMergeCells Calculate merge cell width - * @return PHPExcel_Worksheet; + * @return Worksheet; */ public function calculateColumnWidths($calculateMergeCells = false) { @@ -722,7 +722,7 @@ class Worksheet implements IComparable // build list of cells references that participate in a merge $isMergeCell = array(); foreach ($this->getMergeCells() as $cells) { - foreach (PHPExcel_Cell::extractAllCellReferencesInRange($cells) as $cellReference) { + foreach (Cell::extractAllCellReferencesInRange($cells) as $cellReference) { $isMergeCell[$cellReference] = true; } } @@ -735,14 +735,14 @@ class Worksheet implements IComparable if (!isset($isMergeCell[$this->cellCollection->getCurrentAddress()])) { // Calculated value // To formatted string - $cellValue = PHPExcel_Style_NumberFormat::toFormattedString( + $cellValue = Style\NumberFormat::toFormattedString( $cell->getCalculatedValue(), $this->getParent()->getCellXfByIndex($cell->getXfIndex())->getNumberFormat()->getFormatCode() ); $autoSizes[$this->cellCollection->getCurrentColumn()] = max( (float) $autoSizes[$this->cellCollection->getCurrentColumn()], - (float)PHPExcel_Shared_Font::calculateColumnWidth( + (float) Shared\Font::calculateColumnWidth( $this->getParent()->getCellXfByIndex($cell->getXfIndex())->getFont(), $cellValue, $this->getParent()->getCellXfByIndex($cell->getXfIndex())->getAlignment()->getTextRotation(), @@ -779,7 +779,7 @@ class Worksheet implements IComparable * Re-bind parent * * @param PHPExcel $parent - * @return PHPExcel_Worksheet + * @return Worksheet */ public function rebindParent(PHPExcel $parent) { @@ -817,7 +817,7 @@ class Worksheet implements IComparable * This should be left as the default true, unless you are * certain that no formula cells on any worksheet contain * references to this worksheet - * @return PHPExcel_Worksheet + * @return Worksheet */ public function setTitle($pValue = 'Worksheet', $updateFormulaCellReferences = true) { @@ -837,19 +837,19 @@ class Worksheet implements IComparable if ($this->parent->sheetNameExists($pValue)) { // Use name, but append with lowest possible integer - if (PHPExcel_Shared_String::CountCharacters($pValue) > 29) { - $pValue = PHPExcel_Shared_String::Substring($pValue, 0, 29); + if (Shared\String::CountCharacters($pValue) > 29) { + $pValue = Shared\String::Substring($pValue, 0, 29); } $i = 1; while ($this->parent->sheetNameExists($pValue . ' ' . $i)) { ++$i; if ($i == 10) { - if (PHPExcel_Shared_String::CountCharacters($pValue) > 28) { - $pValue = PHPExcel_Shared_String::Substring($pValue, 0, 28); + if (Shared\String::CountCharacters($pValue) > 28) { + $pValue = Shared\String::Substring($pValue, 0, 28); } } elseif ($i == 100) { - if (PHPExcel_Shared_String::CountCharacters($pValue) > 27) { - $pValue = PHPExcel_Shared_String::Substring($pValue, 0, 27); + if (Shared\String::CountCharacters($pValue) > 27) { + $pValue = Shared\String::Substring($pValue, 0, 27); } } } @@ -866,10 +866,10 @@ class Worksheet implements IComparable if ($this->parent) { // New title $newTitle = $this->getTitle(); - PHPExcel_Calculation::getInstance($this->parent) + Calculation::getInstance($this->parent) ->renameCalculationCacheForWorksheet($oldTitle, $newTitle); if ($updateFormulaCellReferences) { - PHPExcel_ReferenceHelper::getInstance()->updateNamedFormulas($this->parent, $oldTitle, $newTitle); + ReferenceHelper::getInstance()->updateNamedFormulas($this->parent, $oldTitle, $newTitle); } } @@ -890,9 +890,9 @@ class Worksheet implements IComparable * Set sheet state * * @param string $value Sheet state (visible, hidden, veryHidden) - * @return PHPExcel_Worksheet + * @return Worksheet */ - public function setSheetState($value = PHPExcel_Worksheet::SHEETSTATE_VISIBLE) + public function setSheetState($value = Worksheet::SHEETSTATE_VISIBLE) { $this->sheetState = $value; return $this; @@ -901,7 +901,7 @@ class Worksheet implements IComparable /** * Get page setup * - * @return PHPExcel_Worksheet_PageSetup + * @return Worksheet\PageSetup */ public function getPageSetup() { @@ -911,10 +911,10 @@ class Worksheet implements IComparable /** * Set page setup * - * @param PHPExcel_Worksheet_PageSetup $pValue - * @return PHPExcel_Worksheet + * @param Worksheet\PageSetup $pValue + * @return Worksheet */ - public function setPageSetup(PHPExcel_Worksheet_PageSetup $pValue) + public function setPageSetup(Worksheet\PageSetup $pValue) { $this->pageSetup = $pValue; return $this; @@ -923,7 +923,7 @@ class Worksheet implements IComparable /** * Get page margins * - * @return PHPExcel_Worksheet_PageMargins + * @return Worksheet\PageMargins */ public function getPageMargins() { @@ -933,10 +933,10 @@ class Worksheet implements IComparable /** * Set page margins * - * @param PHPExcel_Worksheet_PageMargins $pValue - * @return PHPExcel_Worksheet + * @param Worksheet\PageMargins $pValue + * @return Worksheet */ - public function setPageMargins(PHPExcel_Worksheet_PageMargins $pValue) + public function setPageMargins(Worksheet\PageMargins $pValue) { $this->pageMargins = $pValue; return $this; @@ -945,7 +945,7 @@ class Worksheet implements IComparable /** * Get page header/footer * - * @return PHPExcel_Worksheet_HeaderFooter + * @return Worksheet\HeaderFooter */ public function getHeaderFooter() { @@ -955,10 +955,10 @@ class Worksheet implements IComparable /** * Set page header/footer * - * @param PHPExcel_Worksheet_HeaderFooter $pValue - * @return PHPExcel_Worksheet + * @param Worksheet\HeaderFooter $pValue + * @return Worksheet */ - public function setHeaderFooter(PHPExcel_Worksheet_HeaderFooter $pValue) + public function setHeaderFooter(Worksheet\HeaderFooter $pValue) { $this->headerFooter = $pValue; return $this; @@ -967,7 +967,7 @@ class Worksheet implements IComparable /** * Get sheet view * - * @return PHPExcel_Worksheet_SheetView + * @return Worksheet\SheetView */ public function getSheetView() { @@ -977,10 +977,10 @@ class Worksheet implements IComparable /** * Set sheet view * - * @param PHPExcel_Worksheet_SheetView $pValue - * @return PHPExcel_Worksheet + * @param Worksheet\SheetView $pValue + * @return Worksheet */ - public function setSheetView(PHPExcel_Worksheet_SheetView $pValue) + public function setSheetView(Worksheet\SheetView $pValue) { $this->sheetView = $pValue; return $this; @@ -989,7 +989,7 @@ class Worksheet implements IComparable /** * Get Protection * - * @return PHPExcel_Worksheet_Protection + * @return Worksheet\Protection */ public function getProtection() { @@ -999,10 +999,10 @@ class Worksheet implements IComparable /** * Set Protection * - * @param PHPExcel_Worksheet_Protection $pValue - * @return PHPExcel_Worksheet + * @param Worksheet\Protection $pValue + * @return Worksheet */ - public function setProtection(PHPExcel_Worksheet_Protection $pValue) + public function setProtection(Worksheet\Protection $pValue) { $this->protection = $pValue; $this->dirty = true; @@ -1080,7 +1080,7 @@ class Worksheet implements IComparable * @param string $pCoordinate Coordinate of the cell * @param mixed $pValue Value of the cell * @param bool $returnCell Return the worksheet (false, default) or the cell (true) - * @return PHPExcel_Worksheet|PHPExcel_Cell Depending on the last parameter being specified + * @return Worksheet|Cell Depending on the last parameter being specified */ public function setCellValue($pCoordinate = 'A1', $pValue = null, $returnCell = false) { @@ -1095,7 +1095,7 @@ class Worksheet implements IComparable * @param string $pRow Numeric row coordinate of the cell * @param mixed $pValue Value of the cell * @param bool $returnCell Return the worksheet (false, default) or the cell (true) - * @return PHPExcel_Worksheet|PHPExcel_Cell Depending on the last parameter being specified + * @return Worksheet|Cell Depending on the last parameter being specified */ public function setCellValueByColumnAndRow($pColumn = 0, $pRow = 1, $pValue = null, $returnCell = false) { @@ -1110,9 +1110,9 @@ class Worksheet implements IComparable * @param mixed $pValue Value of the cell * @param string $pDataType Explicit data type * @param bool $returnCell Return the worksheet (false, default) or the cell (true) - * @return PHPExcel_Worksheet|PHPExcel_Cell Depending on the last parameter being specified + * @return Worksheet|Cell Depending on the last parameter being specified */ - public function setCellValueExplicit($pCoordinate = 'A1', $pValue = null, $pDataType = PHPExcel_Cell_DataType::TYPE_STRING, $returnCell = false) + public function setCellValueExplicit($pCoordinate = 'A1', $pValue = null, $pDataType = Cell\DataType::TYPE_STRING, $returnCell = false) { // Set value $cell = $this->getCell(strtoupper($pCoordinate))->setValueExplicit($pValue, $pDataType); @@ -1127,9 +1127,9 @@ class Worksheet implements IComparable * @param mixed $pValue Value of the cell * @param string $pDataType Explicit data type * @param bool $returnCell Return the worksheet (false, default) or the cell (true) - * @return PHPExcel_Worksheet|PHPExcel_Cell Depending on the last parameter being specified + * @return Worksheet|Cell Depending on the last parameter being specified */ - public function setCellValueExplicitByColumnAndRow($pColumn = 0, $pRow = 1, $pValue = null, $pDataType = PHPExcel_Cell_DataType::TYPE_STRING, $returnCell = false) + public function setCellValueExplicitByColumnAndRow($pColumn = 0, $pRow = 1, $pValue = null, $pDataType = Cell\DataType::TYPE_STRING, $returnCell = false) { $cell = $this->getCellByColumnAndRow($pColumn, $pRow)->setValueExplicit($pValue, $pDataType); return ($returnCell) ? $cell : $this; @@ -1139,8 +1139,8 @@ class Worksheet implements IComparable * Get cell at a specific coordinate * * @param string $pCoordinate Coordinate of the cell - * @throws PHPExcel_Exception - * @return PHPExcel_Cell Cell that was found + * @throws Exception + * @return Cell Cell that was found */ public function getCell($pCoordinate = 'A1') { @@ -1151,14 +1151,14 @@ class Worksheet implements IComparable // Worksheet reference? if (strpos($pCoordinate, '!') !== false) { - $worksheetReference = PHPExcel_Worksheet::extractSheetTitle($pCoordinate, true); + $worksheetReference = Worksheet::extractSheetTitle($pCoordinate, true); return $this->parent->getSheetByName($worksheetReference[0])->getCell(strtoupper($worksheetReference[1])); } // Named range? - if ((!preg_match('/^'.PHPExcel_Calculation::CALCULATION_REGEXP_CELLREF.'$/i', $pCoordinate, $matches)) && - (preg_match('/^'.PHPExcel_Calculation::CALCULATION_REGEXP_NAMEDRANGE.'$/i', $pCoordinate, $matches))) { - $namedRange = PHPExcel_NamedRange::resolveRange($pCoordinate, $this); + if ((!preg_match('/^'.Calculation::CALCULATION_REGEXP_CELLREF.'$/i', $pCoordinate, $matches)) && + (preg_match('/^'.Calculation::CALCULATION_REGEXP_NAMEDRANGE.'$/i', $pCoordinate, $matches))) { + $namedRange = NamedRange::resolveRange($pCoordinate, $this); if ($namedRange !== null) { $pCoordinate = $namedRange->getRange(); return $namedRange->getWorksheet()->getCell($pCoordinate); @@ -1169,9 +1169,9 @@ class Worksheet implements IComparable $pCoordinate = strtoupper($pCoordinate); if (strpos($pCoordinate, ':') !== false || strpos($pCoordinate, ',') !== false) { - throw new PHPExcel_Exception('Cell coordinate can not be a range of cells.'); + throw new Exception('Cell coordinate can not be a range of cells.'); } elseif (strpos($pCoordinate, '$') !== false) { - throw new PHPExcel_Exception('Cell coordinate must not be absolute.'); + throw new Exception('Cell coordinate must not be absolute.'); } // Create new cell object @@ -1183,11 +1183,11 @@ class Worksheet implements IComparable * * @param string $pColumn Numeric column coordinate of the cell * @param string $pRow Numeric row coordinate of the cell - * @return PHPExcel_Cell Cell that was found + * @return Cell Cell that was found */ public function getCellByColumnAndRow($pColumn = 0, $pRow = 1) { - $columnLetter = PHPExcel_Cell::stringFromColumnIndex($pColumn); + $columnLetter = Cell::stringFromColumnIndex($pColumn); $coordinate = $columnLetter . $pRow; if ($this->cellCollection->isDataSet($coordinate)) { @@ -1201,19 +1201,19 @@ class Worksheet implements IComparable * Create a new cell at the specified coordinate * * @param string $pCoordinate Coordinate of the cell - * @return PHPExcel_Cell Cell that was created + * @return Cell Cell that was created */ private function createNewCell($pCoordinate) { $cell = $this->cellCollection->addCacheData( $pCoordinate, - new PHPExcel_Cell(null, PHPExcel_Cell_DataType::TYPE_NULL, $this) + new Cell(null, Cell\DataType::TYPE_NULL, $this) ); $this->cellCollectionIsSorted = false; // Coordinates - $aCoordinates = PHPExcel_Cell::coordinateFromString($pCoordinate); - if (PHPExcel_Cell::columnIndexFromString($this->cachedHighestColumn) < PHPExcel_Cell::columnIndexFromString($aCoordinates[0])) { + $aCoordinates = Cell::coordinateFromString($pCoordinate); + if (Cell::columnIndexFromString($this->cachedHighestColumn) < Cell::columnIndexFromString($aCoordinates[0])) { $this->cachedHighestColumn = $aCoordinates[0]; } $this->cachedHighestRow = max($this->cachedHighestRow, $aCoordinates[1]); @@ -1238,28 +1238,28 @@ class Worksheet implements IComparable * Does the cell at a specific coordinate exist? * * @param string $pCoordinate Coordinate of the cell - * @throws PHPExcel_Exception + * @throws Exception * @return boolean */ public function cellExists($pCoordinate = 'A1') { // Worksheet reference? if (strpos($pCoordinate, '!') !== false) { - $worksheetReference = PHPExcel_Worksheet::extractSheetTitle($pCoordinate, true); + $worksheetReference = Worksheet::extractSheetTitle($pCoordinate, true); return $this->parent->getSheetByName($worksheetReference[0])->cellExists(strtoupper($worksheetReference[1])); } // Named range? - if ((!preg_match('/^'.PHPExcel_Calculation::CALCULATION_REGEXP_CELLREF.'$/i', $pCoordinate, $matches)) && - (preg_match('/^'.PHPExcel_Calculation::CALCULATION_REGEXP_NAMEDRANGE.'$/i', $pCoordinate, $matches))) { - $namedRange = PHPExcel_NamedRange::resolveRange($pCoordinate, $this); + if ((!preg_match('/^'.Calculation::CALCULATION_REGEXP_CELLREF.'$/i', $pCoordinate, $matches)) && + (preg_match('/^'.Calculation::CALCULATION_REGEXP_NAMEDRANGE.'$/i', $pCoordinate, $matches))) { + $namedRange = NamedRange::resolveRange($pCoordinate, $this); if ($namedRange !== null) { $pCoordinate = $namedRange->getRange(); if ($this->getHashCode() != $namedRange->getWorksheet()->getHashCode()) { if (!$namedRange->getLocalOnly()) { return $namedRange->getWorksheet()->cellExists($pCoordinate); } else { - throw new PHPExcel_Exception('Named range ' . $namedRange->getName() . ' is not accessible from within sheet ' . $this->getTitle()); + throw new Exception('Named range ' . $namedRange->getName() . ' is not accessible from within sheet ' . $this->getTitle()); } } } else { @@ -1271,12 +1271,12 @@ class Worksheet implements IComparable $pCoordinate = strtoupper($pCoordinate); if (strpos($pCoordinate, ':') !== false || strpos($pCoordinate, ',') !== false) { - throw new PHPExcel_Exception('Cell coordinate can not be a range of cells.'); + throw new Exception('Cell coordinate can not be a range of cells.'); } elseif (strpos($pCoordinate, '$') !== false) { - throw new PHPExcel_Exception('Cell coordinate must not be absolute.'); + throw new Exception('Cell coordinate must not be absolute.'); } else { // Coordinates - $aCoordinates = PHPExcel_Cell::coordinateFromString($pCoordinate); + $aCoordinates = Cell::coordinateFromString($pCoordinate); // Cell exists? return $this->cellCollection->isDataSet($pCoordinate); @@ -1292,14 +1292,14 @@ class Worksheet implements IComparable */ public function cellExistsByColumnAndRow($pColumn = 0, $pRow = 1) { - return $this->cellExists(PHPExcel_Cell::stringFromColumnIndex($pColumn) . $pRow); + return $this->cellExists(Cell::stringFromColumnIndex($pColumn) . $pRow); } /** * Get row dimension at a specific row * * @param int $pRow Numeric index of the row - * @return PHPExcel_Worksheet_RowDimension + * @return Worksheet\RowDimension */ public function getRowDimension($pRow = 1, $create = true) { @@ -1311,7 +1311,7 @@ class Worksheet implements IComparable if (!$create) { return null; } - $this->rowDimensions[$pRow] = new PHPExcel_Worksheet_RowDimension($pRow); + $this->rowDimensions[$pRow] = new Worksheet\RowDimension($pRow); $this->cachedHighestRow = max($this->cachedHighestRow, $pRow); } @@ -1322,7 +1322,7 @@ class Worksheet implements IComparable * Get column dimension at a specific column * * @param string $pColumn String index of the column - * @return PHPExcel_Worksheet_ColumnDimension + * @return Worksheet\ColumnDimension */ public function getColumnDimension($pColumn = 'A', $create = true) { @@ -1334,9 +1334,9 @@ class Worksheet implements IComparable if (!$create) { return null; } - $this->columnDimensions[$pColumn] = new PHPExcel_Worksheet_ColumnDimension($pColumn); + $this->columnDimensions[$pColumn] = new Worksheet\ColumnDimension($pColumn); - if (PHPExcel_Cell::columnIndexFromString($this->cachedHighestColumn) < PHPExcel_Cell::columnIndexFromString($pColumn)) { + if (Cell::columnIndexFromString($this->cachedHighestColumn) < Cell::columnIndexFromString($pColumn)) { $this->cachedHighestColumn = $pColumn; } } @@ -1347,17 +1347,17 @@ class Worksheet implements IComparable * Get column dimension at a specific column by using numeric cell coordinates * * @param string $pColumn Numeric column coordinate of the cell - * @return PHPExcel_Worksheet_ColumnDimension + * @return Worksheet\ColumnDimension */ public function getColumnDimensionByColumn($pColumn = 0) { - return $this->getColumnDimension(PHPExcel_Cell::stringFromColumnIndex($pColumn)); + return $this->getColumnDimension(Cell::stringFromColumnIndex($pColumn)); } /** * Get styles * - * @return PHPExcel_Style[] + * @return Style[] */ public function getStyles() { @@ -1368,8 +1368,8 @@ class Worksheet implements IComparable * Get default style of workbook. * * @deprecated - * @return PHPExcel_Style - * @throws PHPExcel_Exception + * @return Style + * @throws Exception */ public function getDefaultStyle() { @@ -1377,14 +1377,14 @@ class Worksheet implements IComparable } /** - * Set default style - should only be used by PHPExcel_IReader implementations! + * Set default style - should only be used by \PHPExcel\IReader implementations! * * @deprecated - * @param PHPExcel_Style $pValue - * @throws PHPExcel_Exception - * @return PHPExcel_Worksheet + * @param Style $pValue + * @throws Exception + * @return Worksheet */ - public function setDefaultStyle(PHPExcel_Style $pValue) + public function setDefaultStyle(Style $pValue) { $this->parent->getDefaultStyle()->applyFromArray(array( 'font' => array( @@ -1399,8 +1399,8 @@ class Worksheet implements IComparable * Get style for cell * * @param string $pCellCoordinate Cell coordinate (or range) to get style for - * @return PHPExcel_Style - * @throws PHPExcel_Exception + * @return Style + * @throws Exception */ public function getStyle($pCellCoordinate = 'A1') { @@ -1417,7 +1417,7 @@ class Worksheet implements IComparable * Get conditional styles for a cell * * @param string $pCoordinate - * @return PHPExcel_Style_Conditional[] + * @return Style\Conditional[] */ public function getConditionalStyles($pCoordinate = 'A1') { @@ -1446,7 +1446,7 @@ class Worksheet implements IComparable * Removes conditional styles for a cell * * @param string $pCoordinate - * @return PHPExcel_Worksheet + * @return Worksheet */ public function removeConditionalStyles($pCoordinate = 'A1') { @@ -1468,8 +1468,8 @@ class Worksheet implements IComparable * Set conditional styles * * @param $pCoordinate string E.g. 'A1' - * @param $pValue PHPExcel_Style_Conditional[] - * @return PHPExcel_Worksheet + * @param $pValue Style\Conditional[] + * @return Worksheet */ public function setConditionalStyles($pCoordinate = 'A1', $pValue) { @@ -1484,16 +1484,16 @@ class Worksheet implements IComparable * @param int $pRow Numeric row coordinate of the cell * @param int pColumn2 Numeric column coordinate of the range cell * @param int pRow2 Numeric row coordinate of the range cell - * @return PHPExcel_Style + * @return Style */ public function getStyleByColumnAndRow($pColumn = 0, $pRow = 1, $pColumn2 = null, $pRow2 = null) { if (!is_null($pColumn2) && !is_null($pRow2)) { - $cellRange = PHPExcel_Cell::stringFromColumnIndex($pColumn) . $pRow . ':' . PHPExcel_Cell::stringFromColumnIndex($pColumn2) . $pRow2; + $cellRange = Cell::stringFromColumnIndex($pColumn) . $pRow . ':' . Cell::stringFromColumnIndex($pColumn2) . $pRow2; return $this->getStyle($cellRange); } - return $this->getStyle(PHPExcel_Cell::stringFromColumnIndex($pColumn) . $pRow); + return $this->getStyle(Cell::stringFromColumnIndex($pColumn) . $pRow); } /** @@ -1502,12 +1502,12 @@ class Worksheet implements IComparable * Please note that this will overwrite existing cell styles for cells in range! * * @deprecated - * @param PHPExcel_Style $pSharedCellStyle Cell style to share + * @param Style $pSharedCellStyle Cell style to share * @param string $pRange Range of cells (i.e. "A1:B10"), or just one cell (i.e. "A1") - * @throws PHPExcel_Exception - * @return PHPExcel_Worksheet + * @throws Exception + * @return Worksheet */ - public function setSharedStyle(PHPExcel_Style $pSharedCellStyle = null, $pRange = '') + public function setSharedStyle(Style $pSharedCellStyle = null, $pRange = '') { $this->duplicateStyle($pSharedCellStyle, $pRange); return $this; @@ -1518,12 +1518,12 @@ class Worksheet implements IComparable * * Please note that this will overwrite existing cell styles for cells in range! * - * @param PHPExcel_Style $pCellStyle Cell style to duplicate + * @param Style $pCellStyle Cell style to duplicate * @param string $pRange Range of cells (i.e. "A1:B10"), or just one cell (i.e. "A1") - * @throws PHPExcel_Exception - * @return PHPExcel_Worksheet + * @throws Exception + * @return Worksheet */ - public function duplicateStyle(PHPExcel_Style $pCellStyle = null, $pRange = '') + public function duplicateStyle(Style $pCellStyle = null, $pRange = '') { // make sure we have a real style and not supervisor $style = $pCellStyle->getIsSupervisor() ? $pCellStyle->getSharedComponent() : $pCellStyle; @@ -1540,7 +1540,7 @@ class Worksheet implements IComparable } // Calculate range outer borders - list($rangeStart, $rangeEnd) = PHPExcel_Cell::rangeBoundaries($pRange . ':' . $pRange); + list($rangeStart, $rangeEnd) = Cell::rangeBoundaries($pRange . ':' . $pRange); // Make sure we can loop upwards on rows and columns if ($rangeStart[0] > $rangeEnd[0] && $rangeStart[1] > $rangeEnd[1]) { @@ -1552,7 +1552,7 @@ class Worksheet implements IComparable // Loop through cells and apply styles for ($col = $rangeStart[0]; $col <= $rangeEnd[0]; ++$col) { for ($row = $rangeStart[1]; $row <= $rangeEnd[1]; ++$row) { - $this->getCell(PHPExcel_Cell::stringFromColumnIndex($col - 1) . $row)->setXfIndex($xfIndex); + $this->getCell(Cell::stringFromColumnIndex($col - 1) . $row)->setXfIndex($xfIndex); } } @@ -1564,21 +1564,21 @@ class Worksheet implements IComparable * * Please note that this will overwrite existing cell styles for cells in range! * - * @param array of PHPExcel_Style_Conditional $pCellStyle Cell style to duplicate + * @param Style\Conditional[] $pCellStyle Cell style to duplicate * @param string $pRange Range of cells (i.e. "A1:B10"), or just one cell (i.e. "A1") - * @throws PHPExcel_Exception - * @return PHPExcel_Worksheet + * @throws Exception + * @return Worksheet */ public function duplicateConditionalStyle(array $pCellStyle = null, $pRange = '') { foreach ($pCellStyle as $cellStyle) { - if (!($cellStyle instanceof PHPExcel_Style_Conditional)) { - throw new PHPExcel_Exception('Style is not a conditional style'); + if (!($cellStyle instanceof Style\Conditional)) { + throw new Exception('Style is not a conditional style'); } } // Calculate range outer borders - list($rangeStart, $rangeEnd) = PHPExcel_Cell::rangeBoundaries($pRange . ':' . $pRange); + list($rangeStart, $rangeEnd) = Cell::rangeBoundaries($pRange . ':' . $pRange); // Make sure we can loop upwards on rows and columns if ($rangeStart[0] > $rangeEnd[0] && $rangeStart[1] > $rangeEnd[1]) { @@ -1590,7 +1590,7 @@ class Worksheet implements IComparable // Loop through cells and apply styles for ($col = $rangeStart[0]; $col <= $rangeEnd[0]; ++$col) { for ($row = $rangeStart[1]; $row <= $rangeEnd[1]; ++$row) { - $this->setConditionalStyles(PHPExcel_Cell::stringFromColumnIndex($col - 1) . $row, $pCellStyle); + $this->setConditionalStyles(Cell::stringFromColumnIndex($col - 1) . $row, $pCellStyle); } } @@ -1608,8 +1608,8 @@ class Worksheet implements IComparable * @param array $pStyles Array containing style information * @param string $pRange Range of cells (i.e. "A1:B10"), or just one cell (i.e. "A1") * @param boolean $pAdvanced Advanced mode for setting borders. - * @throws PHPExcel_Exception - * @return PHPExcel_Worksheet + * @throws Exception + * @return Worksheet */ public function duplicateStyleArray($pStyles = null, $pRange = '', $pAdvanced = true) { @@ -1621,17 +1621,17 @@ class Worksheet implements IComparable * Set break on a cell * * @param string $pCell Cell coordinate (e.g. A1) - * @param int $pBreak Break type (type of PHPExcel_Worksheet::BREAK_*) - * @throws PHPExcel_Exception - * @return PHPExcel_Worksheet + * @param int $pBreak Break type (type of Worksheet::BREAK_*) + * @throws Exception + * @return Worksheet */ - public function setBreak($pCell = 'A1', $pBreak = PHPExcel_Worksheet::BREAK_NONE) + public function setBreak($pCell = 'A1', $pBreak = Worksheet::BREAK_NONE) { // Uppercase coordinate $pCell = strtoupper($pCell); if ($pCell != '') { - if ($pBreak == PHPExcel_Worksheet::BREAK_NONE) { + if ($pBreak == Worksheet::BREAK_NONE) { if (isset($this->breaks[$pCell])) { unset($this->breaks[$pCell]); } @@ -1639,7 +1639,7 @@ class Worksheet implements IComparable $this->breaks[$pCell] = $pBreak; } } else { - throw new PHPExcel_Exception('No cell coordinate specified.'); + throw new Exception('No cell coordinate specified.'); } return $this; @@ -1650,12 +1650,12 @@ class Worksheet implements IComparable * * @param integer $pColumn Numeric column coordinate of the cell * @param integer $pRow Numeric row coordinate of the cell - * @param integer $pBreak Break type (type of PHPExcel_Worksheet::BREAK_*) - * @return PHPExcel_Worksheet + * @param integer $pBreak Break type (type of \PHPExcel\Worksheet::BREAK_*) + * @return Worksheet */ - public function setBreakByColumnAndRow($pColumn = 0, $pRow = 1, $pBreak = PHPExcel_Worksheet::BREAK_NONE) + public function setBreakByColumnAndRow($pColumn = 0, $pRow = 1, $pBreak = Worksheet::BREAK_NONE) { - return $this->setBreak(PHPExcel_Cell::stringFromColumnIndex($pColumn) . $pRow, $pBreak); + return $this->setBreak(Cell::stringFromColumnIndex($pColumn) . $pRow, $pBreak); } /** @@ -1672,8 +1672,8 @@ class Worksheet implements IComparable * Set merge on a cell range * * @param string $pRange Cell range (e.g. A1:E1) - * @throws PHPExcel_Exception - * @return PHPExcel_Worksheet + * @throws Exception + * @return Worksheet */ public function mergeCells($pRange = 'A1:A1') { @@ -1686,21 +1686,21 @@ class Worksheet implements IComparable // make sure cells are created // get the cells in the range - $aReferences = PHPExcel_Cell::extractAllCellReferencesInRange($pRange); + $aReferences = Cell::extractAllCellReferencesInRange($pRange); // create upper left cell if it does not already exist $upperLeft = $aReferences[0]; if (!$this->cellExists($upperLeft)) { - $this->getCell($upperLeft)->setValueExplicit(null, PHPExcel_Cell_DataType::TYPE_NULL); + $this->getCell($upperLeft)->setValueExplicit(null, Cell\DataType::TYPE_NULL); } // create or blank out the rest of the cells in the range $count = count($aReferences); for ($i = 1; $i < $count; $i++) { - $this->getCell($aReferences[$i])->setValueExplicit(null, PHPExcel_Cell_DataType::TYPE_NULL); + $this->getCell($aReferences[$i])->setValueExplicit(null, Cell\DataType::TYPE_NULL); } } else { - throw new PHPExcel_Exception('Merge must be set on a range of cells.'); + throw new Exception('Merge must be set on a range of cells.'); } return $this; @@ -1713,12 +1713,12 @@ class Worksheet implements IComparable * @param int $pRow1 Numeric row coordinate of the first cell * @param int $pColumn2 Numeric column coordinate of the last cell * @param int $pRow2 Numeric row coordinate of the last cell - * @throws PHPExcel_Exception - * @return PHPExcel_Worksheet + * @throws Exception + * @return Worksheet */ public function mergeCellsByColumnAndRow($pColumn1 = 0, $pRow1 = 1, $pColumn2 = 0, $pRow2 = 1) { - $cellRange = PHPExcel_Cell::stringFromColumnIndex($pColumn1) . $pRow1 . ':' . PHPExcel_Cell::stringFromColumnIndex($pColumn2) . $pRow2; + $cellRange = Cell::stringFromColumnIndex($pColumn1) . $pRow1 . ':' . Cell::stringFromColumnIndex($pColumn2) . $pRow2; return $this->mergeCells($cellRange); } @@ -1726,8 +1726,8 @@ class Worksheet implements IComparable * Remove merge on a cell range * * @param string $pRange Cell range (e.g. A1:E1) - * @throws PHPExcel_Exception - * @return PHPExcel_Worksheet + * @throws Exception + * @return Worksheet */ public function unmergeCells($pRange = 'A1:A1') { @@ -1738,10 +1738,10 @@ class Worksheet implements IComparable if (isset($this->mergeCells[$pRange])) { unset($this->mergeCells[$pRange]); } else { - throw new PHPExcel_Exception('Cell range ' . $pRange . ' not known as merged.'); + throw new Exception('Cell range ' . $pRange . ' not known as merged.'); } } else { - throw new PHPExcel_Exception('Merge can only be removed from a range of cells.'); + throw new Exception('Merge can only be removed from a range of cells.'); } return $this; @@ -1754,12 +1754,12 @@ class Worksheet implements IComparable * @param int $pRow1 Numeric row coordinate of the first cell * @param int $pColumn2 Numeric column coordinate of the last cell * @param int $pRow2 Numeric row coordinate of the last cell - * @throws PHPExcel_Exception - * @return PHPExcel_Worksheet + * @throws Exception + * @return Worksheet */ public function unmergeCellsByColumnAndRow($pColumn1 = 0, $pRow1 = 1, $pColumn2 = 0, $pRow2 = 1) { - $cellRange = PHPExcel_Cell::stringFromColumnIndex($pColumn1) . $pRow1 . ':' . PHPExcel_Cell::stringFromColumnIndex($pColumn2) . $pRow2; + $cellRange = Cell::stringFromColumnIndex($pColumn1) . $pRow1 . ':' . Cell::stringFromColumnIndex($pColumn2) . $pRow2; return $this->unmergeCells($cellRange); } @@ -1791,8 +1791,8 @@ class Worksheet implements IComparable * @param string $pRange Cell (e.g. A1) or cell range (e.g. A1:E1) * @param string $pPassword Password to unlock the protection * @param boolean $pAlreadyHashed If the password has already been hashed, set this to true - * @throws PHPExcel_Exception - * @return PHPExcel_Worksheet + * @throws Exception + * @return Worksheet */ public function protectCells($pRange = 'A1', $pPassword = '', $pAlreadyHashed = false) { @@ -1800,7 +1800,7 @@ class Worksheet implements IComparable $pRange = strtoupper($pRange); if (!$pAlreadyHashed) { - $pPassword = PHPExcel_Shared_PasswordHasher::hashPassword($pPassword); + $pPassword = Shared\PasswordHasher::hashPassword($pPassword); } $this->protectedCells[$pRange] = $pPassword; @@ -1816,12 +1816,12 @@ class Worksheet implements IComparable * @param int $pRow2 Numeric row coordinate of the last cell * @param string $pPassword Password to unlock the protection * @param boolean $pAlreadyHashed If the password has already been hashed, set this to true - * @throws PHPExcel_Exception - * @return PHPExcel_Worksheet + * @throws Exception + * @return Worksheet */ public function protectCellsByColumnAndRow($pColumn1 = 0, $pRow1 = 1, $pColumn2 = 0, $pRow2 = 1, $pPassword = '', $pAlreadyHashed = false) { - $cellRange = PHPExcel_Cell::stringFromColumnIndex($pColumn1) . $pRow1 . ':' . PHPExcel_Cell::stringFromColumnIndex($pColumn2) . $pRow2; + $cellRange = Cell::stringFromColumnIndex($pColumn1) . $pRow1 . ':' . Cell::stringFromColumnIndex($pColumn2) . $pRow2; return $this->protectCells($cellRange, $pPassword, $pAlreadyHashed); } @@ -1829,8 +1829,8 @@ class Worksheet implements IComparable * Remove protection on a cell range * * @param string $pRange Cell (e.g. A1) or cell range (e.g. A1:E1) - * @throws PHPExcel_Exception - * @return PHPExcel_Worksheet + * @throws Exception + * @return Worksheet */ public function unprotectCells($pRange = 'A1') { @@ -1840,7 +1840,7 @@ class Worksheet implements IComparable if (isset($this->protectedCells[$pRange])) { unset($this->protectedCells[$pRange]); } else { - throw new PHPExcel_Exception('Cell range ' . $pRange . ' not known as protected.'); + throw new Exception('Cell range ' . $pRange . ' not known as protected.'); } return $this; } @@ -1854,12 +1854,12 @@ class Worksheet implements IComparable * @param int $pRow2 Numeric row coordinate of the last cell * @param string $pPassword Password to unlock the protection * @param boolean $pAlreadyHashed If the password has already been hashed, set this to true - * @throws PHPExcel_Exception - * @return PHPExcel_Worksheet + * @throws Exception + * @return Worksheet */ public function unprotectCellsByColumnAndRow($pColumn1 = 0, $pRow1 = 1, $pColumn2 = 0, $pRow2 = 1, $pPassword = '', $pAlreadyHashed = false) { - $cellRange = PHPExcel_Cell::stringFromColumnIndex($pColumn1) . $pRow1 . ':' . PHPExcel_Cell::stringFromColumnIndex($pColumn2) . $pRow2; + $cellRange = Cell::stringFromColumnIndex($pColumn1) . $pRow1 . ':' . Cell::stringFromColumnIndex($pColumn2) . $pRow2; return $this->unprotectCells($cellRange, $pPassword, $pAlreadyHashed); } @@ -1876,7 +1876,7 @@ class Worksheet implements IComparable /** * Get Autofilter * - * @return PHPExcel_Worksheet_AutoFilter + * @return Worksheet\AutoFilter */ public function getAutoFilter() { @@ -1886,17 +1886,17 @@ class Worksheet implements IComparable /** * Set AutoFilter * - * @param PHPExcel_Worksheet_AutoFilter|string $pValue + * @param Worksheet\AutoFilter|string $pValue * A simple string containing a Cell range like 'A1:E10' is permitted for backward compatibility - * @throws PHPExcel_Exception - * @return PHPExcel_Worksheet + * @throws Exception + * @return Worksheet */ public function setAutoFilter($pValue) { $pRange = strtoupper($pValue); if (is_string($pValue)) { $this->autoFilter->setRange($pValue); - } elseif (is_object($pValue) && ($pValue instanceof PHPExcel_Worksheet_AutoFilter)) { + } elseif (is_object($pValue) && ($pValue instanceof Worksheet\AutoFilter)) { $this->autoFilter = $pValue; } return $this; @@ -1909,22 +1909,22 @@ class Worksheet implements IComparable * @param integer $pRow1 Numeric row coordinate of the first cell * @param integer $pColumn2 Numeric column coordinate of the second cell * @param integer $pRow2 Numeric row coordinate of the second cell - * @throws PHPExcel_Exception - * @return PHPExcel_Worksheet + * @throws Exception + * @return Worksheet */ public function setAutoFilterByColumnAndRow($pColumn1 = 0, $pRow1 = 1, $pColumn2 = 0, $pRow2 = 1) { return $this->setAutoFilter( - PHPExcel_Cell::stringFromColumnIndex($pColumn1) . $pRow1 + Cell::stringFromColumnIndex($pColumn1) . $pRow1 . ':' . - PHPExcel_Cell::stringFromColumnIndex($pColumn2) . $pRow2 + Cell::stringFromColumnIndex($pColumn2) . $pRow2 ); } /** * Remove autofilter * - * @return PHPExcel_Worksheet + * @return Worksheet */ public function removeAutoFilter() { @@ -1951,8 +1951,8 @@ class Worksheet implements IComparable * B1 will freeze the columns to the left of cell B1 (i.e column A) * B2 will freeze the rows above and to the left of cell A2 * (i.e row 1 and column A) - * @throws PHPExcel_Exception - * @return PHPExcel_Worksheet + * @throws Exception + * @return Worksheet */ public function freezePane($pCell = '') { @@ -1961,7 +1961,7 @@ class Worksheet implements IComparable if (strpos($pCell, ':') === false && strpos($pCell, ',') === false) { $this->freezePane = $pCell; } else { - throw new PHPExcel_Exception('Freeze pane can not be set on a range of cells.'); + throw new Exception('Freeze pane can not be set on a range of cells.'); } return $this; } @@ -1971,18 +1971,18 @@ class Worksheet implements IComparable * * @param int $pColumn Numeric column coordinate of the cell * @param int $pRow Numeric row coordinate of the cell - * @throws PHPExcel_Exception - * @return PHPExcel_Worksheet + * @throws Exception + * @return Worksheet */ public function freezePaneByColumnAndRow($pColumn = 0, $pRow = 1) { - return $this->freezePane(PHPExcel_Cell::stringFromColumnIndex($pColumn) . $pRow); + return $this->freezePane(Cell::stringFromColumnIndex($pColumn) . $pRow); } /** * Unfreeze Pane * - * @return PHPExcel_Worksheet + * @return Worksheet */ public function unfreezePane() { @@ -1994,16 +1994,16 @@ class Worksheet implements IComparable * * @param int $pBefore Insert before this one * @param int $pNumRows Number of rows to insert - * @throws PHPExcel_Exception - * @return PHPExcel_Worksheet + * @throws Exception + * @return Worksheet */ public function insertNewRowBefore($pBefore = 1, $pNumRows = 1) { if ($pBefore >= 1) { - $objReferenceHelper = PHPExcel_ReferenceHelper::getInstance(); + $objReferenceHelper = ReferenceHelper::getInstance(); $objReferenceHelper->insertNewBefore('A' . $pBefore, 0, $pNumRows, $this); } else { - throw new PHPExcel_Exception("Rows can only be inserted before at least row 1."); + throw new Exception("Rows can only be inserted before at least row 1."); } return $this; } @@ -2013,16 +2013,16 @@ class Worksheet implements IComparable * * @param int $pBefore Insert before this one * @param int $pNumCols Number of columns to insert - * @throws PHPExcel_Exception - * @return PHPExcel_Worksheet + * @throws Exception + * @return Worksheet */ public function insertNewColumnBefore($pBefore = 'A', $pNumCols = 1) { if (!is_numeric($pBefore)) { - $objReferenceHelper = PHPExcel_ReferenceHelper::getInstance(); + $objReferenceHelper = ReferenceHelper::getInstance(); $objReferenceHelper->insertNewBefore($pBefore . '1', $pNumCols, 0, $this); } else { - throw new PHPExcel_Exception("Column references should not be numeric."); + throw new Exception("Column references should not be numeric."); } return $this; } @@ -2032,15 +2032,15 @@ class Worksheet implements IComparable * * @param int $pBefore Insert before this one (numeric column coordinate of the cell) * @param int $pNumCols Number of columns to insert - * @throws PHPExcel_Exception - * @return PHPExcel_Worksheet + * @throws Exception + * @return Worksheet */ public function insertNewColumnBeforeByIndex($pBefore = 0, $pNumCols = 1) { if ($pBefore >= 0) { - return $this->insertNewColumnBefore(PHPExcel_Cell::stringFromColumnIndex($pBefore), $pNumCols); + return $this->insertNewColumnBefore(Cell::stringFromColumnIndex($pBefore), $pNumCols); } else { - throw new PHPExcel_Exception("Columns can only be inserted before at least column A (0)."); + throw new Exception("Columns can only be inserted before at least column A (0)."); } } @@ -2049,21 +2049,21 @@ class Worksheet implements IComparable * * @param int $pRow Remove starting with this one * @param int $pNumRows Number of rows to remove - * @throws PHPExcel_Exception - * @return PHPExcel_Worksheet + * @throws Exception + * @return Worksheet */ public function removeRow($pRow = 1, $pNumRows = 1) { if ($pRow >= 1) { $highestRow = $this->getHighestDataRow(); - $objReferenceHelper = PHPExcel_ReferenceHelper::getInstance(); + $objReferenceHelper = ReferenceHelper::getInstance(); $objReferenceHelper->insertNewBefore('A' . ($pRow + $pNumRows), 0, -$pNumRows, $this); for ($r = 0; $r < $pNumRows; ++$r) { $this->getCellCacheController()->removeRow($highestRow); --$highestRow; } } else { - throw new PHPExcel_Exception("Rows to be deleted should at least start from row 1."); + throw new Exception("Rows to be deleted should at least start from row 1."); } return $this; } @@ -2073,22 +2073,22 @@ class Worksheet implements IComparable * * @param string $pColumn Remove starting with this one * @param int $pNumCols Number of columns to remove - * @throws PHPExcel_Exception - * @return PHPExcel_Worksheet + * @throws Exception + * @return Worksheet */ public function removeColumn($pColumn = 'A', $pNumCols = 1) { if (!is_numeric($pColumn)) { $highestColumn = $this->getHighestDataColumn(); - $pColumn = PHPExcel_Cell::stringFromColumnIndex(PHPExcel_Cell::columnIndexFromString($pColumn) - 1 + $pNumCols); - $objReferenceHelper = PHPExcel_ReferenceHelper::getInstance(); + $pColumn = Cell::stringFromColumnIndex(Cell::columnIndexFromString($pColumn) - 1 + $pNumCols); + $objReferenceHelper = ReferenceHelper::getInstance(); $objReferenceHelper->insertNewBefore($pColumn . '1', -$pNumCols, 0, $this); for ($c = 0; $c < $pNumCols; ++$c) { $this->getCellCacheController()->removeColumn($highestColumn); - $highestColumn = PHPExcel_Cell::stringFromColumnIndex(PHPExcel_Cell::columnIndexFromString($highestColumn) - 2); + $highestColumn = Cell::stringFromColumnIndex(Cell::columnIndexFromString($highestColumn) - 2); } } else { - throw new PHPExcel_Exception("Column references should not be numeric."); + throw new Exception("Column references should not be numeric."); } return $this; } @@ -2098,15 +2098,15 @@ class Worksheet implements IComparable * * @param int $pColumn Remove starting with this one (numeric column coordinate of the cell) * @param int $pNumCols Number of columns to remove - * @throws PHPExcel_Exception - * @return PHPExcel_Worksheet + * @throws Exception + * @return Worksheet */ public function removeColumnByIndex($pColumn = 0, $pNumCols = 1) { if ($pColumn >= 0) { - return $this->removeColumn(PHPExcel_Cell::stringFromColumnIndex($pColumn), $pNumCols); + return $this->removeColumn(Cell::stringFromColumnIndex($pColumn), $pNumCols); } else { - throw new PHPExcel_Exception("Columns to be deleted should at least start from column 0"); + throw new Exception("Columns to be deleted should at least start from column 0"); } } @@ -2124,7 +2124,7 @@ class Worksheet implements IComparable * Set show gridlines * * @param boolean $pValue Show gridlines (true/false) - * @return PHPExcel_Worksheet + * @return Worksheet */ public function setShowGridlines($pValue = false) { @@ -2146,7 +2146,7 @@ class Worksheet implements IComparable * Set print gridlines * * @param boolean $pValue Print gridlines (true/false) - * @return PHPExcel_Worksheet + * @return Worksheet */ public function setPrintGridlines($pValue = false) { @@ -2168,7 +2168,7 @@ class Worksheet implements IComparable * Set show row and column headers * * @param boolean $pValue Show row and column headers (true/false) - * @return PHPExcel_Worksheet + * @return Worksheet */ public function setShowRowColHeaders($pValue = false) { @@ -2190,7 +2190,7 @@ class Worksheet implements IComparable * Set show summary below * * @param boolean $pValue Show summary below (true/false) - * @return PHPExcel_Worksheet + * @return Worksheet */ public function setShowSummaryBelow($pValue = true) { @@ -2212,7 +2212,7 @@ class Worksheet implements IComparable * Set show summary right * * @param boolean $pValue Show summary right (true/false) - * @return PHPExcel_Worksheet + * @return Worksheet */ public function setShowSummaryRight($pValue = true) { @@ -2223,7 +2223,7 @@ class Worksheet implements IComparable /** * Get comments * - * @return PHPExcel_Comment[] + * @return Comment[] */ public function getComments() { @@ -2233,8 +2233,8 @@ class Worksheet implements IComparable /** * Set comments array for the entire sheet. * - * @param array of PHPExcel_Comment - * @return PHPExcel_Worksheet + * @param array of Comment + * @return Worksheet */ public function setComments($pValue = array()) { @@ -2247,8 +2247,8 @@ class Worksheet implements IComparable * Get comment for cell * * @param string $pCellCoordinate Cell coordinate to get comment for - * @return PHPExcel_Comment - * @throws PHPExcel_Exception + * @return Comment + * @throws Exception */ public function getComment($pCellCoordinate = 'A1') { @@ -2256,18 +2256,18 @@ class Worksheet implements IComparable $pCellCoordinate = strtoupper($pCellCoordinate); if (strpos($pCellCoordinate, ':') !== false || strpos($pCellCoordinate, ',') !== false) { - throw new PHPExcel_Exception('Cell coordinate string can not be a range of cells.'); + throw new Exception('Cell coordinate string can not be a range of cells.'); } elseif (strpos($pCellCoordinate, '$') !== false) { - throw new PHPExcel_Exception('Cell coordinate string must not be absolute.'); + throw new Exception('Cell coordinate string must not be absolute.'); } elseif ($pCellCoordinate == '') { - throw new PHPExcel_Exception('Cell coordinate can not be zero-length string.'); + throw new Exception('Cell coordinate can not be zero-length string.'); } else { // Check if we already have a comment for this cell. // If not, create a new comment. if (isset($this->comments[$pCellCoordinate])) { return $this->comments[$pCellCoordinate]; } else { - $newComment = new PHPExcel_Comment(); + $newComment = new Comment(); $this->comments[$pCellCoordinate] = $newComment; return $newComment; } @@ -2279,11 +2279,11 @@ class Worksheet implements IComparable * * @param int $pColumn Numeric column coordinate of the cell * @param int $pRow Numeric row coordinate of the cell - * @return PHPExcel_Comment + * @return Comment */ public function getCommentByColumnAndRow($pColumn = 0, $pRow = 1) { - return $this->getComment(PHPExcel_Cell::stringFromColumnIndex($pColumn) . $pRow); + return $this->getComment(Cell::stringFromColumnIndex($pColumn) . $pRow); } /** @@ -2321,7 +2321,7 @@ class Worksheet implements IComparable * Selected cell * * @param string $pCoordinate Cell (i.e. A1) - * @return PHPExcel_Worksheet + * @return Worksheet */ public function setSelectedCell($pCoordinate = 'A1') { @@ -2332,8 +2332,8 @@ class Worksheet implements IComparable * Select a range of cells. * * @param string $pCoordinate Cell range, examples: 'A1', 'B2:G5', 'A:C', '3:6' - * @throws PHPExcel_Exception - * @return PHPExcel_Worksheet + * @throws Exception + * @return Worksheet */ public function setSelectedCells($pCoordinate = 'A1') { @@ -2353,7 +2353,7 @@ class Worksheet implements IComparable $pCoordinate = preg_replace('/^([0-9]+):([0-9]+)$/', 'A${1}:XFD${2}', $pCoordinate); if (strpos($pCoordinate, ':') !== false || strpos($pCoordinate, ',') !== false) { - list($first, ) = PHPExcel_Cell::splitRange($pCoordinate); + list($first, ) = Cell::splitRange($pCoordinate); $this->activeCell = $first[0]; } else { $this->activeCell = $pCoordinate; @@ -2367,12 +2367,12 @@ class Worksheet implements IComparable * * @param int $pColumn Numeric column coordinate of the cell * @param int $pRow Numeric row coordinate of the cell - * @throws PHPExcel_Exception - * @return PHPExcel_Worksheet + * @throws Exception + * @return Worksheet */ public function setSelectedCellByColumnAndRow($pColumn = 0, $pRow = 1) { - return $this->setSelectedCells(PHPExcel_Cell::stringFromColumnIndex($pColumn) . $pRow); + return $this->setSelectedCells(Cell::stringFromColumnIndex($pColumn) . $pRow); } /** @@ -2389,7 +2389,7 @@ class Worksheet implements IComparable * Set right-to-left * * @param boolean $value Right-to-left true/false - * @return PHPExcel_Worksheet + * @return Worksheet */ public function setRightToLeft($value = false) { @@ -2404,8 +2404,8 @@ class Worksheet implements IComparable * @param mixed $nullValue Value in source array that stands for blank cell * @param string $startCell Insert array starting from this cell address as the top left coordinate * @param boolean $strictNullComparison Apply strict comparison when testing for null values in the array - * @throws PHPExcel_Exception - * @return PHPExcel_Worksheet + * @throws Exception + * @return Worksheet */ public function fromArray($source = null, $nullValue = null, $startCell = 'A1', $strictNullComparison = false) { @@ -2416,7 +2416,7 @@ class Worksheet implements IComparable } // start coordinate - list ($startColumn, $startRow) = PHPExcel_Cell::coordinateFromString($startCell); + list ($startColumn, $startRow) = Cell::coordinateFromString($startCell); // Loop through $source foreach ($source as $rowData) { @@ -2438,7 +2438,7 @@ class Worksheet implements IComparable ++$startRow; } } else { - throw new PHPExcel_Exception("Parameter \$source should be an array."); + throw new Exception("Parameter \$source should be an array."); } return $this; } @@ -2459,10 +2459,10 @@ class Worksheet implements IComparable // Returnvalue $returnValue = array(); // Identify the range that we need to extract from the worksheet - list($rangeStart, $rangeEnd) = PHPExcel_Cell::rangeBoundaries($pRange); - $minCol = PHPExcel_Cell::stringFromColumnIndex($rangeStart[0] -1); + list($rangeStart, $rangeEnd) = Cell::rangeBoundaries($pRange); + $minCol = Cell::stringFromColumnIndex($rangeStart[0] -1); $minRow = $rangeStart[1]; - $maxCol = PHPExcel_Cell::stringFromColumnIndex($rangeEnd[0] -1); + $maxCol = Cell::stringFromColumnIndex($rangeEnd[0] -1); $maxRow = $rangeEnd[1]; $maxCol++; @@ -2480,7 +2480,7 @@ class Worksheet implements IComparable // Cell exists $cell = $this->cellCollection->getCacheData($col.$row); if ($cell->getValue() !== null) { - if ($cell->getValue() instanceof PHPExcel_RichText) { + if ($cell->getValue() instanceof RichText) { $returnValue[$rRef][$cRef] = $cell->getValue()->getPlainText(); } else { if ($calculateFormulas) { @@ -2492,9 +2492,9 @@ class Worksheet implements IComparable if ($formatData) { $style = $this->parent->getCellXfByIndex($cell->getXfIndex()); - $returnValue[$rRef][$cRef] = PHPExcel_Style_NumberFormat::toFormattedString( + $returnValue[$rRef][$cRef] = Style\NumberFormat::toFormattedString( $returnValue[$rRef][$cRef], - ($style && $style->getNumberFormat()) ? $style->getNumberFormat()->getFormatCode() : PHPExcel_Style_NumberFormat::FORMAT_GENERAL + ($style && $style->getNumberFormat()) ? $style->getNumberFormat()->getFormatCode() : Style\NumberFormat::FORMAT_GENERAL ); } } else { @@ -2523,11 +2523,11 @@ class Worksheet implements IComparable * @param boolean $returnCellRef False - Return a simple array of rows and columns indexed by number counting from zero * True - Return rows and columns indexed by their actual row and column IDs * @return array - * @throws PHPExcel_Exception + * @throws Exception */ public function namedRangeToArray($pNamedRange = '', $nullValue = null, $calculateFormulas = true, $formatData = true, $returnCellRef = false) { - $namedRange = PHPExcel_NamedRange::resolveRange($pNamedRange, $this); + $namedRange = NamedRange::resolveRange($pNamedRange, $this); if ($namedRange !== null) { $pWorkSheet = $namedRange->getWorksheet(); $pCellRange = $namedRange->getRange(); @@ -2535,7 +2535,7 @@ class Worksheet implements IComparable return $pWorkSheet->rangeToArray($pCellRange, $nullValue, $calculateFormulas, $formatData, $returnCellRef); } - throw new PHPExcel_Exception('Named Range '.$pNamedRange.' does not exist.'); + throw new Exception('Named Range '.$pNamedRange.' does not exist.'); } @@ -2567,11 +2567,11 @@ class Worksheet implements IComparable * @param integer $startRow The row number at which to start iterating * @param integer $endRow The row number at which to stop iterating * - * @return PHPExcel_Worksheet_RowIterator + * @return Worksheet\RowIterator */ public function getRowIterator($startRow = 1, $endRow = null) { - return new PHPExcel_Worksheet_RowIterator($this, $startRow, $endRow); + return new Worksheet\RowIterator($this, $startRow, $endRow); } /** @@ -2580,17 +2580,17 @@ class Worksheet implements IComparable * @param string $startColumn The column address at which to start iterating * @param string $endColumn The column address at which to stop iterating * - * @return PHPExcel_Worksheet_ColumnIterator + * @return Worksheet\ColumnIterator */ public function getColumnIterator($startColumn = 'A', $endColumn = null) { - return new PHPExcel_Worksheet_ColumnIterator($this, $startColumn, $endColumn); + return new Worksheet\ColumnIterator($this, $startColumn, $endColumn); } /** * Run PHPExcel garabage collector. * - * @return PHPExcel_Worksheet + * @return Worksheet */ public function garbageCollect() { @@ -2608,11 +2608,11 @@ class Worksheet implements IComparable // Lookup highest column and highest row if cells are cleaned $colRow = $this->cellCollection->getHighestRowAndColumn(); $highestRow = $colRow['row']; - $highestColumn = PHPExcel_Cell::columnIndexFromString($colRow['column']); + $highestColumn = Cell::columnIndexFromString($colRow['column']); // Loop through column dimensions foreach ($this->columnDimensions as $dimension) { - $highestColumn = max($highestColumn, PHPExcel_Cell::columnIndexFromString($dimension->getColumnIndex())); + $highestColumn = max($highestColumn, Cell::columnIndexFromString($dimension->getColumnIndex())); } // Loop through row dimensions @@ -2624,7 +2624,7 @@ class Worksheet implements IComparable if ($highestColumn < 0) { $this->cachedHighestColumn = 'A'; } else { - $this->cachedHighestColumn = PHPExcel_Cell::stringFromColumnIndex(--$highestColumn); + $this->cachedHighestColumn = Cell::stringFromColumnIndex(--$highestColumn); } $this->cachedHighestRow = $highestRow; @@ -2683,7 +2683,7 @@ class Worksheet implements IComparable } // else create hyperlink - $this->hyperlinkCollection[$pCellCoordinate] = new PHPExcel_Cell_Hyperlink(); + $this->hyperlinkCollection[$pCellCoordinate] = new Cell\Hyperlink(); return $this->hyperlinkCollection[$pCellCoordinate]; } @@ -2691,10 +2691,10 @@ class Worksheet implements IComparable * Set hyperlnk * * @param string $pCellCoordinate Cell coordinate to insert hyperlink - * @param PHPExcel_Cell_Hyperlink $pHyperlink - * @return PHPExcel_Worksheet + * @param Cell\Hyperlink $pHyperlink + * @return Worksheet */ - public function setHyperlink($pCellCoordinate = 'A1', PHPExcel_Cell_Hyperlink $pHyperlink = null) + public function setHyperlink($pCellCoordinate = 'A1', Cell\Hyperlink $pHyperlink = null) { if ($pHyperlink === null) { unset($this->hyperlinkCollection[$pCellCoordinate]); @@ -2718,7 +2718,7 @@ class Worksheet implements IComparable /** * Get collection of hyperlinks * - * @return PHPExcel_Cell_Hyperlink[] + * @return Cell\Hyperlink[] */ public function getHyperlinkCollection() { @@ -2738,7 +2738,7 @@ class Worksheet implements IComparable } // else create data validation - $this->dataValidationCollection[$pCellCoordinate] = new PHPExcel_Cell_DataValidation(); + $this->dataValidationCollection[$pCellCoordinate] = new Cell\DataValidation(); return $this->dataValidationCollection[$pCellCoordinate]; } @@ -2746,10 +2746,10 @@ class Worksheet implements IComparable * Set data validation * * @param string $pCellCoordinate Cell coordinate to insert data validation - * @param PHPExcel_Cell_DataValidation $pDataValidation - * @return PHPExcel_Worksheet + * @param Cell\DataValidation $pDataValidation + * @return Worksheet */ - public function setDataValidation($pCellCoordinate = 'A1', PHPExcel_Cell_DataValidation $pDataValidation = null) + public function setDataValidation($pCellCoordinate = 'A1', Cell\DataValidation $pDataValidation = null) { if ($pDataValidation === null) { unset($this->dataValidationCollection[$pCellCoordinate]); @@ -2773,7 +2773,7 @@ class Worksheet implements IComparable /** * Get collection of data validations * - * @return PHPExcel_Cell_DataValidation[] + * @return Cell\DataValidation[] */ public function getDataValidationCollection() { @@ -2790,20 +2790,20 @@ class Worksheet implements IComparable { $maxCol = $this->getHighestColumn(); $maxRow = $this->getHighestRow(); - $maxCol = PHPExcel_Cell::columnIndexFromString($maxCol); + $maxCol = Cell::columnIndexFromString($maxCol); $rangeBlocks = explode(' ', $range); foreach ($rangeBlocks as &$rangeSet) { - $rangeBoundaries = PHPExcel_Cell::getRangeBoundaries($rangeSet); + $rangeBoundaries = Cell::getRangeBoundaries($rangeSet); - if (PHPExcel_Cell::columnIndexFromString($rangeBoundaries[0][0]) > $maxCol) { - $rangeBoundaries[0][0] = PHPExcel_Cell::stringFromColumnIndex($maxCol); + if (Cell::columnIndexFromString($rangeBoundaries[0][0]) > $maxCol) { + $rangeBoundaries[0][0] = Cell::stringFromColumnIndex($maxCol); } if ($rangeBoundaries[0][1] > $maxRow) { $rangeBoundaries[0][1] = $maxRow; } - if (PHPExcel_Cell::columnIndexFromString($rangeBoundaries[1][0]) > $maxCol) { - $rangeBoundaries[1][0] = PHPExcel_Cell::stringFromColumnIndex($maxCol); + if (Cell::columnIndexFromString($rangeBoundaries[1][0]) > $maxCol) { + $rangeBoundaries[1][0] = Cell::stringFromColumnIndex($maxCol); } if ($rangeBoundaries[1][1] > $maxRow) { $rangeBoundaries[1][1] = $maxRow; @@ -2819,12 +2819,12 @@ class Worksheet implements IComparable /** * Get tab color * - * @return PHPExcel_Style_Color + * @return Style\Color */ public function getTabColor() { if ($this->tabColor === null) { - $this->tabColor = new PHPExcel_Style_Color(); + $this->tabColor = new Style\Color(); } return $this->tabColor; } @@ -2832,7 +2832,7 @@ class Worksheet implements IComparable /** * Reset tab color * - * @return PHPExcel_Worksheet + * @return Worksheet */ public function resetTabColor() { @@ -2855,7 +2855,7 @@ class Worksheet implements IComparable /** * Copy worksheet (!= clone!) * - * @return PHPExcel_Worksheet + * @return Worksheet */ public function copy() { @@ -2882,7 +2882,7 @@ class Worksheet implements IComparable } elseif ($key == 'drawingCollection') { $newCollection = clone $this->drawingCollection; $this->drawingCollection = $newCollection; - } elseif (($key == 'autoFilter') && ($this->autoFilter instanceof PHPExcel_Worksheet_AutoFilter)) { + } elseif (($key == 'autoFilter') && ($this->autoFilter instanceof Worksheet\AutoFilter)) { $newAutoFilter = clone $this->autoFilter; $this->autoFilter = $newAutoFilter; $this->autoFilter->setParent($this); @@ -2897,7 +2897,7 @@ class Worksheet implements IComparable * * @param null|string Same rule as Title minus space not allowed (but, like Excel, change silently space to underscore) * @return objWorksheet - * @throws PHPExcel_Exception + * @throws Exception */ public function setCodeName($pValue = null) { @@ -2917,19 +2917,19 @@ class Worksheet implements IComparable if ($this->getParent()->sheetCodeNameExists($pValue)) { // Use name, but append with lowest possible integer - if (PHPExcel_Shared_String::CountCharacters($pValue) > 29) { - $pValue = PHPExcel_Shared_String::Substring($pValue, 0, 29); + if (Shared\String::CountCharacters($pValue) > 29) { + $pValue = Shared\String::Substring($pValue, 0, 29); } $i = 1; while ($this->getParent()->sheetCodeNameExists($pValue . '_' . $i)) { ++$i; if ($i == 10) { - if (PHPExcel_Shared_String::CountCharacters($pValue) > 28) { - $pValue = PHPExcel_Shared_String::Substring($pValue, 0, 28); + if (Shared\String::CountCharacters($pValue) > 28) { + $pValue = Shared\String::Substring($pValue, 0, 28); } } elseif ($i == 100) { - if (PHPExcel_Shared_String::CountCharacters($pValue) > 27) { - $pValue = PHPExcel_Shared_String::Substring($pValue, 0, 27); + if (Shared\String::CountCharacters($pValue) > 27) { + $pValue = Shared\String::Substring($pValue, 0, 27); } } } diff --git a/classes/src/Worksheet/AutoFilter.php b/classes/src/Worksheet/AutoFilter.php index 6ec8a446..312e4fe0 100644 --- a/classes/src/Worksheet/AutoFilter.php +++ b/classes/src/Worksheet/AutoFilter.php @@ -1,5 +1,7 @@ range = $pRange; $this->workSheet = $pSheet; @@ -79,7 +81,7 @@ class PHPExcel_Worksheet_AutoFilter * @param PHPExcel_Worksheet $pSheet * @return PHPExcel_Worksheet_AutoFilter */ - public function setParent(PHPExcel_Worksheet $pSheet = null) + public function setParent(\PHPExcel\Worksheet $pSheet = null) { $this->workSheet = $pSheet; diff --git a/classes/src/Worksheet/BaseDrawing.php b/classes/src/Worksheet/BaseDrawing.php index 9ad15c70..682cbe7b 100644 --- a/classes/src/Worksheet/BaseDrawing.php +++ b/classes/src/Worksheet/BaseDrawing.php @@ -1,5 +1,7 @@ * */ -class PHPExcel_Worksheet_HeaderFooter +class HeaderFooter { /* Header/footer image location */ const IMAGE_HEADER_LEFT = 'LH'; diff --git a/classes/src/Worksheet/HeaderFooterDrawing.php b/classes/src/Worksheet/HeaderFooterDrawing.php index a491f4ba..ce51887a 100644 --- a/classes/src/Worksheet/HeaderFooterDrawing.php +++ b/classes/src/Worksheet/HeaderFooterDrawing.php @@ -1,5 +1,7 @@ * Paper size taken from Office Open XML Part 4 - Markup Language Reference, page 1988: @@ -104,7 +102,7 @@ * @package PHPExcel_Worksheet * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) */ -class PHPExcel_Worksheet_PageSetup +class PageSetup { /* Paper size */ const PAPERSIZE_LETTER = 1; @@ -189,14 +187,14 @@ class PHPExcel_Worksheet_PageSetup * * @var int */ - private $paperSize = PHPExcel_Worksheet_PageSetup::PAPERSIZE_LETTER; + private $paperSize = self::PAPERSIZE_LETTER; /** * Orientation * * @var string */ - private $orientation = PHPExcel_Worksheet_PageSetup::ORIENTATION_DEFAULT; + private $orientation = self::ORIENTATION_DEFAULT; /** * Scale (Print Scale) @@ -275,7 +273,7 @@ class PHPExcel_Worksheet_PageSetup private $firstPageNumber = null; /** - * Create a new PHPExcel_Worksheet_PageSetup + * Create a new PageSetup */ public function __construct() { @@ -295,9 +293,9 @@ class PHPExcel_Worksheet_PageSetup * Set Paper Size * * @param int $pValue - * @return PHPExcel_Worksheet_PageSetup + * @return PageSetup */ - public function setPaperSize($pValue = PHPExcel_Worksheet_PageSetup::PAPERSIZE_LETTER) + public function setPaperSize($pValue = self::PAPERSIZE_LETTER) { $this->paperSize = $pValue; return $this; @@ -317,9 +315,9 @@ class PHPExcel_Worksheet_PageSetup * Set Orientation * * @param string $pValue - * @return PHPExcel_Worksheet_PageSetup + * @return PageSetup */ - public function setOrientation($pValue = PHPExcel_Worksheet_PageSetup::ORIENTATION_DEFAULT) + public function setOrientation($pValue = self::ORIENTATION_DEFAULT) { $this->orientation = $pValue; return $this; @@ -341,10 +339,10 @@ class PHPExcel_Worksheet_PageSetup * Print scaling. Valid values range from 10 to 400 * This setting is overridden when fitToWidth and/or fitToHeight are in use * - * @param int? $pValue + * @param int? $pValue * @param boolean $pUpdate Update fitToPage so scaling applies rather than fitToHeight / fitToWidth - * @return PHPExcel_Worksheet_PageSetup - * @throws PHPExcel_Exception + * @return PageSetup + * @throws \PHPExcel\Exception */ public function setScale($pValue = 100, $pUpdate = true) { @@ -356,7 +354,7 @@ class PHPExcel_Worksheet_PageSetup $this->fitToPage = false; } } else { - throw new PHPExcel_Exception("Scale must not be negative"); + throw new \PHPExcel\Exception("Scale must not be negative"); } return $this; } @@ -375,7 +373,7 @@ class PHPExcel_Worksheet_PageSetup * Set Fit To Page * * @param boolean $pValue - * @return PHPExcel_Worksheet_PageSetup + * @return PageSetup */ public function setFitToPage($pValue = true) { @@ -398,7 +396,7 @@ class PHPExcel_Worksheet_PageSetup * * @param int? $pValue * @param boolean $pUpdate Update fitToPage so it applies rather than scaling - * @return PHPExcel_Worksheet_PageSetup + * @return PageSetup */ public function setFitToHeight($pValue = 1, $pUpdate = true) { @@ -424,7 +422,7 @@ class PHPExcel_Worksheet_PageSetup * * @param int? $pValue * @param boolean $pUpdate Update fitToPage so it applies rather than scaling - * @return PHPExcel_Worksheet_PageSetup + * @return PageSetup */ public function setFitToWidth($pValue = 1, $pUpdate = true) { @@ -465,7 +463,7 @@ class PHPExcel_Worksheet_PageSetup * Set Columns to repeat at left * * @param array $pValue Containing start column and end column, empty array if option unset - * @return PHPExcel_Worksheet_PageSetup + * @return PageSetup */ public function setColumnsToRepeatAtLeft($pValue = null) { @@ -480,7 +478,7 @@ class PHPExcel_Worksheet_PageSetup * * @param string $pStart * @param string $pEnd - * @return PHPExcel_Worksheet_PageSetup + * @return PageSetup */ public function setColumnsToRepeatAtLeftByStartAndEnd($pStart = 'A', $pEnd = 'A') { @@ -518,7 +516,7 @@ class PHPExcel_Worksheet_PageSetup * Set Rows to repeat at top * * @param array $pValue Containing start column and end column, empty array if option unset - * @return PHPExcel_Worksheet_PageSetup + * @return PageSetup */ public function setRowsToRepeatAtTop($pValue = null) { @@ -533,7 +531,7 @@ class PHPExcel_Worksheet_PageSetup * * @param int $pStart * @param int $pEnd - * @return PHPExcel_Worksheet_PageSetup + * @return PageSetup */ public function setRowsToRepeatAtTopByStartAndEnd($pStart = 1, $pEnd = 1) { @@ -555,7 +553,7 @@ class PHPExcel_Worksheet_PageSetup * Set center page horizontally * * @param bool $value - * @return PHPExcel_Worksheet_PageSetup + * @return PageSetup */ public function setHorizontalCentered($value = false) { @@ -577,7 +575,7 @@ class PHPExcel_Worksheet_PageSetup * Set center page vertically * * @param bool $value - * @return PHPExcel_Worksheet_PageSetup + * @return PageSetup */ public function setVerticalCentered($value = false) { @@ -632,7 +630,7 @@ class PHPExcel_Worksheet_PageSetup * Default behaviour, or an index value of 0, will clear all print ranges that are set * Otherwise, the range identified by the value of $index will be removed from the series * Print areas are numbered from 1 - * @return PHPExcel_Worksheet_PageSetup + * @return PageSetup */ public function clearPrintArea($index = 0) { @@ -666,8 +664,8 @@ class PHPExcel_Worksheet_PageSetup * @param string $method Determines the method used when setting multiple print areas * Default behaviour, or the "O" method, overwrites existing print area * The "I" method, inserts the new print area before any specified index, or at the end of the list - * @return PHPExcel_Worksheet_PageSetup - * @throws PHPExcel_Exception + * @return PageSetup + * @throws \PHPExcel\Exception */ public function setPrintArea($value, $index = 0, $method = self::SETPRINTRANGE_OVERWRITE) { @@ -725,8 +723,8 @@ class PHPExcel_Worksheet_PageSetup * Specifying an index value of 0, will always append the new print range at the end of the * list. * Print areas are numbered from 1 - * @return PHPExcel_Worksheet_PageSetup - * @throws PHPExcel_Exception + * @return PageSetup + * @throws \PHPExcel\Exception */ public function addPrintArea($value, $index = -1) { @@ -753,8 +751,8 @@ class PHPExcel_Worksheet_PageSetup * @param string $method Determines the method used when setting multiple print areas * Default behaviour, or the "O" method, overwrites existing print area * The "I" method, inserts the new print area before any specified index, or at the end of the list - * @return PHPExcel_Worksheet_PageSetup - * @throws PHPExcel_Exception + * @return PageSetup + * @throws \PHPExcel\Exception */ public function setPrintAreaByColumnAndRow($column1, $row1, $column2, $row2, $index = 0, $method = self::SETPRINTRANGE_OVERWRITE) { @@ -778,8 +776,8 @@ class PHPExcel_Worksheet_PageSetup * Specifying an index value of 0, will always append the new print range at the end of the * list. * Print areas are numbered from 1 - * @return PHPExcel_Worksheet_PageSetup - * @throws PHPExcel_Exception + * @return PageSetup + * @throws \PHPExcel\Exception */ public function addPrintAreaByColumnAndRow($column1, $row1, $column2, $row2, $index = -1) { diff --git a/classes/src/Worksheet/Protection.php b/classes/src/Worksheet/Protection.php index 00633eeb..b0d4cc4d 100644 --- a/classes/src/Worksheet/Protection.php +++ b/classes/src/Worksheet/Protection.php @@ -1,6 +1,9 @@