From 539a89a918bb0afb4b389cddb9a1ff4bdc5ce6d7 Mon Sep 17 00:00:00 2001 From: Adrien Crivelli Date: Tue, 16 Aug 2016 23:24:47 +0900 Subject: [PATCH] Rename namespace `PHPExcel` to `PhpSpreadsheet` This also fix a few bugs that were introduced when migrating to namespace. Some non-namespaces classes were leftover FIX #15 --- composer.json | 2 +- phpunit-cc.xml | 2 +- phpunit.xml | 2 +- src/Autoloader.php | 19 +- src/Bootstrap.php | 11 +- .../CachedObjectStorage/APC.php | 51 +- .../CachedObjectStorage/CacheBase.php | 43 +- .../CachedObjectStorage/DiscISAM.php | 39 +- .../CachedObjectStorage/ICache.php | 39 +- .../CachedObjectStorage/Igbinary.php | 25 +- .../CachedObjectStorage/Memcache.php | 59 +- .../CachedObjectStorage/Memory.php | 27 +- .../CachedObjectStorage/MemoryGZip.php | 25 +- .../CachedObjectStorage/MemorySerialized.php | 25 +- .../CachedObjectStorage/PHPTemp.php | 33 +- .../CachedObjectStorage/SQLite.php | 65 +- .../CachedObjectStorage/SQLite3.php | 67 +- .../CachedObjectStorage/Wincache.php | 53 +- .../CachedObjectStorageFactory.php | 17 +- .../CalcEngine/CyclicReferenceStack.php | 11 +- src/PhpSpreadsheet/CalcEngine/Logger.php | 11 +- src/PhpSpreadsheet/Calculation.php | 639 +++++++++--------- src/PhpSpreadsheet/Calculation/Categories.php | 35 +- src/PhpSpreadsheet/Calculation/Database.php | 17 +- src/PhpSpreadsheet/Calculation/DateTime.php | 109 ++- .../Calculation/Engineering.php | 15 +- src/PhpSpreadsheet/Calculation/Exception.php | 13 +- .../Calculation/ExceptionHandler.php | 13 +- src/PhpSpreadsheet/Calculation/Financial.php | 17 +- .../Calculation/FormulaParser.php | 11 +- .../Calculation/FormulaToken.php | 11 +- src/PhpSpreadsheet/Calculation/Functions.php | 17 +- src/PhpSpreadsheet/Calculation/Logical.php | 23 +- src/PhpSpreadsheet/Calculation/LookupRef.php | 55 +- src/PhpSpreadsheet/Calculation/MathTrig.php | 33 +- .../Calculation/Statistical.php | 49 +- src/PhpSpreadsheet/Calculation/TextData.php | 61 +- .../Calculation/Token/Stack.php | 13 +- src/PhpSpreadsheet/Cell.php | 13 +- .../Cell/AdvancedValueBinder.php | 45 +- src/PhpSpreadsheet/Cell/DataType.php | 17 +- src/PhpSpreadsheet/Cell/DataValidation.php | 11 +- .../Cell/DefaultValueBinder.php | 21 +- src/PhpSpreadsheet/Cell/Hyperlink.php | 11 +- src/PhpSpreadsheet/Cell/IValueBinder.php | 15 +- src/PhpSpreadsheet/Chart.php | 13 +- src/PhpSpreadsheet/Chart/Axis.php | 2 +- src/PhpSpreadsheet/Chart/DataSeries.php | 15 +- src/PhpSpreadsheet/Chart/DataSeriesValues.php | 29 +- src/PhpSpreadsheet/Chart/Exception.php | 13 +- src/PhpSpreadsheet/Chart/GridLines.php | 2 +- src/PhpSpreadsheet/Chart/Layout.php | 11 +- src/PhpSpreadsheet/Chart/Legend.php | 11 +- src/PhpSpreadsheet/Chart/PlotArea.php | 15 +- src/PhpSpreadsheet/Chart/Properties.php | 2 +- src/PhpSpreadsheet/Chart/Renderer/JpGraph.php | 51 +- src/PhpSpreadsheet/Chart/Title.php | 13 +- src/PhpSpreadsheet/Comment.php | 11 +- src/PhpSpreadsheet/Document/Properties.php | 11 +- src/PhpSpreadsheet/Document/Security.php | 15 +- src/PhpSpreadsheet/Exception.php | 11 +- src/PhpSpreadsheet/HashTable.php | 13 +- src/PhpSpreadsheet/Helper/HTML.php | 17 +- src/PhpSpreadsheet/IComparable.php | 9 +- src/PhpSpreadsheet/IOFactory.php | 23 +- src/PhpSpreadsheet/NamedRange.php | 11 +- src/PhpSpreadsheet/Reader/BaseReader.php | 13 +- src/PhpSpreadsheet/Reader/CSV.php | 39 +- .../Reader/DefaultReadFilter.php | 11 +- src/PhpSpreadsheet/Reader/Excel2003XML.php | 149 ++-- src/PhpSpreadsheet/Reader/Excel2007.php | 311 +++++---- src/PhpSpreadsheet/Reader/Excel2007/Chart.php | 45 +- src/PhpSpreadsheet/Reader/Excel2007/Theme.php | 11 +- src/PhpSpreadsheet/Reader/Excel5.php | 455 +++++++------ src/PhpSpreadsheet/Reader/Excel5/Color.php | 4 +- .../Reader/Excel5/Color/BIFF5.php | 2 +- .../Reader/Excel5/Color/BIFF8.php | 2 +- .../Reader/Excel5/Color/BuiltIn.php | 2 +- .../Reader/Excel5/ErrorCode.php | 2 +- src/PhpSpreadsheet/Reader/Excel5/Escher.php | 123 ++-- src/PhpSpreadsheet/Reader/Excel5/MD5.php | 11 +- src/PhpSpreadsheet/Reader/Excel5/RC4.php | 11 +- .../Reader/Excel5/Style/Border.php | 4 +- .../Reader/Excel5/Style/FillPattern.php | 4 +- src/PhpSpreadsheet/Reader/Exception.php | 13 +- src/PhpSpreadsheet/Reader/Gnumeric.php | 219 +++--- src/PhpSpreadsheet/Reader/HTML.php | 57 +- src/PhpSpreadsheet/Reader/IReadFilter.php | 11 +- src/PhpSpreadsheet/Reader/IReader.php | 15 +- src/PhpSpreadsheet/Reader/OOCalc.php | 133 ++-- src/PhpSpreadsheet/Reader/SYLK.php | 89 ++- src/PhpSpreadsheet/ReferenceHelper.php | 19 +- src/PhpSpreadsheet/RichText.php | 13 +- src/PhpSpreadsheet/RichText/ITextElement.php | 11 +- src/PhpSpreadsheet/RichText/Run.php | 21 +- src/PhpSpreadsheet/RichText/TextElement.php | 11 +- src/PhpSpreadsheet/Settings.php | 77 +-- src/PhpSpreadsheet/Shared/CodePage.php | 19 +- src/PhpSpreadsheet/Shared/Date.php | 73 +- src/PhpSpreadsheet/Shared/Drawing.php | 31 +- src/PhpSpreadsheet/Shared/Escher.php | 11 +- .../Shared/Escher/DgContainer.php | 11 +- .../Escher/DgContainer/SpgrContainer.php | 17 +- .../DgContainer/SpgrContainer/SpContainer.php | 19 +- .../Shared/Escher/DggContainer.php | 11 +- .../Escher/DggContainer/BstoreContainer.php | 11 +- .../DggContainer/BstoreContainer/BSE.php | 15 +- .../DggContainer/BstoreContainer/BSE/Blip.php | 17 +- src/PhpSpreadsheet/Shared/Excel5.php | 65 +- src/PhpSpreadsheet/Shared/File.php | 13 +- src/PhpSpreadsheet/Shared/Font.php | 51 +- .../Shared/JAMA/CholeskyDecomposition.php | 11 +- .../Shared/JAMA/EigenvalueDecomposition.php | 3 +- .../Shared/JAMA/LUDecomposition.php | 15 +- src/PhpSpreadsheet/Shared/JAMA/Matrix.php | 158 ++--- .../Shared/JAMA/QRDecomposition.php | 9 +- .../JAMA/SingularValueDecomposition.php | 3 +- .../Shared/JAMA/utils/Error.php | 1 - .../Shared/JAMA/utils/Maths.php | 3 +- src/PhpSpreadsheet/Shared/OLE.php | 17 +- .../Shared/OLE/ChainedBlockStream.php | 9 +- src/PhpSpreadsheet/Shared/OLE/PPS.php | 9 +- src/PhpSpreadsheet/Shared/OLE/PPS/File.php | 9 +- src/PhpSpreadsheet/Shared/OLE/PPS/Root.php | 55 +- src/PhpSpreadsheet/Shared/OLERead.php | 17 +- src/PhpSpreadsheet/Shared/PCLZip/PclZip.php | 2 +- src/PhpSpreadsheet/Shared/PasswordHasher.php | 11 +- src/PhpSpreadsheet/Shared/StringHelper.php | 25 +- src/PhpSpreadsheet/Shared/TimeZone.php | 15 +- src/PhpSpreadsheet/Shared/Trend/BestFit.php | 9 +- .../Shared/Trend/ExponentialBestFit.php | 11 +- .../Shared/Trend/LinearBestFit.php | 11 +- .../Shared/Trend/LogarithmicBestFit.php | 11 +- .../Shared/Trend/PolynomialBestFit.php | 11 +- .../Shared/Trend/PowerBestFit.php | 11 +- src/PhpSpreadsheet/Shared/Trend/Trend.php | 15 +- src/PhpSpreadsheet/Shared/XMLWriter.php | 11 +- src/PhpSpreadsheet/Shared/ZipArchive.php | 17 +- .../Shared/ZipStreamWrapper.php | 17 +- src/PhpSpreadsheet/Spreadsheet.php | 19 +- src/PhpSpreadsheet/Style.php | 21 +- src/PhpSpreadsheet/Style/Alignment.php | 29 +- src/PhpSpreadsheet/Style/Border.php | 27 +- src/PhpSpreadsheet/Style/Borders.php | 47 +- src/PhpSpreadsheet/Style/Color.php | 19 +- src/PhpSpreadsheet/Style/Conditional.php | 25 +- src/PhpSpreadsheet/Style/Fill.php | 25 +- src/PhpSpreadsheet/Style/Font.php | 25 +- src/PhpSpreadsheet/Style/NumberFormat.php | 31 +- src/PhpSpreadsheet/Style/Protection.php | 19 +- src/PhpSpreadsheet/Style/Supervisor.php | 17 +- src/PhpSpreadsheet/Worksheet.php | 23 +- src/PhpSpreadsheet/Worksheet/AutoFilter.php | 105 ++- .../Worksheet/AutoFilter/Column.php | 41 +- .../Worksheet/AutoFilter/Column/Rule.php | 43 +- src/PhpSpreadsheet/Worksheet/BaseDrawing.php | 33 +- src/PhpSpreadsheet/Worksheet/CellIterator.php | 19 +- src/PhpSpreadsheet/Worksheet/Column.php | 19 +- .../Worksheet/ColumnCellIterator.php | 35 +- .../Worksheet/ColumnDimension.php | 11 +- .../Worksheet/ColumnIterator.php | 45 +- src/PhpSpreadsheet/Worksheet/Dimension.php | 15 +- src/PhpSpreadsheet/Worksheet/Drawing.php | 17 +- .../Worksheet/Drawing/Shadow.php | 25 +- src/PhpSpreadsheet/Worksheet/HeaderFooter.php | 19 +- .../Worksheet/HeaderFooterDrawing.php | 17 +- src/PhpSpreadsheet/Worksheet/Iterator.php | 19 +- .../Worksheet/MemoryDrawing.php | 13 +- src/PhpSpreadsheet/Worksheet/PageMargins.php | 11 +- src/PhpSpreadsheet/Worksheet/PageSetup.php | 48 +- src/PhpSpreadsheet/Worksheet/Protection.php | 13 +- src/PhpSpreadsheet/Worksheet/Row.php | 19 +- .../Worksheet/RowCellIterator.php | 51 +- src/PhpSpreadsheet/Worksheet/RowDimension.php | 11 +- src/PhpSpreadsheet/Worksheet/RowIterator.php | 31 +- src/PhpSpreadsheet/Worksheet/SheetView.php | 23 +- src/PhpSpreadsheet/Writer/BaseWriter.php | 23 +- src/PhpSpreadsheet/Writer/CSV.php | 41 +- src/PhpSpreadsheet/Writer/Excel2007.php | 161 +++-- src/PhpSpreadsheet/Writer/Excel2007/Chart.php | 123 ++-- .../Writer/Excel2007/Comments.php | 51 +- .../Writer/Excel2007/ContentTypes.php | 71 +- .../Writer/Excel2007/DocProps.php | 77 +-- .../Writer/Excel2007/Drawing.php | 107 ++- src/PhpSpreadsheet/Writer/Excel2007/Rels.php | 83 ++- .../Writer/Excel2007/RelsRibbon.php | 23 +- .../Writer/Excel2007/RelsVBA.php | 21 +- .../Writer/Excel2007/StringTable.php | 65 +- src/PhpSpreadsheet/Writer/Excel2007/Style.php | 229 ++++--- src/PhpSpreadsheet/Writer/Excel2007/Theme.php | 36 +- .../Writer/Excel2007/Workbook.php | 187 +++-- .../Writer/Excel2007/Worksheet.php | 318 +++++---- .../Writer/Excel2007/WriterPart.php | 31 +- src/PhpSpreadsheet/Writer/Excel5.php | 179 +++-- .../Writer/Excel5/BIFFwriter.php | 13 +- src/PhpSpreadsheet/Writer/Excel5/Escher.php | 39 +- src/PhpSpreadsheet/Writer/Excel5/Font.php | 31 +- src/PhpSpreadsheet/Writer/Excel5/Parser.php | 61 +- src/PhpSpreadsheet/Writer/Excel5/Workbook.php | 157 +++-- .../Writer/Excel5/Worksheet.php | 499 +++++++------- src/PhpSpreadsheet/Writer/Excel5/Xf.php | 127 ++-- src/PhpSpreadsheet/Writer/Exception.php | 13 +- src/PhpSpreadsheet/Writer/HTML.php | 319 +++++---- src/PhpSpreadsheet/Writer/IWriter.php | 15 +- src/PhpSpreadsheet/Writer/OpenDocument.php | 81 ++- .../Writer/OpenDocument/Cell/Comment.php | 22 +- .../Writer/OpenDocument/Content.php | 82 ++- .../Writer/OpenDocument/Meta.php | 45 +- .../Writer/OpenDocument/MetaInf.php | 25 +- .../Writer/OpenDocument/Mimetype.php | 17 +- .../Writer/OpenDocument/Settings.php | 25 +- .../Writer/OpenDocument/Styles.php | 25 +- .../Writer/OpenDocument/Thumbnails.php | 17 +- .../Writer/OpenDocument/WriterPart.php | 13 +- src/PhpSpreadsheet/Writer/PDF.php | 21 +- src/PhpSpreadsheet/Writer/PDF/Core.php | 183 +++-- src/PhpSpreadsheet/Writer/PDF/DomPDF.php | 45 +- src/PhpSpreadsheet/Writer/PDF/MPDF.php | 55 +- src/PhpSpreadsheet/Writer/PDF/TcPDF.php | 55 +- src/PhpSpreadsheet/locale/bg/config | 9 +- src/PhpSpreadsheet/locale/cs/config | 12 +- src/PhpSpreadsheet/locale/cs/functions | 12 +- src/PhpSpreadsheet/locale/da/config | 17 +- src/PhpSpreadsheet/locale/da/functions | 12 +- src/PhpSpreadsheet/locale/de/config | 15 +- src/PhpSpreadsheet/locale/de/functions | 12 +- src/PhpSpreadsheet/locale/en/uk/config | 12 +- src/PhpSpreadsheet/locale/es/config | 15 +- src/PhpSpreadsheet/locale/es/functions | 12 +- src/PhpSpreadsheet/locale/fi/config | 15 +- src/PhpSpreadsheet/locale/fi/functions | 14 +- src/PhpSpreadsheet/locale/fr/config | 15 +- src/PhpSpreadsheet/locale/fr/functions | 12 +- src/PhpSpreadsheet/locale/hu/config | 12 +- src/PhpSpreadsheet/locale/hu/functions | 14 +- src/PhpSpreadsheet/locale/it/config | 15 +- src/PhpSpreadsheet/locale/it/functions | 12 +- src/PhpSpreadsheet/locale/nl/config | 15 +- src/PhpSpreadsheet/locale/nl/functions | 12 +- src/PhpSpreadsheet/locale/no/config | 15 +- src/PhpSpreadsheet/locale/no/functions | 12 +- src/PhpSpreadsheet/locale/pl/config | 15 +- src/PhpSpreadsheet/locale/pl/functions | 12 +- src/PhpSpreadsheet/locale/pt/br/config | 15 +- src/PhpSpreadsheet/locale/pt/config | 15 +- src/PhpSpreadsheet/locale/ru/config | 15 +- src/PhpSpreadsheet/locale/ru/functions | 16 +- src/PhpSpreadsheet/locale/sv/config | 15 +- src/PhpSpreadsheet/locale/tr/config | 15 +- src/PhpSpreadsheet/locale/tr/functions | 12 +- .../Calculation/DateTimeTest.php | 7 +- .../Calculation/EngineeringTest.php | 4 +- .../Calculation/FinancialTest.php | 4 +- .../Calculation/FunctionsTest.php | 2 +- .../Calculation/LogicalTest.php | 4 +- .../Calculation/LookupRefTest.php | 5 +- .../Calculation/MathTrigTest.php | 6 +- .../Calculation/TextDataTest.php | 6 +- tests/PhpSpreadsheet/CalculationTest.php | 4 +- .../Cell/AdvancedValueBinderTest.php | 20 +- tests/PhpSpreadsheet/Cell/DataTypeTest.php | 8 +- .../Cell/DefaultValueBinderTest.php | 14 +- tests/PhpSpreadsheet/Cell/HyperlinkTest.php | 20 +- tests/PhpSpreadsheet/CellTest.php | 4 +- .../Chart/DataSeriesValuesTest.php | 4 +- tests/PhpSpreadsheet/Chart/LayoutTest.php | 2 +- tests/PhpSpreadsheet/Chart/LegendTest.php | 2 +- tests/PhpSpreadsheet/Custom/Complex.php | 2 +- .../Reader/XEEValidatorTest.php | 4 +- tests/PhpSpreadsheet/ReferenceHelperTest.php | 2 +- tests/PhpSpreadsheet/SettingsTest.php | 6 +- tests/PhpSpreadsheet/Shared/CodePageTest.php | 4 +- tests/PhpSpreadsheet/Shared/DateTest.php | 2 +- tests/PhpSpreadsheet/Shared/FileTest.php | 2 +- tests/PhpSpreadsheet/Shared/FontTest.php | 2 +- .../Shared/PasswordHasherTest.php | 2 +- tests/PhpSpreadsheet/Shared/StringTest.php | 2 +- tests/PhpSpreadsheet/Shared/TimeZoneTest.php | 2 +- tests/PhpSpreadsheet/Style/ColorTest.php | 2 +- .../Style/NumberFormatDateTest.php | 4 +- .../PhpSpreadsheet/Style/NumberFormatTest.php | 4 +- .../Worksheet/AutoFilter/Column/RuleTest.php | 2 +- .../Worksheet/AutoFilter/ColumnTest.php | 6 +- .../Worksheet/AutoFilterTest.php | 32 +- .../Worksheet/CellCollectionTest.php | 4 +- .../Worksheet/ColumnCellIteratorTest.php | 10 +- .../Worksheet/ColumnIteratorTest.php | 10 +- .../Worksheet/RowCellIteratorTest.php | 10 +- .../Worksheet/RowIteratorTest.php | 10 +- .../Worksheet/WorksheetColumnTest.php | 6 +- .../Worksheet/WorksheetRowTest.php | 6 +- tests/bootstrap.php | 15 +- tests/data/Calculation/DateTime/DATE.php | 6 +- tests/data/Calculation/DateTime/DATEVALUE.php | 38 +- tests/data/Calculation/MathTrig/CEILING.php | 2 +- tests/data/Calculation/TextData/CODE.php | 2 +- tests/data/Shared/PasswordHashes.php | 4 +- 297 files changed, 5014 insertions(+), 5483 deletions(-) diff --git a/composer.json b/composer.json index 4305ae99..f2a69af4 100644 --- a/composer.json +++ b/composer.json @@ -43,7 +43,7 @@ }, "autoload": { "psr-4": { - "PHPExcel\\": "src/PhpSpreadsheet" + "PhpSpreadsheet\\": "src/PhpSpreadsheet" } }, "autoload-dev": { diff --git a/phpunit-cc.xml b/phpunit-cc.xml index c7c314f8..c87c42f3 100644 --- a/phpunit-cc.xml +++ b/phpunit-cc.xml @@ -18,7 +18,7 @@ - + ./tests/PhpSpreadsheet diff --git a/phpunit.xml b/phpunit.xml index 52f6ec5f..2ea211a6 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -18,7 +18,7 @@ - + ./tests/PhpSpreadsheet diff --git a/src/Autoloader.php b/src/Autoloader.php index aa2166e8..4380522d 100644 --- a/src/Autoloader.php +++ b/src/Autoloader.php @@ -1,12 +1,12 @@ cacheTime )) { $this->__destruct(); - throw new \PHPExcel\Exception('Failed to store cell ' . $this->currentObjectID . ' in APC'); + throw new \PhpSpreadsheet\Exception('Failed to store cell ' . $this->currentObjectID . ' in APC'); } $this->currentCellIsDirty = false; } @@ -75,11 +72,11 @@ class APC extends CacheBase implements ICache * * @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 \PhpSpreadsheet\Cell $cell Cell to update + * @return \PhpSpreadsheet\Cell + * @throws \PhpSpreadsheet\Exception */ - public function addCacheData($pCoord, \PHPExcel\Cell $cell) + public function addCacheData($pCoord, \PhpSpreadsheet\Cell $cell) { if (($pCoord !== $this->currentObjectID) && ($this->currentObjectID !== null)) { $this->storeData(); @@ -94,11 +91,11 @@ class APC extends CacheBase implements ICache } /** - * Is a value set in the current \PHPExcel\CachedObjectStorage\ICache for an indexed cell? + * Is a value set in the current \PhpSpreadsheet\CachedObjectStorage\ICache for an indexed cell? * * @access public * @param string $pCoord Coordinate address of the cell to check - * @throws \PHPExcel\Exception + * @throws \PhpSpreadsheet\Exception * @return boolean */ public function isDataSet($pCoord) @@ -113,7 +110,7 @@ class APC extends CacheBase implements ICache 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 \PhpSpreadsheet\Exception('Cell entry '.$pCoord.' no longer exists in APC cache'); } return true; } @@ -125,8 +122,8 @@ class APC extends CacheBase implements ICache * * @access public * @param string $pCoord Coordinate of the cell - * @throws \PHPExcel\Exception - * @return \PHPExcel\Cell Cell that was found, or null if not found + * @throws \PhpSpreadsheet\Exception + * @return \PhpSpreadsheet\Cell Cell that was found, or null if not found */ public function getCacheData($pCoord) { @@ -141,7 +138,7 @@ class APC extends CacheBase implements ICache if ($obj === 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 \PhpSpreadsheet\Exception('Cell entry '.$pCoord.' no longer exists in APC cache'); } } else { // Return null if requested entry doesn't exist in cache @@ -177,7 +174,7 @@ class APC extends CacheBase implements ICache * * @access public * @param string $pCoord Coordinate address of the cell to delete - * @throws \PHPExcel\Exception + * @throws \PhpSpreadsheet\Exception */ public function deleteCacheData($pCoord) { @@ -192,10 +189,10 @@ class APC extends CacheBase implements ICache * Clone the cell collection * * @access public - * @param \PHPExcel\Worksheet $parent The new worksheet that we're copying to - * @throws \PHPExcel\Exception + * @param \PhpSpreadsheet\Worksheet $parent The new worksheet that we're copying to + * @throws \PhpSpreadsheet\Exception */ - public function copyCellCollection(\PHPExcel\Worksheet $parent) + public function copyCellCollection(\PhpSpreadsheet\Worksheet $parent) { parent::copyCellCollection($parent); // Get a new id for the new file name @@ -208,11 +205,11 @@ class APC extends CacheBase implements ICache 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 \PhpSpreadsheet\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 \PhpSpreadsheet\Exception('Failed to store cell ' . $cellID . ' in APC'); } } } @@ -243,10 +240,10 @@ class APC extends CacheBase implements ICache /** * Initialise this new cell collection * - * @param \PHPExcel\Worksheet $parent The worksheet for this cell collection + * @param \PhpSpreadsheet\Worksheet $parent The worksheet for this cell collection * @param array of mixed $arguments Additional initialisation arguments */ - public function __construct(\PHPExcel\Worksheet $parent, $arguments) + public function __construct(\PhpSpreadsheet\Worksheet $parent, $arguments) { $cacheTime = (isset($arguments['cacheTime'])) ? $arguments['cacheTime'] : 600; diff --git a/src/PhpSpreadsheet/CachedObjectStorage/CacheBase.php b/src/PhpSpreadsheet/CachedObjectStorage/CacheBase.php index 3ebc596d..bfe76dc8 100644 --- a/src/PhpSpreadsheet/CachedObjectStorage/CacheBase.php +++ b/src/PhpSpreadsheet/CachedObjectStorage/CacheBase.php @@ -1,11 +1,9 @@ parent = $parent; } @@ -81,7 +78,7 @@ abstract class CacheBase /** * Return the parent worksheet for this cell collection * - * @return \PHPExcel\Worksheet + * @return \PhpSpreadsheet\Worksheet */ public function getParent() { @@ -89,7 +86,7 @@ abstract class CacheBase } /** - * Is a value set in the current \PHPExcel\CachedObjectStorage\ICache for an indexed cell? + * Is a value set in the current \PhpSpreadsheet\CachedObjectStorage\ICache for an indexed cell? * * @param string $pCoord Coordinate address of the cell to check * @return boolean @@ -127,11 +124,11 @@ abstract class CacheBase /** * Add or Update a cell in cache * - * @param \PHPExcel\Cell $cell Cell to update - * @return \PHPExcel\Cell - * @throws \PHPExcel\Exception + * @param \PhpSpreadsheet\Cell $cell Cell to update + * @return \PhpSpreadsheet\Cell + * @throws \PhpSpreadsheet\Exception */ - public function updateCacheData(\PHPExcel\Cell $cell) + public function updateCacheData(\PhpSpreadsheet\Cell $cell) { return $this->addCacheData($cell->getCoordinate(), $cell); } @@ -140,7 +137,7 @@ abstract class CacheBase * Delete a cell in cache identified by coordinate address * * @param string $pCoord Coordinate address of the cell to delete - * @throws \PHPExcel\Exception + * @throws \PhpSpreadsheet\Exception */ public function deleteCacheData($pCoord) { @@ -262,9 +259,9 @@ abstract class CacheBase if ($r != $row) { continue; } - $columnList[] = \PHPExcel\Cell::columnIndexFromString($c); + $columnList[] = \PhpSpreadsheet\Cell::columnIndexFromString($c); } - return \PHPExcel\Cell::stringFromColumnIndex(max($columnList) - 1); + return \PhpSpreadsheet\Cell::stringFromColumnIndex(max($columnList) - 1); } /** @@ -311,9 +308,9 @@ abstract class CacheBase /** * Clone the cell collection * - * @param \PHPExcel\Worksheet $parent The new worksheet that we're copying to + * @param \PhpSpreadsheet\Worksheet $parent The new worksheet that we're copying to */ - public function copyCellCollection(\PHPExcel\Worksheet $parent) + public function copyCellCollection(\PhpSpreadsheet\Worksheet $parent) { $this->currentCellIsDirty; $this->storeData(); diff --git a/src/PhpSpreadsheet/CachedObjectStorage/DiscISAM.php b/src/PhpSpreadsheet/CachedObjectStorage/DiscISAM.php index 3b06d906..9414faea 100644 --- a/src/PhpSpreadsheet/CachedObjectStorage/DiscISAM.php +++ b/src/PhpSpreadsheet/CachedObjectStorage/DiscISAM.php @@ -1,11 +1,9 @@ currentObjectID) && ($this->currentObjectID !== null)) { $this->storeData(); @@ -98,8 +95,8 @@ class DiscISAM extends CacheBase implements ICache * 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 \PhpSpreadsheet\Exception + * @return \PhpSpreadsheet\Cell Cell that was found, or null if not found */ public function getCacheData($pCoord) { @@ -142,14 +139,14 @@ class DiscISAM extends CacheBase implements ICache /** * Clone the cell collection * - * @param \PHPExcel\Worksheet $parent The new worksheet that we're copying to + * @param \PhpSpreadsheet\Worksheet $parent The new worksheet that we're copying to */ - public function copyCellCollection(\PHPExcel\Worksheet $parent) + public function copyCellCollection(\PhpSpreadsheet\Worksheet $parent) { parent::copyCellCollection($parent); // Get a new id for the new file name $baseUnique = $this->getUniqueID(); - $newFileName = $this->cacheDirectory.'/PHPExcel.'.$baseUnique.'.cache'; + $newFileName = $this->cacheDirectory.'/PhpSpreadsheet.'.$baseUnique.'.cache'; // Copy the existing cell cache file copy($this->fileName, $newFileName); $this->fileName = $newFileName; @@ -179,19 +176,19 @@ class DiscISAM extends CacheBase implements ICache /** * Initialise this new cell collection * - * @param \PHPExcel\Worksheet $parent The worksheet for this cell collection + * @param \PhpSpreadsheet\Worksheet $parent The worksheet for this cell collection * @param array of mixed $arguments Additional initialisation arguments */ - public function __construct(\PHPExcel\Worksheet $parent, $arguments) + public function __construct(\PhpSpreadsheet\Worksheet $parent, $arguments) { $this->cacheDirectory = ((isset($arguments['dir'])) && ($arguments['dir'] !== null)) ? $arguments['dir'] - : \PHPExcel\Shared\File::sysGetTempDir(); + : \PhpSpreadsheet\Shared\File::sysGetTempDir(); parent::__construct($parent); if (is_null($this->fileHandle)) { $baseUnique = $this->getUniqueID(); - $this->fileName = $this->cacheDirectory.'/PHPExcel.'.$baseUnique.'.cache'; + $this->fileName = $this->cacheDirectory.'/PhpSpreadsheet.'.$baseUnique.'.cache'; $this->fileHandle = fopen($this->fileName, 'a+'); } } diff --git a/src/PhpSpreadsheet/CachedObjectStorage/ICache.php b/src/PhpSpreadsheet/CachedObjectStorage/ICache.php index ee50c8b0..17a198f7 100644 --- a/src/PhpSpreadsheet/CachedObjectStorage/ICache.php +++ b/src/PhpSpreadsheet/CachedObjectStorage/ICache.php @@ -1,11 +1,9 @@ currentObjectID) && ($this->currentObjectID !== null)) { $this->storeData(); @@ -74,8 +71,8 @@ class Igbinary extends CacheBase implements ICache * 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 \PhpSpreadsheet\Exception + * @return \PhpSpreadsheet\Cell Cell that was found, or null if not found */ public function getCacheData($pCoord) { diff --git a/src/PhpSpreadsheet/CachedObjectStorage/Memcache.php b/src/PhpSpreadsheet/CachedObjectStorage/Memcache.php index d9283020..260ff24c 100644 --- a/src/PhpSpreadsheet/CachedObjectStorage/Memcache.php +++ b/src/PhpSpreadsheet/CachedObjectStorage/Memcache.php @@ -1,11 +1,9 @@ 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 \PhpSpreadsheet\Exception("Failed to store cell {$this->currentObjectID} in MemCache"); } } $this->currentCellIsDirty = false; @@ -79,11 +76,11 @@ class Memcache extends CacheBase implements ICache * 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 \PhpSpreadsheet\Cell $cell Cell to update + * @return \PhpSpreadsheet\Cell + * @throws \PhpSpreadsheet\Exception */ - public function addCacheData($pCoord, \PHPExcel\Cell $cell) + public function addCacheData($pCoord, \PhpSpreadsheet\Cell $cell) { if (($pCoord !== $this->currentObjectID) && ($this->currentObjectID !== null)) { $this->storeData(); @@ -99,11 +96,11 @@ class Memcache extends CacheBase implements ICache /** - * Is a value set in the current \PHPExcel\CachedObjectStorage\ICache for an indexed cell? + * Is a value set in the current \PhpSpreadsheet\CachedObjectStorage\ICache for an indexed cell? * * @param string $pCoord Coordinate address of the cell to check * @return boolean - * @throws \PHPExcel\Exception + * @throws \PhpSpreadsheet\Exception */ public function isDataSet($pCoord) { @@ -117,7 +114,7 @@ class Memcache extends CacheBase implements ICache if ($success === false) { // Entry no longer exists in Memcache, so clear it from the cache array parent::deleteCacheData($pCoord); - throw new \PHPExcel\Exception('Cell entry '.$pCoord.' no longer exists in MemCache'); + throw new \PhpSpreadsheet\Exception('Cell entry '.$pCoord.' no longer exists in MemCache'); } return true; } @@ -129,8 +126,8 @@ class Memcache extends CacheBase implements ICache * 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 \PhpSpreadsheet\Exception + * @return \PhpSpreadsheet\Cell Cell that was found, or null if not found */ public function getCacheData($pCoord) { @@ -145,7 +142,7 @@ class Memcache extends CacheBase implements ICache if ($obj === false) { // Entry no longer exists in Memcache, so clear it from the cache array parent::deleteCacheData($pCoord); - throw new \PHPExcel\Exception("Cell entry {$pCoord} no longer exists in MemCache"); + throw new \PhpSpreadsheet\Exception("Cell entry {$pCoord} no longer exists in MemCache"); } } else { // Return null if requested entry doesn't exist in cache @@ -180,7 +177,7 @@ class Memcache extends CacheBase implements ICache * Delete a cell in cache identified by coordinate address * * @param string $pCoord Coordinate address of the cell to delete - * @throws \PHPExcel\Exception + * @throws \PhpSpreadsheet\Exception */ public function deleteCacheData($pCoord) { @@ -194,10 +191,10 @@ class Memcache extends CacheBase implements ICache /** * Clone the cell collection * - * @param \PHPExcel\Worksheet $parent The new worksheet that we're copying to - * @throws \PHPExcel\Exception + * @param \PhpSpreadsheet\Worksheet $parent The new worksheet that we're copying to + * @throws \PhpSpreadsheet\Exception */ - public function copyCellCollection(\PHPExcel\Worksheet $parent) + public function copyCellCollection(\PhpSpreadsheet\Worksheet $parent) { parent::copyCellCollection($parent); // Get a new id for the new file name @@ -210,11 +207,11 @@ class Memcache extends CacheBase implements ICache if ($obj === false) { // Entry no longer exists in Memcache, so clear it from the cache array parent::deleteCacheData($cellID); - throw new \PHPExcel\Exception("Cell entry {$cellID} no longer exists in MemCache"); + throw new \PhpSpreadsheet\Exception("Cell entry {$cellID} no longer exists in MemCache"); } if (!$this->memcache->add($newCachePrefix . $cellID . '.cache', $obj, null, $this->cacheTime)) { $this->__destruct(); - throw new \PHPExcel\Exception("Failed to store cell {$cellID} in MemCache"); + throw new \PhpSpreadsheet\Exception("Failed to store cell {$cellID} in MemCache"); } } } @@ -245,11 +242,11 @@ class Memcache extends CacheBase implements ICache /** * Initialise this new cell collection * - * @param \PHPExcel\Worksheet $parent The worksheet for this cell collection + * @param \PhpSpreadsheet\Worksheet $parent The worksheet for this cell collection * @param mixed[] $arguments Additional initialisation arguments - * @throws \PHPExcel\Exception + * @throws \PhpSpreadsheet\Exception */ - public function __construct(\PHPExcel\Worksheet $parent, $arguments) + public function __construct(\PhpSpreadsheet\Worksheet $parent, $arguments) { $memcacheServer = (isset($arguments['memcacheServer'])) ? $arguments['memcacheServer'] : 'localhost'; $memcachePort = (isset($arguments['memcachePort'])) ? $arguments['memcachePort'] : 11211; @@ -262,7 +259,7 @@ class Memcache extends CacheBase implements ICache // Set a new Memcache object and connect to the Memcache server $this->memcache = new Memcache(); if (!$this->memcache->addServer($memcacheServer, $memcachePort, false, 50, 5, 5, true, array($this, 'failureCallback'))) { - throw new \PHPExcel\Exception("Could not connect to MemCache server at {$memcacheServer}:{$memcachePort}"); + throw new \PhpSpreadsheet\Exception("Could not connect to MemCache server at {$memcacheServer}:{$memcachePort}"); } $this->cacheTime = $cacheTime; @@ -275,11 +272,11 @@ class Memcache extends CacheBase implements ICache * * @param string $host Memcache server * @param integer $port Memcache port - * @throws \PHPExcel\Exception + * @throws \PhpSpreadsheet\Exception */ public function failureCallback($host, $port) { - throw new \PHPExcel\Exception("memcache {$host}:{$port} failed"); + throw new \PhpSpreadsheet\Exception("memcache {$host}:{$port} failed"); } /** diff --git a/src/PhpSpreadsheet/CachedObjectStorage/Memory.php b/src/PhpSpreadsheet/CachedObjectStorage/Memory.php index 09a61a87..ba567e71 100644 --- a/src/PhpSpreadsheet/CachedObjectStorage/Memory.php +++ b/src/PhpSpreadsheet/CachedObjectStorage/Memory.php @@ -1,11 +1,9 @@ cellCache[$pCoord] = $cell; @@ -61,8 +58,8 @@ class Memory extends CacheBase implements ICache * 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 \PhpSpreadsheet\Exception + * @return \PhpSpreadsheet\Cell Cell that was found, or null if not found */ public function getCacheData($pCoord) { @@ -84,9 +81,9 @@ class Memory extends CacheBase implements ICache /** * Clone the cell collection * - * @param \PHPExcel\Worksheet $parent The new worksheet that we're copying to + * @param \PhpSpreadsheet\Worksheet $parent The new worksheet that we're copying to */ - public function copyCellCollection(\PHPExcel\Worksheet $parent) + public function copyCellCollection(\PhpSpreadsheet\Worksheet $parent) { parent::copyCellCollection($parent); diff --git a/src/PhpSpreadsheet/CachedObjectStorage/MemoryGZip.php b/src/PhpSpreadsheet/CachedObjectStorage/MemoryGZip.php index 772dcc7b..6e2be11a 100644 --- a/src/PhpSpreadsheet/CachedObjectStorage/MemoryGZip.php +++ b/src/PhpSpreadsheet/CachedObjectStorage/MemoryGZip.php @@ -1,11 +1,9 @@ currentObjectID) && ($this->currentObjectID !== null)) { $this->storeData(); @@ -74,8 +71,8 @@ class MemoryGZip extends CacheBase implements ICache * 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 \PhpSpreadsheet\Exception + * @return \PhpSpreadsheet\Cell Cell that was found, or null if not found */ public function getCacheData($pCoord) { diff --git a/src/PhpSpreadsheet/CachedObjectStorage/MemorySerialized.php b/src/PhpSpreadsheet/CachedObjectStorage/MemorySerialized.php index 05d825e2..41ecad5b 100644 --- a/src/PhpSpreadsheet/CachedObjectStorage/MemorySerialized.php +++ b/src/PhpSpreadsheet/CachedObjectStorage/MemorySerialized.php @@ -1,11 +1,9 @@ currentObjectID) && ($this->currentObjectID !== null)) { $this->storeData(); @@ -72,8 +69,8 @@ class MemorySerialized extends CacheBase implements ICache * 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 \PhpSpreadsheet\Exception + * @return \PhpSpreadsheet\Cell Cell that was found, or null if not found */ public function getCacheData($pCoord) { diff --git a/src/PhpSpreadsheet/CachedObjectStorage/PHPTemp.php b/src/PhpSpreadsheet/CachedObjectStorage/PHPTemp.php index c0caa09d..f235656e 100644 --- a/src/PhpSpreadsheet/CachedObjectStorage/PHPTemp.php +++ b/src/PhpSpreadsheet/CachedObjectStorage/PHPTemp.php @@ -1,11 +1,9 @@ currentObjectID) && ($this->currentObjectID !== null)) { $this->storeData(); @@ -92,8 +89,8 @@ class PHPTemp extends CacheBase implements ICache * 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 \PhpSpreadsheet\Exception + * @return \PhpSpreadsheet\Cell Cell that was found, or null if not found */ public function getCacheData($pCoord) { @@ -136,9 +133,9 @@ class PHPTemp extends CacheBase implements ICache /** * Clone the cell collection * - * @param \PHPExcel\Worksheet $parent The new worksheet that we're copying to + * @param \PhpSpreadsheet\Worksheet $parent The new worksheet that we're copying to */ - public function copyCellCollection(\PHPExcel\Worksheet $parent) + public function copyCellCollection(\PhpSpreadsheet\Worksheet $parent) { parent::copyCellCollection($parent); // Open a new stream for the cell cache data @@ -174,10 +171,10 @@ class PHPTemp extends CacheBase implements ICache /** * Initialise this new cell collection * - * @param \PHPExcel\Worksheet $parent The worksheet for this cell collection + * @param \PhpSpreadsheet\Worksheet $parent The worksheet for this cell collection * @param mixed[] $arguments Additional initialisation arguments */ - public function __construct(\PHPExcel\Worksheet $parent, $arguments) + public function __construct(\PhpSpreadsheet\Worksheet $parent, $arguments) { $this->memoryCacheSize = (isset($arguments['memoryCacheSize'])) ? $arguments['memoryCacheSize'] : '1MB'; diff --git a/src/PhpSpreadsheet/CachedObjectStorage/SQLite.php b/src/PhpSpreadsheet/CachedObjectStorage/SQLite.php index c8894d74..da5b57e5 100644 --- a/src/PhpSpreadsheet/CachedObjectStorage/SQLite.php +++ b/src/PhpSpreadsheet/CachedObjectStorage/SQLite.php @@ -1,11 +1,9 @@ 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 \PhpSpreadsheet\Exception(sqlite_error_string($this->DBHandle->lastError())); } $this->currentCellIsDirty = false; } @@ -66,11 +63,11 @@ class SQLite extends CacheBase implements ICache * 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 \PhpSpreadsheet\Cell $cell Cell to update + * @return \PhpSpreadsheet\Cell + * @throws \PhpSpreadsheet\Exception */ - public function addCacheData($pCoord, \PHPExcel\Cell $cell) + public function addCacheData($pCoord, \PhpSpreadsheet\Cell $cell) { if (($pCoord !== $this->currentObjectID) && ($this->currentObjectID !== null)) { $this->storeData(); @@ -87,8 +84,8 @@ class SQLite extends CacheBase implements ICache * 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 \PhpSpreadsheet\Exception + * @return \PhpSpreadsheet\Cell Cell that was found, or null if not found */ public function getCacheData($pCoord) { @@ -100,7 +97,7 @@ class SQLite extends CacheBase implements ICache $query = "SELECT value FROM kvp_".$this->TableName." WHERE id='".$pCoord."'"; $cellResultSet = $this->DBHandle->query($query, SQLITE_ASSOC); if ($cellResultSet === false) { - throw new \PHPExcel\Exception(sqlite_error_string($this->DBHandle->lastError())); + throw new \PhpSpreadsheet\Exception(sqlite_error_string($this->DBHandle->lastError())); } elseif ($cellResultSet->numRows() == 0) { // Return null if requested entry doesn't exist in cache return null; @@ -123,7 +120,7 @@ class SQLite extends CacheBase implements ICache * * @param string $pCoord Coordinate address of the cell to check * @return boolean - * @throws \PHPExcel\Exception + * @throws \PhpSpreadsheet\Exception */ public function isDataSet($pCoord) { @@ -135,7 +132,7 @@ class SQLite extends CacheBase implements ICache $query = "SELECT id FROM kvp_".$this->TableName." WHERE id='".$pCoord."'"; $cellResultSet = $this->DBHandle->query($query, SQLITE_ASSOC); if ($cellResultSet === false) { - throw new \PHPExcel\Exception(sqlite_error_string($this->DBHandle->lastError())); + throw new \PhpSpreadsheet\Exception(sqlite_error_string($this->DBHandle->lastError())); } elseif ($cellResultSet->numRows() == 0) { // Return null if requested entry doesn't exist in cache return false; @@ -147,7 +144,7 @@ class SQLite extends CacheBase implements ICache * Delete a cell in cache identified by coordinate address * * @param string $pCoord Coordinate address of the cell to delete - * @throws \PHPExcel\Exception + * @throws \PhpSpreadsheet\Exception */ public function deleteCacheData($pCoord) { @@ -159,7 +156,7 @@ class SQLite extends CacheBase implements ICache // Check if the requested entry exists in the cache $query = "DELETE FROM kvp_".$this->TableName." WHERE id='".$pCoord."'"; if (!$this->DBHandle->queryExec($query)) { - throw new \PHPExcel\Exception(sqlite_error_string($this->DBHandle->lastError())); + throw new \PhpSpreadsheet\Exception(sqlite_error_string($this->DBHandle->lastError())); } $this->currentCellIsDirty = false; @@ -170,7 +167,7 @@ class SQLite extends CacheBase implements ICache * * @param string $fromAddress Current address of the cell to move * @param string $toAddress Destination address of the cell to move - * @throws \PHPExcel\Exception + * @throws \PhpSpreadsheet\Exception * @return boolean */ public function moveCell($fromAddress, $toAddress) @@ -182,13 +179,13 @@ class SQLite extends CacheBase implements ICache $query = "DELETE FROM kvp_".$this->TableName." WHERE id='".$toAddress."'"; $result = $this->DBHandle->exec($query); if ($result === false) { - throw new \PHPExcel\Exception($this->DBHandle->lastErrorMsg()); + throw new \PhpSpreadsheet\Exception($this->DBHandle->lastErrorMsg()); } $query = "UPDATE kvp_".$this->TableName." SET id='".$toAddress."' WHERE id='".$fromAddress."'"; $result = $this->DBHandle->exec($query); if ($result === false) { - throw new \PHPExcel\Exception($this->DBHandle->lastErrorMsg()); + throw new \PhpSpreadsheet\Exception($this->DBHandle->lastErrorMsg()); } return true; @@ -198,7 +195,7 @@ class SQLite extends CacheBase implements ICache * Get a list of all cell addresses currently held in cache * * @return string[] - * @throws \PHPExcel\Exception + * @throws \PhpSpreadsheet\Exception */ public function getCellList() { @@ -209,7 +206,7 @@ class SQLite extends CacheBase implements ICache $query = "SELECT id FROM kvp_".$this->TableName; $cellIdsResult = $this->DBHandle->unbufferedQuery($query, SQLITE_ASSOC); if ($cellIdsResult === false) { - throw new \PHPExcel\Exception(sqlite_error_string($this->DBHandle->lastError())); + throw new \PhpSpreadsheet\Exception(sqlite_error_string($this->DBHandle->lastError())); } $cellKeys = array(); @@ -223,10 +220,10 @@ class SQLite extends CacheBase implements ICache /** * Clone the cell collection * - * @param \PHPExcel\Worksheet $parent The new worksheet that we're copying to - * @throws \PHPExcel\Exception + * @param \PhpSpreadsheet\Worksheet $parent The new worksheet that we're copying to + * @throws \PhpSpreadsheet\Exception */ - public function copyCellCollection(\PHPExcel\Worksheet $parent) + public function copyCellCollection(\PhpSpreadsheet\Worksheet $parent) { $this->currentCellIsDirty; $this->storeData(); @@ -236,7 +233,7 @@ class SQLite extends CacheBase implements ICache if (!$this->DBHandle->queryExec('CREATE TABLE kvp_'.$tableName.' (id VARCHAR(12) PRIMARY KEY, value BLOB) AS SELECT * FROM kvp_'.$this->TableName) ) { - throw new \PHPExcel\Exception(sqlite_error_string($this->DBHandle->lastError())); + throw new \PhpSpreadsheet\Exception(sqlite_error_string($this->DBHandle->lastError())); } // Copy the existing cell cache file @@ -264,10 +261,10 @@ class SQLite extends CacheBase implements ICache /** * Initialise this new cell collection * - * @param \PHPExcel\Worksheet $parent The worksheet for this cell collection - * @throws \PHPExcel\Exception + * @param \PhpSpreadsheet\Worksheet $parent The worksheet for this cell collection + * @throws \PhpSpreadsheet\Exception */ - public function __construct(\PHPExcel\Worksheet $parent) + public function __construct(\PhpSpreadsheet\Worksheet $parent) { parent::__construct($parent); if (is_null($this->DBHandle)) { @@ -276,10 +273,10 @@ class SQLite extends CacheBase implements ICache $this->DBHandle = new SQLiteDatabase($_DBName); if ($this->DBHandle === false) { - throw new \PHPExcel\Exception(sqlite_error_string($this->DBHandle->lastError())); + throw new \PhpSpreadsheet\Exception(sqlite_error_string($this->DBHandle->lastError())); } if (!$this->DBHandle->queryExec('CREATE TABLE kvp_'.$this->TableName.' (id VARCHAR(12) PRIMARY KEY, value BLOB)')) { - throw new \PHPExcel\Exception(sqlite_error_string($this->DBHandle->lastError())); + throw new \PhpSpreadsheet\Exception(sqlite_error_string($this->DBHandle->lastError())); } } } diff --git a/src/PhpSpreadsheet/CachedObjectStorage/SQLite3.php b/src/PhpSpreadsheet/CachedObjectStorage/SQLite3.php index 7237e236..0e625f69 100644 --- a/src/PhpSpreadsheet/CachedObjectStorage/SQLite3.php +++ b/src/PhpSpreadsheet/CachedObjectStorage/SQLite3.php @@ -1,11 +1,9 @@ insertQuery->bindValue('data', serialize($this->currentObject), SQLITE3_BLOB); $result = $this->insertQuery->execute(); if ($result === false) { - throw new \PHPExcel\Exception($this->DBHandle->lastErrorMsg()); + throw new \PhpSpreadsheet\Exception($this->DBHandle->lastErrorMsg()); } $this->currentCellIsDirty = false; } @@ -97,11 +94,11 @@ class SQLite3 extends CacheBase implements ICache * 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 \PhpSpreadsheet\Cell $cell Cell to update + * @return \PhpSpreadsheet\Cell + * @throws \PhpSpreadsheet\Exception */ - public function addCacheData($pCoord, \PHPExcel\Cell $cell) + public function addCacheData($pCoord, \PhpSpreadsheet\Cell $cell) { if (($pCoord !== $this->currentObjectID) && ($this->currentObjectID !== null)) { $this->storeData(); @@ -118,9 +115,9 @@ class SQLite3 extends CacheBase implements ICache * 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 + * @throws \PhpSpreadsheet\Exception + * @return \PhpSpreadsheet\Cell Cell that was found, or null if not found + * @throws \PhpSpreadsheet\Exception */ public function getCacheData($pCoord) { @@ -132,7 +129,7 @@ class SQLite3 extends CacheBase implements ICache $this->selectQuery->bindValue('id', $pCoord, SQLITE3_TEXT); $cellResult = $this->selectQuery->execute(); if ($cellResult === false) { - throw new \PHPExcel\Exception($this->DBHandle->lastErrorMsg()); + throw new \PhpSpreadsheet\Exception($this->DBHandle->lastErrorMsg()); } $cellData = $cellResult->fetchArray(SQLITE3_ASSOC); if ($cellData === false) { @@ -156,7 +153,7 @@ class SQLite3 extends CacheBase implements ICache * * @param string $pCoord Coordinate address of the cell to check * @return boolean - * @throws \PHPExcel\Exception + * @throws \PhpSpreadsheet\Exception */ public function isDataSet($pCoord) { @@ -168,7 +165,7 @@ class SQLite3 extends CacheBase implements ICache $this->selectQuery->bindValue('id', $pCoord, SQLITE3_TEXT); $cellResult = $this->selectQuery->execute(); if ($cellResult === false) { - throw new \PHPExcel\Exception($this->DBHandle->lastErrorMsg()); + throw new \PhpSpreadsheet\Exception($this->DBHandle->lastErrorMsg()); } $cellData = $cellResult->fetchArray(SQLITE3_ASSOC); @@ -179,7 +176,7 @@ class SQLite3 extends CacheBase implements ICache * Delete a cell in cache identified by coordinate address * * @param string $pCoord Coordinate address of the cell to delete - * @throws \PHPExcel\Exception + * @throws \PhpSpreadsheet\Exception */ public function deleteCacheData($pCoord) { @@ -192,7 +189,7 @@ class SQLite3 extends CacheBase implements ICache $this->deleteQuery->bindValue('id', $pCoord, SQLITE3_TEXT); $result = $this->deleteQuery->execute(); if ($result === false) { - throw new \PHPExcel\Exception($this->DBHandle->lastErrorMsg()); + throw new \PhpSpreadsheet\Exception($this->DBHandle->lastErrorMsg()); } $this->currentCellIsDirty = false; @@ -204,7 +201,7 @@ class SQLite3 extends CacheBase implements ICache * @param string $fromAddress Current address of the cell to move * @param string $toAddress Destination address of the cell to move * @return boolean - * @throws \PHPExcel\Exception + * @throws \PhpSpreadsheet\Exception */ public function moveCell($fromAddress, $toAddress) { @@ -215,14 +212,14 @@ class SQLite3 extends CacheBase implements ICache $this->deleteQuery->bindValue('id', $toAddress, SQLITE3_TEXT); $result = $this->deleteQuery->execute(); if ($result === false) { - throw new \PHPExcel\Exception($this->DBHandle->lastErrorMsg()); + throw new \PhpSpreadsheet\Exception($this->DBHandle->lastErrorMsg()); } $this->updateQuery->bindValue('toid', $toAddress, SQLITE3_TEXT); $this->updateQuery->bindValue('fromid', $fromAddress, SQLITE3_TEXT); $result = $this->updateQuery->execute(); if ($result === false) { - throw new \PHPExcel\Exception($this->DBHandle->lastErrorMsg()); + throw new \PhpSpreadsheet\Exception($this->DBHandle->lastErrorMsg()); } return true; @@ -232,7 +229,7 @@ class SQLite3 extends CacheBase implements ICache * Get a list of all cell addresses currently held in cache * * @return string[] - * @throws \PHPExcel\Exception + * @throws \PhpSpreadsheet\Exception */ public function getCellList() { @@ -243,7 +240,7 @@ class SQLite3 extends CacheBase implements ICache $query = "SELECT id FROM kvp_".$this->TableName; $cellIdsResult = $this->DBHandle->query($query); if ($cellIdsResult === false) { - throw new \PHPExcel\Exception($this->DBHandle->lastErrorMsg()); + throw new \PhpSpreadsheet\Exception($this->DBHandle->lastErrorMsg()); } $cellKeys = array(); @@ -257,10 +254,10 @@ class SQLite3 extends CacheBase implements ICache /** * Clone the cell collection * - * @param \PHPExcel\Worksheet $parent The new worksheet that we're copying to - * @throws \PHPExcel\Exception + * @param \PhpSpreadsheet\Worksheet $parent The new worksheet that we're copying to + * @throws \PhpSpreadsheet\Exception */ - public function copyCellCollection(\PHPExcel\Worksheet $parent) + public function copyCellCollection(\PhpSpreadsheet\Worksheet $parent) { $this->currentCellIsDirty; $this->storeData(); @@ -270,7 +267,7 @@ class SQLite3 extends CacheBase implements ICache if (!$this->DBHandle->exec('CREATE TABLE kvp_'.$tableName.' (id VARCHAR(12) PRIMARY KEY, value BLOB) AS SELECT * FROM kvp_'.$this->TableName) ) { - throw new \PHPExcel\Exception($this->DBHandle->lastErrorMsg()); + throw new \PhpSpreadsheet\Exception($this->DBHandle->lastErrorMsg()); } // Copy the existing cell cache file @@ -298,10 +295,10 @@ class SQLite3 extends CacheBase implements ICache /** * Initialise this new cell collection * - * @param \PHPExcel\Worksheet $parent The worksheet for this cell collection - * @throws \PHPExcel\Exception + * @param \PhpSpreadsheet\Worksheet $parent The worksheet for this cell collection + * @throws \PhpSpreadsheet\Exception */ - public function __construct(\PHPExcel\Worksheet $parent) + public function __construct(\PhpSpreadsheet\Worksheet $parent) { parent::__construct($parent); if (is_null($this->DBHandle)) { @@ -310,10 +307,10 @@ class SQLite3 extends CacheBase implements ICache $this->DBHandle = new \SQLite3($_DBName); if ($this->DBHandle === false) { - throw new \PHPExcel\Exception($this->DBHandle->lastErrorMsg()); + throw new \PhpSpreadsheet\Exception($this->DBHandle->lastErrorMsg()); } if (!$this->DBHandle->exec('CREATE TABLE kvp_'.$this->TableName.' (id VARCHAR(12) PRIMARY KEY, value BLOB)')) { - throw new \PHPExcel\Exception($this->DBHandle->lastErrorMsg()); + throw new \PhpSpreadsheet\Exception($this->DBHandle->lastErrorMsg()); } } diff --git a/src/PhpSpreadsheet/CachedObjectStorage/Wincache.php b/src/PhpSpreadsheet/CachedObjectStorage/Wincache.php index e3c13b25..bd337445 100644 --- a/src/PhpSpreadsheet/CachedObjectStorage/Wincache.php +++ b/src/PhpSpreadsheet/CachedObjectStorage/Wincache.php @@ -1,11 +1,9 @@ cachePrefix.$this->currentObjectID.'.cache')) { if (!wincache_ucache_set($this->cachePrefix.$this->currentObjectID.'.cache', $obj, $this->cacheTime)) { $this->__destruct(); - throw new \PHPExcel\Exception('Failed to store cell '.$this->currentObjectID.' in WinCache'); + throw new \PhpSpreadsheet\Exception('Failed to store cell '.$this->currentObjectID.' in WinCache'); } } else { if (!wincache_ucache_add($this->cachePrefix.$this->currentObjectID.'.cache', $obj, $this->cacheTime)) { $this->__destruct(); - throw new \PHPExcel\Exception('Failed to store cell '.$this->currentObjectID.' in WinCache'); + throw new \PhpSpreadsheet\Exception('Failed to store cell '.$this->currentObjectID.' in WinCache'); } } $this->currentCellIsDirty = false; @@ -78,11 +75,11 @@ class Wincache extends CacheBase implements ICache * 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 \PhpSpreadsheet\Cell $cell Cell to update + * @return \PhpSpreadsheet\Cell + * @throws \PhpSpreadsheet\Exception */ - public function addCacheData($pCoord, \PHPExcel\Cell $cell) + public function addCacheData($pCoord, \PhpSpreadsheet\Cell $cell) { if (($pCoord !== $this->currentObjectID) && ($this->currentObjectID !== null)) { $this->storeData(); @@ -97,11 +94,11 @@ class Wincache extends CacheBase implements ICache } /** - * Is a value set in the current \PHPExcel\CachedObjectStorage\ICache for an indexed cell? + * Is a value set in the current \PhpSpreadsheet\CachedObjectStorage\ICache for an indexed cell? * * @param string $pCoord Coordinate address of the cell to check * @return boolean - * @throws \PHPExcel\Exception + * @throws \PhpSpreadsheet\Exception */ public function isDataSet($pCoord) { @@ -115,7 +112,7 @@ class Wincache extends CacheBase implements ICache if ($success === false) { // Entry no longer exists in Wincache, so clear it from the cache array parent::deleteCacheData($pCoord); - throw new \PHPExcel\Exception('Cell entry '.$pCoord.' no longer exists in WinCache'); + throw new \PhpSpreadsheet\Exception('Cell entry '.$pCoord.' no longer exists in WinCache'); } return true; } @@ -127,8 +124,8 @@ class Wincache extends CacheBase implements ICache * 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 \PhpSpreadsheet\Exception + * @return \PhpSpreadsheet\Cell Cell that was found, or null if not found */ public function getCacheData($pCoord) { @@ -145,7 +142,7 @@ class Wincache extends CacheBase implements ICache if ($success === false) { // Entry no longer exists in WinCache, so clear it from the cache array parent::deleteCacheData($pCoord); - throw new \PHPExcel\Exception('Cell entry '.$pCoord.' no longer exists in WinCache'); + throw new \PhpSpreadsheet\Exception('Cell entry '.$pCoord.' no longer exists in WinCache'); } } else { // Return null if requested entry doesn't exist in cache @@ -181,7 +178,7 @@ class Wincache extends CacheBase implements ICache * Delete a cell in cache identified by coordinate address * * @param string $pCoord Coordinate address of the cell to delete - * @throws \PHPExcel\Exception + * @throws \PhpSpreadsheet\Exception */ public function deleteCacheData($pCoord) { @@ -195,10 +192,10 @@ class Wincache extends CacheBase implements ICache /** * Clone the cell collection * - * @param \PHPExcel\Worksheet $parent The new worksheet that we're copying to - * @throws \PHPExcel\Exception + * @param \PhpSpreadsheet\Worksheet $parent The new worksheet that we're copying to + * @throws \PhpSpreadsheet\Exception */ - public function copyCellCollection(\PHPExcel\Worksheet $parent) + public function copyCellCollection(\PhpSpreadsheet\Worksheet $parent) { parent::copyCellCollection($parent); // Get a new id for the new file name @@ -212,11 +209,11 @@ class Wincache extends CacheBase implements ICache if ($success === false) { // Entry no longer exists in WinCache, so clear it from the cache array parent::deleteCacheData($cellID); - throw new \PHPExcel\Exception('Cell entry '.$cellID.' no longer exists in Wincache'); + throw new \PhpSpreadsheet\Exception('Cell entry '.$cellID.' no longer exists in Wincache'); } if (!wincache_ucache_add($newCachePrefix.$cellID.'.cache', $obj, $this->cacheTime)) { $this->__destruct(); - throw new \PHPExcel\Exception('Failed to store cell '.$cellID.' in Wincache'); + throw new \PhpSpreadsheet\Exception('Failed to store cell '.$cellID.' in Wincache'); } } } @@ -248,10 +245,10 @@ class Wincache extends CacheBase implements ICache /** * Initialise this new cell collection * - * @param \PHPExcel\Worksheet $parent The worksheet for this cell collection + * @param \PhpSpreadsheet\Worksheet $parent The worksheet for this cell collection * @param mixed[] $arguments Additional initialisation arguments */ - public function __construct(\PHPExcel\Worksheet $parent, $arguments) + public function __construct(\PhpSpreadsheet\Worksheet $parent, $arguments) { $cacheTime = (isset($arguments['cacheTime'])) ? $arguments['cacheTime'] : 600; diff --git a/src/PhpSpreadsheet/CachedObjectStorageFactory.php b/src/PhpSpreadsheet/CachedObjectStorageFactory.php index 0e0e0119..a12a42d2 100644 --- a/src/PhpSpreadsheet/CachedObjectStorageFactory.php +++ b/src/PhpSpreadsheet/CachedObjectStorageFactory.php @@ -1,11 +1,9 @@ null ); - // PHPExcel functions - private static $PHPExcelFunctions = array( + // PhpSpreadsheet functions + private static $phpSpreadsheetFunctions = array( 'ABS' => array( 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, 'functionCall' => 'abs', @@ -271,12 +270,12 @@ class Calculation ), 'ACCRINT' => array( 'category' => Calculation\Categories::CATEGORY_FINANCIAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Financial::ACCRINT', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Financial::ACCRINT', 'argumentCount' => '4-7' ), 'ACCRINTM' => array( 'category' => Calculation\Categories::CATEGORY_FINANCIAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Financial::ACCRINTM', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Financial::ACCRINTM', 'argumentCount' => '3-5' ), 'ACOS' => array( @@ -291,22 +290,22 @@ class Calculation ), 'ADDRESS' => array( 'category' => Calculation\Categories::CATEGORY_LOOKUP_AND_REFERENCE, - 'functionCall' => '\\PHPExcel\\Calculation\\LookupRef::cellAddress', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\LookupRef::cellAddress', 'argumentCount' => '2-5' ), 'AMORDEGRC' => array( 'category' => Calculation\Categories::CATEGORY_FINANCIAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Financial::AMORDEGRC', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Financial::AMORDEGRC', 'argumentCount' => '6,7' ), 'AMORLINC' => array( 'category' => Calculation\Categories::CATEGORY_FINANCIAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Financial::AMORLINC', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Financial::AMORLINC', 'argumentCount' => '6,7' ), 'AND' => array( 'category' => Calculation\Categories::CATEGORY_LOGICAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Logical::logicalAnd', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Logical::logicalAnd', 'argumentCount' => '1+' ), 'AREAS' => array( @@ -336,7 +335,7 @@ class Calculation ), 'ATAN2' => array( 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, - 'functionCall' => '\\PHPExcel\\Calculation\\MathTrig::ATAN2', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\MathTrig::ATAN2', 'argumentCount' => '2' ), 'ATANH' => array( @@ -346,22 +345,22 @@ class Calculation ), 'AVEDEV' => array( 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Statistical::AVEDEV', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::AVEDEV', 'argumentCount' => '1+' ), 'AVERAGE' => array( 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Statistical::AVERAGE', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::AVERAGE', 'argumentCount' => '1+' ), 'AVERAGEA' => array( 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Statistical::AVERAGEA', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::AVERAGEA', 'argumentCount' => '1+' ), 'AVERAGEIF' => array( 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Statistical::AVERAGEIF', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::AVERAGEIF', 'argumentCount' => '2,3' ), 'AVERAGEIFS' => array( @@ -376,57 +375,57 @@ class Calculation ), 'BESSELI' => array( 'category' => Calculation\Categories::CATEGORY_ENGINEERING, - 'functionCall' => '\\PHPExcel\\Calculation\\Engineering::BESSELI', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Engineering::BESSELI', 'argumentCount' => '2' ), 'BESSELJ' => array( 'category' => Calculation\Categories::CATEGORY_ENGINEERING, - 'functionCall' => '\\PHPExcel\\Calculation\\Engineering::BESSELJ', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Engineering::BESSELJ', 'argumentCount' => '2' ), 'BESSELK' => array( 'category' => Calculation\Categories::CATEGORY_ENGINEERING, - 'functionCall' => '\\PHPExcel\\Calculation\\Engineering::BESSELK', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Engineering::BESSELK', 'argumentCount' => '2' ), 'BESSELY' => array( 'category' => Calculation\Categories::CATEGORY_ENGINEERING, - 'functionCall' => '\\PHPExcel\\Calculation\\Engineering::BESSELY', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Engineering::BESSELY', 'argumentCount' => '2' ), 'BETADIST' => array( 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Statistical::BETADIST', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::BETADIST', 'argumentCount' => '3-5' ), 'BETAINV' => array( 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Statistical::BETAINV', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::BETAINV', 'argumentCount' => '3-5' ), 'BIN2DEC' => array( 'category' => Calculation\Categories::CATEGORY_ENGINEERING, - 'functionCall' => '\\PHPExcel\\Calculation\\Engineering::BINTODEC', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Engineering::BINTODEC', 'argumentCount' => '1' ), 'BIN2HEX' => array( 'category' => Calculation\Categories::CATEGORY_ENGINEERING, - 'functionCall' => '\\PHPExcel\\Calculation\\Engineering::BINTOHEX', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Engineering::BINTOHEX', 'argumentCount' => '1,2' ), 'BIN2OCT' => array( 'category' => Calculation\Categories::CATEGORY_ENGINEERING, - 'functionCall' => '\\PHPExcel\\Calculation\\Engineering::BINTOOCT', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Engineering::BINTOOCT', 'argumentCount' => '1,2' ), 'BINOMDIST' => array( 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Statistical::BINOMDIST', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::BINOMDIST', 'argumentCount' => '4' ), 'CEILING' => array( 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, - 'functionCall' => '\\PHPExcel\\Calculation\\MathTrig::CEILING', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\MathTrig::CEILING', 'argumentCount' => '2' ), 'CELL' => array( @@ -436,17 +435,17 @@ class Calculation ), 'CHAR' => array( 'category' => Calculation\Categories::CATEGORY_TEXT_AND_DATA, - 'functionCall' => '\\PHPExcel\\Calculation\\TextData::CHARACTER', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\TextData::CHARACTER', 'argumentCount' => '1' ), 'CHIDIST' => array( 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Statistical::CHIDIST', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::CHIDIST', 'argumentCount' => '2' ), 'CHIINV' => array( 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Statistical::CHIINV', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::CHIINV', 'argumentCount' => '2' ), 'CHITEST' => array( @@ -456,58 +455,58 @@ class Calculation ), 'CHOOSE' => array( 'category' => Calculation\Categories::CATEGORY_LOOKUP_AND_REFERENCE, - 'functionCall' => '\\PHPExcel\\Calculation\\LookupRef::CHOOSE', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\LookupRef::CHOOSE', 'argumentCount' => '2+' ), 'CLEAN' => array( 'category' => Calculation\Categories::CATEGORY_TEXT_AND_DATA, - 'functionCall' => '\\PHPExcel\\Calculation\\TextData::TRIMNONPRINTABLE', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\TextData::TRIMNONPRINTABLE', 'argumentCount' => '1' ), 'CODE' => array( 'category' => Calculation\Categories::CATEGORY_TEXT_AND_DATA, - 'functionCall' => '\\PHPExcel\\Calculation\\TextData::ASCIICODE', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\TextData::ASCIICODE', 'argumentCount' => '1' ), 'COLUMN' => array( 'category' => Calculation\Categories::CATEGORY_LOOKUP_AND_REFERENCE, - 'functionCall' => '\\PHPExcel\\Calculation\\LookupRef::COLUMN', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\LookupRef::COLUMN', 'argumentCount' => '-1', 'passByReference' => array(true) ), 'COLUMNS' => array( 'category' => Calculation\Categories::CATEGORY_LOOKUP_AND_REFERENCE, - 'functionCall' => '\\PHPExcel\\Calculation\\LookupRef::COLUMNS', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\LookupRef::COLUMNS', 'argumentCount' => '1' ), 'COMBIN' => array( 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, - 'functionCall' => '\\PHPExcel\\Calculation\\MathTrig::COMBIN', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\MathTrig::COMBIN', 'argumentCount' => '2' ), 'COMPLEX' => array( 'category' => Calculation\Categories::CATEGORY_ENGINEERING, - 'functionCall' => '\\PHPExcel\\Calculation\\Engineering::COMPLEX', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Engineering::COMPLEX', 'argumentCount' => '2,3' ), 'CONCATENATE' => array( 'category' => Calculation\Categories::CATEGORY_TEXT_AND_DATA, - 'functionCall' => '\\PHPExcel\\Calculation\\TextData::CONCATENATE', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\TextData::CONCATENATE', 'argumentCount' => '1+' ), 'CONFIDENCE' => array( 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Statistical::CONFIDENCE', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::CONFIDENCE', 'argumentCount' => '3' ), 'CONVERT' => array( 'category' => Calculation\Categories::CATEGORY_ENGINEERING, - 'functionCall' => '\\PHPExcel\\Calculation\\Engineering::CONVERTUOM', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Engineering::CONVERTUOM', 'argumentCount' => '3' ), 'CORREL' => array( 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Statistical::CORREL', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::CORREL', 'argumentCount' => '2' ), 'COS' => array( @@ -522,22 +521,22 @@ class Calculation ), 'COUNT' => array( 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Statistical::COUNT', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::COUNT', 'argumentCount' => '1+' ), 'COUNTA' => array( 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Statistical::COUNTA', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::COUNTA', 'argumentCount' => '1+' ), 'COUNTBLANK' => array( 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Statistical::COUNTBLANK', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::COUNTBLANK', 'argumentCount' => '1' ), 'COUNTIF' => array( 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Statistical::COUNTIF', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::COUNTIF', 'argumentCount' => '2' ), 'COUNTIFS' => array( @@ -547,42 +546,42 @@ class Calculation ), 'COUPDAYBS' => array( 'category' => Calculation\Categories::CATEGORY_FINANCIAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Financial::COUPDAYBS', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Financial::COUPDAYBS', 'argumentCount' => '3,4' ), 'COUPDAYS' => array( 'category' => Calculation\Categories::CATEGORY_FINANCIAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Financial::COUPDAYS', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Financial::COUPDAYS', 'argumentCount' => '3,4' ), 'COUPDAYSNC' => array( 'category' => Calculation\Categories::CATEGORY_FINANCIAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Financial::COUPDAYSNC', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Financial::COUPDAYSNC', 'argumentCount' => '3,4' ), 'COUPNCD' => array( 'category' => Calculation\Categories::CATEGORY_FINANCIAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Financial::COUPNCD', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Financial::COUPNCD', 'argumentCount' => '3,4' ), 'COUPNUM' => array( 'category' => Calculation\Categories::CATEGORY_FINANCIAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Financial::COUPNUM', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Financial::COUPNUM', 'argumentCount' => '3,4' ), 'COUPPCD' => array( 'category' => Calculation\Categories::CATEGORY_FINANCIAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Financial::COUPPCD', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Financial::COUPPCD', 'argumentCount' => '3,4' ), 'COVAR' => array( 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Statistical::COVAR', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::COVAR', 'argumentCount' => '2' ), 'CRITBINOM' => array( 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Statistical::CRITBINOM', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::CRITBINOM', 'argumentCount' => '3' ), 'CUBEKPIMEMBER' => array( @@ -622,77 +621,77 @@ class Calculation ), 'CUMIPMT' => array( 'category' => Calculation\Categories::CATEGORY_FINANCIAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Financial::CUMIPMT', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Financial::CUMIPMT', 'argumentCount' => '6' ), 'CUMPRINC' => array( 'category' => Calculation\Categories::CATEGORY_FINANCIAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Financial::CUMPRINC', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Financial::CUMPRINC', 'argumentCount' => '6' ), 'DATE' => array( 'category' => Calculation\Categories::CATEGORY_DATE_AND_TIME, - 'functionCall' => '\\PHPExcel\\Calculation\\DateTime::DATE', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\DateTime::DATE', 'argumentCount' => '3' ), 'DATEDIF' => array( 'category' => Calculation\Categories::CATEGORY_DATE_AND_TIME, - 'functionCall' => '\\PHPExcel\\Calculation\\DateTime::DATEDIF', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\DateTime::DATEDIF', 'argumentCount' => '2,3' ), 'DATEVALUE' => array( 'category' => Calculation\Categories::CATEGORY_DATE_AND_TIME, - 'functionCall' => '\\PHPExcel\\Calculation\\DateTime::DATEVALUE', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\DateTime::DATEVALUE', 'argumentCount' => '1' ), 'DAVERAGE' => array( 'category' => Calculation\Categories::CATEGORY_DATABASE, - 'functionCall' => '\\PHPExcel\\Calculation\\Database::DAVERAGE', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Database::DAVERAGE', 'argumentCount' => '3' ), 'DAY' => array( 'category' => Calculation\Categories::CATEGORY_DATE_AND_TIME, - 'functionCall' => '\\PHPExcel\\Calculation\\DateTime::DAYOFMONTH', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\DateTime::DAYOFMONTH', 'argumentCount' => '1' ), 'DAYS360' => array( 'category' => Calculation\Categories::CATEGORY_DATE_AND_TIME, - 'functionCall' => '\\PHPExcel\\Calculation\\DateTime::DAYS360', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\DateTime::DAYS360', 'argumentCount' => '2,3' ), 'DB' => array( 'category' => Calculation\Categories::CATEGORY_FINANCIAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Financial::DB', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Financial::DB', 'argumentCount' => '4,5' ), 'DCOUNT' => array( 'category' => Calculation\Categories::CATEGORY_DATABASE, - 'functionCall' => '\\PHPExcel\\Calculation\\Database::DCOUNT', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Database::DCOUNT', 'argumentCount' => '3' ), 'DCOUNTA' => array( 'category' => Calculation\Categories::CATEGORY_DATABASE, - 'functionCall' => '\\PHPExcel\\Calculation\\Database::DCOUNTA', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Database::DCOUNTA', 'argumentCount' => '3' ), 'DDB' => array( 'category' => Calculation\Categories::CATEGORY_FINANCIAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Financial::DDB', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Financial::DDB', 'argumentCount' => '4,5' ), 'DEC2BIN' => array( 'category' => Calculation\Categories::CATEGORY_ENGINEERING, - 'functionCall' => '\\PHPExcel\\Calculation\\Engineering::DECTOBIN', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Engineering::DECTOBIN', 'argumentCount' => '1,2' ), 'DEC2HEX' => array( 'category' => Calculation\Categories::CATEGORY_ENGINEERING, - 'functionCall' => '\\PHPExcel\\Calculation\\Engineering::DECTOHEX', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Engineering::DECTOHEX', 'argumentCount' => '1,2' ), 'DEC2OCT' => array( 'category' => Calculation\Categories::CATEGORY_ENGINEERING, - 'functionCall' => '\\PHPExcel\\Calculation\\Engineering::DECTOOCT', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Engineering::DECTOOCT', 'argumentCount' => '1,2' ), 'DEGREES' => array( @@ -702,67 +701,67 @@ class Calculation ), 'DELTA' => array( 'category' => Calculation\Categories::CATEGORY_ENGINEERING, - 'functionCall' => '\\PHPExcel\\Calculation\\Engineering::DELTA', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Engineering::DELTA', 'argumentCount' => '1,2' ), 'DEVSQ' => array( 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Statistical::DEVSQ', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::DEVSQ', 'argumentCount' => '1+' ), 'DGET' => array( 'category' => Calculation\Categories::CATEGORY_DATABASE, - 'functionCall' => '\\PHPExcel\\Calculation\\Database::DGET', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Database::DGET', 'argumentCount' => '3' ), 'DISC' => array( 'category' => Calculation\Categories::CATEGORY_FINANCIAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Financial::DISC', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Financial::DISC', 'argumentCount' => '4,5' ), 'DMAX' => array( 'category' => Calculation\Categories::CATEGORY_DATABASE, - 'functionCall' => '\\PHPExcel\\Calculation\\Database::DMAX', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Database::DMAX', 'argumentCount' => '3' ), 'DMIN' => array( 'category' => Calculation\Categories::CATEGORY_DATABASE, - 'functionCall' => '\\PHPExcel\\Calculation\\Database::DMIN', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Database::DMIN', 'argumentCount' => '3' ), 'DOLLAR' => array( 'category' => Calculation\Categories::CATEGORY_TEXT_AND_DATA, - 'functionCall' => '\\PHPExcel\\Calculation\\TextData::DOLLAR', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\TextData::DOLLAR', 'argumentCount' => '1,2' ), 'DOLLARDE' => array( 'category' => Calculation\Categories::CATEGORY_FINANCIAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Financial::DOLLARDE', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Financial::DOLLARDE', 'argumentCount' => '2' ), 'DOLLARFR' => array( 'category' => Calculation\Categories::CATEGORY_FINANCIAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Financial::DOLLARFR', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Financial::DOLLARFR', 'argumentCount' => '2' ), 'DPRODUCT' => array( 'category' => Calculation\Categories::CATEGORY_DATABASE, - 'functionCall' => '\\PHPExcel\\Calculation\\Database::DPRODUCT', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Database::DPRODUCT', 'argumentCount' => '3' ), 'DSTDEV' => array( 'category' => Calculation\Categories::CATEGORY_DATABASE, - 'functionCall' => '\\PHPExcel\\Calculation\\Database::DSTDEV', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Database::DSTDEV', 'argumentCount' => '3' ), 'DSTDEVP' => array( 'category' => Calculation\Categories::CATEGORY_DATABASE, - 'functionCall' => '\\PHPExcel\\Calculation\\Database::DSTDEVP', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Database::DSTDEVP', 'argumentCount' => '3' ), 'DSUM' => array( 'category' => Calculation\Categories::CATEGORY_DATABASE, - 'functionCall' => '\\PHPExcel\\Calculation\\Database::DSUM', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Database::DSUM', 'argumentCount' => '3' ), 'DURATION' => array( @@ -772,37 +771,37 @@ class Calculation ), 'DVAR' => array( 'category' => Calculation\Categories::CATEGORY_DATABASE, - 'functionCall' => '\\PHPExcel\\Calculation\\Database::DVAR', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Database::DVAR', 'argumentCount' => '3' ), 'DVARP' => array( 'category' => Calculation\Categories::CATEGORY_DATABASE, - 'functionCall' => '\\PHPExcel\\Calculation\\Database::DVARP', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Database::DVARP', 'argumentCount' => '3' ), 'EDATE' => array( 'category' => Calculation\Categories::CATEGORY_DATE_AND_TIME, - 'functionCall' => '\\PHPExcel\\Calculation\\DateTime::EDATE', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\DateTime::EDATE', 'argumentCount' => '2' ), 'EFFECT' => array( 'category' => Calculation\Categories::CATEGORY_FINANCIAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Financial::EFFECT', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Financial::EFFECT', 'argumentCount' => '2' ), 'EOMONTH' => array( 'category' => Calculation\Categories::CATEGORY_DATE_AND_TIME, - 'functionCall' => '\\PHPExcel\\Calculation\\DateTime::EOMONTH', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\DateTime::EOMONTH', 'argumentCount' => '2' ), 'ERF' => array( 'category' => Calculation\Categories::CATEGORY_ENGINEERING, - 'functionCall' => '\\PHPExcel\\Calculation\\Engineering::ERF', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Engineering::ERF', 'argumentCount' => '1,2' ), 'ERFC' => array( 'category' => Calculation\Categories::CATEGORY_ENGINEERING, - 'functionCall' => '\\PHPExcel\\Calculation\\Engineering::ERFC', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Engineering::ERFC', 'argumentCount' => '1' ), 'ERROR.TYPE' => array( @@ -812,7 +811,7 @@ class Calculation ), 'EVEN' => array( 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, - 'functionCall' => '\\PHPExcel\\Calculation\\MathTrig::EVEN', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\MathTrig::EVEN', 'argumentCount' => '1' ), 'EXACT' => array( @@ -827,22 +826,22 @@ class Calculation ), 'EXPONDIST' => array( 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Statistical::EXPONDIST', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::EXPONDIST', 'argumentCount' => '3' ), 'FACT' => array( 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, - 'functionCall' => '\\PHPExcel\\Calculation\\MathTrig::FACT', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\MathTrig::FACT', 'argumentCount' => '1' ), 'FACTDOUBLE' => array( 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, - 'functionCall' => '\\PHPExcel\\Calculation\\MathTrig::FACTDOUBLE', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\MathTrig::FACTDOUBLE', 'argumentCount' => '1' ), 'FALSE' => array( 'category' => Calculation\Categories::CATEGORY_LOGICAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Logical::FALSE', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Logical::FALSE', 'argumentCount' => '0' ), 'FDIST' => array( @@ -852,12 +851,12 @@ class Calculation ), 'FIND' => array( 'category' => Calculation\Categories::CATEGORY_TEXT_AND_DATA, - 'functionCall' => '\\PHPExcel\\Calculation\\TextData::SEARCHSENSITIVE', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\TextData::SEARCHSENSITIVE', 'argumentCount' => '2,3' ), 'FINDB' => array( 'category' => Calculation\Categories::CATEGORY_TEXT_AND_DATA, - 'functionCall' => '\\PHPExcel\\Calculation\\TextData::SEARCHSENSITIVE', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\TextData::SEARCHSENSITIVE', 'argumentCount' => '2,3' ), 'FINV' => array( @@ -867,27 +866,27 @@ class Calculation ), 'FISHER' => array( 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Statistical::FISHER', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::FISHER', 'argumentCount' => '1' ), 'FISHERINV' => array( 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Statistical::FISHERINV', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::FISHERINV', 'argumentCount' => '1' ), 'FIXED' => array( 'category' => Calculation\Categories::CATEGORY_TEXT_AND_DATA, - 'functionCall' => '\\PHPExcel\\Calculation\\TextData::FIXEDFORMAT', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\TextData::FIXEDFORMAT', 'argumentCount' => '1-3' ), 'FLOOR' => array( 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, - 'functionCall' => '\\PHPExcel\\Calculation\\MathTrig::FLOOR', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\MathTrig::FLOOR', 'argumentCount' => '2' ), 'FORECAST' => array( 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Statistical::FORECAST', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::FORECAST', 'argumentCount' => '3' ), 'FREQUENCY' => array( @@ -902,42 +901,42 @@ class Calculation ), 'FV' => array( 'category' => Calculation\Categories::CATEGORY_FINANCIAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Financial::FV', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Financial::FV', 'argumentCount' => '3-5' ), 'FVSCHEDULE' => array( 'category' => Calculation\Categories::CATEGORY_FINANCIAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Financial::FVSCHEDULE', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Financial::FVSCHEDULE', 'argumentCount' => '2' ), 'GAMMADIST' => array( 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Statistical::GAMMADIST', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::GAMMADIST', 'argumentCount' => '4' ), 'GAMMAINV' => array( 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Statistical::GAMMAINV', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::GAMMAINV', 'argumentCount' => '3' ), 'GAMMALN' => array( 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Statistical::GAMMALN', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::GAMMALN', 'argumentCount' => '1' ), 'GCD' => array( 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, - 'functionCall' => '\\PHPExcel\\Calculation\\MathTrig::GCD', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\MathTrig::GCD', 'argumentCount' => '1+' ), 'GEOMEAN' => array( 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Statistical::GEOMEAN', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::GEOMEAN', 'argumentCount' => '1+' ), 'GESTEP' => array( 'category' => Calculation\Categories::CATEGORY_ENGINEERING, - 'functionCall' => '\\PHPExcel\\Calculation\\Engineering::GESTEP', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Engineering::GESTEP', 'argumentCount' => '1,2' ), 'GETPIVOTDATA' => array( @@ -947,153 +946,153 @@ class Calculation ), 'GROWTH' => array( 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Statistical::GROWTH', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::GROWTH', 'argumentCount' => '1-4' ), 'HARMEAN' => array( 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Statistical::HARMEAN', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::HARMEAN', 'argumentCount' => '1+' ), 'HEX2BIN' => array( 'category' => Calculation\Categories::CATEGORY_ENGINEERING, - 'functionCall' => '\\PHPExcel\\Calculation\\Engineering::HEXTOBIN', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Engineering::HEXTOBIN', 'argumentCount' => '1,2' ), 'HEX2DEC' => array( 'category' => Calculation\Categories::CATEGORY_ENGINEERING, - 'functionCall' => '\\PHPExcel\\Calculation\\Engineering::HEXTODEC', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Engineering::HEXTODEC', 'argumentCount' => '1' ), 'HEX2OCT' => array( 'category' => Calculation\Categories::CATEGORY_ENGINEERING, - 'functionCall' => '\\PHPExcel\\Calculation\\Engineering::HEXTOOCT', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Engineering::HEXTOOCT', 'argumentCount' => '1,2' ), 'HLOOKUP' => array( 'category' => Calculation\Categories::CATEGORY_LOOKUP_AND_REFERENCE, - 'functionCall' => '\\PHPExcel\\Calculation\\LookupRef::HLOOKUP', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\LookupRef::HLOOKUP', 'argumentCount' => '3,4' ), 'HOUR' => array( 'category' => Calculation\Categories::CATEGORY_DATE_AND_TIME, - 'functionCall' => '\\PHPExcel\\Calculation\\DateTime::HOUROFDAY', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\DateTime::HOUROFDAY', 'argumentCount' => '1' ), 'HYPERLINK' => array( 'category' => Calculation\Categories::CATEGORY_LOOKUP_AND_REFERENCE, - 'functionCall' => '\\PHPExcel\\Calculation\\LookupRef::HYPERLINK', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\LookupRef::HYPERLINK', 'argumentCount' => '1,2', 'passCellReference' => true ), 'HYPGEOMDIST' => array( 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Statistical::HYPGEOMDIST', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::HYPGEOMDIST', 'argumentCount' => '4' ), 'IF' => array( 'category' => Calculation\Categories::CATEGORY_LOGICAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Logical::statementIf', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Logical::statementIf', 'argumentCount' => '1-3' ), 'IFERROR' => array( 'category' => Calculation\Categories::CATEGORY_LOGICAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Logical::IFERROR', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Logical::IFERROR', 'argumentCount' => '2' ), 'IMABS' => array( 'category' => Calculation\Categories::CATEGORY_ENGINEERING, - 'functionCall' => '\\PHPExcel\\Calculation\\Engineering::IMABS', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Engineering::IMABS', 'argumentCount' => '1' ), 'IMAGINARY' => array( 'category' => Calculation\Categories::CATEGORY_ENGINEERING, - 'functionCall' => '\\PHPExcel\\Calculation\\Engineering::IMAGINARY', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Engineering::IMAGINARY', 'argumentCount' => '1' ), 'IMARGUMENT' => array( 'category' => Calculation\Categories::CATEGORY_ENGINEERING, - 'functionCall' => '\\PHPExcel\\Calculation\\Engineering::IMARGUMENT', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Engineering::IMARGUMENT', 'argumentCount' => '1' ), 'IMCONJUGATE' => array( 'category' => Calculation\Categories::CATEGORY_ENGINEERING, - 'functionCall' => '\\PHPExcel\\Calculation\\Engineering::IMCONJUGATE', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Engineering::IMCONJUGATE', 'argumentCount' => '1' ), 'IMCOS' => array( 'category' => Calculation\Categories::CATEGORY_ENGINEERING, - 'functionCall' => '\\PHPExcel\\Calculation\\Engineering::IMCOS', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Engineering::IMCOS', 'argumentCount' => '1' ), 'IMDIV' => array( 'category' => Calculation\Categories::CATEGORY_ENGINEERING, - 'functionCall' => '\\PHPExcel\\Calculation\\Engineering::IMDIV', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Engineering::IMDIV', 'argumentCount' => '2' ), 'IMEXP' => array( 'category' => Calculation\Categories::CATEGORY_ENGINEERING, - 'functionCall' => '\\PHPExcel\\Calculation\\Engineering::IMEXP', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Engineering::IMEXP', 'argumentCount' => '1' ), 'IMLN' => array( 'category' => Calculation\Categories::CATEGORY_ENGINEERING, - 'functionCall' => '\\PHPExcel\\Calculation\\Engineering::IMLN', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Engineering::IMLN', 'argumentCount' => '1' ), 'IMLOG10' => array( 'category' => Calculation\Categories::CATEGORY_ENGINEERING, - 'functionCall' => '\\PHPExcel\\Calculation\\Engineering::IMLOG10', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Engineering::IMLOG10', 'argumentCount' => '1' ), 'IMLOG2' => array( 'category' => Calculation\Categories::CATEGORY_ENGINEERING, - 'functionCall' => '\\PHPExcel\\Calculation\\Engineering::IMLOG2', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Engineering::IMLOG2', 'argumentCount' => '1' ), 'IMPOWER' => array( 'category' => Calculation\Categories::CATEGORY_ENGINEERING, - 'functionCall' => '\\PHPExcel\\Calculation\\Engineering::IMPOWER', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Engineering::IMPOWER', 'argumentCount' => '2' ), 'IMPRODUCT' => array( 'category' => Calculation\Categories::CATEGORY_ENGINEERING, - 'functionCall' => '\\PHPExcel\\Calculation\\Engineering::IMPRODUCT', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Engineering::IMPRODUCT', 'argumentCount' => '1+' ), 'IMREAL' => array( 'category' => Calculation\Categories::CATEGORY_ENGINEERING, - 'functionCall' => '\\PHPExcel\\Calculation\\Engineering::IMREAL', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Engineering::IMREAL', 'argumentCount' => '1' ), 'IMSIN' => array( 'category' => Calculation\Categories::CATEGORY_ENGINEERING, - 'functionCall' => '\\PHPExcel\\Calculation\\Engineering::IMSIN', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Engineering::IMSIN', 'argumentCount' => '1' ), 'IMSQRT' => array( 'category' => Calculation\Categories::CATEGORY_ENGINEERING, - 'functionCall' => '\\PHPExcel\\Calculation\\Engineering::IMSQRT', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Engineering::IMSQRT', 'argumentCount' => '1' ), 'IMSUB' => array( 'category' => Calculation\Categories::CATEGORY_ENGINEERING, - 'functionCall' => '\\PHPExcel\\Calculation\\Engineering::IMSUB', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Engineering::IMSUB', 'argumentCount' => '2' ), 'IMSUM' => array( 'category' => Calculation\Categories::CATEGORY_ENGINEERING, - 'functionCall' => '\\PHPExcel\\Calculation\\Engineering::IMSUM', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Engineering::IMSUM', 'argumentCount' => '1+' ), 'INDEX' => array( 'category' => Calculation\Categories::CATEGORY_LOOKUP_AND_REFERENCE, - 'functionCall' => '\\PHPExcel\\Calculation\\LookupRef::INDEX', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\LookupRef::INDEX', 'argumentCount' => '1-4' ), 'INDIRECT' => array( 'category' => Calculation\Categories::CATEGORY_LOOKUP_AND_REFERENCE, - 'functionCall' => '\\PHPExcel\\Calculation\\LookupRef::INDIRECT', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\LookupRef::INDIRECT', 'argumentCount' => '1,2', 'passCellReference' => true ), @@ -1104,27 +1103,27 @@ class Calculation ), 'INT' => array( 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, - 'functionCall' => '\\PHPExcel\\Calculation\\MathTrig::INT', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\MathTrig::INT', 'argumentCount' => '1' ), 'INTERCEPT' => array( 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Statistical::INTERCEPT', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::INTERCEPT', 'argumentCount' => '2' ), 'INTRATE' => array( 'category' => Calculation\Categories::CATEGORY_FINANCIAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Financial::INTRATE', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Financial::INTRATE', 'argumentCount' => '4,5' ), 'IPMT' => array( 'category' => Calculation\Categories::CATEGORY_FINANCIAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Financial::IPMT', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Financial::IPMT', 'argumentCount' => '4-6' ), 'IRR' => array( 'category' => Calculation\Categories::CATEGORY_FINANCIAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Financial::IRR', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Financial::IRR', 'argumentCount' => '1,2' ), 'ISBLANK' => array( @@ -1174,7 +1173,7 @@ class Calculation ), 'ISPMT' => array( 'category' => Calculation\Categories::CATEGORY_FINANCIAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Financial::ISPMT', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Financial::ISPMT', 'argumentCount' => '4' ), 'ISREF' => array( @@ -1194,42 +1193,42 @@ class Calculation ), 'KURT' => array( 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Statistical::KURT', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::KURT', 'argumentCount' => '1+' ), 'LARGE' => array( 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Statistical::LARGE', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::LARGE', 'argumentCount' => '2' ), 'LCM' => array( 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, - 'functionCall' => '\\PHPExcel\\Calculation\\MathTrig::LCM', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\MathTrig::LCM', 'argumentCount' => '1+' ), 'LEFT' => array( 'category' => Calculation\Categories::CATEGORY_TEXT_AND_DATA, - 'functionCall' => '\\PHPExcel\\Calculation\\TextData::LEFT', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\TextData::LEFT', 'argumentCount' => '1,2' ), 'LEFTB' => array( 'category' => Calculation\Categories::CATEGORY_TEXT_AND_DATA, - 'functionCall' => '\\PHPExcel\\Calculation\\TextData::LEFT', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\TextData::LEFT', 'argumentCount' => '1,2' ), 'LEN' => array( 'category' => Calculation\Categories::CATEGORY_TEXT_AND_DATA, - 'functionCall' => '\\PHPExcel\\Calculation\\TextData::STRINGLENGTH', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\TextData::STRINGLENGTH', 'argumentCount' => '1' ), 'LENB' => array( 'category' => Calculation\Categories::CATEGORY_TEXT_AND_DATA, - 'functionCall' => '\\PHPExcel\\Calculation\\TextData::STRINGLENGTH', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\TextData::STRINGLENGTH', 'argumentCount' => '1' ), 'LINEST' => array( 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Statistical::LINEST', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::LINEST', 'argumentCount' => '1-4' ), 'LN' => array( @@ -1239,7 +1238,7 @@ class Calculation ), 'LOG' => array( 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, - 'functionCall' => '\\PHPExcel\\Calculation\\MathTrig::logBase', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\MathTrig::logBase', 'argumentCount' => '1,2' ), 'LOG10' => array( @@ -1249,52 +1248,52 @@ class Calculation ), 'LOGEST' => array( 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Statistical::LOGEST', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::LOGEST', 'argumentCount' => '1-4' ), 'LOGINV' => array( 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Statistical::LOGINV', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::LOGINV', 'argumentCount' => '3' ), 'LOGNORMDIST' => array( 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Statistical::LOGNORMDIST', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::LOGNORMDIST', 'argumentCount' => '3' ), 'LOOKUP' => array( 'category' => Calculation\Categories::CATEGORY_LOOKUP_AND_REFERENCE, - 'functionCall' => '\\PHPExcel\\Calculation\\LookupRef::LOOKUP', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\LookupRef::LOOKUP', 'argumentCount' => '2,3' ), 'LOWER' => array( 'category' => Calculation\Categories::CATEGORY_TEXT_AND_DATA, - 'functionCall' => '\\PHPExcel\\Calculation\\TextData::LOWERCASE', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\TextData::LOWERCASE', 'argumentCount' => '1' ), 'MATCH' => array( 'category' => Calculation\Categories::CATEGORY_LOOKUP_AND_REFERENCE, - 'functionCall' => '\\PHPExcel\\Calculation\\LookupRef::MATCH', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\LookupRef::MATCH', 'argumentCount' => '2,3' ), 'MAX' => array( 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Statistical::MAX', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::MAX', 'argumentCount' => '1+' ), 'MAXA' => array( 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Statistical::MAXA', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::MAXA', 'argumentCount' => '1+' ), 'MAXIF' => array( 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Statistical::MAXIF', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::MAXIF', 'argumentCount' => '2+' ), 'MDETERM' => array( 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, - 'functionCall' => '\\PHPExcel\\Calculation\\MathTrig::MDETERM', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\MathTrig::MDETERM', 'argumentCount' => '1' ), 'MDURATION' => array( @@ -1304,7 +1303,7 @@ class Calculation ), 'MEDIAN' => array( 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Statistical::MEDIAN', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::MEDIAN', 'argumentCount' => '1+' ), 'MEDIANIF' => array( @@ -1314,72 +1313,72 @@ class Calculation ), 'MID' => array( 'category' => Calculation\Categories::CATEGORY_TEXT_AND_DATA, - 'functionCall' => '\\PHPExcel\\Calculation\\TextData::MID', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\TextData::MID', 'argumentCount' => '3' ), 'MIDB' => array( 'category' => Calculation\Categories::CATEGORY_TEXT_AND_DATA, - 'functionCall' => '\\PHPExcel\\Calculation\\TextData::MID', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\TextData::MID', 'argumentCount' => '3' ), 'MIN' => array( 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Statistical::MIN', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::MIN', 'argumentCount' => '1+' ), 'MINA' => array( 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Statistical::MINA', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::MINA', 'argumentCount' => '1+' ), 'MINIF' => array( 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Statistical::MINIF', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::MINIF', 'argumentCount' => '2+' ), 'MINUTE' => array( 'category' => Calculation\Categories::CATEGORY_DATE_AND_TIME, - 'functionCall' => '\\PHPExcel\\Calculation\\DateTime::MINUTEOFHOUR', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\DateTime::MINUTEOFHOUR', 'argumentCount' => '1' ), 'MINVERSE' => array( 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, - 'functionCall' => '\\PHPExcel\\Calculation\\MathTrig::MINVERSE', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\MathTrig::MINVERSE', 'argumentCount' => '1' ), 'MIRR' => array( 'category' => Calculation\Categories::CATEGORY_FINANCIAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Financial::MIRR', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Financial::MIRR', 'argumentCount' => '3' ), 'MMULT' => array( 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, - 'functionCall' => '\\PHPExcel\\Calculation\\MathTrig::MMULT', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\MathTrig::MMULT', 'argumentCount' => '2' ), 'MOD' => array( 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, - 'functionCall' => '\\PHPExcel\\Calculation\\MathTrig::MOD', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\MathTrig::MOD', 'argumentCount' => '2' ), 'MODE' => array( 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Statistical::MODE', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::MODE', 'argumentCount' => '1+' ), 'MONTH' => array( 'category' => Calculation\Categories::CATEGORY_DATE_AND_TIME, - 'functionCall' => '\\PHPExcel\\Calculation\\DateTime::MONTHOFYEAR', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\DateTime::MONTHOFYEAR', 'argumentCount' => '1' ), 'MROUND' => array( 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, - 'functionCall' => '\\PHPExcel\\Calculation\\MathTrig::MROUND', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\MathTrig::MROUND', 'argumentCount' => '2' ), 'MULTINOMIAL' => array( 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, - 'functionCall' => '\\PHPExcel\\Calculation\\MathTrig::MULTINOMIAL', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\MathTrig::MULTINOMIAL', 'argumentCount' => '1+' ), 'N' => array( @@ -1394,77 +1393,77 @@ class Calculation ), 'NEGBINOMDIST' => array( 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Statistical::NEGBINOMDIST', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::NEGBINOMDIST', 'argumentCount' => '3' ), 'NETWORKDAYS' => array( 'category' => Calculation\Categories::CATEGORY_DATE_AND_TIME, - 'functionCall' => '\\PHPExcel\\Calculation\\DateTime::NETWORKDAYS', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\DateTime::NETWORKDAYS', 'argumentCount' => '2+' ), 'NOMINAL' => array( 'category' => Calculation\Categories::CATEGORY_FINANCIAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Financial::NOMINAL', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Financial::NOMINAL', 'argumentCount' => '2' ), 'NORMDIST' => array( 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Statistical::NORMDIST', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::NORMDIST', 'argumentCount' => '4' ), 'NORMINV' => array( 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Statistical::NORMINV', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::NORMINV', 'argumentCount' => '3' ), 'NORMSDIST' => array( 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Statistical::NORMSDIST', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::NORMSDIST', 'argumentCount' => '1' ), 'NORMSINV' => array( 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Statistical::NORMSINV', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::NORMSINV', 'argumentCount' => '1' ), 'NOT' => array( 'category' => Calculation\Categories::CATEGORY_LOGICAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Logical::NOT', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Logical::NOT', 'argumentCount' => '1' ), 'NOW' => array( 'category' => Calculation\Categories::CATEGORY_DATE_AND_TIME, - 'functionCall' => '\\PHPExcel\\Calculation\\DateTime::DATETIMENOW', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\DateTime::DATETIMENOW', 'argumentCount' => '0' ), 'NPER' => array( 'category' => Calculation\Categories::CATEGORY_FINANCIAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Financial::NPER', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Financial::NPER', 'argumentCount' => '3-5' ), 'NPV' => array( 'category' => Calculation\Categories::CATEGORY_FINANCIAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Financial::NPV', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Financial::NPV', 'argumentCount' => '2+' ), 'OCT2BIN' => array( 'category' => Calculation\Categories::CATEGORY_ENGINEERING, - 'functionCall' => '\\PHPExcel\\Calculation\\Engineering::OCTTOBIN', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Engineering::OCTTOBIN', 'argumentCount' => '1,2' ), 'OCT2DEC' => array( 'category' => Calculation\Categories::CATEGORY_ENGINEERING, - 'functionCall' => '\\PHPExcel\\Calculation\\Engineering::OCTTODEC', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Engineering::OCTTODEC', 'argumentCount' => '1' ), 'OCT2HEX' => array( 'category' => Calculation\Categories::CATEGORY_ENGINEERING, - 'functionCall' => '\\PHPExcel\\Calculation\\Engineering::OCTTOHEX', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Engineering::OCTTOHEX', 'argumentCount' => '1,2' ), 'ODD' => array( 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, - 'functionCall' => '\\PHPExcel\\Calculation\\MathTrig::ODD', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\MathTrig::ODD', 'argumentCount' => '1' ), 'ODDFPRICE' => array( @@ -1489,34 +1488,34 @@ class Calculation ), 'OFFSET' => array( 'category' => Calculation\Categories::CATEGORY_LOOKUP_AND_REFERENCE, - 'functionCall' => '\\PHPExcel\\Calculation\\LookupRef::OFFSET', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\LookupRef::OFFSET', 'argumentCount' => '3-5', 'passCellReference' => true, 'passByReference' => array(true) ), 'OR' => array( 'category' => Calculation\Categories::CATEGORY_LOGICAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Logical::logicalOr', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Logical::logicalOr', 'argumentCount' => '1+' ), 'PEARSON' => array( 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Statistical::CORREL', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::CORREL', 'argumentCount' => '2' ), 'PERCENTILE' => array( 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Statistical::PERCENTILE', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::PERCENTILE', 'argumentCount' => '2' ), 'PERCENTRANK' => array( 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Statistical::PERCENTRANK', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::PERCENTRANK', 'argumentCount' => '2,3' ), 'PERMUT' => array( 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Statistical::PERMUT', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::PERMUT', 'argumentCount' => '2' ), 'PHONETIC' => array( @@ -1531,37 +1530,37 @@ class Calculation ), 'PMT' => array( 'category' => Calculation\Categories::CATEGORY_FINANCIAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Financial::PMT', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Financial::PMT', 'argumentCount' => '3-5' ), 'POISSON' => array( 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Statistical::POISSON', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::POISSON', 'argumentCount' => '3' ), 'POWER' => array( 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, - 'functionCall' => '\\PHPExcel\\Calculation\\MathTrig::POWER', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\MathTrig::POWER', 'argumentCount' => '2' ), 'PPMT' => array( 'category' => Calculation\Categories::CATEGORY_FINANCIAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Financial::PPMT', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Financial::PPMT', 'argumentCount' => '4-6' ), 'PRICE' => array( 'category' => Calculation\Categories::CATEGORY_FINANCIAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Financial::PRICE', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Financial::PRICE', 'argumentCount' => '6,7' ), 'PRICEDISC' => array( 'category' => Calculation\Categories::CATEGORY_FINANCIAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Financial::PRICEDISC', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Financial::PRICEDISC', 'argumentCount' => '4,5' ), 'PRICEMAT' => array( 'category' => Calculation\Categories::CATEGORY_FINANCIAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Financial::PRICEMAT', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Financial::PRICEMAT', 'argumentCount' => '5,6' ), 'PROB' => array( @@ -1571,27 +1570,27 @@ class Calculation ), 'PRODUCT' => array( 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, - 'functionCall' => '\\PHPExcel\\Calculation\\MathTrig::PRODUCT', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\MathTrig::PRODUCT', 'argumentCount' => '1+' ), 'PROPER' => array( 'category' => Calculation\Categories::CATEGORY_TEXT_AND_DATA, - 'functionCall' => '\\PHPExcel\\Calculation\\TextData::PROPERCASE', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\TextData::PROPERCASE', 'argumentCount' => '1' ), 'PV' => array( 'category' => Calculation\Categories::CATEGORY_FINANCIAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Financial::PV', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Financial::PV', 'argumentCount' => '3-5' ), 'QUARTILE' => array( 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Statistical::QUARTILE', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::QUARTILE', 'argumentCount' => '2' ), 'QUOTIENT' => array( 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, - 'functionCall' => '\\PHPExcel\\Calculation\\MathTrig::QUOTIENT', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\MathTrig::QUOTIENT', 'argumentCount' => '2' ), 'RADIANS' => array( @@ -1601,37 +1600,37 @@ class Calculation ), 'RAND' => array( 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, - 'functionCall' => '\\PHPExcel\\Calculation\\MathTrig::RAND', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\MathTrig::RAND', 'argumentCount' => '0' ), 'RANDBETWEEN' => array( 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, - 'functionCall' => '\\PHPExcel\\Calculation\\MathTrig::RAND', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\MathTrig::RAND', 'argumentCount' => '2' ), 'RANK' => array( 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Statistical::RANK', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::RANK', 'argumentCount' => '2,3' ), 'RATE' => array( 'category' => Calculation\Categories::CATEGORY_FINANCIAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Financial::RATE', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Financial::RATE', 'argumentCount' => '3-6' ), 'RECEIVED' => array( 'category' => Calculation\Categories::CATEGORY_FINANCIAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Financial::RECEIVED', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Financial::RECEIVED', 'argumentCount' => '4-5' ), 'REPLACE' => array( 'category' => Calculation\Categories::CATEGORY_TEXT_AND_DATA, - 'functionCall' => '\\PHPExcel\\Calculation\\TextData::REPLACE', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\TextData::REPLACE', 'argumentCount' => '4' ), 'REPLACEB' => array( 'category' => Calculation\Categories::CATEGORY_TEXT_AND_DATA, - 'functionCall' => '\\PHPExcel\\Calculation\\TextData::REPLACE', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\TextData::REPLACE', 'argumentCount' => '4' ), 'REPT' => array( @@ -1641,17 +1640,17 @@ class Calculation ), 'RIGHT' => array( 'category' => Calculation\Categories::CATEGORY_TEXT_AND_DATA, - 'functionCall' => '\\PHPExcel\\Calculation\\TextData::RIGHT', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\TextData::RIGHT', 'argumentCount' => '1,2' ), 'RIGHTB' => array( 'category' => Calculation\Categories::CATEGORY_TEXT_AND_DATA, - 'functionCall' => '\\PHPExcel\\Calculation\\TextData::RIGHT', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\TextData::RIGHT', 'argumentCount' => '1,2' ), 'ROMAN' => array( 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, - 'functionCall' => '\\PHPExcel\\Calculation\\MathTrig::ROMAN', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\MathTrig::ROMAN', 'argumentCount' => '1,2' ), 'ROUND' => array( @@ -1661,28 +1660,28 @@ class Calculation ), 'ROUNDDOWN' => array( 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, - 'functionCall' => '\\PHPExcel\\Calculation\\MathTrig::ROUNDDOWN', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\MathTrig::ROUNDDOWN', 'argumentCount' => '2' ), 'ROUNDUP' => array( 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, - 'functionCall' => '\\PHPExcel\\Calculation\\MathTrig::ROUNDUP', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\MathTrig::ROUNDUP', 'argumentCount' => '2' ), 'ROW' => array( 'category' => Calculation\Categories::CATEGORY_LOOKUP_AND_REFERENCE, - 'functionCall' => '\\PHPExcel\\Calculation\\LookupRef::ROW', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\LookupRef::ROW', 'argumentCount' => '-1', 'passByReference' => array(true) ), 'ROWS' => array( 'category' => Calculation\Categories::CATEGORY_LOOKUP_AND_REFERENCE, - 'functionCall' => '\\PHPExcel\\Calculation\\LookupRef::ROWS', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\LookupRef::ROWS', 'argumentCount' => '1' ), 'RSQ' => array( 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Statistical::RSQ', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::RSQ', 'argumentCount' => '2' ), 'RTD' => array( @@ -1692,27 +1691,27 @@ class Calculation ), 'SEARCH' => array( 'category' => Calculation\Categories::CATEGORY_TEXT_AND_DATA, - 'functionCall' => '\\PHPExcel\\Calculation\\TextData::SEARCHINSENSITIVE', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\TextData::SEARCHINSENSITIVE', 'argumentCount' => '2,3' ), 'SEARCHB' => array( 'category' => Calculation\Categories::CATEGORY_TEXT_AND_DATA, - 'functionCall' => '\\PHPExcel\\Calculation\\TextData::SEARCHINSENSITIVE', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\TextData::SEARCHINSENSITIVE', 'argumentCount' => '2,3' ), 'SECOND' => array( 'category' => Calculation\Categories::CATEGORY_DATE_AND_TIME, - 'functionCall' => '\\PHPExcel\\Calculation\\DateTime::SECONDOFMINUTE', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\DateTime::SECONDOFMINUTE', 'argumentCount' => '1' ), 'SERIESSUM' => array( 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, - 'functionCall' => '\\PHPExcel\\Calculation\\MathTrig::SERIESSUM', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\MathTrig::SERIESSUM', 'argumentCount' => '4' ), 'SIGN' => array( 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, - 'functionCall' => '\\PHPExcel\\Calculation\\MathTrig::SIGN', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\MathTrig::SIGN', 'argumentCount' => '1' ), 'SIN' => array( @@ -1727,22 +1726,22 @@ class Calculation ), 'SKEW' => array( 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Statistical::SKEW', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::SKEW', 'argumentCount' => '1+' ), 'SLN' => array( 'category' => Calculation\Categories::CATEGORY_FINANCIAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Financial::SLN', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Financial::SLN', 'argumentCount' => '3' ), 'SLOPE' => array( 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Statistical::SLOPE', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::SLOPE', 'argumentCount' => '2' ), 'SMALL' => array( 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Statistical::SMALL', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::SMALL', 'argumentCount' => '2' ), 'SQRT' => array( @@ -1752,97 +1751,97 @@ class Calculation ), 'SQRTPI' => array( 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, - 'functionCall' => '\\PHPExcel\\Calculation\\MathTrig::SQRTPI', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\MathTrig::SQRTPI', 'argumentCount' => '1' ), 'STANDARDIZE' => array( 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Statistical::STANDARDIZE', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::STANDARDIZE', 'argumentCount' => '3' ), 'STDEV' => array( 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Statistical::STDEV', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::STDEV', 'argumentCount' => '1+' ), 'STDEVA' => array( 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Statistical::STDEVA', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::STDEVA', 'argumentCount' => '1+' ), 'STDEVP' => array( 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Statistical::STDEVP', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::STDEVP', 'argumentCount' => '1+' ), 'STDEVPA' => array( 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Statistical::STDEVPA', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::STDEVPA', 'argumentCount' => '1+' ), 'STEYX' => array( 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Statistical::STEYX', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::STEYX', 'argumentCount' => '2' ), 'SUBSTITUTE' => array( 'category' => Calculation\Categories::CATEGORY_TEXT_AND_DATA, - 'functionCall' => '\\PHPExcel\\Calculation\\TextData::SUBSTITUTE', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\TextData::SUBSTITUTE', 'argumentCount' => '3,4' ), 'SUBTOTAL' => array( 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, - 'functionCall' => '\\PHPExcel\\Calculation\\MathTrig::SUBTOTAL', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\MathTrig::SUBTOTAL', 'argumentCount' => '2+' ), 'SUM' => array( 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, - 'functionCall' => '\\PHPExcel\\Calculation\\MathTrig::SUM', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\MathTrig::SUM', 'argumentCount' => '1+' ), 'SUMIF' => array( 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, - 'functionCall' => '\\PHPExcel\\Calculation\\MathTrig::SUMIF', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\MathTrig::SUMIF', 'argumentCount' => '2,3' ), 'SUMIFS' => array( 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, - 'functionCall' => '\\PHPExcel\\Calculation\\MathTrig::SUMIFS', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\MathTrig::SUMIFS', 'argumentCount' => '3+' ), 'SUMPRODUCT' => array( 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, - 'functionCall' => '\\PHPExcel\\Calculation\\MathTrig::SUMPRODUCT', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\MathTrig::SUMPRODUCT', 'argumentCount' => '1+' ), 'SUMSQ' => array( 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, - 'functionCall' => '\\PHPExcel\\Calculation\\MathTrig::SUMSQ', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\MathTrig::SUMSQ', 'argumentCount' => '1+' ), 'SUMX2MY2' => array( 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, - 'functionCall' => '\\PHPExcel\\Calculation\\MathTrig::SUMX2MY2', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\MathTrig::SUMX2MY2', 'argumentCount' => '2' ), 'SUMX2PY2' => array( 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, - 'functionCall' => '\\PHPExcel\\Calculation\\MathTrig::SUMX2PY2', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\MathTrig::SUMX2PY2', 'argumentCount' => '2' ), 'SUMXMY2' => array( 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, - 'functionCall' => '\\PHPExcel\\Calculation\\MathTrig::SUMXMY2', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\MathTrig::SUMXMY2', 'argumentCount' => '2' ), 'SYD' => array( 'category' => Calculation\Categories::CATEGORY_FINANCIAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Financial::SYD', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Financial::SYD', 'argumentCount' => '4' ), 'T' => array( 'category' => Calculation\Categories::CATEGORY_TEXT_AND_DATA, - 'functionCall' => '\\PHPExcel\\Calculation\\TextData::RETURNSTRING', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\TextData::RETURNSTRING', 'argumentCount' => '1' ), 'TAN' => array( @@ -1857,77 +1856,77 @@ class Calculation ), 'TBILLEQ' => array( 'category' => Calculation\Categories::CATEGORY_FINANCIAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Financial::TBILLEQ', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Financial::TBILLEQ', 'argumentCount' => '3' ), 'TBILLPRICE' => array( 'category' => Calculation\Categories::CATEGORY_FINANCIAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Financial::TBILLPRICE', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Financial::TBILLPRICE', 'argumentCount' => '3' ), 'TBILLYIELD' => array( 'category' => Calculation\Categories::CATEGORY_FINANCIAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Financial::TBILLYIELD', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Financial::TBILLYIELD', 'argumentCount' => '3' ), 'TDIST' => array( 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Statistical::TDIST', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::TDIST', 'argumentCount' => '3' ), 'TEXT' => array( 'category' => Calculation\Categories::CATEGORY_TEXT_AND_DATA, - 'functionCall' => '\\PHPExcel\\Calculation\\TextData::TEXTFORMAT', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\TextData::TEXTFORMAT', 'argumentCount' => '2' ), 'TIME' => array( 'category' => Calculation\Categories::CATEGORY_DATE_AND_TIME, - 'functionCall' => '\\PHPExcel\\Calculation\\DateTime::TIME', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\DateTime::TIME', 'argumentCount' => '3' ), 'TIMEVALUE' => array( 'category' => Calculation\Categories::CATEGORY_DATE_AND_TIME, - 'functionCall' => '\\PHPExcel\\Calculation\\DateTime::TIMEVALUE', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\DateTime::TIMEVALUE', 'argumentCount' => '1' ), 'TINV' => array( 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Statistical::TINV', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::TINV', 'argumentCount' => '2' ), 'TODAY' => array( 'category' => Calculation\Categories::CATEGORY_DATE_AND_TIME, - 'functionCall' => '\\PHPExcel\\Calculation\\DateTime::DATENOW', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\DateTime::DATENOW', 'argumentCount' => '0' ), 'TRANSPOSE' => array( 'category' => Calculation\Categories::CATEGORY_LOOKUP_AND_REFERENCE, - 'functionCall' => '\\PHPExcel\\Calculation\\LookupRef::TRANSPOSE', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\LookupRef::TRANSPOSE', 'argumentCount' => '1' ), 'TREND' => array( 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Statistical::TREND', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::TREND', 'argumentCount' => '1-4' ), 'TRIM' => array( 'category' => Calculation\Categories::CATEGORY_TEXT_AND_DATA, - 'functionCall' => '\\PHPExcel\\Calculation\\TextData::TRIMSPACES', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\TextData::TRIMSPACES', 'argumentCount' => '1' ), 'TRIMMEAN' => array( 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Statistical::TRIMMEAN', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::TRIMMEAN', 'argumentCount' => '2' ), 'TRUE' => array( 'category' => Calculation\Categories::CATEGORY_LOGICAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Logical::TRUE', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Logical::TRUE', 'argumentCount' => '0' ), 'TRUNC' => array( 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, - 'functionCall' => '\\PHPExcel\\Calculation\\MathTrig::TRUNC', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\MathTrig::TRUNC', 'argumentCount' => '1,2' ), 'TTEST' => array( @@ -1942,7 +1941,7 @@ class Calculation ), 'UPPER' => array( 'category' => Calculation\Categories::CATEGORY_TEXT_AND_DATA, - 'functionCall' => '\\PHPExcel\\Calculation\\TextData::UPPERCASE', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\TextData::UPPERCASE', 'argumentCount' => '1' ), 'USDOLLAR' => array( @@ -1952,27 +1951,27 @@ class Calculation ), 'VALUE' => array( 'category' => Calculation\Categories::CATEGORY_TEXT_AND_DATA, - 'functionCall' => '\\PHPExcel\\Calculation\\TextData::VALUE', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\TextData::VALUE', 'argumentCount' => '1' ), 'VAR' => array( 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Statistical::VARFunc', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::VARFunc', 'argumentCount' => '1+' ), 'VARA' => array( 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Statistical::VARA', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::VARA', 'argumentCount' => '1+' ), 'VARP' => array( 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Statistical::VARP', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::VARP', 'argumentCount' => '1+' ), 'VARPA' => array( 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Statistical::VARPA', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::VARPA', 'argumentCount' => '1+' ), 'VDB' => array( @@ -1987,47 +1986,47 @@ class Calculation ), 'VLOOKUP' => array( 'category' => Calculation\Categories::CATEGORY_LOOKUP_AND_REFERENCE, - 'functionCall' => '\\PHPExcel\\Calculation\\LookupRef::VLOOKUP', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\LookupRef::VLOOKUP', 'argumentCount' => '3,4' ), 'WEEKDAY' => array( 'category' => Calculation\Categories::CATEGORY_DATE_AND_TIME, - 'functionCall' => '\\PHPExcel\\Calculation\\DateTime::DAYOFWEEK', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\DateTime::DAYOFWEEK', 'argumentCount' => '1,2' ), 'WEEKNUM' => array( 'category' => Calculation\Categories::CATEGORY_DATE_AND_TIME, - 'functionCall' => '\\PHPExcel\\Calculation\\DateTime::WEEKOFYEAR', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\DateTime::WEEKOFYEAR', 'argumentCount' => '1,2' ), 'WEIBULL' => array( 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Statistical::WEIBULL', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::WEIBULL', 'argumentCount' => '4' ), 'WORKDAY' => array( 'category' => Calculation\Categories::CATEGORY_DATE_AND_TIME, - 'functionCall' => '\\PHPExcel\\Calculation\\DateTime::WORKDAY', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\DateTime::WORKDAY', 'argumentCount' => '2+' ), 'XIRR' => array( 'category' => Calculation\Categories::CATEGORY_FINANCIAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Financial::XIRR', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Financial::XIRR', 'argumentCount' => '2,3' ), 'XNPV' => array( 'category' => Calculation\Categories::CATEGORY_FINANCIAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Financial::XNPV', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Financial::XNPV', 'argumentCount' => '3' ), 'YEAR' => array( 'category' => Calculation\Categories::CATEGORY_DATE_AND_TIME, - 'functionCall' => '\\PHPExcel\\Calculation\\DateTime::YEAR', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\DateTime::YEAR', 'argumentCount' => '1' ), 'YEARFRAC' => array( 'category' => Calculation\Categories::CATEGORY_DATE_AND_TIME, - 'functionCall' => '\\PHPExcel\\Calculation\\DateTime::YEARFRAC', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\DateTime::YEARFRAC', 'argumentCount' => '2,3' ), 'YIELD' => array( @@ -2037,17 +2036,17 @@ class Calculation ), 'YIELDDISC' => array( 'category' => Calculation\Categories::CATEGORY_FINANCIAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Financial::YIELDDISC', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Financial::YIELDDISC', 'argumentCount' => '4,5' ), 'YIELDMAT' => array( 'category' => Calculation\Categories::CATEGORY_FINANCIAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Financial::YIELDMAT', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Financial::YIELDMAT', 'argumentCount' => '5,6' ), 'ZTEST' => array( 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PHPExcel\\Calculation\\Statistical::ZTEST', + 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::ZTEST', 'argumentCount' => '2-3' ) ); @@ -2073,7 +2072,7 @@ class Calculation private static function loadLocales() { - $localeFileDirectory = PHPEXCEL_ROOT.'PHPExcel/locale/'; + $localeFileDirectory = PHPSPREADSHEET_ROOT.'PhpSpreadsheet/locale/'; foreach (glob($localeFileDirectory.'/*', GLOB_ONLYDIR) as $filename) { $filename = substr($filename, strlen($localeFileDirectory)+1); if ($filename != 'en') { @@ -2086,7 +2085,7 @@ class Calculation * Get an instance of this class * * @access public - * @param Spreadsheet $spreadsheet Injected spreadsheet for working with a PHPExcel Spreadsheet object, + * @param Spreadsheet $spreadsheet Injected spreadsheet for working with a PhpSpreadsheet Spreadsheet object, * or NULL to create a standalone claculation engine * @return Calculation */ @@ -2100,7 +2099,7 @@ class Calculation } if (!isset(self::$instance) || (self::$instance === null)) { - self::$instance = new \PHPExcel\Calculation(); + self::$instance = new \PhpSpreadsheet\Calculation(); } return self::$instance; @@ -2119,7 +2118,7 @@ class Calculation /** * Flush the calculation cache for any existing instance of this class - * but only if a \PHPExcel\Calculation instance exists + * but only if a \PhpSpreadsheet\Calculation instance exists * * @access public * @return null @@ -2320,10 +2319,10 @@ class Calculation // Default is English, if user isn't requesting english, then read the necessary data from the locale files if ($locale != 'en_us') { // Search for a file with a list of function names for locale - $functionNamesFile = PHPEXCEL_ROOT . 'PHPExcel'.DIRECTORY_SEPARATOR.'locale'.DIRECTORY_SEPARATOR.str_replace('_', DIRECTORY_SEPARATOR, $locale).DIRECTORY_SEPARATOR.'functions'; + $functionNamesFile = PHPSPREADSHEET_ROOT . 'PhpSpreadsheet'.DIRECTORY_SEPARATOR.'locale'.DIRECTORY_SEPARATOR.str_replace('_', DIRECTORY_SEPARATOR, $locale).DIRECTORY_SEPARATOR.'functions'; if (!file_exists($functionNamesFile)) { // If there isn't a locale specific function file, look for a language specific function file - $functionNamesFile = PHPEXCEL_ROOT . 'PHPExcel'.DIRECTORY_SEPARATOR.'locale'.DIRECTORY_SEPARATOR.$language.DIRECTORY_SEPARATOR.'functions'; + $functionNamesFile = PHPSPREADSHEET_ROOT . 'PhpSpreadsheet'.DIRECTORY_SEPARATOR.'locale'.DIRECTORY_SEPARATOR.$language.DIRECTORY_SEPARATOR.'functions'; if (!file_exists($functionNamesFile)) { return false; } @@ -2336,7 +2335,7 @@ class Calculation list($fName, $lfName) = explode('=', $localeFunction); $fName = trim($fName); $lfName = trim($lfName); - if ((isset(self::$PHPExcelFunctions[$fName])) && ($lfName != '') && ($fName != $lfName)) { + if ((isset(self::$phpSpreadsheetFunctions[$fName])) && ($lfName != '') && ($fName != $lfName)) { self::$localeFunctions[$fName] = $lfName; } } @@ -2349,9 +2348,9 @@ class Calculation self::$localeBoolean['FALSE'] = self::$localeFunctions['FALSE']; } - $configFile = PHPEXCEL_ROOT . 'PHPExcel'.DIRECTORY_SEPARATOR.'locale'.DIRECTORY_SEPARATOR.str_replace('_', DIRECTORY_SEPARATOR, $locale).DIRECTORY_SEPARATOR.'config'; + $configFile = PHPSPREADSHEET_ROOT . 'PhpSpreadsheet'.DIRECTORY_SEPARATOR.'locale'.DIRECTORY_SEPARATOR.str_replace('_', DIRECTORY_SEPARATOR, $locale).DIRECTORY_SEPARATOR.'config'; if (!file_exists($configFile)) { - $configFile = PHPEXCEL_ROOT . 'PHPExcel'.DIRECTORY_SEPARATOR.'locale'.DIRECTORY_SEPARATOR.$language.DIRECTORY_SEPARATOR.'config'; + $configFile = PHPSPREADSHEET_ROOT . 'PhpSpreadsheet'.DIRECTORY_SEPARATOR.'locale'.DIRECTORY_SEPARATOR.$language.DIRECTORY_SEPARATOR.'config'; } if (file_exists($configFile)) { $localeSettings = file($configFile, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); @@ -3222,10 +3221,10 @@ class Calculation //echo 'Built-in function '.$functionName, PHP_EOL; $expectedArgumentCount = self::$controlFunctions[$functionName]['argumentCount']; $functionCall = self::$controlFunctions[$functionName]['functionCall']; - } elseif (isset(self::$PHPExcelFunctions[$functionName])) { -//echo 'PHPExcel function '.$functionName, PHP_EOL; - $expectedArgumentCount = self::$PHPExcelFunctions[$functionName]['argumentCount']; - $functionCall = self::$PHPExcelFunctions[$functionName]['functionCall']; + } elseif (isset(self::$phpSpreadsheetFunctions[$functionName])) { +//echo 'PhpSpreadsheet function '.$functionName, PHP_EOL; + $expectedArgumentCount = self::$phpSpreadsheetFunctions[$functionName]['argumentCount']; + $functionCall = self::$phpSpreadsheetFunctions[$functionName]['functionCall']; } else { // did we somehow push a non-function on the stack? this should never happen return $this->raiseFormulaError("Formula Error: Internal error, non-function on stack"); } @@ -3314,7 +3313,7 @@ class Calculation if (preg_match('/^'.self::CALCULATION_REGEXP_FUNCTION.'$/i', $val, $matches)) { $val = preg_replace('/\s/u', '', $val); // echo 'Element '.$val.' is a Function
'; - if (isset(self::$PHPExcelFunctions[strtoupper($matches[1])]) || isset(self::$controlFunctions[strtoupper($matches[1])])) { // it's a function + if (isset(self::$phpSpreadsheetFunctions[strtoupper($matches[1])]) || isset(self::$controlFunctions[strtoupper($matches[1])])) { // it's a function $stack->push('Function', strtoupper($val)); $ax = preg_match('/^\s*(\s*\))/ui', substr($formula, $index+$length), $amatch); if ($ax) { @@ -3774,11 +3773,11 @@ class Calculation if ($functionName != 'MKMATRIX') { $this->_debugLog->writeDebugLog('Evaluating Function ', self::localeFunc($functionName), '() with ', (($argCount == 0) ? 'no' : $argCount), ' argument', (($argCount == 1) ? '' : 's')); } - if ((isset(self::$PHPExcelFunctions[$functionName])) || (isset(self::$controlFunctions[$functionName]))) { // function - if (isset(self::$PHPExcelFunctions[$functionName])) { - $functionCall = self::$PHPExcelFunctions[$functionName]['functionCall']; - $passByReference = isset(self::$PHPExcelFunctions[$functionName]['passByReference']); - $passCellReference = isset(self::$PHPExcelFunctions[$functionName]['passCellReference']); + if ((isset(self::$phpSpreadsheetFunctions[$functionName])) || (isset(self::$controlFunctions[$functionName]))) { // function + if (isset(self::$phpSpreadsheetFunctions[$functionName])) { + $functionCall = self::$phpSpreadsheetFunctions[$functionName]['functionCall']; + $passByReference = isset(self::$phpSpreadsheetFunctions[$functionName]['passByReference']); + $passCellReference = isset(self::$phpSpreadsheetFunctions[$functionName]['passCellReference']); } elseif (isset(self::$controlFunctions[$functionName])) { $functionCall = self::$controlFunctions[$functionName]['functionCall']; $passByReference = isset(self::$controlFunctions[$functionName]['passByReference']); @@ -3791,8 +3790,8 @@ class Calculation $arg = $stack->pop(); $a = $argCount - $i - 1; if (($passByReference) && - (isset(self::$PHPExcelFunctions[$functionName]['passByReference'][$a])) && - (self::$PHPExcelFunctions[$functionName]['passByReference'][$a])) { + (isset(self::$phpSpreadsheetFunctions[$functionName]['passByReference'][$a])) && + (self::$phpSpreadsheetFunctions[$functionName]['passByReference'][$a])) { if ($arg['reference'] === null) { $args[] = $cellID; if ($functionName != 'MKMATRIX') { @@ -3871,7 +3870,7 @@ class Calculation // if the token is a number, boolean, string or an Excel error, push it onto the stack if (isset(self::$excelConstants[strtoupper($token)])) { $excelConstant = strtoupper($token); -// echo 'Token is a PHPExcel constant: '.$excelConstant.'
'; +// echo 'Token is a PhpSpreadsheet constant: '.$excelConstant.'
'; $stack->push('Constant Value', self::$excelConstants[$excelConstant]); $this->_debugLog->writeDebugLog('Evaluating Constant ', $excelConstant, ' as ', $this->showTypeDetails(self::$excelConstants[$excelConstant])); } elseif ((is_numeric($token)) || ($token === null) || (is_bool($token)) || ($token == '') || ($token{0} == '"') || ($token{0} == '#')) { @@ -4317,8 +4316,8 @@ class Calculation public function isImplemented($pFunction = '') { $pFunction = strtoupper($pFunction); - if (isset(self::$PHPExcelFunctions[$pFunction])) { - return (self::$PHPExcelFunctions[$pFunction]['functionCall'] != 'Calculation\Categories::DUMMY'); + if (isset(self::$phpSpreadsheetFunctions[$pFunction])) { + return (self::$phpSpreadsheetFunctions[$pFunction]['functionCall'] != 'Calculation\Categories::DUMMY'); } else { return false; } @@ -4334,7 +4333,7 @@ class Calculation { $returnValue = array(); - foreach (self::$PHPExcelFunctions as $functionName => $function) { + foreach (self::$phpSpreadsheetFunctions as $functionName => $function) { if ($function['functionCall'] != 'Calculation\Categories::DUMMY') { $returnValue[$functionName] = new Calculation\Categories( $function['category'], @@ -4355,7 +4354,7 @@ class Calculation */ public function listAllFunctionNames() { - return array_keys(self::$PHPExcelFunctions); + return array_keys(self::$phpSpreadsheetFunctions); } /** @@ -4366,7 +4365,7 @@ class Calculation public function listFunctionNames() { $returnValue = array(); - foreach (self::$PHPExcelFunctions as $functionName => $function) { + foreach (self::$phpSpreadsheetFunctions as $functionName => $function) { if ($function['functionCall'] != 'Calculation\Categories::DUMMY') { $returnValue[] = $functionName; } diff --git a/src/PhpSpreadsheet/Calculation/Categories.php b/src/PhpSpreadsheet/Calculation/Categories.php index 6a77839a..e5bec251 100644 --- a/src/PhpSpreadsheet/Calculation/Categories.php +++ b/src/PhpSpreadsheet/Calculation/Categories.php @@ -1,11 +1,9 @@ category = $pCategory; $this->excelName = $pExcelName; - $this->phpExcelName = $pPHPExcelName; + $this->spreadsheetName = $spreadsheetName; } else { throw new Exception("Invalid parameters passed."); } @@ -128,22 +125,22 @@ class Categories } /** - * Get PHPExcel function name + * Get PhpSpreadsheet function name * * @return string */ - public function getPHPExcelName() + public function getPhpSpreadsheetName() { - return $this->phpExcelName; + return $this->spreadsheetName; } /** - * Set PHPExcel function name + * Set PhpSpreadsheet function name * * @param string $value */ - public function setPHPExcelName($value) + public function setPhpSpreadsheetName($value) { - $this->phpExcelName = $value; + $this->spreadsheetName = $value; } } diff --git a/src/PhpSpreadsheet/Calculation/Database.php b/src/PhpSpreadsheet/Calculation/Database.php index fa429ded..36715f7d 100644 --- a/src/PhpSpreadsheet/Calculation/Database.php +++ b/src/PhpSpreadsheet/Calculation/Database.php @@ -1,11 +1,9 @@ _calculateFormulaValue('='.$testConditionList); + $result = \PhpSpreadsheet\Calculation::getInstance()->_calculateFormulaValue('='.$testConditionList); // If the row failed to meet the criteria, remove it from the database if (!$result) { unset($database[$dataRow]); @@ -144,7 +141,7 @@ class Database foreach ($database as $row) { $colData[] = $row[$field]; } - + return $colData; } diff --git a/src/PhpSpreadsheet/Calculation/DateTime.php b/src/PhpSpreadsheet/Calculation/DateTime.php index 9436668f..1f3ceeca 100644 --- a/src/PhpSpreadsheet/Calculation/DateTime.php +++ b/src/PhpSpreadsheet/Calculation/DateTime.php @@ -1,11 +1,9 @@ format('m'); $oYear = (int) $PHPDateObject->format('Y'); @@ -156,7 +153,7 @@ class DateTime * open the worksheet. * * NOTE: When used in a Cell Formula, MS Excel changes the cell format so that it matches the date - * and time format of your regional settings. PHPExcel does not change cell formatting in this way. + * and time format of your regional settings. PhpSpreadsheet does not change cell formatting in this way. * * Excel Function: * NOW() @@ -173,7 +170,7 @@ class DateTime $retValue = false; switch (Functions::getReturnDateType()) { case Functions::RETURNDATE_EXCEL: - $retValue = (float) \PHPExcel\Shared\Date::PHPToExcel(time()); + $retValue = (float) \PhpSpreadsheet\Shared\Date::PHPToExcel(time()); break; case Functions::RETURNDATE_PHP_NUMERIC: $retValue = (integer) time(); @@ -197,7 +194,7 @@ class DateTime * open the worksheet. * * NOTE: When used in a Cell Formula, MS Excel changes the cell format so that it matches the date - * and time format of your regional settings. PHPExcel does not change cell formatting in this way. + * and time format of your regional settings. PhpSpreadsheet does not change cell formatting in this way. * * Excel Function: * TODAY() @@ -212,16 +209,16 @@ class DateTime $saveTimeZone = date_default_timezone_get(); date_default_timezone_set('UTC'); $retValue = false; - $excelDateTime = floor(\PHPExcel\Shared\Date::PHPToExcel(time())); + $excelDateTime = floor(\PhpSpreadsheet\Shared\Date::PHPToExcel(time())); switch (Functions::getReturnDateType()) { case Functions::RETURNDATE_EXCEL: $retValue = (float) $excelDateTime; break; case Functions::RETURNDATE_PHP_NUMERIC: - $retValue = (integer) \PHPExcel\Shared\Date::excelToTimestamp($excelDateTime); + $retValue = (integer) \PhpSpreadsheet\Shared\Date::excelToTimestamp($excelDateTime); break; case Functions::RETURNDATE_PHP_OBJECT: - $retValue = \PHPExcel\Shared\Date::excelToDateTimeObject($excelDateTime); + $retValue = \PhpSpreadsheet\Shared\Date::excelToDateTimeObject($excelDateTime); break; } date_default_timezone_set($saveTimeZone); @@ -236,12 +233,12 @@ class DateTime * The DATE function returns a value that represents a particular date. * * NOTE: When used in a Cell Formula, MS Excel changes the cell format so that it matches the date - * format of your regional settings. PHPExcel does not change cell formatting in this way. + * format of your regional settings. PhpSpreadsheet does not change cell formatting in this way. * * Excel Function: * DATE(year,month,day) * - * PHPExcel is a lot more forgiving than MS Excel when passing non numeric values to this function. + * PhpSpreadsheet is a lot more forgiving than MS Excel when passing non numeric values to this function. * A Month name or abbreviation (English only at this point) such as 'January' or 'Jan' will still be accepted, * as will a day value with a suffix (e.g. '21st' rather than simply 21); again only English language. * @@ -287,16 +284,16 @@ class DateTime $day = Functions::flattenSingleValue($day); if (($month !== null) && (!is_numeric($month))) { - $month = \PHPExcel\Shared\Date::monthStringToNumber($month); + $month = \PhpSpreadsheet\Shared\Date::monthStringToNumber($month); } if (($day !== null) && (!is_numeric($day))) { - $day = \PHPExcel\Shared\Date::dayStringToNumber($day); + $day = \PhpSpreadsheet\Shared\Date::dayStringToNumber($day); } - $year = ($year !== null) ? \PHPExcel\Shared\StringHelper::testStringAsNumeric($year) : 0; - $month = ($month !== null) ? \PHPExcel\Shared\StringHelper::testStringAsNumeric($month) : 0; - $day = ($day !== null) ? \PHPExcel\Shared\StringHelper::testStringAsNumeric($day) : 0; + $year = ($year !== null) ? \PhpSpreadsheet\Shared\StringHelper::testStringAsNumeric($year) : 0; + $month = ($month !== null) ? \PhpSpreadsheet\Shared\StringHelper::testStringAsNumeric($month) : 0; + $day = ($day !== null) ? \PhpSpreadsheet\Shared\StringHelper::testStringAsNumeric($day) : 0; if ((!is_numeric($year)) || (!is_numeric($month)) || (!is_numeric($day))) { @@ -306,7 +303,7 @@ class DateTime $month = (integer) $month; $day = (integer) $day; - $baseYear = \PHPExcel\Shared\Date::getExcelCalendar(); + $baseYear = \PhpSpreadsheet\Shared\Date::getExcelCalendar(); // Validate parameters if ($year < ($baseYear-1900)) { return Functions::NAN(); @@ -336,14 +333,14 @@ class DateTime } // Execute function - $excelDateValue = \PHPExcel\Shared\Date::formattedPHPToExcel($year, $month, $day); + $excelDateValue = \PhpSpreadsheet\Shared\Date::formattedPHPToExcel($year, $month, $day); switch (Functions::getReturnDateType()) { case Functions::RETURNDATE_EXCEL: return (float) $excelDateValue; case Functions::RETURNDATE_PHP_NUMERIC: - return (integer) \PHPExcel\Shared\Date::excelToTimestamp($excelDateValue); + return (integer) \PhpSpreadsheet\Shared\Date::excelToTimestamp($excelDateValue); case Functions::RETURNDATE_PHP_OBJECT: - return \PHPExcel\Shared\Date::excelToDateTimeObject($excelDateValue); + return \PhpSpreadsheet\Shared\Date::excelToDateTimeObject($excelDateValue); } } @@ -354,7 +351,7 @@ class DateTime * The TIME function returns a value that represents a particular time. * * NOTE: When used in a Cell Formula, MS Excel changes the cell format so that it matches the time - * format of your regional settings. PHPExcel does not change cell formatting in this way. + * format of your regional settings. PhpSpreadsheet does not change cell formatting in this way. * * Excel Function: * TIME(hour,minute,second) @@ -429,13 +426,13 @@ class DateTime switch (Functions::getReturnDateType()) { case Functions::RETURNDATE_EXCEL: $date = 0; - $calendar = \PHPExcel\Shared\Date::getExcelCalendar(); - if ($calendar != \PHPExcel\Shared\Date::CALENDAR_WINDOWS_1900) { + $calendar = \PhpSpreadsheet\Shared\Date::getExcelCalendar(); + if ($calendar != \PhpSpreadsheet\Shared\Date::CALENDAR_WINDOWS_1900) { $date = 1; } - return (float) \PHPExcel\Shared\Date::formattedPHPToExcel($calendar, 1, $date, $hour, $minute, $second); + return (float) \PhpSpreadsheet\Shared\Date::formattedPHPToExcel($calendar, 1, $date, $hour, $minute, $second); case Functions::RETURNDATE_PHP_NUMERIC: - return (integer) \PHPExcel\Shared\Date::excelToTimestamp(\PHPExcel\Shared\Date::formattedPHPToExcel(1970, 1, 1, $hour, $minute, $second)); // -2147468400; // -2147472000 + 3600 + return (integer) \PhpSpreadsheet\Shared\Date::excelToTimestamp(\PhpSpreadsheet\Shared\Date::formattedPHPToExcel(1970, 1, 1, $hour, $minute, $second)); // -2147468400; // -2147472000 + 3600 case Functions::RETURNDATE_PHP_OBJECT: $dayAdjust = 0; if ($hour < 0) { @@ -465,7 +462,7 @@ class DateTime * value. * * NOTE: When used in a Cell Formula, MS Excel changes the cell format so that it matches the date - * format of your regional settings. PHPExcel does not change cell formatting in this way. + * format of your regional settings. PhpSpreadsheet does not change cell formatting in this way. * * Excel Function: * DATEVALUE(dateValue) @@ -571,7 +568,7 @@ class DateTime return Functions::VALUE(); } $excelDateValue = floor( - \PHPExcel\Shared\Date::formattedPHPToExcel( + \PhpSpreadsheet\Shared\Date::formattedPHPToExcel( $PHPDateArray['year'], $PHPDateArray['month'], $PHPDateArray['day'], @@ -584,7 +581,7 @@ class DateTime case Functions::RETURNDATE_EXCEL: return (float) $excelDateValue; case Functions::RETURNDATE_PHP_NUMERIC: - return (integer) \PHPExcel\Shared\Date::excelToTimestamp($excelDateValue); + return (integer) \PhpSpreadsheet\Shared\Date::excelToTimestamp($excelDateValue); case Functions::RETURNDATE_PHP_OBJECT: return new \DateTime($PHPDateArray['year'].'-'.$PHPDateArray['month'].'-'.$PHPDateArray['day'].' 00:00:00'); } @@ -601,7 +598,7 @@ class DateTime * value. * * NOTE: When used in a Cell Formula, MS Excel changes the cell format so that it matches the time - * format of your regional settings. PHPExcel does not change cell formatting in this way. + * format of your regional settings. PhpSpreadsheet does not change cell formatting in this way. * * Excel Function: * TIMEVALUE(timeValue) @@ -629,7 +626,7 @@ class DateTime $PHPDateArray = date_parse($timeValue); if (($PHPDateArray !== false) && ($PHPDateArray['error_count'] == 0)) { if (Functions::getCompatibilityMode() == Functions::COMPATIBILITY_OPENOFFICE) { - $excelDateValue = \PHPExcel\Shared\Date::formattedPHPToExcel( + $excelDateValue = \PhpSpreadsheet\Shared\Date::formattedPHPToExcel( $PHPDateArray['year'], $PHPDateArray['month'], $PHPDateArray['day'], @@ -638,14 +635,14 @@ class DateTime $PHPDateArray['second'] ); } else { - $excelDateValue = \PHPExcel\Shared\Date::formattedPHPToExcel(1900, 1, 1, $PHPDateArray['hour'], $PHPDateArray['minute'], $PHPDateArray['second']) - 1; + $excelDateValue = \PhpSpreadsheet\Shared\Date::formattedPHPToExcel(1900, 1, 1, $PHPDateArray['hour'], $PHPDateArray['minute'], $PHPDateArray['second']) - 1; } switch (Functions::getReturnDateType()) { case Functions::RETURNDATE_EXCEL: return (float) $excelDateValue; case Functions::RETURNDATE_PHP_NUMERIC: - return (integer) $phpDateValue = \PHPExcel\Shared\Date::excelToTimestamp($excelDateValue+25569) - 3600; + return (integer) $phpDateValue = \PhpSpreadsheet\Shared\Date::excelToTimestamp($excelDateValue+25569) - 3600; case Functions::RETURNDATE_PHP_OBJECT: return new \DateTime('1900-01-01 '.$PHPDateArray['hour'].':'.$PHPDateArray['minute'].':'.$PHPDateArray['second']); } @@ -685,12 +682,12 @@ class DateTime // Execute function $difference = $endDate - $startDate; - $PHPStartDateObject = \PHPExcel\Shared\Date::excelToDateTimeObject($startDate); + $PHPStartDateObject = \PhpSpreadsheet\Shared\Date::excelToDateTimeObject($startDate); $startDays = $PHPStartDateObject->format('j'); $startMonths = $PHPStartDateObject->format('n'); $startYears = $PHPStartDateObject->format('Y'); - $PHPEndDateObject = \PHPExcel\Shared\Date::excelToDateTimeObject($endDate); + $PHPEndDateObject = \PhpSpreadsheet\Shared\Date::excelToDateTimeObject($endDate); $endDays = $PHPEndDateObject->format('j'); $endMonths = $PHPEndDateObject->format('n'); $endYears = $PHPEndDateObject->format('Y'); @@ -805,12 +802,12 @@ class DateTime } // Execute function - $PHPStartDateObject = \PHPExcel\Shared\Date::excelToDateTimeObject($startDate); + $PHPStartDateObject = \PhpSpreadsheet\Shared\Date::excelToDateTimeObject($startDate); $startDay = $PHPStartDateObject->format('j'); $startMonth = $PHPStartDateObject->format('n'); $startYear = $PHPStartDateObject->format('Y'); - $PHPEndDateObject = \PHPExcel\Shared\Date::excelToDateTimeObject($endDate); + $PHPEndDateObject = \PhpSpreadsheet\Shared\Date::excelToDateTimeObject($endDate); $endDay = $PHPEndDateObject->format('j'); $endMonth = $PHPEndDateObject->format('n'); $endYear = $PHPEndDateObject->format('Y'); @@ -1112,9 +1109,9 @@ class DateTime case Functions::RETURNDATE_EXCEL: return (float) $endDate; case Functions::RETURNDATE_PHP_NUMERIC: - return (integer) \PHPExcel\Shared\Date::excelToTimestamp($endDate); + return (integer) \PhpSpreadsheet\Shared\Date::excelToTimestamp($endDate); case Functions::RETURNDATE_PHP_OBJECT: - return \PHPExcel\Shared\Date::excelToDateTimeObject($endDate); + return \PhpSpreadsheet\Shared\Date::excelToDateTimeObject($endDate); } } @@ -1147,7 +1144,7 @@ class DateTime } // Execute function - $PHPDateObject = \PHPExcel\Shared\Date::excelToDateTimeObject($dateValue); + $PHPDateObject = \PhpSpreadsheet\Shared\Date::excelToDateTimeObject($dateValue); return (int) $PHPDateObject->format('j'); } @@ -1191,7 +1188,7 @@ class DateTime } // Execute function - $PHPDateObject = \PHPExcel\Shared\Date::excelToDateTimeObject($dateValue); + $PHPDateObject = \PhpSpreadsheet\Shared\Date::excelToDateTimeObject($dateValue); $DoW = $PHPDateObject->format('w'); $firstDay = 1; @@ -1267,7 +1264,7 @@ class DateTime } // Execute function - $PHPDateObject = \PHPExcel\Shared\Date::excelToDateTimeObject($dateValue); + $PHPDateObject = \PhpSpreadsheet\Shared\Date::excelToDateTimeObject($dateValue); $dayOfYear = $PHPDateObject->format('z'); $PHPDateObject->modify('-' . $dayOfYear . ' days'); $dow = $PHPDateObject->format('w'); @@ -1306,7 +1303,7 @@ class DateTime } // Execute function - $PHPDateObject = \PHPExcel\Shared\Date::excelToDateTimeObject($dateValue); + $PHPDateObject = \PhpSpreadsheet\Shared\Date::excelToDateTimeObject($dateValue); return (int) $PHPDateObject->format('n'); } @@ -1338,7 +1335,7 @@ class DateTime } // Execute function - $PHPDateObject = \PHPExcel\Shared\Date::excelToDateTimeObject($dateValue); + $PHPDateObject = \PhpSpreadsheet\Shared\Date::excelToDateTimeObject($dateValue); return (int) $PHPDateObject->format('Y'); } @@ -1379,7 +1376,7 @@ class DateTime } elseif ($timeValue < 0.0) { return Functions::NAN(); } - $timeValue = \PHPExcel\Shared\Date::excelToTimestamp($timeValue); + $timeValue = \PhpSpreadsheet\Shared\Date::excelToTimestamp($timeValue); return (int) gmdate('G', $timeValue); } @@ -1420,7 +1417,7 @@ class DateTime } elseif ($timeValue < 0.0) { return Functions::NAN(); } - $timeValue = \PHPExcel\Shared\Date::excelToTimestamp($timeValue); + $timeValue = \PhpSpreadsheet\Shared\Date::excelToTimestamp($timeValue); return (int) gmdate('i', $timeValue); } @@ -1461,7 +1458,7 @@ class DateTime } elseif ($timeValue < 0.0) { return Functions::NAN(); } - $timeValue = \PHPExcel\Shared\Date::excelToTimestamp($timeValue); + $timeValue = \PhpSpreadsheet\Shared\Date::excelToTimestamp($timeValue); return (int) gmdate('s', $timeValue); } @@ -1505,9 +1502,9 @@ class DateTime switch (Functions::getReturnDateType()) { case Functions::RETURNDATE_EXCEL: - return (float) \PHPExcel\Shared\Date::PHPToExcel($PHPDateObject); + return (float) \PhpSpreadsheet\Shared\Date::PHPToExcel($PHPDateObject); case Functions::RETURNDATE_PHP_NUMERIC: - return (integer) \PHPExcel\Shared\Date::excelToTimestamp(\PHPExcel\Shared\Date::PHPToExcel($PHPDateObject)); + return (integer) \PhpSpreadsheet\Shared\Date::excelToTimestamp(\PhpSpreadsheet\Shared\Date::PHPToExcel($PHPDateObject)); case Functions::RETURNDATE_PHP_OBJECT: return $PHPDateObject; } @@ -1554,9 +1551,9 @@ class DateTime switch (Functions::getReturnDateType()) { case Functions::RETURNDATE_EXCEL: - return (float) \PHPExcel\Shared\Date::PHPToExcel($PHPDateObject); + return (float) \PhpSpreadsheet\Shared\Date::PHPToExcel($PHPDateObject); case Functions::RETURNDATE_PHP_NUMERIC: - return (integer) \PHPExcel\Shared\Date::excelToTimestamp(\PHPExcel\Shared\Date::PHPToExcel($PHPDateObject)); + return (integer) \PhpSpreadsheet\Shared\Date::excelToTimestamp(\PhpSpreadsheet\Shared\Date::PHPToExcel($PHPDateObject)); case Functions::RETURNDATE_PHP_OBJECT: return $PHPDateObject; } diff --git a/src/PhpSpreadsheet/Calculation/Engineering.php b/src/PhpSpreadsheet/Calculation/Engineering.php index f3b44cb4..d760f8f8 100644 --- a/src/PhpSpreadsheet/Calculation/Engineering.php +++ b/src/PhpSpreadsheet/Calculation/Engineering.php @@ -1,14 +1,12 @@ modify('-'.$months.' months'); } if ($next) { @@ -81,7 +78,7 @@ class Financial $result->modify('-1 day'); } - return \PHPExcel\Shared\Date::PHPToExcel($result); + return \PhpSpreadsheet\Shared\Date::PHPToExcel($result); } diff --git a/src/PhpSpreadsheet/Calculation/FormulaParser.php b/src/PhpSpreadsheet/Calculation/FormulaParser.php index 5a7122a0..784333c8 100644 --- a/src/PhpSpreadsheet/Calculation/FormulaParser.php +++ b/src/PhpSpreadsheet/Calculation/FormulaParser.php @@ -1,11 +1,9 @@ ', '<', '='))) { if (!is_numeric($condition)) { - $condition = \PHPExcel\Calculation::wrapResult(strtoupper($condition)); + $condition = \PhpSpreadsheet\Calculation::wrapResult(strtoupper($condition)); } return '=' . $condition; } else { @@ -325,7 +322,7 @@ class Functions if (!is_numeric($operand)) { $operand = str_replace('"', '""', $operand); - $operand = \PHPExcel\Calculation::wrapResult(strtoupper($operand)); + $operand = \PhpSpreadsheet\Calculation::wrapResult(strtoupper($operand)); } return $operator . $operand; @@ -518,7 +515,7 @@ class Functions */ public static function VERSION() { - return 'PHPExcel ##VERSION##, ##DATE##'; + return 'PhpSpreadsheet ##VERSION##, ##DATE##'; } diff --git a/src/PhpSpreadsheet/Calculation/Logical.php b/src/PhpSpreadsheet/Calculation/Logical.php index fb9a8cf0..47985fc8 100644 --- a/src/PhpSpreadsheet/Calculation/Logical.php +++ b/src/PhpSpreadsheet/Calculation/Logical.php @@ -1,11 +1,9 @@ $value) { $columnKey = preg_replace('/[^a-z]/i', '', $columnKey); - return (integer) \PHPExcel\Cell::columnIndexFromString($columnKey); + return (integer) \PhpSpreadsheet\Cell::columnIndexFromString($columnKey); } } else { if (strpos($cellAddress, '!') !== false) { @@ -124,12 +121,12 @@ class LookupRef $endAddress = preg_replace('/[^a-z]/i', '', $endAddress); $returnValue = array(); do { - $returnValue[] = (integer) \PHPExcel\Cell::columnIndexFromString($startAddress); + $returnValue[] = (integer) \PhpSpreadsheet\Cell::columnIndexFromString($startAddress); } while ($startAddress++ != $endAddress); return $returnValue; } else { $cellAddress = preg_replace('/[^a-z]/i', '', $cellAddress); - return (integer) \PHPExcel\Cell::columnIndexFromString($cellAddress); + return (integer) \PhpSpreadsheet\Cell::columnIndexFromString($cellAddress); } } } @@ -156,7 +153,7 @@ class LookupRef reset($cellAddress); $isMatrix = (is_numeric(key($cellAddress))); - list($columns, $rows) = \PHPExcel\Calculation::_getMatrixDimensions($cellAddress); + list($columns, $rows) = \PhpSpreadsheet\Calculation::_getMatrixDimensions($cellAddress); if ($isMatrix) { return $rows; @@ -234,7 +231,7 @@ class LookupRef reset($cellAddress); $isMatrix = (is_numeric(key($cellAddress))); - list($columns, $rows) = \PHPExcel\Calculation::_getMatrixDimensions($cellAddress); + list($columns, $rows) = \PhpSpreadsheet\Calculation::_getMatrixDimensions($cellAddress); if ($isMatrix) { return $columns; @@ -254,10 +251,10 @@ class LookupRef * @category Logical Functions * @param string $linkURL Value to check, is also the value returned when no error * @param string $displayName Value to return when testValue is an error condition - * @param \PHPExcel\Cell $pCell The cell to set the hyperlink in + * @param \PhpSpreadsheet\Cell $pCell The cell to set the hyperlink in * @return mixed The value of $displayName (or $linkURL if $displayName was blank) */ - public static function HYPERLINK($linkURL = '', $displayName = null, \PHPExcel\Cell $pCell = null) + public static function HYPERLINK($linkURL = '', $displayName = null, \PhpSpreadsheet\Cell $pCell = null) { $args = func_get_args(); $pCell = array_pop($args); @@ -292,13 +289,13 @@ class LookupRef * NOTE - INDIRECT() does not yet support the optional a1 parameter introduced in Excel 2010 * * @param cellAddress $cellAddress The cell address of the current cell (containing this formula) - * @param \PHPExcel\Cell $pCell The current cell (containing this formula) + * @param \PhpSpreadsheet\Cell $pCell The current cell (containing this formula) * @return mixed The cells referenced by cellAddress * * @todo Support for the optional a1 parameter introduced in Excel 2010 * */ - public static function INDIRECT($cellAddress = null, \PHPExcel\Cell $pCell = null) + public static function INDIRECT($cellAddress = null, \PhpSpreadsheet\Cell $pCell = null) { $cellAddress = Functions::flattenSingleValue($cellAddress); if (is_null($cellAddress) || $cellAddress === '') { @@ -311,9 +308,9 @@ class LookupRef list($cellAddress1, $cellAddress2) = explode(':', $cellAddress); } - if ((!preg_match('/^'.\PHPExcel\Calculation::CALCULATION_REGEXP_CELLREF.'$/i', $cellAddress1, $matches)) || - ((!is_null($cellAddress2)) && (!preg_match('/^'.\PHPExcel\Calculation::CALCULATION_REGEXP_CELLREF.'$/i', $cellAddress2, $matches)))) { - if (!preg_match('/^'.\PHPExcel\Calculation::CALCULATION_REGEXP_NAMEDRANGE.'$/i', $cellAddress1, $matches)) { + if ((!preg_match('/^'.\PhpSpreadsheet\Calculation::CALCULATION_REGEXP_CELLREF.'$/i', $cellAddress1, $matches)) || + ((!is_null($cellAddress2)) && (!preg_match('/^'.\PhpSpreadsheet\Calculation::CALCULATION_REGEXP_CELLREF.'$/i', $cellAddress2, $matches)))) { + if (!preg_match('/^'.\PhpSpreadsheet\Calculation::CALCULATION_REGEXP_NAMEDRANGE.'$/i', $cellAddress1, $matches)) { return Functions::REF(); } @@ -325,7 +322,7 @@ class LookupRef $pSheet = $pCell->getWorksheet(); } - return \PHPExcel\Calculation::getInstance()->extractNamedRange($cellAddress, $pSheet, false); + return \PhpSpreadsheet\Calculation::getInstance()->extractNamedRange($cellAddress, $pSheet, false); } if (strpos($cellAddress, '!') !== false) { @@ -336,7 +333,7 @@ class LookupRef $pSheet = $pCell->getWorksheet(); } - return \PHPExcel\Calculation::getInstance()->extractCellRange($cellAddress, $pSheet, false); + return \PhpSpreadsheet\Calculation::getInstance()->extractCellRange($cellAddress, $pSheet, false); } @@ -391,23 +388,23 @@ class LookupRef } else { $startCell = $endCell = $cellAddress; } - list($startCellColumn, $startCellRow) = \PHPExcel\Cell::coordinateFromString($startCell); - list($endCellColumn, $endCellRow) = \PHPExcel\Cell::coordinateFromString($endCell); + list($startCellColumn, $startCellRow) = \PhpSpreadsheet\Cell::coordinateFromString($startCell); + list($endCellColumn, $endCellRow) = \PhpSpreadsheet\Cell::coordinateFromString($endCell); $startCellRow += $rows; - $startCellColumn = \PHPExcel\Cell::columnIndexFromString($startCellColumn) - 1; + $startCellColumn = \PhpSpreadsheet\Cell::columnIndexFromString($startCellColumn) - 1; $startCellColumn += $columns; if (($startCellRow <= 0) || ($startCellColumn < 0)) { return Functions::REF(); } - $endCellColumn = \PHPExcel\Cell::columnIndexFromString($endCellColumn) - 1; + $endCellColumn = \PhpSpreadsheet\Cell::columnIndexFromString($endCellColumn) - 1; if (($width != null) && (!is_object($width))) { $endCellColumn = $startCellColumn + $width - 1; } else { $endCellColumn += $columns; } - $startCellColumn = \PHPExcel\Cell::stringFromColumnIndex($startCellColumn); + $startCellColumn = \PhpSpreadsheet\Cell::stringFromColumnIndex($startCellColumn); if (($height != null) && (!is_object($height))) { $endCellRow = $startCellRow + $height - 1; @@ -418,7 +415,7 @@ class LookupRef if (($endCellRow <= 0) || ($endCellColumn < 0)) { return Functions::REF(); } - $endCellColumn = \PHPExcel\Cell::stringFromColumnIndex($endCellColumn); + $endCellColumn = \PhpSpreadsheet\Cell::stringFromColumnIndex($endCellColumn); $cellAddress = $startCellColumn.$startCellRow; if (($startCellColumn != $endCellColumn) || ($startCellRow != $endCellRow)) { @@ -431,7 +428,7 @@ class LookupRef $pSheet = $pCell->getWorksheet(); } - return \PHPExcel\Calculation::getInstance()->extractCellRange($cellAddress, $pSheet, false); + return \PhpSpreadsheet\Calculation::getInstance()->extractCellRange($cellAddress, $pSheet, false); } diff --git a/src/PhpSpreadsheet/Calculation/MathTrig.php b/src/PhpSpreadsheet/Calculation/MathTrig.php index d1cfde6f..99be5539 100644 --- a/src/PhpSpreadsheet/Calculation/MathTrig.php +++ b/src/PhpSpreadsheet/Calculation/MathTrig.php @@ -1,11 +1,9 @@ det(); - } catch (\PHPExcel\Exception $ex) { + } catch (\PhpSpreadsheet\Exception $ex) { return Functions::VALUE(); } } @@ -609,9 +606,9 @@ class MathTrig } try { - $matrix = new \PHPExcel\Shared\JAMA\Matrix($matrixData); + $matrix = new \PhpSpreadsheet\Shared\JAMA\Matrix($matrixData); return $matrix->inverse()->getArray(); - } catch (\PHPExcel\Exception $ex) { + } catch (\PhpSpreadsheet\Exception $ex) { return Functions::VALUE(); } } @@ -650,7 +647,7 @@ class MathTrig } ++$rowA; } - $matrixA = new \PHPExcel\Shared\JAMA\Matrix($matrixAData); + $matrixA = new \PhpSpreadsheet\Shared\JAMA\Matrix($matrixAData); $rowB = 0; foreach ($matrixData2 as $matrixRow) { if (!is_array($matrixRow)) { @@ -666,14 +663,14 @@ class MathTrig } ++$rowB; } - $matrixB = new \PHPExcel\Shared\JAMA\Matrix($matrixBData); + $matrixB = new \PhpSpreadsheet\Shared\JAMA\Matrix($matrixBData); if ($columnA != $rowB) { return Functions::VALUE(); } return $matrixA->times($matrixB)->getArray(); - } catch (\PHPExcel\Exception $ex) { + } catch (\PhpSpreadsheet\Exception $ex) { var_dump($ex->getMessage()); return Functions::VALUE(); } @@ -1201,11 +1198,11 @@ class MathTrig foreach ($aArgs as $key => $arg) { if (!is_numeric($arg)) { $arg = str_replace('"', '""', $arg); - $arg = \PHPExcel\Calculation::wrapResult(strtoupper($arg)); + $arg = \PhpSpreadsheet\Calculation::wrapResult(strtoupper($arg)); } $testCondition = '='.$arg.$condition; - if (\PHPExcel\Calculation::getInstance()->_calculateFormulaValue($testCondition)) { + if (\PhpSpreadsheet\Calculation::getInstance()->_calculateFormulaValue($testCondition)) { // Is it a value within our criteria $returnValue += $sumArgs[$key]; } @@ -1249,10 +1246,10 @@ class MathTrig // Loop through arguments foreach ($aArgs as $key => $arg) { if (!is_numeric($arg)) { - $arg = \PHPExcel\Calculation::wrapResult(strtoupper($arg)); + $arg = \PhpSpreadsheet\Calculation::wrapResult(strtoupper($arg)); } $testCondition = '='.$arg.$condition; - if (\PHPExcel\Calculation::getInstance()->_calculateFormulaValue($testCondition)) { + if (\PhpSpreadsheet\Calculation::getInstance()->_calculateFormulaValue($testCondition)) { // Is it a value within our criteria $returnValue += $sumArgs[$key]; } diff --git a/src/PhpSpreadsheet/Calculation/Statistical.php b/src/PhpSpreadsheet/Calculation/Statistical.php index 9ff59d4d..ac3cc739 100644 --- a/src/PhpSpreadsheet/Calculation/Statistical.php +++ b/src/PhpSpreadsheet/Calculation/Statistical.php @@ -1,6 +1,6 @@ $arg) { if (!is_numeric($arg)) { - $arg = \PHPExcel\Calculation::wrapResult(strtoupper($arg)); + $arg = \PhpSpreadsheet\Calculation::wrapResult(strtoupper($arg)); } $testCondition = '='.$arg.$condition; - if (\PHPExcel\Calculation::getInstance()->_calculateFormulaValue($testCondition)) { + if (\PhpSpreadsheet\Calculation::getInstance()->_calculateFormulaValue($testCondition)) { if ((is_null($returnValue)) || ($arg > $returnValue)) { $returnValue += $arg; ++$aCount; @@ -1165,7 +1162,7 @@ class Statistical return Functions::DIV0(); } - $bestFitLinear = \PHPExcel\Shared\trend\trend::calculate(\PHPExcel\Shared\trend\trend::TREND_LINEAR, $yValues, $xValues); + $bestFitLinear = \PhpSpreadsheet\Shared\trend\trend::calculate(\PhpSpreadsheet\Shared\trend\trend::TREND_LINEAR, $yValues, $xValues); return $bestFitLinear->getCorrelation(); } @@ -1287,10 +1284,10 @@ class Statistical // Loop through arguments foreach ($aArgs as $arg) { if (!is_numeric($arg)) { - $arg = \PHPExcel\Calculation::wrapResult(strtoupper($arg)); + $arg = \PhpSpreadsheet\Calculation::wrapResult(strtoupper($arg)); } $testCondition = '='.$arg.$condition; - if (\PHPExcel\Calculation::getInstance()->_calculateFormulaValue($testCondition)) { + if (\PhpSpreadsheet\Calculation::getInstance()->_calculateFormulaValue($testCondition)) { // Is it a value within our criteria ++$returnValue; } @@ -1323,7 +1320,7 @@ class Statistical return Functions::DIV0(); } - $bestFitLinear = \PHPExcel\Shared\trend\trend::calculate(\PHPExcel\Shared\trend\trend::TREND_LINEAR, $yValues, $xValues); + $bestFitLinear = \PhpSpreadsheet\Shared\trend\trend::calculate(\PhpSpreadsheet\Shared\trend\trend::TREND_LINEAR, $yValues, $xValues); return $bestFitLinear->getCovariance(); } @@ -1609,7 +1606,7 @@ class Statistical return Functions::DIV0(); } - $bestFitLinear = \PHPExcel\Shared\trend\trend::calculate(\PHPExcel\Shared\trend\trend::TREND_LINEAR, $yValues, $xValues); + $bestFitLinear = \PhpSpreadsheet\Shared\trend\trend::calculate(\PhpSpreadsheet\Shared\trend\trend::TREND_LINEAR, $yValues, $xValues); return $bestFitLinear->getValueOfYForX($xValue); } @@ -1780,7 +1777,7 @@ class Statistical $newValues = Functions::flattenArray($newValues); $const = (is_null($const)) ? true : (boolean) Functions::flattenSingleValue($const); - $bestFitExponential = \PHPExcel\Shared\trend\trend::calculate(\PHPExcel\Shared\trend\trend::TREND_EXPONENTIAL, $yValues, $xValues, $const); + $bestFitExponential = \PhpSpreadsheet\Shared\trend\trend::calculate(\PhpSpreadsheet\Shared\trend\trend::TREND_EXPONENTIAL, $yValues, $xValues, $const); if (empty($newValues)) { $newValues = $bestFitExponential->getXValues(); } @@ -1904,7 +1901,7 @@ class Statistical return Functions::DIV0(); } - $bestFitLinear = \PHPExcel\Shared\trend\trend::calculate(\PHPExcel\Shared\trend\trend::TREND_LINEAR, $yValues, $xValues); + $bestFitLinear = \PhpSpreadsheet\Shared\trend\trend::calculate(\PhpSpreadsheet\Shared\trend\trend::TREND_LINEAR, $yValues, $xValues); return $bestFitLinear->getIntersect(); } @@ -2026,7 +2023,7 @@ class Statistical return 0; } - $bestFitLinear = \PHPExcel\Shared\trend\trend::calculate(\PHPExcel\Shared\trend\trend::TREND_LINEAR, $yValues, $xValues, $const); + $bestFitLinear = \PhpSpreadsheet\Shared\trend\trend::calculate(\PhpSpreadsheet\Shared\trend\trend::TREND_LINEAR, $yValues, $xValues, $const); if ($stats) { return array( array( @@ -2092,7 +2089,7 @@ class Statistical return 1; } - $bestFitExponential = \PHPExcel\Shared\trend\trend::calculate(\PHPExcel\Shared\trend\trend::TREND_EXPONENTIAL, $yValues, $xValues, $const); + $bestFitExponential = \PhpSpreadsheet\Shared\trend\trend::calculate(\PhpSpreadsheet\Shared\trend\trend::TREND_EXPONENTIAL, $yValues, $xValues, $const); if ($stats) { return array( array( @@ -2279,10 +2276,10 @@ class Statistical // Loop through arguments foreach ($aArgs as $key => $arg) { if (!is_numeric($arg)) { - $arg = \PHPExcel\Calculation::wrapResult(strtoupper($arg)); + $arg = \PhpSpreadsheet\Calculation::wrapResult(strtoupper($arg)); } $testCondition = '='.$arg.$condition; - if (\PHPExcel\Calculation::getInstance()->_calculateFormulaValue($testCondition)) { + if (\PhpSpreadsheet\Calculation::getInstance()->_calculateFormulaValue($testCondition)) { if ((is_null($returnValue)) || ($arg > $returnValue)) { $returnValue = $arg; } @@ -2438,10 +2435,10 @@ class Statistical // Loop through arguments foreach ($aArgs as $key => $arg) { if (!is_numeric($arg)) { - $arg = \PHPExcel\Calculation::wrapResult(strtoupper($arg)); + $arg = \PhpSpreadsheet\Calculation::wrapResult(strtoupper($arg)); } $testCondition = '='.$arg.$condition; - if (\PHPExcel\Calculation::getInstance()->_calculateFormulaValue($testCondition)) { + if (\PhpSpreadsheet\Calculation::getInstance()->_calculateFormulaValue($testCondition)) { if ((is_null($returnValue)) || ($arg < $returnValue)) { $returnValue = $arg; } @@ -2917,7 +2914,7 @@ class Statistical return Functions::DIV0(); } - $bestFitLinear = \PHPExcel\Shared\trend\trend::calculate(\PHPExcel\Shared\trend\trend::TREND_LINEAR, $yValues, $xValues); + $bestFitLinear = \PhpSpreadsheet\Shared\trend\trend::calculate(\PhpSpreadsheet\Shared\trend\trend::TREND_LINEAR, $yValues, $xValues); return $bestFitLinear->getGoodnessOfFit(); } @@ -2983,7 +2980,7 @@ class Statistical return Functions::DIV0(); } - $bestFitLinear = \PHPExcel\Shared\trend\trend::calculate(\PHPExcel\Shared\trend\trend::TREND_LINEAR, $yValues, $xValues); + $bestFitLinear = \PhpSpreadsheet\Shared\trend\trend::calculate(\PhpSpreadsheet\Shared\trend\trend::TREND_LINEAR, $yValues, $xValues); return $bestFitLinear->getSlope(); } @@ -3276,7 +3273,7 @@ class Statistical return Functions::DIV0(); } - $bestFitLinear = \PHPExcel\Shared\trend\trend::calculate(\PHPExcel\Shared\trend\trend::TREND_LINEAR, $yValues, $xValues); + $bestFitLinear = \PhpSpreadsheet\Shared\trend\trend::calculate(\PhpSpreadsheet\Shared\trend\trend::TREND_LINEAR, $yValues, $xValues); return $bestFitLinear->getStdevOfResiduals(); } @@ -3419,7 +3416,7 @@ class Statistical $newValues = Functions::flattenArray($newValues); $const = (is_null($const)) ? true : (boolean) Functions::flattenSingleValue($const); - $bestFitLinear = \PHPExcel\Shared\trend\trend::calculate(\PHPExcel\Shared\trend\trend::TREND_LINEAR, $yValues, $xValues, $const); + $bestFitLinear = \PhpSpreadsheet\Shared\trend\trend::calculate(\PhpSpreadsheet\Shared\trend\trend::TREND_LINEAR, $yValues, $xValues, $const); if (empty($newValues)) { $newValues = $bestFitLinear->getXValues(); } diff --git a/src/PhpSpreadsheet/Calculation/TextData.php b/src/PhpSpreadsheet/Calculation/TextData.php index 6ada6902..1a77ac28 100644 --- a/src/PhpSpreadsheet/Calculation/TextData.php +++ b/src/PhpSpreadsheet/Calculation/TextData.php @@ -1,11 +1,9 @@ 0) && (\PHPExcel\Shared\StringHelper::countCharacters($haystack) > $offset)) { - if (\PHPExcel\Shared\StringHelper::countCharacters($needle) == 0) { + if (($offset > 0) && (\PhpSpreadsheet\Shared\StringHelper::countCharacters($haystack) > $offset)) { + if (\PhpSpreadsheet\Shared\StringHelper::countCharacters($needle) == 0) { return $offset; } if (function_exists('mb_strpos')) { @@ -271,11 +268,11 @@ class TextData if (!is_bool($needle)) { if (is_bool($haystack)) { - $haystack = ($haystack) ? \PHPExcel\Calculation::getTRUE() : \PHPExcel\Calculation::getFALSE(); + $haystack = ($haystack) ? \PhpSpreadsheet\Calculation::getTRUE() : \PhpSpreadsheet\Calculation::getFALSE(); } - if (($offset > 0) && (\PHPExcel\Shared\StringHelper::countCharacters($haystack) > $offset)) { - if (\PHPExcel\Shared\StringHelper::countCharacters($needle) == 0) { + if (($offset > 0) && (\PhpSpreadsheet\Shared\StringHelper::countCharacters($haystack) > $offset)) { + if (\PhpSpreadsheet\Shared\StringHelper::countCharacters($needle) == 0) { return $offset; } if (function_exists('mb_stripos')) { @@ -341,7 +338,7 @@ class TextData } if (is_bool($value)) { - $value = ($value) ? \PHPExcel\Calculation::getTRUE() : \PHPExcel\Calculation::getFALSE(); + $value = ($value) ? \PhpSpreadsheet\Calculation::getTRUE() : \PhpSpreadsheet\Calculation::getFALSE(); } if (function_exists('mb_substr')) { @@ -371,7 +368,7 @@ class TextData } if (is_bool($value)) { - $value = ($value) ? \PHPExcel\Calculation::getTRUE() : \PHPExcel\Calculation::getFALSE(); + $value = ($value) ? \PhpSpreadsheet\Calculation::getTRUE() : \PhpSpreadsheet\Calculation::getFALSE(); } if (empty($chars)) { @@ -402,7 +399,7 @@ class TextData } if (is_bool($value)) { - $value = ($value) ? \PHPExcel\Calculation::getTRUE() : \PHPExcel\Calculation::getFALSE(); + $value = ($value) ? \PhpSpreadsheet\Calculation::getTRUE() : \PhpSpreadsheet\Calculation::getFALSE(); } if ((function_exists('mb_substr')) && (function_exists('mb_strlen'))) { @@ -424,7 +421,7 @@ class TextData $value = Functions::flattenSingleValue($value); if (is_bool($value)) { - $value = ($value) ? \PHPExcel\Calculation::getTRUE() : \PHPExcel\Calculation::getFALSE(); + $value = ($value) ? \PhpSpreadsheet\Calculation::getTRUE() : \PhpSpreadsheet\Calculation::getFALSE(); } if (function_exists('mb_strlen')) { @@ -448,10 +445,10 @@ class TextData $mixedCaseString = Functions::flattenSingleValue($mixedCaseString); if (is_bool($mixedCaseString)) { - $mixedCaseString = ($mixedCaseString) ? \PHPExcel\Calculation::getTRUE() : \PHPExcel\Calculation::getFALSE(); + $mixedCaseString = ($mixedCaseString) ? \PhpSpreadsheet\Calculation::getTRUE() : \PhpSpreadsheet\Calculation::getFALSE(); } - return \PHPExcel\Shared\StringHelper::strToLower($mixedCaseString); + return \PhpSpreadsheet\Shared\StringHelper::strToLower($mixedCaseString); } @@ -468,10 +465,10 @@ class TextData $mixedCaseString = Functions::flattenSingleValue($mixedCaseString); if (is_bool($mixedCaseString)) { - $mixedCaseString = ($mixedCaseString) ? \PHPExcel\Calculation::getTRUE() : \PHPExcel\Calculation::getFALSE(); + $mixedCaseString = ($mixedCaseString) ? \PhpSpreadsheet\Calculation::getTRUE() : \PhpSpreadsheet\Calculation::getFALSE(); } - return \PHPExcel\Shared\StringHelper::strToUpper($mixedCaseString); + return \PhpSpreadsheet\Shared\StringHelper::strToUpper($mixedCaseString); } @@ -488,10 +485,10 @@ class TextData $mixedCaseString = Functions::flattenSingleValue($mixedCaseString); if (is_bool($mixedCaseString)) { - $mixedCaseString = ($mixedCaseString) ? \PHPExcel\Calculation::getTRUE() : \PHPExcel\Calculation::getFALSE(); + $mixedCaseString = ($mixedCaseString) ? \PhpSpreadsheet\Calculation::getTRUE() : \PhpSpreadsheet\Calculation::getFALSE(); } - return \PHPExcel\Shared\StringHelper::strToTitle($mixedCaseString); + return \PhpSpreadsheet\Shared\StringHelper::strToTitle($mixedCaseString); } @@ -595,11 +592,11 @@ class TextData $value = Functions::flattenSingleValue($value); $format = Functions::flattenSingleValue($format); - if ((is_string($value)) && (!is_numeric($value)) && \PHPExcel\Shared\Date::isDateTimeFormatCode($format)) { + if ((is_string($value)) && (!is_numeric($value)) && \PhpSpreadsheet\Shared\Date::isDateTimeFormatCode($format)) { $value = DateTime::DATEVALUE($value); } - return (string) \PHPExcel\Style\NumberFormat::toFormattedString($value, $format); + return (string) \PhpSpreadsheet\Style\NumberFormat::toFormattedString($value, $format); } /** @@ -614,9 +611,9 @@ class TextData if (!is_numeric($value)) { $numberValue = str_replace( - \PHPExcel\Shared\StringHelper::getThousandsSeparator(), + \PhpSpreadsheet\Shared\StringHelper::getThousandsSeparator(), '', - trim($value, " \t\n\r\0\x0B" . \PHPExcel\Shared\StringHelper::getCurrencyCode()) + trim($value, " \t\n\r\0\x0B" . \PhpSpreadsheet\Shared\StringHelper::getCurrencyCode()) ); if (is_numeric($numberValue)) { return (float) $numberValue; diff --git a/src/PhpSpreadsheet/Calculation/Token/Stack.php b/src/PhpSpreadsheet/Calculation/Token/Stack.php index a7812c40..5b61c048 100644 --- a/src/PhpSpreadsheet/Calculation/Token/Stack.php +++ b/src/PhpSpreadsheet/Calculation/Token/Stack.php @@ -1,11 +1,9 @@ $reference ); if ($type == 'Function') { - $localeFunction = \PHPExcel\Calculation::localeFunc($value); + $localeFunction = \PhpSpreadsheet\Calculation::localeFunc($value); if ($localeFunction != $value) { $this->stack[($this->count - 1)]['localeValue'] = $localeFunction; } diff --git a/src/PhpSpreadsheet/Cell.php b/src/PhpSpreadsheet/Cell.php index 38379707..a3a2956f 100644 --- a/src/PhpSpreadsheet/Cell.php +++ b/src/PhpSpreadsheet/Cell.php @@ -1,11 +1,9 @@ setValueExplicit(true, DataType::TYPE_BOOL); return true; - } elseif ($value == \PHPExcel\Calculation::getFALSE()) { + } elseif ($value == \PhpSpreadsheet\Calculation::getFALSE()) { $cell->setValueExplicit(false, DataType::TYPE_BOOL); return true; } // Check for number in scientific format - if (preg_match('/^'.\PHPExcel\Calculation::CALCULATION_REGEXP_NUMBER.'$/', $value)) { + if (preg_match('/^'.\PhpSpreadsheet\Calculation::CALCULATION_REGEXP_NUMBER.'$/', $value)) { $cell->setValueExplicit((float) $value, DataType::TYPE_NUMERIC); return true; } @@ -95,14 +92,14 @@ class AdvancedValueBinder extends DefaultValueBinder implements IValueBinder $cell->setValueExplicit($value, DataType::TYPE_NUMERIC); // Set style $cell->getWorksheet()->getStyle($cell->getCoordinate()) - ->getNumberFormat()->setFormatCode(\PHPExcel\Style\NumberFormat::FORMAT_PERCENTAGE_00); + ->getNumberFormat()->setFormatCode(\PhpSpreadsheet\Style\NumberFormat::FORMAT_PERCENTAGE_00); return true; } // Check for currency - $currencyCode = \PHPExcel\Shared\StringHelper::getCurrencyCode(); - $decimalSeparator = \PHPExcel\Shared\StringHelper::getDecimalSeparator(); - $thousandsSeparator = \PHPExcel\Shared\StringHelper::getThousandsSeparator(); + $currencyCode = \PhpSpreadsheet\Shared\StringHelper::getCurrencyCode(); + $decimalSeparator = \PhpSpreadsheet\Shared\StringHelper::getDecimalSeparator(); + $thousandsSeparator = \PhpSpreadsheet\Shared\StringHelper::getThousandsSeparator(); if (preg_match('/^'.preg_quote($currencyCode).' *(\d{1,3}('.preg_quote($thousandsSeparator).'\d{3})*|(\d+))('.preg_quote($decimalSeparator).'\d{2})?$/', $value)) { // Convert value to number $value = (float) trim(str_replace(array($currencyCode, $thousandsSeparator, $decimalSeparator), array('', '', '.'), $value)); @@ -110,7 +107,7 @@ class AdvancedValueBinder extends DefaultValueBinder implements IValueBinder // Set style $cell->getWorksheet()->getStyle($cell->getCoordinate()) ->getNumberFormat()->setFormatCode( - str_replace('$', $currencyCode, \PHPExcel\Style\NumberFormat::FORMAT_CURRENCY_USD_SIMPLE) + str_replace('$', $currencyCode, \PhpSpreadsheet\Style\NumberFormat::FORMAT_CURRENCY_USD_SIMPLE) ); return true; } elseif (preg_match('/^\$ *(\d{1,3}(\,\d{3})*|(\d+))(\.\d{2})?$/', $value)) { @@ -119,7 +116,7 @@ class AdvancedValueBinder extends DefaultValueBinder implements IValueBinder $cell->setValueExplicit($value, DataType::TYPE_NUMERIC); // Set style $cell->getWorksheet()->getStyle($cell->getCoordinate()) - ->getNumberFormat()->setFormatCode(\PHPExcel\Style\NumberFormat::FORMAT_CURRENCY_USD_SIMPLE); + ->getNumberFormat()->setFormatCode(\PhpSpreadsheet\Style\NumberFormat::FORMAT_CURRENCY_USD_SIMPLE); return true; } @@ -131,7 +128,7 @@ class AdvancedValueBinder extends DefaultValueBinder implements IValueBinder $cell->setValueExplicit($days, DataType::TYPE_NUMERIC); // Set style $cell->getWorksheet()->getStyle($cell->getCoordinate()) - ->getNumberFormat()->setFormatCode(\PHPExcel\Style\NumberFormat::FORMAT_DATE_TIME3); + ->getNumberFormat()->setFormatCode(\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_TIME3); return true; } @@ -144,12 +141,12 @@ class AdvancedValueBinder extends DefaultValueBinder implements IValueBinder $cell->setValueExplicit($days, DataType::TYPE_NUMERIC); // Set style $cell->getWorksheet()->getStyle($cell->getCoordinate()) - ->getNumberFormat()->setFormatCode(\PHPExcel\Style\NumberFormat::FORMAT_DATE_TIME4); + ->getNumberFormat()->setFormatCode(\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_TIME4); return true; } // Check for datetime, e.g. '2008-12-31', '2008-12-31 15:59', '2008-12-31 15:59:10' - if (($d = \PHPExcel\Shared\Date::stringToExcel($value)) !== false) { + if (($d = \PhpSpreadsheet\Shared\Date::stringToExcel($value)) !== false) { // Convert value to number $cell->setValueExplicit($d, DataType::TYPE_NUMERIC); // Determine style. Either there is a time part or not. Look for ':' @@ -165,7 +162,7 @@ class AdvancedValueBinder extends DefaultValueBinder implements IValueBinder // Check for newline character "\n" if (strpos($value, "\n") !== false) { - $value = \PHPExcel\Shared\StringHelper::sanitizeUTF8($value); + $value = \PhpSpreadsheet\Shared\StringHelper::sanitizeUTF8($value); $cell->setValueExplicit($value, DataType::TYPE_STRING); // Set style $cell->getWorksheet()->getStyle($cell->getCoordinate()) diff --git a/src/PhpSpreadsheet/Cell/DataType.php b/src/PhpSpreadsheet/Cell/DataType.php index d48d52af..7641805d 100644 --- a/src/PhpSpreadsheet/Cell/DataType.php +++ b/src/PhpSpreadsheet/Cell/DataType.php @@ -1,11 +1,9 @@ format('Y-m-d H:i:s'); - } elseif (!($value instanceof \PHPExcel\RichText)) { + } elseif (!($value instanceof \PhpSpreadsheet\RichText)) { $value = (string) $value; } } @@ -70,7 +67,7 @@ class DefaultValueBinder implements IValueBinder return DataType::TYPE_NULL; } elseif ($pValue === '') { return DataType::TYPE_STRING; - } elseif ($pValue instanceof \PHPExcel\RichText) { + } elseif ($pValue instanceof \PhpSpreadsheet\RichText) { return DataType::TYPE_INLINE; } elseif ($pValue{0} === '=' && strlen($pValue) > 1) { return DataType::TYPE_FORMULA; diff --git a/src/PhpSpreadsheet/Cell/Hyperlink.php b/src/PhpSpreadsheet/Cell/Hyperlink.php index 33f2816c..b9f7d155 100644 --- a/src/PhpSpreadsheet/Cell/Hyperlink.php +++ b/src/PhpSpreadsheet/Cell/Hyperlink.php @@ -1,11 +1,9 @@ plotCategory = $plotCategory; $this->smoothLine = $smoothLine; $this->plotStyle = $plotStyle; - + if (is_null($plotDirection)) { $plotDirection = self::DIRECTION_COL; } @@ -363,7 +360,7 @@ class DataSeries return $this; } - public function refresh(\PHPExcel\Worksheet $worksheet) + public function refresh(\PhpSpreadsheet\Worksheet $worksheet) { foreach ($this->plotValues as $plotValues) { if ($plotValues !== null) { diff --git a/src/PhpSpreadsheet/Chart/DataSeriesValues.php b/src/PhpSpreadsheet/Chart/DataSeriesValues.php index b757f956..3b1f505c 100644 --- a/src/PhpSpreadsheet/Chart/DataSeriesValues.php +++ b/src/PhpSpreadsheet/Chart/DataSeriesValues.php @@ -1,11 +1,11 @@ dataValues = \PHPExcel\Calculation\Functions::flattenArray($dataValues); + $this->dataValues = \PhpSpreadsheet\Calculation\Functions::flattenArray($dataValues); $this->pointCount = count($dataValues); if ($refreshDataSource) { @@ -287,11 +286,11 @@ class DataSeriesValues return $var !== null; } - public function refresh(\PHPExcel\Worksheet $worksheet, $flatten = true) + public function refresh(\PhpSpreadsheet\Worksheet $worksheet, $flatten = true) { if ($this->dataSource !== null) { - $calcEngine = \PHPExcel\Calculation::getInstance($worksheet->getParent()); - $newDataValues = \PHPExcel\Calculation::unwrapResult( + $calcEngine = \PhpSpreadsheet\Calculation::getInstance($worksheet->getParent()); + $newDataValues = \PhpSpreadsheet\Calculation::unwrapResult( $calcEngine->_calculateFormulaValue( '='.$this->dataSource, null, @@ -299,7 +298,7 @@ class DataSeriesValues ) ); if ($flatten) { - $this->dataValues = \PHPExcel\Calculation\Functions::flattenArray($newDataValues); + $this->dataValues = \PhpSpreadsheet\Calculation\Functions::flattenArray($newDataValues); foreach ($this->dataValues as &$dataValue) { if ((!empty($dataValue)) && ($dataValue[0] == '#')) { $dataValue = 0.0; @@ -312,9 +311,9 @@ class DataSeriesValues list(, $cellRange) = $cellRange; } - $dimensions = \PHPExcel\Cell::rangeDimension(str_replace('$', '', $cellRange)); + $dimensions = \PhpSpreadsheet\Cell::rangeDimension(str_replace('$', '', $cellRange)); if (($dimensions[0] == 1) || ($dimensions[1] == 1)) { - $this->dataValues = \PHPExcel\Calculation\Functions::flattenArray($newDataValues); + $this->dataValues = \PhpSpreadsheet\Calculation\Functions::flattenArray($newDataValues); } else { $newArray = array_values(array_shift($newDataValues)); foreach ($newArray as $i => $newDataSet) { diff --git a/src/PhpSpreadsheet/Chart/Exception.php b/src/PhpSpreadsheet/Chart/Exception.php index b6b9ec74..5dd2d11c 100644 --- a/src/PhpSpreadsheet/Chart/Exception.php +++ b/src/PhpSpreadsheet/Chart/Exception.php @@ -1,11 +1,9 @@ plotSeries = $plotSeries; - + return $this; } - public function refresh(\PHPExcel\Worksheet $worksheet) + public function refresh(\PhpSpreadsheet\Worksheet $worksheet) { foreach ($this->plotSeries as $plotSeries) { $plotSeries->refresh($worksheet); diff --git a/src/PhpSpreadsheet/Chart/Properties.php b/src/PhpSpreadsheet/Chart/Properties.php index 5bc19fb8..13b3c000 100644 --- a/src/PhpSpreadsheet/Chart/Properties.php +++ b/src/PhpSpreadsheet/Chart/Properties.php @@ -1,6 +1,6 @@ renderCartesianPlotArea(); @@ -577,7 +574,7 @@ class JpGraph private function renderLineChart($groupCount, $dimensions = '2d') { - require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_line.php'); + require_once(\PhpSpreadsheet\Settings::getChartRendererPath().'jpgraph_line.php'); $this->renderCartesianPlotArea(); @@ -589,7 +586,7 @@ class JpGraph private function renderBarChart($groupCount, $dimensions = '2d') { - require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_bar.php'); + require_once(\PhpSpreadsheet\Settings::getChartRendererPath().'jpgraph_bar.php'); $this->renderCartesianPlotArea(); @@ -601,9 +598,9 @@ class JpGraph private function renderScatterChart($groupCount) { - require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_scatter.php'); - require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_regstat.php'); - require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_line.php'); + require_once(\PhpSpreadsheet\Settings::getChartRendererPath().'jpgraph_scatter.php'); + require_once(\PhpSpreadsheet\Settings::getChartRendererPath().'jpgraph_regstat.php'); + require_once(\PhpSpreadsheet\Settings::getChartRendererPath().'jpgraph_line.php'); $this->renderCartesianPlotArea('linlin'); @@ -615,7 +612,7 @@ class JpGraph private function renderBubbleChart($groupCount) { - require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_scatter.php'); + require_once(\PhpSpreadsheet\Settings::getChartRendererPath().'jpgraph_scatter.php'); $this->renderCartesianPlotArea('linlin'); @@ -627,9 +624,9 @@ class JpGraph private function renderPieChart($groupCount, $dimensions = '2d', $doughnut = false, $multiplePlots = false) { - require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_pie.php'); + require_once(\PhpSpreadsheet\Settings::getChartRendererPath().'jpgraph_pie.php'); if ($dimensions == '3d') { - require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_pie3d.php'); + require_once(\PhpSpreadsheet\Settings::getChartRendererPath().'jpgraph_pie3d.php'); } $this->renderPiePlotArea($doughnut); @@ -704,7 +701,7 @@ class JpGraph private function renderRadarChart($groupCount) { - require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_radar.php'); + require_once(\PhpSpreadsheet\Settings::getChartRendererPath().'jpgraph_radar.php'); $this->renderRadarPlotArea(); @@ -716,7 +713,7 @@ class JpGraph private function renderStockChart($groupCount) { - require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_stock.php'); + require_once(\PhpSpreadsheet\Settings::getChartRendererPath().'jpgraph_stock.php'); $this->renderCartesianPlotArea('intint'); @@ -728,7 +725,7 @@ class JpGraph private function renderContourChart($groupCount, $dimensions) { - require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_contour.php'); + require_once(\PhpSpreadsheet\Settings::getChartRendererPath().'jpgraph_contour.php'); $this->renderCartesianPlotArea('intint'); @@ -740,11 +737,11 @@ class JpGraph private function renderCombinationChart($groupCount, $dimensions, $outputDestination) { - require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_line.php'); - require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_bar.php'); - require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_scatter.php'); - require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_regstat.php'); - require_once(\PHPExcel\Settings::getChartRendererPath().'jpgraph_line.php'); + require_once(\PhpSpreadsheet\Settings::getChartRendererPath().'jpgraph_line.php'); + require_once(\PhpSpreadsheet\Settings::getChartRendererPath().'jpgraph_bar.php'); + require_once(\PhpSpreadsheet\Settings::getChartRendererPath().'jpgraph_scatter.php'); + require_once(\PhpSpreadsheet\Settings::getChartRendererPath().'jpgraph_regstat.php'); + require_once(\PhpSpreadsheet\Settings::getChartRendererPath().'jpgraph_line.php'); $this->renderCartesianPlotArea(); @@ -877,7 +874,7 @@ class JpGraph /** * Create a new jpgraph */ - public function __construct(\PHPExcel\Chart $chart) + public function __construct(\PhpSpreadsheet\Chart $chart) { $this->graph = null; $this->chart = $chart; diff --git a/src/PhpSpreadsheet/Chart/Title.php b/src/PhpSpreadsheet/Chart/Title.php index a974d2ba..5ec5496a 100644 --- a/src/PhpSpreadsheet/Chart/Title.php +++ b/src/PhpSpreadsheet/Chart/Title.php @@ -1,11 +1,9 @@ caption = $caption; - + return $this; } diff --git a/src/PhpSpreadsheet/Comment.php b/src/PhpSpreadsheet/Comment.php index 0bb63868..3c3304d5 100644 --- a/src/PhpSpreadsheet/Comment.php +++ b/src/PhpSpreadsheet/Comment.php @@ -1,11 +1,9 @@ revisionsPassword = $pValue; return $this; @@ -195,7 +192,7 @@ class Security public function setWorkbookPassword($pValue = '', $pAlreadyHashed = false) { if (!$pAlreadyHashed) { - $pValue = \PHPExcel\Shared\PasswordHasher::hashPassword($pValue); + $pValue = \PhpSpreadsheet\Shared\PasswordHasher::hashPassword($pValue); } $this->workbookPassword = $pValue; return $this; diff --git a/src/PhpSpreadsheet/Exception.php b/src/PhpSpreadsheet/Exception.php index c86c1e5a..aa460cfa 100644 --- a/src/PhpSpreadsheet/Exception.php +++ b/src/PhpSpreadsheet/Exception.php @@ -1,11 +1,11 @@ preserveWhiteSpace = false; - $this->richTextObject = new \PHPExcel\RichText(); + $this->richTextObject = new \PhpSpreadsheet\RichText(); $this->parseElements($dom); // Clean any further spurious whitespace @@ -661,7 +658,7 @@ class HTML $richtextRun->getFont()->setSize($this->size); } if ($this->color) { - $richtextRun->getFont()->setColor(new \PHPExcel\Style\Color('ff' . $this->color)); + $richtextRun->getFont()->setColor(new \PhpSpreadsheet\Style\Color('ff' . $this->color)); } if ($this->bold) { $richtextRun->getFont()->setBold(true); @@ -670,7 +667,7 @@ class HTML $richtextRun->getFont()->setItalic(true); } if ($this->underline) { - $richtextRun->getFont()->setUnderline(\PHPExcel\Style\Font::UNDERLINE_SINGLE); + $richtextRun->getFont()->setUnderline(\PhpSpreadsheet\Style\Font::UNDERLINE_SINGLE); } if ($this->superscript) { $richtextRun->getFont()->setSuperScript(true); diff --git a/src/PhpSpreadsheet/IComparable.php b/src/PhpSpreadsheet/IComparable.php index 5937595d..51f94f8c 100644 --- a/src/PhpSpreadsheet/IComparable.php +++ b/src/PhpSpreadsheet/IComparable.php @@ -1,10 +1,8 @@ 'IWriter', 'path' => 'PHPExcel/Writer/{0}.php', 'class' => '\\PHPExcel\\Writer\\{0}' ), - array( 'type' => 'IReader', 'path' => 'PHPExcel/Reader/{0}.php', 'class' => '\\PHPExcel\\Reader\\{0}' ) + array( 'type' => 'IWriter', 'path' => 'PhpSpreadsheet/Writer/{0}.php', 'class' => '\\PhpSpreadsheet\\Writer\\{0}' ), + array( 'type' => 'IReader', 'path' => 'PhpSpreadsheet/Reader/{0}.php', 'class' => '\\PhpSpreadsheet\\Reader\\{0}' ) ); /** @@ -101,7 +98,7 @@ class IOFactory * @static * @access public * @param string $type Example: IWriter - * @param string $location Example: PHPExcel/Writer/{0}.php + * @param string $location Example: PhpSpreadsheet/Writer/{0}.php * @param string $classname Example: Writer\{0} */ public static function addSearchLocation($type = '', $location = '', $classname = '') @@ -114,12 +111,12 @@ class IOFactory * * @static * @access public - * @param Spreadsheet $phpExcel + * @param Spreadsheet $spreadsheet * @param string $writerType Example: Excel2007 * @return Writer\IWriter * @throws Writer\Exception */ - public static function createWriter(Spreadsheet $phpExcel, $writerType = '') + public static function createWriter(Spreadsheet $spreadsheet, $writerType = '') { // Search type $searchType = 'IWriter'; @@ -129,7 +126,7 @@ class IOFactory if ($searchLocation['type'] == $searchType) { $className = str_replace('{0}', $writerType, $searchLocation['class']); - $instance = new $className($phpExcel); + $instance = new $className($spreadsheet); if ($instance !== null) { return $instance; } diff --git a/src/PhpSpreadsheet/NamedRange.php b/src/PhpSpreadsheet/NamedRange.php index 3877c3e9..d76a88b5 100644 --- a/src/PhpSpreadsheet/NamedRange.php +++ b/src/PhpSpreadsheet/NamedRange.php @@ -1,11 +1,11 @@ loadIntoExisting($pFilename, $objPHPExcel); + return $this->loadIntoExisting($pFilename, $spreadsheet); } /** - * Loads PHPExcel from file into PHPExcel instance + * Loads PhpSpreadsheet from file into PhpSpreadsheet instance * * @param string $pFilename - * @param Spreadsheet $objPHPExcel + * @param Spreadsheet $spreadsheet * @return Spreadsheet * @throws Exception */ - public function loadIntoExisting($pFilename, Spreadsheet $objPHPExcel) + public function loadIntoExisting($pFilename, Spreadsheet $spreadsheet) { $lineEnding = ini_get('auto_detect_line_endings'); ini_set('auto_detect_line_endings', true); @@ -255,11 +252,11 @@ class CSV extends BaseReader implements IReader $this->skipBOM(); $this->checkSeparator(); - // Create new PHPExcel object - while ($objPHPExcel->getSheetCount() <= $this->sheetIndex) { - $objPHPExcel->createSheet(); + // Create new PhpSpreadsheet object + while ($spreadsheet->getSheetCount() <= $this->sheetIndex) { + $spreadsheet->createSheet(); } - $sheet = $objPHPExcel->setActiveSheetIndex($this->sheetIndex); + $sheet = $spreadsheet->setActiveSheetIndex($this->sheetIndex); $escapeEnclosures = array( "\\" . $this->enclosure, $this->enclosure . $this->enclosure @@ -281,7 +278,7 @@ class CSV extends BaseReader implements IReader // Convert encoding if necessary if ($this->inputEncoding !== 'UTF-8') { - $rowDatum = \PHPExcel\Shared\StringHelper::convertEncoding($rowDatum, 'UTF-8', $this->inputEncoding); + $rowDatum = \PhpSpreadsheet\Shared\StringHelper::convertEncoding($rowDatum, 'UTF-8', $this->inputEncoding); } // Set cell value @@ -302,7 +299,7 @@ class CSV extends BaseReader implements IReader ini_set('auto_detect_line_endings', $lineEnding); // Return - return $objPHPExcel; + return $spreadsheet; } /** diff --git a/src/PhpSpreadsheet/Reader/DefaultReadFilter.php b/src/PhpSpreadsheet/Reader/DefaultReadFilter.php index ce0e5591..062bbb8e 100644 --- a/src/PhpSpreadsheet/Reader/DefaultReadFilter.php +++ b/src/PhpSpreadsheet/Reader/DefaultReadFilter.php @@ -1,11 +1,9 @@ openFile($pFilename); $fileHandle = $this->fileHandle; - + // Read sample data (first 2 KB will do) $data = fread($fileHandle, 2048); fclose($fileHandle); @@ -105,7 +102,7 @@ class Excel2003XML extends BaseReader implements IReader /** - * Reads names of the worksheets from a file, without parsing the whole file to a PHPExcel object + * Reads names of the worksheets from a file, without parsing the whole file to a PhpSpreadsheet object * * @param string $pFilename * @throws Exception @@ -125,7 +122,7 @@ class Excel2003XML extends BaseReader implements IReader $xml = simplexml_load_string( $this->securityScan(file_get_contents($pFilename)), 'SimpleXMLElement', - \PHPExcel\Settings::getLibXmlLoaderOptions() + \PhpSpreadsheet\Settings::getLibXmlLoaderOptions() ); $namespaces = $xml->getNamespaces(true); @@ -157,7 +154,7 @@ class Excel2003XML extends BaseReader implements IReader $xml = simplexml_load_string( $this->securityScan(file_get_contents($pFilename)), 'SimpleXMLElement', - \PHPExcel\Settings::getLibXmlLoaderOptions() + \PhpSpreadsheet\Settings::getLibXmlLoaderOptions() ); $namespaces = $xml->getNamespaces(true); @@ -203,7 +200,7 @@ class Excel2003XML extends BaseReader implements IReader } } - $tmpInfo['lastColumnLetter'] = \PHPExcel\Cell::stringFromColumnIndex($tmpInfo['lastColumnIndex']); + $tmpInfo['lastColumnLetter'] = \PhpSpreadsheet\Cell::stringFromColumnIndex($tmpInfo['lastColumnIndex']); $tmpInfo['totalColumns'] = $tmpInfo['lastColumnIndex'] + 1; $worksheetInfo[] = $tmpInfo; @@ -215,20 +212,20 @@ class Excel2003XML extends BaseReader implements IReader /** - * Loads PHPExcel from file + * Loads PhpSpreadsheet from file * * @param string $pFilename - * @return \PHPExcel\Spreadsheet + * @return \PhpSpreadsheet\Spreadsheet * @throws Exception */ public function load($pFilename) { - // Create new PHPExcel - $objPHPExcel = new PHPExcel(); - $objPHPExcel->removeSheetByIndex(0); + // Create new PhpSpreadsheet + $spreadsheet = new PhpSpreadsheet(); + $spreadsheet->removeSheetByIndex(0); // Load into this instance - return $this->loadIntoExisting($pFilename, $objPHPExcel); + return $this->loadIntoExisting($pFilename, $spreadsheet); } protected static function identifyFixedStyleValue($styleList, &$styleAttributeValue) @@ -276,38 +273,38 @@ class Excel2003XML extends BaseReader implements IReader } /** - * Loads PHPExcel from file into PHPExcel instance + * Loads PhpSpreadsheet from file into PhpSpreadsheet instance * * @param string $pFilename - * @param PHPExcel $objPHPExcel - * @return PHPExcel - * @throws Exception + * @param \PhpSpreadsheet\Spreadsheet $spreadsheet + * @return \PhpSpreadsheet\Spreadsheet + * @throws Exception */ - public function loadIntoExisting($pFilename, PHPExcel $objPHPExcel) + public function loadIntoExisting($pFilename, \PhpSpreadsheet\Spreadsheet $spreadsheet) { $fromFormats = array('\-', '\ '); $toFormats = array('-', ' '); $underlineStyles = array ( - \PHPExcel\Style\Font::UNDERLINE_NONE, - \PHPExcel\Style\Font::UNDERLINE_DOUBLE, - \PHPExcel\Style\Font::UNDERLINE_DOUBLEACCOUNTING, - \PHPExcel\Style\Font::UNDERLINE_SINGLE, - \PHPExcel\Style\Font::UNDERLINE_SINGLEACCOUNTING + \PhpSpreadsheet\Style\Font::UNDERLINE_NONE, + \PhpSpreadsheet\Style\Font::UNDERLINE_DOUBLE, + \PhpSpreadsheet\Style\Font::UNDERLINE_DOUBLEACCOUNTING, + \PhpSpreadsheet\Style\Font::UNDERLINE_SINGLE, + \PhpSpreadsheet\Style\Font::UNDERLINE_SINGLEACCOUNTING ); $verticalAlignmentStyles = array ( - \PHPExcel\Style\Alignment::VERTICAL_BOTTOM, - \PHPExcel\Style\Alignment::VERTICAL_TOP, - \PHPExcel\Style\Alignment::VERTICAL_CENTER, - \PHPExcel\Style\Alignment::VERTICAL_JUSTIFY + \PhpSpreadsheet\Style\Alignment::VERTICAL_BOTTOM, + \PhpSpreadsheet\Style\Alignment::VERTICAL_TOP, + \PhpSpreadsheet\Style\Alignment::VERTICAL_CENTER, + \PhpSpreadsheet\Style\Alignment::VERTICAL_JUSTIFY ); $horizontalAlignmentStyles = array ( - \PHPExcel\Style\Alignment::HORIZONTAL_GENERAL, - \PHPExcel\Style\Alignment::HORIZONTAL_LEFT, - \PHPExcel\Style\Alignment::HORIZONTAL_RIGHT, - \PHPExcel\Style\Alignment::HORIZONTAL_CENTER, - \PHPExcel\Style\Alignment::HORIZONTAL_CENTER_CONTINUOUS, - \PHPExcel\Style\Alignment::HORIZONTAL_JUSTIFY + \PhpSpreadsheet\Style\Alignment::HORIZONTAL_GENERAL, + \PhpSpreadsheet\Style\Alignment::HORIZONTAL_LEFT, + \PhpSpreadsheet\Style\Alignment::HORIZONTAL_RIGHT, + \PhpSpreadsheet\Style\Alignment::HORIZONTAL_CENTER, + \PhpSpreadsheet\Style\Alignment::HORIZONTAL_CENTER_CONTINUOUS, + \PhpSpreadsheet\Style\Alignment::HORIZONTAL_JUSTIFY ); $timezoneObj = new \DateTimeZone('Europe/London'); @@ -325,11 +322,11 @@ class Excel2003XML extends BaseReader implements IReader $xml = simplexml_load_string( $this->securityScan(file_get_contents($pFilename)), 'SimpleXMLElement', - \PHPExcel\Settings::getLibXmlLoaderOptions() + \PhpSpreadsheet\Settings::getLibXmlLoaderOptions() ); $namespaces = $xml->getNamespaces(true); - $docProps = $objPHPExcel->getProperties(); + $docProps = $spreadsheet->getProperties(); if (isset($xml->DocumentProperties[0])) { foreach ($xml->DocumentProperties[0] as $propertyName => $propertyValue) { switch ($propertyName) { @@ -374,27 +371,27 @@ class Excel2003XML extends BaseReader implements IReader if (isset($xml->CustomDocumentProperties)) { foreach ($xml->CustomDocumentProperties[0] as $propertyName => $propertyValue) { $propertyAttributes = $propertyValue->attributes($namespaces['dt']); - $propertyName = preg_replace_callback('/_x([0-9a-z]{4})_/', '\\PHPExcel\\Reader\\Excel2003XML::hex2str', $propertyName); - $propertyType = \PHPExcel\Document\Properties::PROPERTY_TYPE_UNKNOWN; + $propertyName = preg_replace_callback('/_x([0-9a-z]{4})_/', '\\PhpSpreadsheet\\Reader\\Excel2003XML::hex2str', $propertyName); + $propertyType = \PhpSpreadsheet\Document\Properties::PROPERTY_TYPE_UNKNOWN; switch ((string) $propertyAttributes) { case 'string': - $propertyType = \PHPExcel\Document\Properties::PROPERTY_TYPE_STRING; + $propertyType = \PhpSpreadsheet\Document\Properties::PROPERTY_TYPE_STRING; $propertyValue = trim($propertyValue); break; case 'boolean': - $propertyType = \PHPExcel\Document\Properties::PROPERTY_TYPE_BOOLEAN; + $propertyType = \PhpSpreadsheet\Document\Properties::PROPERTY_TYPE_BOOLEAN; $propertyValue = (bool) $propertyValue; break; case 'integer': - $propertyType = \PHPExcel\Document\Properties::PROPERTY_TYPE_INTEGER; + $propertyType = \PhpSpreadsheet\Document\Properties::PROPERTY_TYPE_INTEGER; $propertyValue = intval($propertyValue); break; case 'float': - $propertyType = \PHPExcel\Document\Properties::PROPERTY_TYPE_FLOAT; + $propertyType = \PhpSpreadsheet\Document\Properties::PROPERTY_TYPE_FLOAT; $propertyValue = floatval($propertyValue); break; case 'dateTime.tz': - $propertyType = \PHPExcel\Document\Properties::PROPERTY_TYPE_DATE; + $propertyType = \PhpSpreadsheet\Document\Properties::PROPERTY_TYPE_DATE; $propertyValue = strtotime(trim($propertyValue)); break; } @@ -440,7 +437,7 @@ class Excel2003XML extends BaseReader implements IReader // echo $borderStyleKey.' = '.$borderStyleValue.'
'; switch ($borderStyleKey) { case 'LineStyle': - $thisBorder['style'] = \PHPExcel\Style\Border::BORDER_MEDIUM; + $thisBorder['style'] = \PhpSpreadsheet\Style\Border::BORDER_MEDIUM; // $thisBorder['style'] = $borderStyleValue; break; case 'Weight': @@ -540,14 +537,14 @@ class Excel2003XML extends BaseReader implements IReader // echo '

Worksheet: ', $worksheet_ss['Name'],'

'; // // Create new Worksheet - $objPHPExcel->createSheet(); - $objPHPExcel->setActiveSheetIndex($worksheetID); + $spreadsheet->createSheet(); + $spreadsheet->setActiveSheetIndex($worksheetID); if (isset($worksheet_ss['Name'])) { $worksheetName = self::convertStringEncoding((string) $worksheet_ss['Name'], $this->charSet); // Use false for $updateFormulaCellReferences to prevent adjustment of worksheet references in // formula cells... during the load, all formulae should be correct, and we're simply bringing // the worksheet name in line with the formula, not the reverse - $objPHPExcel->getActiveSheet()->setTitle($worksheetName, false); + $spreadsheet->getActiveSheet()->setTitle($worksheetName, false); } $columnID = 'A'; @@ -555,12 +552,12 @@ class Excel2003XML extends BaseReader implements IReader foreach ($worksheet->Table->Column as $columnData) { $columnData_ss = $columnData->attributes($namespaces['ss']); if (isset($columnData_ss['Index'])) { - $columnID = \PHPExcel\Cell::stringFromColumnIndex($columnData_ss['Index']-1); + $columnID = \PhpSpreadsheet\Cell::stringFromColumnIndex($columnData_ss['Index']-1); } if (isset($columnData_ss['Width'])) { $columnWidth = $columnData_ss['Width']; // echo 'Setting column width for '.$columnID.' to '.$columnWidth.'
'; - $objPHPExcel->getActiveSheet()->getColumnDimension($columnID)->setWidth($columnWidth / 5.4); + $spreadsheet->getActiveSheet()->getColumnDimension($columnID)->setWidth($columnWidth / 5.4); } ++$columnID; } @@ -581,7 +578,7 @@ class Excel2003XML extends BaseReader implements IReader foreach ($rowData->Cell as $cell) { $cell_ss = $cell->attributes($namespaces['ss']); if (isset($cell_ss['Index'])) { - $columnID = \PHPExcel\Cell::stringFromColumnIndex($cell_ss['Index']-1); + $columnID = \PhpSpreadsheet\Cell::stringFromColumnIndex($cell_ss['Index']-1); } $cellRange = $columnID.$rowID; @@ -595,14 +592,14 @@ class Excel2003XML extends BaseReader implements IReader $columnTo = $columnID; if (isset($cell_ss['MergeAcross'])) { $additionalMergedCells += (int)$cell_ss['MergeAcross']; - $columnTo = \PHPExcel\Cell::stringFromColumnIndex(\PHPExcel\Cell::columnIndexFromString($columnID) + $cell_ss['MergeAcross'] -1); + $columnTo = \PhpSpreadsheet\Cell::stringFromColumnIndex(\PhpSpreadsheet\Cell::columnIndexFromString($columnID) + $cell_ss['MergeAcross'] -1); } $rowTo = $rowID; if (isset($cell_ss['MergeDown'])) { $rowTo = $rowTo + $cell_ss['MergeDown']; } $cellRange .= ':'.$columnTo.$rowTo; - $objPHPExcel->getActiveSheet()->mergeCells($cellRange); + $spreadsheet->getActiveSheet()->mergeCells($cellRange); } $cellIsSet = $hasCalculatedValue = false; @@ -618,7 +615,7 @@ class Excel2003XML extends BaseReader implements IReader } if (isset($cell->Data)) { $cellValue = $cellData = $cell->Data; - $type = \PHPExcel\Cell_DataType::TYPE_NULL; + $type = \PhpSpreadsheet\Cell_DataType::TYPE_NULL; $cellData_ss = $cellData->attributes($namespaces['ss']); if (isset($cellData_ss['Type'])) { $cellDataType = $cellData_ss['Type']; @@ -634,33 +631,33 @@ class Excel2003XML extends BaseReader implements IReader */ case 'String': $cellValue = self::convertStringEncoding($cellValue, $this->charSet); - $type = \PHPExcel\Cell\DataType::TYPE_STRING; + $type = \PhpSpreadsheet\Cell\DataType::TYPE_STRING; break; case 'Number': - $type = \PHPExcel\Cell\DataType::TYPE_NUMERIC; + $type = \PhpSpreadsheet\Cell\DataType::TYPE_NUMERIC; $cellValue = (float) $cellValue; if (floor($cellValue) == $cellValue) { $cellValue = (integer) $cellValue; } break; case 'Boolean': - $type = \PHPExcel\Cell\DataType::TYPE_BOOL; + $type = \PhpSpreadsheet\Cell\DataType::TYPE_BOOL; $cellValue = ($cellValue != 0); break; case 'DateTime': - $type = \PHPExcel\Cell\DataType::TYPE_NUMERIC; - $cellValue = \PHPExcel\Shared\Date::PHPToExcel(strtotime($cellValue)); + $type = \PhpSpreadsheet\Cell\DataType::TYPE_NUMERIC; + $cellValue = \PhpSpreadsheet\Shared\Date::PHPToExcel(strtotime($cellValue)); break; case 'Error': - $type = \PHPExcel\Cell\DataType::TYPE_ERROR; + $type = \PhpSpreadsheet\Cell\DataType::TYPE_ERROR; break; } } if ($hasCalculatedValue) { // echo 'FORMULA
'; - $type = \PHPExcel\Cell\DataType::TYPE_FORMULA; - $columnNumber = \PHPExcel\Cell::columnIndexFromString($columnID); + $type = \PhpSpreadsheet\Cell\DataType::TYPE_FORMULA; + $columnNumber = \PhpSpreadsheet\Cell::columnIndexFromString($columnID); if (substr($cellDataFormula, 0, 3) == 'of:') { $cellDataFormula = substr($cellDataFormula, 3); // echo 'Before: ', $cellDataFormula,'
'; @@ -706,7 +703,7 @@ class Excel2003XML extends BaseReader implements IReader if ($columnReference{0} == '[') { $columnReference = $columnNumber + trim($columnReference, '[]'); } - $A1CellReference = \PHPExcel\Cell::stringFromColumnIndex($columnReference-1).$rowReference; + $A1CellReference = \PhpSpreadsheet\Cell::stringFromColumnIndex($columnReference-1).$rowReference; $value = substr_replace($value, $A1CellReference, $cellReference[0][1], strlen($cellReference[0][0])); } } @@ -720,10 +717,10 @@ class Excel2003XML extends BaseReader implements IReader // echo 'Cell '.$columnID.$rowID.' is a '.$type.' with a value of '.(($hasCalculatedValue) ? $cellDataFormula : $cellValue).'
'; // - $objPHPExcel->getActiveSheet()->getCell($columnID.$rowID)->setValueExplicit((($hasCalculatedValue) ? $cellDataFormula : $cellValue), $type); + $spreadsheet->getActiveSheet()->getCell($columnID.$rowID)->setValueExplicit((($hasCalculatedValue) ? $cellDataFormula : $cellValue), $type); if ($hasCalculatedValue) { // echo 'Formula result is '.$cellValue.'
'; - $objPHPExcel->getActiveSheet()->getCell($columnID.$rowID)->setCalculatedValue($cellValue); + $spreadsheet->getActiveSheet()->getCell($columnID.$rowID)->setCalculatedValue($cellValue); } $cellIsSet = $rowHasData = true; } @@ -741,7 +738,7 @@ class Excel2003XML extends BaseReader implements IReader // echo $annotation,'
'; $annotation = strip_tags($node); // echo 'Annotation: ', $annotation,'
'; - $objPHPExcel->getActiveSheet()->getComment($columnID.$rowID)->setAuthor(self::convertStringEncoding($author, $this->charSet))->setText($this->parseRichText($annotation)); + $spreadsheet->getActiveSheet()->getComment($columnID.$rowID)->setAuthor(self::convertStringEncoding($author, $this->charSet))->setText($this->parseRichText($annotation)); } if (($cellIsSet) && (isset($cell_ss['StyleID']))) { @@ -751,10 +748,10 @@ class Excel2003XML extends BaseReader implements IReader // echo 'Cell '.$columnID.$rowID.'
'; // print_r($this->styles[$style]); // echo '
'; - if (!$objPHPExcel->getActiveSheet()->cellExists($columnID.$rowID)) { - $objPHPExcel->getActiveSheet()->getCell($columnID.$rowID)->setValue(null); + if (!$spreadsheet->getActiveSheet()->cellExists($columnID.$rowID)) { + $spreadsheet->getActiveSheet()->getCell($columnID.$rowID)->setValue(null); } - $objPHPExcel->getActiveSheet()->getStyle($cellRange)->applyFromArray($this->styles[$style]); + $spreadsheet->getActiveSheet()->getStyle($cellRange)->applyFromArray($this->styles[$style]); } } ++$columnID; @@ -771,7 +768,7 @@ class Excel2003XML extends BaseReader implements IReader if (isset($row_ss['Height'])) { $rowHeight = $row_ss['Height']; // echo 'Setting row height to '.$rowHeight.'
'; - $objPHPExcel->getActiveSheet()->getRowDimension($rowID)->setRowHeight($rowHeight); + $spreadsheet->getActiveSheet()->getRowDimension($rowID)->setRowHeight($rowHeight); } } @@ -782,14 +779,14 @@ class Excel2003XML extends BaseReader implements IReader } // Return - return $objPHPExcel; + return $spreadsheet; } protected static function convertStringEncoding($string, $charset) { if ($charset != 'UTF-8') { - return \PHPExcel\Shared\StringHelper::convertEncoding($string, 'UTF-8', $charset); + return \PhpSpreadsheet\Shared\StringHelper::convertEncoding($string, 'UTF-8', $charset); } return $string; } @@ -797,7 +794,7 @@ class Excel2003XML extends BaseReader implements IReader protected function parseRichText($is = '') { - $value = new \PHPExcel\RichText(); + $value = new \PhpSpreadsheet\RichText(); $value->createText(self::convertStringEncoding($is, $this->charSet)); diff --git a/src/PhpSpreadsheet/Reader/Excel2007.php b/src/PhpSpreadsheet/Reader/Excel2007.php index b453ed48..c3829500 100644 --- a/src/PhpSpreadsheet/Reader/Excel2007.php +++ b/src/PhpSpreadsheet/Reader/Excel2007.php @@ -1,11 +1,9 @@ readFilter = new DefaultReadFilter(); - $this->referenceHelper = \PHPExcel\ReferenceHelper::getInstance(); + $this->referenceHelper = \PhpSpreadsheet\ReferenceHelper::getInstance(); } /** @@ -66,7 +63,7 @@ class Excel2007 extends BaseReader implements IReader throw new Exception("Could not open " . $pFilename . " for reading! File does not exist."); } - $zipClass = \PHPExcel\Settings::getZipClass(); + $zipClass = \PhpSpreadsheet\Settings::getZipClass(); // Check if zip class exists // if (!class_exists($zipClass, false)) { @@ -83,7 +80,7 @@ class Excel2007 extends BaseReader implements IReader $this->getFromZipArchive($zip, "_rels/.rels") ), 'SimpleXMLElement', - \PHPExcel\Settings::getLibXmlLoaderOptions() + \PhpSpreadsheet\Settings::getLibXmlLoaderOptions() ); if ($rels !== false) { foreach ($rels->Relationship as $rel) { @@ -118,7 +115,7 @@ class Excel2007 extends BaseReader implements IReader $worksheetNames = array(); - $zipClass = \PHPExcel\Settings::getZipClass(); + $zipClass = \PhpSpreadsheet\Settings::getZipClass(); $zip = new $zipClass; $zip->open($pFilename); @@ -128,7 +125,7 @@ class Excel2007 extends BaseReader implements IReader $this->securityScan( $this->getFromZipArchive($zip, "_rels/.rels"), 'SimpleXMLElement', - \PHPExcel\Settings::getLibXmlLoaderOptions() + \PhpSpreadsheet\Settings::getLibXmlLoaderOptions() ) ); //~ http://schemas.openxmlformats.org/package/2006/relationships"); foreach ($rels->Relationship as $rel) { @@ -138,7 +135,7 @@ class Excel2007 extends BaseReader implements IReader $this->securityScan( $this->getFromZipArchive($zip, "{$rel['Target']}"), 'SimpleXMLElement', - \PHPExcel\Settings::getLibXmlLoaderOptions() + \PhpSpreadsheet\Settings::getLibXmlLoaderOptions() ) ); //~ http://schemas.openxmlformats.org/spreadsheetml/2006/main" @@ -172,7 +169,7 @@ class Excel2007 extends BaseReader implements IReader $worksheetInfo = array(); - $zipClass = \PHPExcel\Settings::getZipClass(); + $zipClass = \PhpSpreadsheet\Settings::getZipClass(); $zip = new $zipClass; $zip->open($pFilename); @@ -181,7 +178,7 @@ class Excel2007 extends BaseReader implements IReader //~ http://schemas.openxmlformats.org/package/2006/relationships" $this->securityScan($this->getFromZipArchive($zip, "_rels/.rels")), 'SimpleXMLElement', - \PHPExcel\Settings::getLibXmlLoaderOptions() + \PhpSpreadsheet\Settings::getLibXmlLoaderOptions() ); foreach ($rels->Relationship as $rel) { if ($rel["Type"] == "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument") { @@ -192,7 +189,7 @@ class Excel2007 extends BaseReader implements IReader $this->getFromZipArchive($zip, "$dir/_rels/" . basename($rel["Target"]) . ".rels") ), 'SimpleXMLElement', - \PHPExcel\Settings::getLibXmlLoaderOptions() + \PhpSpreadsheet\Settings::getLibXmlLoaderOptions() ); $relsWorkbook->registerXPathNamespace("rel", "http://schemas.openxmlformats.org/package/2006/relationships"); @@ -209,7 +206,7 @@ class Excel2007 extends BaseReader implements IReader $this->getFromZipArchive($zip, "{$rel['Target']}") ), 'SimpleXMLElement', - \PHPExcel\Settings::getLibXmlLoaderOptions() + \PhpSpreadsheet\Settings::getLibXmlLoaderOptions() ); if ($xmlWorkbook->sheets) { $dir = dirname($rel["Target"]); @@ -227,10 +224,10 @@ class Excel2007 extends BaseReader implements IReader $xml = new \XMLReader(); $res = $xml->xml( $this->securityScanFile( - 'zip://'.\PHPExcel\Shared\File::realpath($pFilename).'#'."$dir/$fileWorksheet" + 'zip://'.\PhpSpreadsheet\Shared\File::realpath($pFilename).'#'."$dir/$fileWorksheet" ), null, - \PHPExcel\Settings::getLibXmlLoaderOptions() + \PhpSpreadsheet\Settings::getLibXmlLoaderOptions() ); $xml->setParserProperty(2, true); @@ -249,7 +246,7 @@ class Excel2007 extends BaseReader implements IReader $xml->close(); $tmpInfo['lastColumnIndex'] = $tmpInfo['totalColumns'] - 1; - $tmpInfo['lastColumnLetter'] = \PHPExcel\Cell::stringFromColumnIndex($tmpInfo['lastColumnIndex']); + $tmpInfo['lastColumnLetter'] = \PhpSpreadsheet\Cell::stringFromColumnIndex($tmpInfo['lastColumnIndex']); $worksheetInfo[] = $tmpInfo; } @@ -316,11 +313,11 @@ class Excel2007 extends BaseReader implements IReader // echo 'GETTING SHARED FORMULA', PHP_EOL; // echo 'Master is ', $sharedFormulas[$instance]['master'], PHP_EOL; // echo 'Formula is ', $sharedFormulas[$instance]['formula'], PHP_EOL; - $master = \PHPExcel\Cell::coordinateFromString($sharedFormulas[$instance]['master']); - $current = \PHPExcel\Cell::coordinateFromString($r); + $master = \PhpSpreadsheet\Cell::coordinateFromString($sharedFormulas[$instance]['master']); + $current = \PhpSpreadsheet\Cell::coordinateFromString($r); $difference = array(0, 0); - $difference[0] = \PHPExcel\Cell::columnIndexFromString($current[0]) - \PHPExcel\Cell::columnIndexFromString($master[0]); + $difference[0] = \PhpSpreadsheet\Cell::columnIndexFromString($current[0]) - \PhpSpreadsheet\Cell::columnIndexFromString($master[0]); $difference[1] = $current[1] - $master[1]; $value = $this->referenceHelper->updateFormulaReferences($sharedFormulas[$instance]['formula'], 'A1', $difference[0], $difference[1]); @@ -336,7 +333,7 @@ class Excel2007 extends BaseReader implements IReader if (strpos($fileName, '//') !== false) { $fileName = substr($fileName, strpos($fileName, '//') + 1); } - $fileName = \PHPExcel\Shared\File::realpath($fileName); + $fileName = \PhpSpreadsheet\Shared\File::realpath($fileName); // Sadly, some 3rd party xlsx generators don't use consistent case for filenaming // so we need to load case-insensitively from the zip file @@ -370,14 +367,14 @@ class Excel2007 extends BaseReader implements IReader } // Initialisations - $excel = new \PHPExcel\Spreadsheet; + $excel = new \PhpSpreadsheet\Spreadsheet; $excel->removeSheetByIndex(0); if (!$this->readDataOnly) { $excel->removeCellStyleXfByIndex(0); // remove the default style $excel->removeCellXfByIndex(0); // remove the default style } - $zipClass = \PHPExcel\Settings::getZipClass(); + $zipClass = \PhpSpreadsheet\Settings::getZipClass(); $zip = new $zipClass; $zip->open($pFilename); @@ -387,7 +384,7 @@ class Excel2007 extends BaseReader implements IReader //~ http://schemas.openxmlformats.org/package/2006/relationships" $this->securityScan($this->getFromZipArchive($zip, "xl/_rels/workbook.xml.rels")), 'SimpleXMLElement', - \PHPExcel\Settings::getLibXmlLoaderOptions() + \PhpSpreadsheet\Settings::getLibXmlLoaderOptions() ); foreach ($wbRels->Relationship as $rel) { switch ($rel["Type"]) { @@ -398,7 +395,7 @@ class Excel2007 extends BaseReader implements IReader $xmlTheme = simplexml_load_string( $this->securityScan($this->getFromZipArchive($zip, "xl/{$rel['Target']}")), 'SimpleXMLElement', - \PHPExcel\Settings::getLibXmlLoaderOptions() + \PhpSpreadsheet\Settings::getLibXmlLoaderOptions() ); if (is_object($xmlTheme)) { $xmlThemeName = $xmlTheme->attributes(); @@ -433,7 +430,7 @@ class Excel2007 extends BaseReader implements IReader //~ http://schemas.openxmlformats.org/package/2006/relationships" $this->securityScan($this->getFromZipArchive($zip, "_rels/.rels")), 'SimpleXMLElement', - \PHPExcel\Settings::getLibXmlLoaderOptions() + \PhpSpreadsheet\Settings::getLibXmlLoaderOptions() ); foreach ($rels->Relationship as $rel) { switch ($rel["Type"]) { @@ -441,7 +438,7 @@ class Excel2007 extends BaseReader implements IReader $xmlCore = simplexml_load_string( $this->securityScan($this->getFromZipArchive($zip, "{$rel['Target']}")), 'SimpleXMLElement', - \PHPExcel\Settings::getLibXmlLoaderOptions() + \PhpSpreadsheet\Settings::getLibXmlLoaderOptions() ); if (is_object($xmlCore)) { $xmlCore->registerXPathNamespace("dc", "http://purl.org/dc/elements/1.1/"); @@ -463,7 +460,7 @@ class Excel2007 extends BaseReader implements IReader $xmlCore = simplexml_load_string( $this->securityScan($this->getFromZipArchive($zip, "{$rel['Target']}")), 'SimpleXMLElement', - \PHPExcel\Settings::getLibXmlLoaderOptions() + \PhpSpreadsheet\Settings::getLibXmlLoaderOptions() ); if (is_object($xmlCore)) { $docProps = $excel->getProperties(); @@ -479,7 +476,7 @@ class Excel2007 extends BaseReader implements IReader $xmlCore = simplexml_load_string( $this->securityScan($this->getFromZipArchive($zip, "{$rel['Target']}")), 'SimpleXMLElement', - \PHPExcel\Settings::getLibXmlLoaderOptions() + \PhpSpreadsheet\Settings::getLibXmlLoaderOptions() ); if (is_object($xmlCore)) { $docProps = $excel->getProperties(); @@ -490,8 +487,8 @@ class Excel2007 extends BaseReader implements IReader $cellDataOfficeChildren = $xmlProperty->children('http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes'); $attributeType = $cellDataOfficeChildren->getName(); $attributeValue = (string) $cellDataOfficeChildren->{$attributeType}; - $attributeValue = \PHPExcel\Document\Properties::convertProperty($attributeValue, $attributeType); - $attributeType = \PHPExcel\Document\Properties::convertPropertyType($attributeType); + $attributeValue = \PhpSpreadsheet\Document\Properties::convertProperty($attributeValue, $attributeType); + $attributeType = \PhpSpreadsheet\Document\Properties::convertPropertyType($attributeType); $docProps->setCustomProperty($propertyName, $attributeValue, $attributeType); } } @@ -510,7 +507,7 @@ class Excel2007 extends BaseReader implements IReader //~ http://schemas.openxmlformats.org/package/2006/relationships" $this->securityScan($this->getFromZipArchive($zip, "$dir/_rels/" . basename($rel["Target"]) . ".rels")), 'SimpleXMLElement', - \PHPExcel\Settings::getLibXmlLoaderOptions() + \PhpSpreadsheet\Settings::getLibXmlLoaderOptions() ); $relsWorkbook->registerXPathNamespace("rel", "http://schemas.openxmlformats.org/package/2006/relationships"); @@ -520,12 +517,12 @@ class Excel2007 extends BaseReader implements IReader //~ http://schemas.openxmlformats.org/spreadsheetml/2006/main" $this->securityScan($this->getFromZipArchive($zip, "$dir/$xpath[Target]")), 'SimpleXMLElement', - \PHPExcel\Settings::getLibXmlLoaderOptions() + \PhpSpreadsheet\Settings::getLibXmlLoaderOptions() ); if (isset($xmlStrings) && isset($xmlStrings->si)) { foreach ($xmlStrings->si as $val) { if (isset($val->t)) { - $sharedStrings[] = \PHPExcel\Shared\StringHelper::controlCharacterOOXML2PHP((string) $val->t); + $sharedStrings[] = \PhpSpreadsheet\Shared\StringHelper::controlCharacterOOXML2PHP((string) $val->t); } elseif (isset($val->r)) { $sharedStrings[] = $this->parseRichText($val); } @@ -565,7 +562,7 @@ class Excel2007 extends BaseReader implements IReader //~ http://schemas.openxmlformats.org/spreadsheetml/2006/main" $this->securityScan($this->getFromZipArchive($zip, "$dir/$xpath[Target]")), 'SimpleXMLElement', - \PHPExcel\Settings::getLibXmlLoaderOptions() + \PhpSpreadsheet\Settings::getLibXmlLoaderOptions() ); $numFmts = null; if ($xmlStyles && $xmlStyles->numFmts[0]) { @@ -576,7 +573,7 @@ class Excel2007 extends BaseReader implements IReader } if (!$this->readDataOnly && $xmlStyles) { foreach ($xmlStyles->cellXfs->xf as $xf) { - $numFmt = \PHPExcel\Style\NumberFormat::FORMAT_GENERAL; + $numFmt = \PhpSpreadsheet\Style\NumberFormat::FORMAT_GENERAL; if ($xf["numFmtId"]) { if (isset($numFmts)) { @@ -591,8 +588,8 @@ class Excel2007 extends BaseReader implements IReader // But there's a lot of naughty homebrew xlsx writers that do use "reserved" id values that aren't actually used // So we make allowance for them rather than lose formatting masks if ((int)$xf["numFmtId"] < 164 && - \PHPExcel\Style\NumberFormat::builtInFormatCode((int)$xf["numFmtId"]) !== '') { - $numFmt = \PHPExcel\Style\NumberFormat::builtInFormatCode((int)$xf["numFmtId"]); + \PhpSpreadsheet\Style\NumberFormat::builtInFormatCode((int)$xf["numFmtId"]) !== '') { + $numFmt = \PhpSpreadsheet\Style\NumberFormat::builtInFormatCode((int)$xf["numFmtId"]); } } $quotePrefix = false; @@ -612,19 +609,19 @@ class Excel2007 extends BaseReader implements IReader $styles[] = $style; // add style to cellXf collection - $objStyle = new \PHPExcel\Style; + $objStyle = new \PhpSpreadsheet\Style; self::readStyle($objStyle, $style); $excel->addCellXf($objStyle); } foreach ($xmlStyles->cellStyleXfs->xf as $xf) { - $numFmt = \PHPExcel\Style\NumberFormat::FORMAT_GENERAL; + $numFmt = \PhpSpreadsheet\Style\NumberFormat::FORMAT_GENERAL; if ($numFmts && $xf["numFmtId"]) { $tmpNumFmt = self::getArrayItem($numFmts->xpath("sml:numFmt[@numFmtId=$xf[numFmtId]]")); if (isset($tmpNumFmt["formatCode"])) { $numFmt = (string) $tmpNumFmt["formatCode"]; } elseif ((int)$xf["numFmtId"] < 165) { - $numFmt = \PHPExcel\Style\NumberFormat::builtInFormatCode((int)$xf["numFmtId"]); + $numFmt = \PhpSpreadsheet\Style\NumberFormat::builtInFormatCode((int)$xf["numFmtId"]); } } @@ -640,7 +637,7 @@ class Excel2007 extends BaseReader implements IReader $cellStyles[] = $cellStyle; // add style to cellStyleXf collection - $objStyle = new \PHPExcel\Style; + $objStyle = new \PhpSpreadsheet\Style; self::readStyle($objStyle, $cellStyle); $excel->addCellStyleXf($objStyle); } @@ -651,7 +648,7 @@ class Excel2007 extends BaseReader implements IReader // Conditional Styles if ($xmlStyles->dxfs) { foreach ($xmlStyles->dxfs->dxf as $dxf) { - $style = new \PHPExcel\Style(false, true); + $style = new \PhpSpreadsheet\Style(false, true); self::readStyle($style, $dxf); $dxfs[] = $style; } @@ -662,7 +659,7 @@ class Excel2007 extends BaseReader implements IReader if (intval($cellStyle['builtinId']) == 0) { if (isset($cellStyles[intval($cellStyle['xfId'])])) { // Set default style - $style = new \PHPExcel\Style; + $style = new \PhpSpreadsheet\Style; self::readStyle($style, $cellStyles[intval($cellStyle['xfId'])]); // normal style, currently not using it for anything @@ -676,15 +673,15 @@ class Excel2007 extends BaseReader implements IReader //~ http://schemas.openxmlformats.org/spreadsheetml/2006/main" $this->securityScan($this->getFromZipArchive($zip, "{$rel['Target']}")), 'SimpleXMLElement', - \PHPExcel\Settings::getLibXmlLoaderOptions() + \PhpSpreadsheet\Settings::getLibXmlLoaderOptions() ); // Set base date if ($xmlWorkbook->workbookPr) { - \PHPExcel\Shared\Date::setExcelCalendar(\PHPExcel\Shared\Date::CALENDAR_WINDOWS_1900); + \PhpSpreadsheet\Shared\Date::setExcelCalendar(\PhpSpreadsheet\Shared\Date::CALENDAR_WINDOWS_1900); if (isset($xmlWorkbook->workbookPr['date1904'])) { if (self::boolean((string) $xmlWorkbook->workbookPr['date1904'])) { - \PHPExcel\Shared\Date::setExcelCalendar(\PHPExcel\Shared\Date::CALENDAR_MAC_1904); + \PhpSpreadsheet\Shared\Date::setExcelCalendar(\PhpSpreadsheet\Shared\Date::CALENDAR_MAC_1904); } } } @@ -723,7 +720,7 @@ class Excel2007 extends BaseReader implements IReader //~ http://schemas.openxmlformats.org/spreadsheetml/2006/main" $this->securityScan($this->getFromZipArchive($zip, "$dir/$fileWorksheet")), 'SimpleXMLElement', - \PHPExcel\Settings::getLibXmlLoaderOptions() + \PhpSpreadsheet\Settings::getLibXmlLoaderOptions() ); $sharedFormulas = array(); @@ -832,22 +829,22 @@ class Excel2007 extends BaseReader implements IReader foreach ($xmlSheet->cols->col as $col) { for ($i = intval($col["min"]) - 1; $i < intval($col["max"]); ++$i) { if ($col["style"] && !$this->readDataOnly) { - $docSheet->getColumnDimension(\PHPExcel\Cell::stringFromColumnIndex($i))->setXfIndex(intval($col["style"])); + $docSheet->getColumnDimension(\PhpSpreadsheet\Cell::stringFromColumnIndex($i))->setXfIndex(intval($col["style"])); } if (self::boolean($col["bestFit"])) { - //$docSheet->getColumnDimension(\PHPExcel\Cell::stringFromColumnIndex($i))->setAutoSize(true); + //$docSheet->getColumnDimension(\PhpSpreadsheet\Cell::stringFromColumnIndex($i))->setAutoSize(true); } if (self::boolean($col["hidden"])) { - // echo \PHPExcel\Cell::stringFromColumnIndex($i), ': HIDDEN COLUMN',PHP_EOL; - $docSheet->getColumnDimension(\PHPExcel\Cell::stringFromColumnIndex($i))->setVisible(false); + // echo \PhpSpreadsheet\Cell::stringFromColumnIndex($i), ': HIDDEN COLUMN',PHP_EOL; + $docSheet->getColumnDimension(\PhpSpreadsheet\Cell::stringFromColumnIndex($i))->setVisible(false); } if (self::boolean($col["collapsed"])) { - $docSheet->getColumnDimension(\PHPExcel\Cell::stringFromColumnIndex($i))->setCollapsed(true); + $docSheet->getColumnDimension(\PhpSpreadsheet\Cell::stringFromColumnIndex($i))->setCollapsed(true); } if ($col["outlineLevel"] > 0) { - $docSheet->getColumnDimension(\PHPExcel\Cell::stringFromColumnIndex($i))->setOutlineLevel(intval($col["outlineLevel"])); + $docSheet->getColumnDimension(\PhpSpreadsheet\Cell::stringFromColumnIndex($i))->setOutlineLevel(intval($col["outlineLevel"])); } - $docSheet->getColumnDimension(\PHPExcel\Cell::stringFromColumnIndex($i))->setWidth(floatval($col["width"])); + $docSheet->getColumnDimension(\PhpSpreadsheet\Cell::stringFromColumnIndex($i))->setWidth(floatval($col["width"])); if (intval($col["max"]) == 16384) { break; @@ -897,7 +894,7 @@ class Excel2007 extends BaseReader implements IReader // Read cell? if ($this->getReadFilter() !== null) { - $coordinates = \PHPExcel\Cell::coordinateFromString($r); + $coordinates = \PhpSpreadsheet\Cell::coordinateFromString($r); if (!$this->getReadFilter()->readCell($coordinates[0], $coordinates[1], $docSheet->getTitle())) { continue; @@ -916,7 +913,7 @@ class Excel2007 extends BaseReader implements IReader if ((string)$c->v != '') { $value = $sharedStrings[intval($c->v)]; - if ($value instanceof \PHPExcel\RichText) { + if ($value instanceof \PhpSpreadsheet\RichText) { $value = clone $value; } } else { @@ -983,7 +980,7 @@ class Excel2007 extends BaseReader implements IReader } // Rich text? - if ($value instanceof \PHPExcel\RichText && $this->readDataOnly) { + if ($value instanceof \PhpSpreadsheet\RichText && $this->readDataOnly) { $value = $value->getPlainText(); } @@ -1012,7 +1009,7 @@ class Excel2007 extends BaseReader implements IReader if (!$this->readDataOnly && $xmlSheet && $xmlSheet->conditionalFormatting) { foreach ($xmlSheet->conditionalFormatting as $conditional) { foreach ($conditional->cfRule as $cfRule) { - if (((string)$cfRule["type"] == \PHPExcel\Style\Conditional::CONDITION_NONE || (string)$cfRule["type"] == \PHPExcel\Style\Conditional::CONDITION_CELLIS || (string)$cfRule["type"] == \PHPExcel\Style\Conditional::CONDITION_CONTAINSTEXT || (string)$cfRule["type"] == \PHPExcel\Style\Conditional::CONDITION_EXPRESSION) && isset($dxfs[intval($cfRule["dxfId"])])) { + if (((string)$cfRule["type"] == \PhpSpreadsheet\Style\Conditional::CONDITION_NONE || (string)$cfRule["type"] == \PhpSpreadsheet\Style\Conditional::CONDITION_CELLIS || (string)$cfRule["type"] == \PhpSpreadsheet\Style\Conditional::CONDITION_CONTAINSTEXT || (string)$cfRule["type"] == \PhpSpreadsheet\Style\Conditional::CONDITION_EXPRESSION) && isset($dxfs[intval($cfRule["dxfId"])])) { $conditionals[(string) $conditional["sqref"]][intval($cfRule["priority"])] = $cfRule; } } @@ -1022,7 +1019,7 @@ class Excel2007 extends BaseReader implements IReader ksort($cfRules); $conditionalStyles = array(); foreach ($cfRules as $cfRule) { - $objConditional = new \PHPExcel\Style\Conditional(); + $objConditional = new \PhpSpreadsheet\Style\Conditional(); $objConditional->setConditionType((string)$cfRule["type"]); $objConditional->setOperatorType((string)$cfRule["operator"]); @@ -1076,17 +1073,17 @@ class Excel2007 extends BaseReader implements IReader $column = $autoFilter->getColumnByOffset((integer) $filterColumn["colId"]); // Check for standard filters if ($filterColumn->filters) { - $column->setFilterType(\PHPExcel\Worksheet\AutoFilter\Column::AUTOFILTER_FILTERTYPE_FILTER); + $column->setFilterType(\PhpSpreadsheet\Worksheet\AutoFilter\Column::AUTOFILTER_FILTERTYPE_FILTER); $filters = $filterColumn->filters; if ((isset($filters["blank"])) && ($filters["blank"] == 1)) { // Operator is undefined, but always treated as EQUAL - $column->createRule()->setRule(null, '')->setRuleType(\PHPExcel\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_FILTER); + $column->createRule()->setRule(null, '')->setRuleType(\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_FILTER); } // Standard filters are always an OR join, so no join rule needs to be set // Entries can be either filter elements foreach ($filters->filter as $filterRule) { // Operator is undefined, but always treated as EQUAL - $column->createRule()->setRule(null, (string) $filterRule["val"])->setRuleType(\PHPExcel\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_FILTER); + $column->createRule()->setRule(null, (string) $filterRule["val"])->setRuleType(\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_FILTER); } // Or Date Group elements foreach ($filters->dateGroupItem as $dateGroupItem) { @@ -1103,29 +1100,29 @@ class Excel2007 extends BaseReader implements IReader ), (string) $dateGroupItem["dateTimeGrouping"] ) - ->setRuleType(\PHPExcel\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DATEGROUP); + ->setRuleType(\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DATEGROUP); } } // Check for custom filters if ($filterColumn->customFilters) { - $column->setFilterType(\PHPExcel\Worksheet\AutoFilter\Column::AUTOFILTER_FILTERTYPE_CUSTOMFILTER); + $column->setFilterType(\PhpSpreadsheet\Worksheet\AutoFilter\Column::AUTOFILTER_FILTERTYPE_CUSTOMFILTER); $customFilters = $filterColumn->customFilters; // Custom filters can an AND or an OR join; // and there should only ever be one or two entries if ((isset($customFilters["and"])) && ($customFilters["and"] == 1)) { - $column->setJoin(\PHPExcel\Worksheet\AutoFilter\Column::AUTOFILTER_COLUMN_JOIN_AND); + $column->setJoin(\PhpSpreadsheet\Worksheet\AutoFilter\Column::AUTOFILTER_COLUMN_JOIN_AND); } foreach ($customFilters->customFilter as $filterRule) { $column->createRule()->setRule( (string) $filterRule["operator"], (string) $filterRule["val"] ) - ->setRuleType(\PHPExcel\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_CUSTOMFILTER); + ->setRuleType(\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_CUSTOMFILTER); } } // Check for dynamic filters if ($filterColumn->dynamicFilter) { - $column->setFilterType(\PHPExcel\Worksheet\AutoFilter\Column::AUTOFILTER_FILTERTYPE_DYNAMICFILTER); + $column->setFilterType(\PhpSpreadsheet\Worksheet\AutoFilter\Column::AUTOFILTER_FILTERTYPE_DYNAMICFILTER); // We should only ever have one dynamic filter foreach ($filterColumn->dynamicFilter as $filterRule) { $column->createRule()->setRule( @@ -1134,7 +1131,7 @@ class Excel2007 extends BaseReader implements IReader (string) $filterRule["val"], (string) $filterRule["type"] ) - ->setRuleType(\PHPExcel\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMICFILTER); + ->setRuleType(\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMICFILTER); if (isset($filterRule["val"])) { $column->setAttribute('val', (string) $filterRule["val"]); } @@ -1145,21 +1142,21 @@ class Excel2007 extends BaseReader implements IReader } // Check for dynamic filters if ($filterColumn->top10) { - $column->setFilterType(\PHPExcel\Worksheet\AutoFilter\Column::AUTOFILTER_FILTERTYPE_TOPTENFILTER); + $column->setFilterType(\PhpSpreadsheet\Worksheet\AutoFilter\Column::AUTOFILTER_FILTERTYPE_TOPTENFILTER); // We should only ever have one top10 filter foreach ($filterColumn->top10 as $filterRule) { $column->createRule()->setRule( (((isset($filterRule["percent"])) && ($filterRule["percent"] == 1)) - ? \PHPExcel\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_PERCENT - : \PHPExcel\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_BY_VALUE + ? \PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_PERCENT + : \PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_BY_VALUE ), (string) $filterRule["val"], (((isset($filterRule["top"])) && ($filterRule["top"] == 1)) - ? \PHPExcel\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_TOP - : \PHPExcel\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_BOTTOM + ? \PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_TOP + : \PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_BOTTOM ) ) - ->setRuleType(\PHPExcel\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_TOPTENFILTER); + ->setRuleType(\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_TOPTENFILTER); } } } @@ -1248,14 +1245,14 @@ class Excel2007 extends BaseReader implements IReader if ($xmlSheet && $xmlSheet->rowBreaks && $xmlSheet->rowBreaks->brk && !$this->readDataOnly) { foreach ($xmlSheet->rowBreaks->brk as $brk) { if ($brk["man"]) { - $docSheet->setBreak("A$brk[id]", \PHPExcel\Worksheet::BREAK_ROW); + $docSheet->setBreak("A$brk[id]", \PhpSpreadsheet\Worksheet::BREAK_ROW); } } } if ($xmlSheet && $xmlSheet->colBreaks && $xmlSheet->colBreaks->brk && !$this->readDataOnly) { foreach ($xmlSheet->colBreaks->brk as $brk) { if ($brk["man"]) { - $docSheet->setBreak(\PHPExcel\Cell::stringFromColumnIndex((string) $brk["id"]) . "1", \PHPExcel\Worksheet::BREAK_COLUMN); + $docSheet->setBreak(\PhpSpreadsheet\Cell::stringFromColumnIndex((string) $brk["id"]) . "1", \PhpSpreadsheet\Worksheet::BREAK_COLUMN); } } } @@ -1269,7 +1266,7 @@ class Excel2007 extends BaseReader implements IReader $stRange = $docSheet->shrinkRangeToFit($range); // Extract all cell references in $range - foreach (\PHPExcel\Cell::extractAllCellReferencesInRange($stRange) as $reference) { + foreach (\PhpSpreadsheet\Cell::extractAllCellReferencesInRange($stRange) as $reference) { // Create validation $docValidation = $docSheet->getCell($reference)->getDataValidation(); $docValidation->setType((string) $dataValidation["type"]); @@ -1301,7 +1298,7 @@ class Excel2007 extends BaseReader implements IReader $this->getFromZipArchive($zip, dirname("$dir/$fileWorksheet") . "/_rels/" . basename($fileWorksheet) . ".rels") ), 'SimpleXMLElement', - \PHPExcel\Settings::getLibXmlLoaderOptions() + \PhpSpreadsheet\Settings::getLibXmlLoaderOptions() ); foreach ($relsWorksheet->Relationship as $ele) { if ($ele["Type"] == "http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink") { @@ -1316,7 +1313,7 @@ class Excel2007 extends BaseReader implements IReader // Link url $linkRel = $hyperlink->attributes('http://schemas.openxmlformats.org/officeDocument/2006/relationships'); - foreach (\PHPExcel\Cell::extractAllCellReferencesInRange($hyperlink['ref']) as $cellReference) { + foreach (\PhpSpreadsheet\Cell::extractAllCellReferencesInRange($hyperlink['ref']) as $cellReference) { $cell = $docSheet->getCell($cellReference); if (isset($linkRel['id'])) { $hyperlinkUrl = $hyperlinks[ (string)$linkRel['id'] ]; @@ -1349,7 +1346,7 @@ class Excel2007 extends BaseReader implements IReader $this->getFromZipArchive($zip, dirname("$dir/$fileWorksheet") . "/_rels/" . basename($fileWorksheet) . ".rels") ), 'SimpleXMLElement', - \PHPExcel\Settings::getLibXmlLoaderOptions() + \PhpSpreadsheet\Settings::getLibXmlLoaderOptions() ); foreach ($relsWorksheet->Relationship as $ele) { if ($ele["Type"] == "http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments") { @@ -1364,11 +1361,11 @@ class Excel2007 extends BaseReader implements IReader // Loop through comments foreach ($comments as $relName => $relPath) { // Load comments file - $relPath = \PHPExcel\Shared\File::realpath(dirname("$dir/$fileWorksheet") . "/" . $relPath); + $relPath = \PhpSpreadsheet\Shared\File::realpath(dirname("$dir/$fileWorksheet") . "/" . $relPath); $commentsFile = simplexml_load_string( $this->securityScan($this->getFromZipArchive($zip, $relPath)), 'SimpleXMLElement', - \PHPExcel\Settings::getLibXmlLoaderOptions() + \PhpSpreadsheet\Settings::getLibXmlLoaderOptions() ); // Utility variables @@ -1391,11 +1388,11 @@ class Excel2007 extends BaseReader implements IReader // Loop through VML comments foreach ($vmlComments as $relName => $relPath) { // Load VML comments file - $relPath = \PHPExcel\Shared\File::realpath(dirname("$dir/$fileWorksheet") . "/" . $relPath); + $relPath = \PhpSpreadsheet\Shared\File::realpath(dirname("$dir/$fileWorksheet") . "/" . $relPath); $vmlCommentsFile = simplexml_load_string( $this->securityScan($this->getFromZipArchive($zip, $relPath)), 'SimpleXMLElement', - \PHPExcel\Settings::getLibXmlLoaderOptions() + \PhpSpreadsheet\Settings::getLibXmlLoaderOptions() ); $vmlCommentsFile->registerXPathNamespace('v', 'urn:schemas-microsoft-com:vml'); @@ -1466,7 +1463,7 @@ class Excel2007 extends BaseReader implements IReader $this->getFromZipArchive($zip, dirname("$dir/$fileWorksheet") . "/_rels/" . basename($fileWorksheet) . ".rels") ), 'SimpleXMLElement', - \PHPExcel\Settings::getLibXmlLoaderOptions() + \PhpSpreadsheet\Settings::getLibXmlLoaderOptions() ); $vmlRelationship = ''; @@ -1484,7 +1481,7 @@ class Excel2007 extends BaseReader implements IReader $this->getFromZipArchive($zip, dirname($vmlRelationship) . '/_rels/' . basename($vmlRelationship) . '.rels') ), 'SimpleXMLElement', - \PHPExcel\Settings::getLibXmlLoaderOptions() + \PhpSpreadsheet\Settings::getLibXmlLoaderOptions() ); $drawings = array(); foreach ($relsVML->Relationship as $ele) { @@ -1497,7 +1494,7 @@ class Excel2007 extends BaseReader implements IReader $vmlDrawing = simplexml_load_string( $this->securityScan($this->getFromZipArchive($zip, $vmlRelationship)), 'SimpleXMLElement', - \PHPExcel\Settings::getLibXmlLoaderOptions() + \PhpSpreadsheet\Settings::getLibXmlLoaderOptions() ); $vmlDrawing->registerXPathNamespace('v', 'urn:schemas-microsoft-com:vml'); @@ -1512,12 +1509,12 @@ class Excel2007 extends BaseReader implements IReader $imageData = $imageData->attributes('urn:schemas-microsoft-com:office:office'); $style = self::toCSSArray((string)$shape['style']); - $hfImages[(string) $shape['id']] = new \PHPExcel\Worksheet\HeaderFooterDrawing(); + $hfImages[(string) $shape['id']] = new \PhpSpreadsheet\Worksheet\HeaderFooterDrawing(); if (isset($imageData['title'])) { $hfImages[(string) $shape['id']]->setName((string)$imageData['title']); } - $hfImages[(string) $shape['id']]->setPath("zip://".\PHPExcel\Shared_File::realpath($pFilename)."#" . $drawings[(string)$imageData['relid']], false); + $hfImages[(string) $shape['id']]->setPath("zip://".\PhpSpreadsheet\Shared_File::realpath($pFilename)."#" . $drawings[(string)$imageData['relid']], false); $hfImages[(string) $shape['id']]->setResizeProportional(false); $hfImages[(string) $shape['id']]->setWidth($style['width']); $hfImages[(string) $shape['id']]->setHeight($style['height']); @@ -1542,7 +1539,7 @@ class Excel2007 extends BaseReader implements IReader $this->getFromZipArchive($zip, dirname("$dir/$fileWorksheet") . "/_rels/" . basename($fileWorksheet) . ".rels") ), 'SimpleXMLElement', - \PHPExcel\Settings::getLibXmlLoaderOptions() + \PhpSpreadsheet\Settings::getLibXmlLoaderOptions() ); $drawings = array(); foreach ($relsWorksheet->Relationship as $ele) { @@ -1559,7 +1556,7 @@ class Excel2007 extends BaseReader implements IReader $this->getFromZipArchive($zip, dirname($fileDrawing) . "/_rels/" . basename($fileDrawing) . ".rels") ), 'SimpleXMLElement', - \PHPExcel\Settings::getLibXmlLoaderOptions() + \PhpSpreadsheet\Settings::getLibXmlLoaderOptions() ); $images = array(); @@ -1580,7 +1577,7 @@ class Excel2007 extends BaseReader implements IReader $xmlDrawing = simplexml_load_string( $this->securityScan($this->getFromZipArchive($zip, $fileDrawing)), 'SimpleXMLElement', - \PHPExcel\Settings::getLibXmlLoaderOptions() + \PhpSpreadsheet\Settings::getLibXmlLoaderOptions() )->children("http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing"); if ($xmlDrawing->oneCellAnchor) { @@ -1589,32 +1586,32 @@ class Excel2007 extends BaseReader implements IReader $blip = $oneCellAnchor->pic->blipFill->children("http://schemas.openxmlformats.org/drawingml/2006/main")->blip; $xfrm = $oneCellAnchor->pic->spPr->children("http://schemas.openxmlformats.org/drawingml/2006/main")->xfrm; $outerShdw = $oneCellAnchor->pic->spPr->children("http://schemas.openxmlformats.org/drawingml/2006/main")->effectLst->outerShdw; - $objDrawing = new \PHPExcel\Worksheet\Drawing; + $objDrawing = new \PhpSpreadsheet\Worksheet\Drawing; $objDrawing->setName((string) self::getArrayItem($oneCellAnchor->pic->nvPicPr->cNvPr->attributes(), "name")); $objDrawing->setDescription((string) self::getArrayItem($oneCellAnchor->pic->nvPicPr->cNvPr->attributes(), "descr")); $objDrawing->setPath( - "zip://".\PHPExcel\Shared\File::realpath($pFilename)."#" . + "zip://".\PhpSpreadsheet\Shared\File::realpath($pFilename)."#" . $images[(string) self::getArrayItem( $blip->attributes("http://schemas.openxmlformats.org/officeDocument/2006/relationships"), "embed" )], false ); - $objDrawing->setCoordinates(\PHPExcel\Cell::stringFromColumnIndex((string) $oneCellAnchor->from->col) . ($oneCellAnchor->from->row + 1)); - $objDrawing->setOffsetX(\PHPExcel\Shared\Drawing::EMUToPixels($oneCellAnchor->from->colOff)); - $objDrawing->setOffsetY(\PHPExcel\Shared\Drawing::EMUToPixels($oneCellAnchor->from->rowOff)); + $objDrawing->setCoordinates(\PhpSpreadsheet\Cell::stringFromColumnIndex((string) $oneCellAnchor->from->col) . ($oneCellAnchor->from->row + 1)); + $objDrawing->setOffsetX(\PhpSpreadsheet\Shared\Drawing::EMUToPixels($oneCellAnchor->from->colOff)); + $objDrawing->setOffsetY(\PhpSpreadsheet\Shared\Drawing::EMUToPixels($oneCellAnchor->from->rowOff)); $objDrawing->setResizeProportional(false); - $objDrawing->setWidth(\PHPExcel\Shared\Drawing::EMUToPixels(self::getArrayItem($oneCellAnchor->ext->attributes(), "cx"))); - $objDrawing->setHeight(\PHPExcel\Shared\Drawing::EMUToPixels(self::getArrayItem($oneCellAnchor->ext->attributes(), "cy"))); + $objDrawing->setWidth(\PhpSpreadsheet\Shared\Drawing::EMUToPixels(self::getArrayItem($oneCellAnchor->ext->attributes(), "cx"))); + $objDrawing->setHeight(\PhpSpreadsheet\Shared\Drawing::EMUToPixels(self::getArrayItem($oneCellAnchor->ext->attributes(), "cy"))); if ($xfrm) { - $objDrawing->setRotation(\PHPExcel\Shared\Drawing::angleToDegrees(self::getArrayItem($xfrm->attributes(), "rot"))); + $objDrawing->setRotation(\PhpSpreadsheet\Shared\Drawing::angleToDegrees(self::getArrayItem($xfrm->attributes(), "rot"))); } if ($outerShdw) { $shadow = $objDrawing->getShadow(); $shadow->setVisible(true); - $shadow->setBlurRadius(\PHPExcel\Shared\Drawing::EMUTopixels(self::getArrayItem($outerShdw->attributes(), "blurRad"))); - $shadow->setDistance(\PHPExcel\Shared\Drawing::EMUTopixels(self::getArrayItem($outerShdw->attributes(), "dist"))); - $shadow->setDirection(\PHPExcel\Shared\Drawing::angleToDegrees(self::getArrayItem($outerShdw->attributes(), "dir"))); + $shadow->setBlurRadius(\PhpSpreadsheet\Shared\Drawing::EMUTopixels(self::getArrayItem($outerShdw->attributes(), "blurRad"))); + $shadow->setDistance(\PhpSpreadsheet\Shared\Drawing::EMUTopixels(self::getArrayItem($outerShdw->attributes(), "dist"))); + $shadow->setDirection(\PhpSpreadsheet\Shared\Drawing::angleToDegrees(self::getArrayItem($outerShdw->attributes(), "dir"))); $shadow->setAlignment((string) self::getArrayItem($outerShdw->attributes(), "algn")); $shadow->getColor()->setRGB(self::getArrayItem($outerShdw->srgbClr->attributes(), "val")); $shadow->setAlpha(self::getArrayItem($outerShdw->srgbClr->alpha->attributes(), "val") / 1000); @@ -1622,11 +1619,11 @@ class Excel2007 extends BaseReader implements IReader $objDrawing->setWorksheet($docSheet); } else { // ? Can charts be positioned with a oneCellAnchor ? - $coordinates = \PHPExcel\Cell::stringFromColumnIndex((string) $oneCellAnchor->from->col) . ($oneCellAnchor->from->row + 1); - $offsetX = \PHPExcel\Shared\Drawing::EMUToPixels($oneCellAnchor->from->colOff); - $offsetY = \PHPExcel\Shared\Drawing::EMUToPixels($oneCellAnchor->from->rowOff); - $width = \PHPExcel\Shared\Drawing::EMUToPixels(self::getArrayItem($oneCellAnchor->ext->attributes(), "cx")); - $height = \PHPExcel\Shared\Drawing::EMUToPixels(self::getArrayItem($oneCellAnchor->ext->attributes(), "cy")); + $coordinates = \PhpSpreadsheet\Cell::stringFromColumnIndex((string) $oneCellAnchor->from->col) . ($oneCellAnchor->from->row + 1); + $offsetX = \PhpSpreadsheet\Shared\Drawing::EMUToPixels($oneCellAnchor->from->colOff); + $offsetY = \PhpSpreadsheet\Shared\Drawing::EMUToPixels($oneCellAnchor->from->rowOff); + $width = \PhpSpreadsheet\Shared\Drawing::EMUToPixels(self::getArrayItem($oneCellAnchor->ext->attributes(), "cx")); + $height = \PhpSpreadsheet\Shared\Drawing::EMUToPixels(self::getArrayItem($oneCellAnchor->ext->attributes(), "cy")); } } } @@ -1636,45 +1633,45 @@ class Excel2007 extends BaseReader implements IReader $blip = $twoCellAnchor->pic->blipFill->children("http://schemas.openxmlformats.org/drawingml/2006/main")->blip; $xfrm = $twoCellAnchor->pic->spPr->children("http://schemas.openxmlformats.org/drawingml/2006/main")->xfrm; $outerShdw = $twoCellAnchor->pic->spPr->children("http://schemas.openxmlformats.org/drawingml/2006/main")->effectLst->outerShdw; - $objDrawing = new \PHPExcel\Worksheet\Drawing; + $objDrawing = new \PhpSpreadsheet\Worksheet\Drawing; $objDrawing->setName((string) self::getArrayItem($twoCellAnchor->pic->nvPicPr->cNvPr->attributes(), "name")); $objDrawing->setDescription((string) self::getArrayItem($twoCellAnchor->pic->nvPicPr->cNvPr->attributes(), "descr")); $objDrawing->setPath( - "zip://".\PHPExcel\Shared\File::realpath($pFilename)."#" . + "zip://".\PhpSpreadsheet\Shared\File::realpath($pFilename)."#" . $images[(string) self::getArrayItem( $blip->attributes("http://schemas.openxmlformats.org/officeDocument/2006/relationships"), "embed" )], false ); - $objDrawing->setCoordinates(\PHPExcel\Cell::stringFromColumnIndex((string) $twoCellAnchor->from->col) . ($twoCellAnchor->from->row + 1)); - $objDrawing->setOffsetX(\PHPExcel\Shared\Drawing::EMUToPixels($twoCellAnchor->from->colOff)); - $objDrawing->setOffsetY(\PHPExcel\Shared\Drawing::EMUToPixels($twoCellAnchor->from->rowOff)); + $objDrawing->setCoordinates(\PhpSpreadsheet\Cell::stringFromColumnIndex((string) $twoCellAnchor->from->col) . ($twoCellAnchor->from->row + 1)); + $objDrawing->setOffsetX(\PhpSpreadsheet\Shared\Drawing::EMUToPixels($twoCellAnchor->from->colOff)); + $objDrawing->setOffsetY(\PhpSpreadsheet\Shared\Drawing::EMUToPixels($twoCellAnchor->from->rowOff)); $objDrawing->setResizeProportional(false); if ($xfrm) { - $objDrawing->setWidth(\PHPExcel\Shared\Drawing::EMUToPixels(self::getArrayItem($xfrm->ext->attributes(), "cx"))); - $objDrawing->setHeight(\PHPExcel\Shared\Drawing::EMUToPixels(self::getArrayItem($xfrm->ext->attributes(), "cy"))); - $objDrawing->setRotation(\PHPExcel\Shared\Drawing::angleToDegrees(self::getArrayItem($xfrm->attributes(), "rot"))); + $objDrawing->setWidth(\PhpSpreadsheet\Shared\Drawing::EMUToPixels(self::getArrayItem($xfrm->ext->attributes(), "cx"))); + $objDrawing->setHeight(\PhpSpreadsheet\Shared\Drawing::EMUToPixels(self::getArrayItem($xfrm->ext->attributes(), "cy"))); + $objDrawing->setRotation(\PhpSpreadsheet\Shared\Drawing::angleToDegrees(self::getArrayItem($xfrm->attributes(), "rot"))); } if ($outerShdw) { $shadow = $objDrawing->getShadow(); $shadow->setVisible(true); - $shadow->setBlurRadius(\PHPExcel\Shared\Drawing::EMUTopixels(self::getArrayItem($outerShdw->attributes(), "blurRad"))); - $shadow->setDistance(\PHPExcel\Shared\Drawing::EMUTopixels(self::getArrayItem($outerShdw->attributes(), "dist"))); - $shadow->setDirection(\PHPExcel\Shared\Drawing::angleToDegrees(self::getArrayItem($outerShdw->attributes(), "dir"))); + $shadow->setBlurRadius(\PhpSpreadsheet\Shared\Drawing::EMUTopixels(self::getArrayItem($outerShdw->attributes(), "blurRad"))); + $shadow->setDistance(\PhpSpreadsheet\Shared\Drawing::EMUTopixels(self::getArrayItem($outerShdw->attributes(), "dist"))); + $shadow->setDirection(\PhpSpreadsheet\Shared\Drawing::angleToDegrees(self::getArrayItem($outerShdw->attributes(), "dir"))); $shadow->setAlignment((string) self::getArrayItem($outerShdw->attributes(), "algn")); $shadow->getColor()->setRGB(self::getArrayItem($outerShdw->srgbClr->attributes(), "val")); $shadow->setAlpha(self::getArrayItem($outerShdw->srgbClr->alpha->attributes(), "val") / 1000); } $objDrawing->setWorksheet($docSheet); } elseif (($this->includeCharts) && ($twoCellAnchor->graphicFrame)) { - $fromCoordinate = \PHPExcel\Cell::stringFromColumnIndex((string) $twoCellAnchor->from->col) . ($twoCellAnchor->from->row + 1); - $fromOffsetX = \PHPExcel\Shared\Drawing::EMUToPixels($twoCellAnchor->from->colOff); - $fromOffsetY = \PHPExcel\Shared\Drawing::EMUToPixels($twoCellAnchor->from->rowOff); - $toCoordinate = \PHPExcel\Cell::stringFromColumnIndex((string) $twoCellAnchor->to->col) . ($twoCellAnchor->to->row + 1); - $toOffsetX = \PHPExcel\Shared\Drawing::EMUToPixels($twoCellAnchor->to->colOff); - $toOffsetY = \PHPExcel\Shared\Drawing::EMUToPixels($twoCellAnchor->to->rowOff); + $fromCoordinate = \PhpSpreadsheet\Cell::stringFromColumnIndex((string) $twoCellAnchor->from->col) . ($twoCellAnchor->from->row + 1); + $fromOffsetX = \PhpSpreadsheet\Shared\Drawing::EMUToPixels($twoCellAnchor->from->colOff); + $fromOffsetY = \PhpSpreadsheet\Shared\Drawing::EMUToPixels($twoCellAnchor->from->rowOff); + $toCoordinate = \PhpSpreadsheet\Cell::stringFromColumnIndex((string) $twoCellAnchor->to->col) . ($twoCellAnchor->to->row + 1); + $toOffsetX = \PhpSpreadsheet\Shared\Drawing::EMUToPixels($twoCellAnchor->to->colOff); + $toOffsetY = \PhpSpreadsheet\Shared\Drawing::EMUToPixels($twoCellAnchor->to->rowOff); $graphic = $twoCellAnchor->graphicFrame->children("http://schemas.openxmlformats.org/drawingml/2006/main")->graphic; $chartRef = $graphic->graphicData->children("http://schemas.openxmlformats.org/drawingml/2006/chart")->chart; $thisChart = (string) $chartRef->attributes("http://schemas.openxmlformats.org/officeDocument/2006/relationships"); @@ -1805,7 +1802,7 @@ class Excel2007 extends BaseReader implements IReader if ($worksheet = $docSheet->getParent()->getSheetByName($range[0])) { $extractedRange = str_replace('$', '', $range[1]); $scope = $docSheet->getParent()->getSheet($mapSheetId[(integer) $definedName['localSheetId']]); - $excel->addNamedRange(new \PHPExcel\NamedRange((string)$definedName['name'], $worksheet, $extractedRange, true, $scope)); + $excel->addNamedRange(new \PhpSpreadsheet\NamedRange((string)$definedName['name'], $worksheet, $extractedRange, true, $scope)); } } } @@ -1817,7 +1814,7 @@ class Excel2007 extends BaseReader implements IReader $extractedSheetName = ''; if (strpos((string)$definedName, '!') !== false) { // Extract sheet name - $extractedSheetName = \PHPExcel\Worksheet::extractSheetTitle((string)$definedName, true); + $extractedSheetName = \PhpSpreadsheet\Worksheet::extractSheetTitle((string)$definedName, true); $extractedSheetName = $extractedSheetName[0]; // Locate sheet @@ -1829,7 +1826,7 @@ class Excel2007 extends BaseReader implements IReader } if ($locatedSheet !== null) { - $excel->addNamedRange(new \PHPExcel\NamedRange((string)$definedName['name'], $locatedSheet, $extractedRange, false)); + $excel->addNamedRange(new \PhpSpreadsheet\NamedRange((string)$definedName['name'], $locatedSheet, $extractedRange, false)); } } } @@ -1860,7 +1857,7 @@ class Excel2007 extends BaseReader implements IReader $this->getFromZipArchive($zip, "[Content_Types].xml") ), 'SimpleXMLElement', - \PHPExcel\Settings::getLibXmlLoaderOptions() + \PhpSpreadsheet\Settings::getLibXmlLoaderOptions() ); foreach ($contentTypes->Override as $contentType) { switch ($contentType["ContentType"]) { @@ -1872,9 +1869,9 @@ class Excel2007 extends BaseReader implements IReader $this->getFromZipArchive($zip, $chartEntryRef) ), 'SimpleXMLElement', - \PHPExcel\Settings::getLibXmlLoaderOptions() + \PhpSpreadsheet\Settings::getLibXmlLoaderOptions() ); - $objChart = \PHPExcel\Reader\Excel2007\Chart::readChart($chartElements, basename($chartEntryRef, '.xml')); + $objChart = \PhpSpreadsheet\Reader\Excel2007\Chart::readChart($chartElements, basename($chartEntryRef, '.xml')); // echo 'Chart ', $chartEntryRef, '
'; // var_dump($charts[$chartEntryRef]); @@ -1906,13 +1903,13 @@ class Excel2007 extends BaseReader implements IReader if (isset($color["rgb"])) { return (string)$color["rgb"]; } elseif (isset($color["indexed"])) { - return \PHPExcel\Style\Color::indexedColor($color["indexed"]-7, $background)->getARGB(); + return \PhpSpreadsheet\Style\Color::indexedColor($color["indexed"]-7, $background)->getARGB(); } elseif (isset($color["theme"])) { if (self::$theme !== null) { $returnColour = self::$theme->getColourByIndex((int)$color["theme"]); if (isset($color["tint"])) { $tintAdjust = (float) $color["tint"]; - $returnColour = \PHPExcel\Style\Color::changeBrightness($returnColour, $tintAdjust); + $returnColour = \PhpSpreadsheet\Style\Color::changeBrightness($returnColour, $tintAdjust); } return 'FF'.$returnColour; } @@ -1951,7 +1948,7 @@ class Excel2007 extends BaseReader implements IReader $docStyle->getFont()->getColor()->setARGB(self::readColor($style->font->color)); if (isset($style->font->u) && !isset($style->font->u["val"])) { - $docStyle->getFont()->setUnderline(\PHPExcel\Style\Font::UNDERLINE_SINGLE); + $docStyle->getFont()->setUnderline(\PhpSpreadsheet\Style\Font::UNDERLINE_SINGLE); } elseif (isset($style->font->u) && isset($style->font->u["val"])) { $docStyle->getFont()->setUnderline((string)$style->font->u["val"]); } @@ -1997,13 +1994,13 @@ class Excel2007 extends BaseReader implements IReader $diagonalUp = self::boolean((string) $style->border["diagonalUp"]); $diagonalDown = self::boolean((string) $style->border["diagonalDown"]); if (!$diagonalUp && !$diagonalDown) { - $docStyle->getBorders()->setDiagonalDirection(\PHPExcel\Style\Borders::DIAGONAL_NONE); + $docStyle->getBorders()->setDiagonalDirection(\PhpSpreadsheet\Style\Borders::DIAGONAL_NONE); } elseif ($diagonalUp && !$diagonalDown) { - $docStyle->getBorders()->setDiagonalDirection(\PHPExcel\Style\Borders::DIAGONAL_UP); + $docStyle->getBorders()->setDiagonalDirection(\PhpSpreadsheet\Style\Borders::DIAGONAL_UP); } elseif (!$diagonalUp && $diagonalDown) { - $docStyle->getBorders()->setDiagonalDirection(\PHPExcel\Style\Borders::DIAGONAL_DOWN); + $docStyle->getBorders()->setDiagonalDirection(\PhpSpreadsheet\Style\Borders::DIAGONAL_DOWN); } else { - $docStyle->getBorders()->setDiagonalDirection(\PHPExcel\Style\Borders::DIAGONAL_BOTH); + $docStyle->getBorders()->setDiagonalDirection(\PhpSpreadsheet\Style\Borders::DIAGONAL_BOTH); } self::readBorder($docStyle->getBorders()->getLeft(), $style->border->left); self::readBorder($docStyle->getBorders()->getRight(), $style->border->right); @@ -2035,17 +2032,17 @@ class Excel2007 extends BaseReader implements IReader if (isset($style->protection)) { if (isset($style->protection['locked'])) { if (self::boolean((string) $style->protection['locked'])) { - $docStyle->getProtection()->setLocked(\PHPExcel\Style\Protection::PROTECTION_PROTECTED); + $docStyle->getProtection()->setLocked(\PhpSpreadsheet\Style\Protection::PROTECTION_PROTECTED); } else { - $docStyle->getProtection()->setLocked(\PHPExcel\Style\Protection::PROTECTION_UNPROTECTED); + $docStyle->getProtection()->setLocked(\PhpSpreadsheet\Style\Protection::PROTECTION_UNPROTECTED); } } if (isset($style->protection['hidden'])) { if (self::boolean((string) $style->protection['hidden'])) { - $docStyle->getProtection()->setHidden(\PHPExcel\Style\Protection::PROTECTION_PROTECTED); + $docStyle->getProtection()->setHidden(\PhpSpreadsheet\Style\Protection::PROTECTION_PROTECTED); } else { - $docStyle->getProtection()->setHidden(\PHPExcel\Style\Protection::PROTECTION_UNPROTECTED); + $docStyle->getProtection()->setHidden(\PhpSpreadsheet\Style\Protection::PROTECTION_UNPROTECTED); } } } @@ -2068,17 +2065,17 @@ class Excel2007 extends BaseReader implements IReader private function parseRichText($is = null) { - $value = new \PHPExcel\RichText(); + $value = new \PhpSpreadsheet\RichText(); if (isset($is->t)) { - $value->createText(\PHPExcel\Shared\StringHelper::controlCharacterOOXML2PHP((string) $is->t)); + $value->createText(\PhpSpreadsheet\Shared\StringHelper::controlCharacterOOXML2PHP((string) $is->t)); } else { if (is_object($is->r)) { foreach ($is->r as $run) { if (!isset($run->rPr)) { - $objText = $value->createText(\PHPExcel\Shared\StringHelper::controlCharacterOOXML2PHP((string) $run->t)); + $objText = $value->createText(\PhpSpreadsheet\Shared\StringHelper::controlCharacterOOXML2PHP((string) $run->t)); } else { - $objText = $value->createTextRun(\PHPExcel\Shared\StringHelper::controlCharacterOOXML2PHP((string) $run->t)); + $objText = $value->createTextRun(\PhpSpreadsheet\Shared\StringHelper::controlCharacterOOXML2PHP((string) $run->t)); if (isset($run->rPr->rFont["val"])) { $objText->getFont()->setName((string) $run->rPr->rFont["val"]); @@ -2087,7 +2084,7 @@ class Excel2007 extends BaseReader implements IReader $objText->getFont()->setSize((string) $run->rPr->sz["val"]); } if (isset($run->rPr->color)) { - $objText->getFont()->setColor(new \PHPExcel\Style\Color(self::readColor($run->rPr->color))); + $objText->getFont()->setColor(new \PhpSpreadsheet\Style\Color(self::readColor($run->rPr->color))); } if ((isset($run->rPr->b["val"]) && self::boolean((string) $run->rPr->b["val"])) || (isset($run->rPr->b) && !isset($run->rPr->b["val"]))) { @@ -2107,7 +2104,7 @@ class Excel2007 extends BaseReader implements IReader } } if (isset($run->rPr->u) && !isset($run->rPr->u["val"])) { - $objText->getFont()->setUnderline(\PHPExcel\Style\Font::UNDERLINE_SINGLE); + $objText->getFont()->setUnderline(\PhpSpreadsheet\Style\Font::UNDERLINE_SINGLE); } elseif (isset($run->rPr->u) && isset($run->rPr->u["val"])) { $objText->getFont()->setUnderline((string)$run->rPr->u["val"]); } @@ -2139,7 +2136,7 @@ class Excel2007 extends BaseReader implements IReader $UIRels = simplexml_load_string( $this->securityScan($dataRels), 'SimpleXMLElement', - \PHPExcel\Settings::getLibXmlLoaderOptions() + \PhpSpreadsheet\Settings::getLibXmlLoaderOptions() ); if ($UIRels) { // we need to save id and target to avoid parsing customUI.xml and "guess" if it's a pseudo callback who load the image @@ -2189,15 +2186,15 @@ class Excel2007 extends BaseReader implements IReader } if (strpos($item[1], 'pt') !== false) { $item[1] = str_replace('pt', '', $item[1]); - $item[1] = \PHPExcel\Shared\Font::fontSizeToPixels($item[1]); + $item[1] = \PhpSpreadsheet\Shared\Font::fontSizeToPixels($item[1]); } if (strpos($item[1], 'in') !== false) { $item[1] = str_replace('in', '', $item[1]); - $item[1] = \PHPExcel\Shared\Font::inchSizeToPixels($item[1]); + $item[1] = \PhpSpreadsheet\Shared\Font::inchSizeToPixels($item[1]); } if (strpos($item[1], 'cm') !== false) { $item[1] = str_replace('cm', '', $item[1]); - $item[1] = \PHPExcel\Shared\Font::centimeterSizeToPixels($item[1]); + $item[1] = \PhpSpreadsheet\Shared\Font::centimeterSizeToPixels($item[1]); } $style[$item[0]] = $item[1]; diff --git a/src/PhpSpreadsheet/Reader/Excel2007/Chart.php b/src/PhpSpreadsheet/Reader/Excel2007/Chart.php index fef8e974..8866e2f5 100644 --- a/src/PhpSpreadsheet/Reader/Excel2007/Chart.php +++ b/src/PhpSpreadsheet/Reader/Excel2007/Chart.php @@ -1,11 +1,9 @@ getARGB(); + return \PhpSpreadsheet\Style\Color::indexedColor($color["indexed"]-7, $background)->getARGB(); } } @@ -156,9 +153,9 @@ class Chart } } if ($plotAreaLayout == null) { - $plotAreaLayout = new \PHPExcel\Chart\Layout(); + $plotAreaLayout = new \PhpSpreadsheet\Chart\Layout(); } - $plotArea = new \PHPExcel\Chart\PlotArea($plotAreaLayout, $plotSeries); + $plotArea = new \PhpSpreadsheet\Chart\PlotArea($plotAreaLayout, $plotSeries); self::setChartAttributes($plotAreaLayout, $plotAttributes); break; case "plotVisOnly": @@ -187,13 +184,13 @@ class Chart break; } } - $legend = new \PHPExcel\Chart\Legend($legendPos, $legendLayout, $legendOverlay); + $legend = new \PhpSpreadsheet\Chart\Legend($legendPos, $legendLayout, $legendOverlay); break; } } } } - $chart = new \PHPExcel\Chart($chartName, $title, $legend, $plotArea, $plotVisOnly, $dispBlanksAs, $XaxisLabel, $YaxisLabel); + $chart = new \PhpSpreadsheet\Chart($chartName, $title, $legend, $plotArea, $plotVisOnly, $dispBlanksAs, $XaxisLabel, $YaxisLabel); return $chart; } @@ -220,7 +217,7 @@ class Chart } } - return new \PHPExcel\Chart\Title($caption, $titleLayout); + return new \PhpSpreadsheet\Chart\Title($caption, $titleLayout); } private static function chartLayoutDetails($chartDetail, $namespacesChartMeta) @@ -237,7 +234,7 @@ class Chart // echo $detailKey, ' => ',self::getAttribute($detail, 'val', 'string'),PHP_EOL; $layout[$detailKey] = self::getAttribute($detail, 'val', 'string'); } - return new \PHPExcel\Chart\Layout($layout); + return new \PhpSpreadsheet\Chart\Layout($layout); } private static function chartDataSeries($chartDetail, $namespacesChartMeta, $plotType) @@ -288,7 +285,7 @@ class Chart } } } - return new \PHPExcel\Chart\DataSeries($plotType, $multiSeriesType, $plotOrder, $seriesLabel, $seriesCategory, $seriesValues, $smoothLine); + return new \PhpSpreadsheet\Chart\DataSeries($plotType, $multiSeriesType, $plotOrder, $seriesLabel, $seriesCategory, $seriesValues, $smoothLine); } @@ -298,24 +295,24 @@ class Chart $seriesSource = (string) $seriesDetail->strRef->f; $seriesData = self::chartDataSeriesValues($seriesDetail->strRef->strCache->children($namespacesChartMeta['c']), 's'); - return new \PHPExcel\Chart\DataSeriesValues('String', $seriesSource, $seriesData['formatCode'], $seriesData['pointCount'], $seriesData['dataValues'], $marker, $smoothLine); + return new \PhpSpreadsheet\Chart\DataSeriesValues('String', $seriesSource, $seriesData['formatCode'], $seriesData['pointCount'], $seriesData['dataValues'], $marker, $smoothLine); } elseif (isset($seriesDetail->numRef)) { $seriesSource = (string) $seriesDetail->numRef->f; $seriesData = self::chartDataSeriesValues($seriesDetail->numRef->numCache->children($namespacesChartMeta['c'])); - return new \PHPExcel\Chart\DataSeriesValues('Number', $seriesSource, $seriesData['formatCode'], $seriesData['pointCount'], $seriesData['dataValues'], $marker, $smoothLine); + return new \PhpSpreadsheet\Chart\DataSeriesValues('Number', $seriesSource, $seriesData['formatCode'], $seriesData['pointCount'], $seriesData['dataValues'], $marker, $smoothLine); } elseif (isset($seriesDetail->multiLvlStrRef)) { $seriesSource = (string) $seriesDetail->multiLvlStrRef->f; $seriesData = self::chartDataSeriesValuesMultiLevel($seriesDetail->multiLvlStrRef->multiLvlStrCache->children($namespacesChartMeta['c']), 's'); $seriesData['pointCount'] = count($seriesData['dataValues']); - return new \PHPExcel\Chart\DataSeriesValues('String', $seriesSource, $seriesData['formatCode'], $seriesData['pointCount'], $seriesData['dataValues'], $marker, $smoothLine); + return new \PhpSpreadsheet\Chart\DataSeriesValues('String', $seriesSource, $seriesData['formatCode'], $seriesData['pointCount'], $seriesData['dataValues'], $marker, $smoothLine); } elseif (isset($seriesDetail->multiLvlNumRef)) { $seriesSource = (string) $seriesDetail->multiLvlNumRef->f; $seriesData = self::chartDataSeriesValuesMultiLevel($seriesDetail->multiLvlNumRef->multiLvlNumCache->children($namespacesChartMeta['c']), 's'); $seriesData['pointCount'] = count($seriesData['dataValues']); - return new \PHPExcel\Chart\DataSeriesValues('String', $seriesSource, $seriesData['formatCode'], $seriesData['pointCount'], $seriesData['dataValues'], $marker, $smoothLine); + return new \PhpSpreadsheet\Chart\DataSeriesValues('String', $seriesSource, $seriesData['formatCode'], $seriesData['pointCount'], $seriesData['dataValues'], $marker, $smoothLine); } return null; } @@ -389,7 +386,7 @@ class Chart private static function parseRichText($titleDetailPart = null) { - $value = new \PHPExcel\RichText(); + $value = new \PhpSpreadsheet\RichText(); foreach ($titleDetailPart as $titleDetailElementKey => $titleDetailElement) { if (isset($titleDetailElement->t)) { @@ -407,7 +404,7 @@ class Chart $fontColor = (self::getAttribute($titleDetailElement->rPr, 'color', 'string')); if (!is_null($fontColor)) { - $objText->getFont()->setColor(new \PHPExcel\Style\Color(self::readColor($fontColor))); + $objText->getFont()->setColor(new \PhpSpreadsheet\Style\Color(self::readColor($fontColor))); } $bold = self::getAttribute($titleDetailElement->rPr, 'b', 'boolean'); @@ -432,11 +429,11 @@ class Chart $underscore = (self::getAttribute($titleDetailElement->rPr, 'u', 'string')); if (!is_null($underscore)) { if ($underscore == 'sng') { - $objText->getFont()->setUnderline(\PHPExcel\Style\Font::UNDERLINE_SINGLE); + $objText->getFont()->setUnderline(\PhpSpreadsheet\Style\Font::UNDERLINE_SINGLE); } elseif ($underscore == 'dbl') { - $objText->getFont()->setUnderline(\PHPExcel\Style\Font::UNDERLINE_DOUBLE); + $objText->getFont()->setUnderline(\PhpSpreadsheet\Style\Font::UNDERLINE_DOUBLE); } else { - $objText->getFont()->setUnderline(\PHPExcel\Style\Font::UNDERLINE_NONE); + $objText->getFont()->setUnderline(\PhpSpreadsheet\Style\Font::UNDERLINE_NONE); } } diff --git a/src/PhpSpreadsheet/Reader/Excel2007/Theme.php b/src/PhpSpreadsheet/Reader/Excel2007/Theme.php index 62e33ea1..d3aaab78 100644 --- a/src/PhpSpreadsheet/Reader/Excel2007/Theme.php +++ b/src/PhpSpreadsheet/Reader/Excel2007/Theme.php @@ -1,11 +1,9 @@ read($pFilename); return true; - } catch (\PHPExcel\Exception $e) { + } catch (\PhpSpreadsheet\Exception $e) { return false; } } /** - * Reads names of the worksheets from a file, without parsing the whole file to a PHPExcel object + * Reads names of the worksheets from a file, without parsing the whole file to a PhpSpreadsheet object * * @param string $pFilename * @throws Exception @@ -592,7 +589,7 @@ class Excel5 extends BaseReader implements IReader } } - $tmpInfo['lastColumnLetter'] = \PHPExcel\Cell::stringFromColumnIndex($tmpInfo['lastColumnIndex']); + $tmpInfo['lastColumnLetter'] = \PhpSpreadsheet\Cell::stringFromColumnIndex($tmpInfo['lastColumnIndex']); $tmpInfo['totalColumns'] = $tmpInfo['lastColumnIndex'] + 1; $worksheetInfo[] = $tmpInfo; @@ -603,10 +600,10 @@ class Excel5 extends BaseReader implements IReader /** - * Loads PHPExcel from file + * Loads PhpSpreadsheet from file * * @param string $pFilename - * @return \PHPExcel\Spreadsheet + * @return \PhpSpreadsheet\Spreadsheet * @throws Exception */ public function load($pFilename) @@ -615,11 +612,11 @@ class Excel5 extends BaseReader implements IReader $this->loadOLE($pFilename); // Initialisations - $this->phpExcel = new \PHPExcel\Spreadsheet(); - $this->phpExcel->removeSheetByIndex(0); // remove 1st sheet + $this->spreadsheet = new \PhpSpreadsheet\Spreadsheet(); + $this->spreadsheet->removeSheetByIndex(0); // remove 1st sheet if (!$this->readDataOnly) { - $this->phpExcel->removeCellStyleXfByIndex(0); // remove the default style - $this->phpExcel->removeCellXfByIndex(0); // remove the default style + $this->spreadsheet->removeCellStyleXfByIndex(0); // remove the default style + $this->spreadsheet->removeCellXfByIndex(0); // remove the default style } // Read the summary information stream (containing meta data) @@ -722,7 +719,7 @@ class Excel5 extends BaseReader implements IReader } } - foreach ($this->phpExcel->getCellXfCollection() as $objStyle) { + foreach ($this->spreadsheet->getCellXfCollection() as $objStyle) { // fill start and end color $fill = $objStyle->getFill(); @@ -767,7 +764,7 @@ class Excel5 extends BaseReader implements IReader // treat MSODRAWINGGROUP records, workbook-level Escher if (!$this->readDataOnly && $this->drawingGroupData) { - $escherWorkbook = new \PHPExcel\Shared\Escher(); + $escherWorkbook = new \PhpSpreadsheet\Shared\Escher(); $reader = new Excel5\Escher($escherWorkbook); $escherWorkbook = $reader->load($this->drawingGroupData); } @@ -784,8 +781,8 @@ class Excel5 extends BaseReader implements IReader continue; } - // add sheet to PHPExcel object - $this->phpSheet = $this->phpExcel->createSheet(); + // add sheet to PhpSpreadsheet object + $this->phpSheet = $this->spreadsheet->createSheet(); // Use false for $updateFormulaCellReferences to prevent adjustment of worksheet references in formula // cells... during the load, all formulae should be correct, and we're simply bringing the worksheet // name in line with the formula, not the reverse @@ -985,7 +982,7 @@ class Excel5 extends BaseReader implements IReader // treat MSODRAWING records, sheet-level Escher if (!$this->readDataOnly && $this->drawingData) { - $escherWorksheet = new \PHPExcel\Shared\Escher(); + $escherWorksheet = new \PhpSpreadsheet\Shared\Escher(); $reader = new Excel5\Escher($escherWorksheet); $escherWorksheet = $reader->load($this->drawingData); @@ -1009,20 +1006,20 @@ class Excel5 extends BaseReader implements IReader } // calculate the width and height of the shape - list($startColumn, $startRow) = \PHPExcel\Cell::coordinateFromString($spContainer->getStartCoordinates()); - list($endColumn, $endRow) = \PHPExcel\Cell::coordinateFromString($spContainer->getEndCoordinates()); + list($startColumn, $startRow) = \PhpSpreadsheet\Cell::coordinateFromString($spContainer->getStartCoordinates()); + list($endColumn, $endRow) = \PhpSpreadsheet\Cell::coordinateFromString($spContainer->getEndCoordinates()); $startOffsetX = $spContainer->getStartOffsetX(); $startOffsetY = $spContainer->getStartOffsetY(); $endOffsetX = $spContainer->getEndOffsetX(); $endOffsetY = $spContainer->getEndOffsetY(); - $width = \PHPExcel\Shared\Excel5::getDistanceX($this->phpSheet, $startColumn, $startOffsetX, $endColumn, $endOffsetX); - $height = \PHPExcel\Shared\Excel5::getDistanceY($this->phpSheet, $startRow, $startOffsetY, $endRow, $endOffsetY); + $width = \PhpSpreadsheet\Shared\Excel5::getDistanceX($this->phpSheet, $startColumn, $startOffsetX, $endColumn, $endOffsetX); + $height = \PhpSpreadsheet\Shared\Excel5::getDistanceY($this->phpSheet, $startRow, $startOffsetY, $endRow, $endOffsetY); // calculate offsetX and offsetY of the shape - $offsetX = $startOffsetX * \PHPExcel\Shared\Excel5::sizeCol($this->phpSheet, $startColumn) / 1024; - $offsetY = $startOffsetY * \PHPExcel\Shared\Excel5::sizeRow($this->phpSheet, $startRow) / 256; + $offsetX = $startOffsetX * \PhpSpreadsheet\Shared\Excel5::sizeCol($this->phpSheet, $startColumn) / 1024; + $offsetY = $startOffsetY * \PhpSpreadsheet\Shared\Excel5::sizeRow($this->phpSheet, $startRow) / 256; switch ($obj['otObjType']) { case 0x19: @@ -1050,7 +1047,7 @@ class Excel5 extends BaseReader implements IReader // need check because some blip types are not supported by Escher reader such as EMF if ($blip = $BSE->getBlip()) { $ih = imagecreatefromstring($blip->getData()); - $drawing = new \PHPExcel\Worksheet\MemoryDrawing(); + $drawing = new \PhpSpreadsheet\Worksheet\MemoryDrawing(); $drawing->setImageResource($ih); // width, height, offsetX, offsetY @@ -1061,13 +1058,13 @@ class Excel5 extends BaseReader implements IReader $drawing->setOffsetY($offsetY); switch ($blipType) { - case \PHPExcel\Shared\Escher\DggContainer\BstoreContainer\BSE::BLIPTYPE_JPEG: - $drawing->setRenderingFunction(\PHPExcel\Worksheet\MemoryDrawing::RENDERING_JPEG); - $drawing->setMimeType(\PHPExcel\Worksheet\MemoryDrawing::MIMETYPE_JPEG); + case \PhpSpreadsheet\Shared\Escher\DggContainer\BstoreContainer\BSE::BLIPTYPE_JPEG: + $drawing->setRenderingFunction(\PhpSpreadsheet\Worksheet\MemoryDrawing::RENDERING_JPEG); + $drawing->setMimeType(\PhpSpreadsheet\Worksheet\MemoryDrawing::MIMETYPE_JPEG); break; - case \PHPExcel\Shared\Escher\DggContainer\BstoreContainer\BSE::BLIPTYPE_PNG: - $drawing->setRenderingFunction(\PHPExcel\Worksheet\MemoryDrawing::RENDERING_PNG); - $drawing->setMimeType(\PHPExcel\Worksheet\MemoryDrawing::MIMETYPE_PNG); + case \PhpSpreadsheet\Shared\Escher\DggContainer\BstoreContainer\BSE::BLIPTYPE_PNG: + $drawing->setRenderingFunction(\PhpSpreadsheet\Worksheet\MemoryDrawing::RENDERING_PNG); + $drawing->setMimeType(\PhpSpreadsheet\Worksheet\MemoryDrawing::MIMETYPE_PNG); break; } @@ -1085,10 +1082,10 @@ class Excel5 extends BaseReader implements IReader // treat SHAREDFMLA records if ($this->version == self::XLS_BIFF8) { foreach ($this->sharedFormulaParts as $cell => $baseCell) { - list($column, $row) = \PHPExcel\Cell::coordinateFromString($cell); + list($column, $row) = \PhpSpreadsheet\Cell::coordinateFromString($cell); if (($this->getReadFilter() !== null) && $this->getReadFilter()->readCell($column, $row, $this->phpSheet->getTitle())) { $formula = $this->getFormulaFromStructure($this->sharedFormulas[$baseCell], $cell); - $this->phpSheet->getCell($cell)->setValueExplicit('=' . $formula, \PHPExcel\Cell\DataType::TYPE_FORMULA); + $this->phpSheet->getCell($cell)->setValueExplicit('=' . $formula, \PhpSpreadsheet\Cell\DataType::TYPE_FORMULA); } } } @@ -1135,7 +1132,7 @@ class Excel5 extends BaseReader implements IReader $extractedRanges[] = str_replace('$', '', $explodes[1]); // C7:J66 } } - if ($docSheet = $this->phpExcel->getSheetByName($sheetName)) { + if ($docSheet = $this->spreadsheet->getSheetByName($sheetName)) { $docSheet->getPageSetup()->setPrintArea(implode(',', $extractedRanges)); // C7:J66,A1:IV2 } break; @@ -1157,14 +1154,14 @@ class Excel5 extends BaseReader implements IReader // Sheet!$A$1:$IV$2 $explodes = explode('!', $range); if (count($explodes) == 2) { - if ($docSheet = $this->phpExcel->getSheetByName($explodes[0])) { + if ($docSheet = $this->spreadsheet->getSheetByName($explodes[0])) { $extractedRange = $explodes[1]; $extractedRange = str_replace('$', '', $extractedRange); $coordinateStrings = explode(':', $extractedRange); if (count($coordinateStrings) == 2) { - list($firstColumn, $firstRow) = \PHPExcel\Cell::coordinateFromString($coordinateStrings[0]); - list($lastColumn, $lastRow) = \PHPExcel\Cell::coordinateFromString($coordinateStrings[1]); + list($firstColumn, $firstRow) = \PhpSpreadsheet\Cell::coordinateFromString($coordinateStrings[0]); + list($lastColumn, $lastRow) = \PhpSpreadsheet\Cell::coordinateFromString($coordinateStrings[1]); if ($firstColumn == 'A' and $lastColumn == 'IV') { // then we have repeating rows @@ -1184,16 +1181,16 @@ class Excel5 extends BaseReader implements IReader $explodes = explode('!', $definedName['formula']); if (count($explodes) == 2) { - if (($docSheet = $this->phpExcel->getSheetByName($explodes[0])) || - ($docSheet = $this->phpExcel->getSheetByName(trim($explodes[0], "'")))) { + if (($docSheet = $this->spreadsheet->getSheetByName($explodes[0])) || + ($docSheet = $this->spreadsheet->getSheetByName(trim($explodes[0], "'")))) { $extractedRange = $explodes[1]; $extractedRange = str_replace('$', '', $extractedRange); $localOnly = ($definedName['scope'] == 0) ? false : true; - $scope = ($definedName['scope'] == 0) ? null : $this->phpExcel->getSheetByName($this->sheets[$definedName['scope'] - 1]['name']); + $scope = ($definedName['scope'] == 0) ? null : $this->spreadsheet->getSheetByName($this->sheets[$definedName['scope'] - 1]['name']); - $this->phpExcel->addNamedRange(new \PHPExcel\NamedRange((string) $definedName['name'], $docSheet, $extractedRange, $localOnly, $scope)); + $this->spreadsheet->addNamedRange(new \PhpSpreadsheet\NamedRange((string) $definedName['name'], $docSheet, $extractedRange, $localOnly, $scope)); } } else { // Named Value @@ -1203,9 +1200,9 @@ class Excel5 extends BaseReader implements IReader } $this->data = null; - return $this->phpExcel; + return $this->spreadsheet; } - + /** * Read record data from stream, decrypting as required * @@ -1218,12 +1215,12 @@ class Excel5 extends BaseReader implements IReader private function readRecordData($data, $pos, $len) { $data = substr($data, $pos, $len); - + // File not encrypted, or record before encryption start point if ($this->encryption == self::MS_BIFF_CRYPTO_NONE || $pos < $this->encryptionStartPos) { return $data; } - + $recordData = ''; if ($this->encryption == self::MS_BIFF_CRYPTO_RC4) { $oldBlock = floor($this->rc4Pos / self::REKEY_BLOCK); @@ -1269,7 +1266,7 @@ class Excel5 extends BaseReader implements IReader private function loadOLE($pFilename) { // OLE reader - $ole = new \PHPExcel\Shared\OLERead(); + $ole = new \PhpSpreadsheet\Shared\OLERead(); // get excel data, $res = $ole->read($pFilename); // Get workbook data: workbook stream + sheet streams @@ -1343,12 +1340,12 @@ class Excel5 extends BaseReader implements IReader case 0x1E: // null-terminated string prepended by dword string length $byteLength = self::getInt4d($this->summaryInformation, $secOffset + 4 + $offset); $value = substr($this->summaryInformation, $secOffset + 8 + $offset, $byteLength); - $value = \PHPExcel\Shared\StringHelper::convertEncoding($value, 'UTF-8', $codePage); + $value = \PhpSpreadsheet\Shared\StringHelper::convertEncoding($value, 'UTF-8', $codePage); $value = rtrim($value); break; case 0x40: // Filetime (64-bit value representing the number of 100-nanosecond intervals since January 1, 1601) // PHP-time - $value = \PHPExcel\Shared\OLE::OLE2LocalDate(substr($this->summaryInformation, $secOffset + 4 + $offset, 8)); + $value = \PhpSpreadsheet\Shared\OLE::OLE2LocalDate(substr($this->summaryInformation, $secOffset + 4 + $offset, 8)); break; case 0x47: // Clipboard format // not needed yet, fix later if necessary @@ -1357,61 +1354,61 @@ class Excel5 extends BaseReader implements IReader switch ($id) { case 0x01: // Code Page - $codePage = \PHPExcel\Shared\CodePage::numberToName($value); + $codePage = \PhpSpreadsheet\Shared\CodePage::numberToName($value); break; case 0x02: // Title - $this->phpExcel->getProperties()->setTitle($value); + $this->spreadsheet->getProperties()->setTitle($value); break; case 0x03: // Subject - $this->phpExcel->getProperties()->setSubject($value); + $this->spreadsheet->getProperties()->setSubject($value); break; case 0x04: // Author (Creator) - $this->phpExcel->getProperties()->setCreator($value); + $this->spreadsheet->getProperties()->setCreator($value); break; case 0x05: // Keywords - $this->phpExcel->getProperties()->setKeywords($value); + $this->spreadsheet->getProperties()->setKeywords($value); break; case 0x06: // Comments (Description) - $this->phpExcel->getProperties()->setDescription($value); + $this->spreadsheet->getProperties()->setDescription($value); break; case 0x07: // Template - // Not supported by PHPExcel + // Not supported by PhpSpreadsheet break; case 0x08: // Last Saved By (LastModifiedBy) - $this->phpExcel->getProperties()->setLastModifiedBy($value); + $this->spreadsheet->getProperties()->setLastModifiedBy($value); break; case 0x09: // Revision - // Not supported by PHPExcel + // Not supported by PhpSpreadsheet break; case 0x0A: // Total Editing Time - // Not supported by PHPExcel + // Not supported by PhpSpreadsheet break; case 0x0B: // Last Printed - // Not supported by PHPExcel + // Not supported by PhpSpreadsheet break; case 0x0C: // Created Date/Time - $this->phpExcel->getProperties()->setCreated($value); + $this->spreadsheet->getProperties()->setCreated($value); break; case 0x0D: // Modified Date/Time - $this->phpExcel->getProperties()->setModified($value); + $this->spreadsheet->getProperties()->setModified($value); break; case 0x0E: // Number of Pages - // Not supported by PHPExcel + // Not supported by PhpSpreadsheet break; case 0x0F: // Number of Words - // Not supported by PHPExcel + // Not supported by PhpSpreadsheet break; case 0x10: // Number of Characters - // Not supported by PHPExcel + // Not supported by PhpSpreadsheet break; case 0x11: // Thumbnail - // Not supported by PHPExcel + // Not supported by PhpSpreadsheet break; case 0x12: // Name of creating application - // Not supported by PHPExcel + // Not supported by PhpSpreadsheet break; case 0x13: // Security - // Not supported by PHPExcel + // Not supported by PhpSpreadsheet break; } } @@ -1489,12 +1486,12 @@ class Excel5 extends BaseReader implements IReader case 0x1E: // null-terminated string prepended by dword string length $byteLength = self::getInt4d($this->documentSummaryInformation, $secOffset + 4 + $offset); $value = substr($this->documentSummaryInformation, $secOffset + 8 + $offset, $byteLength); - $value = \PHPExcel\Shared\StringHelper::convertEncoding($value, 'UTF-8', $codePage); + $value = \PhpSpreadsheet\Shared\StringHelper::convertEncoding($value, 'UTF-8', $codePage); $value = rtrim($value); break; case 0x40: // Filetime (64-bit value representing the number of 100-nanosecond intervals since January 1, 1601) // PHP-Time - $value = \PHPExcel\Shared\OLE::OLE2LocalDate(substr($this->documentSummaryInformation, $secOffset + 4 + $offset, 8)); + $value = \PhpSpreadsheet\Shared\OLE::OLE2LocalDate(substr($this->documentSummaryInformation, $secOffset + 4 + $offset, 8)); break; case 0x47: // Clipboard format // not needed yet, fix later if necessary @@ -1503,52 +1500,52 @@ class Excel5 extends BaseReader implements IReader switch ($id) { case 0x01: // Code Page - $codePage = \PHPExcel\Shared\CodePage::numberToName($value); + $codePage = \PhpSpreadsheet\Shared\CodePage::numberToName($value); break; case 0x02: // Category - $this->phpExcel->getProperties()->setCategory($value); + $this->spreadsheet->getProperties()->setCategory($value); break; case 0x03: // Presentation Target - // Not supported by PHPExcel + // Not supported by PhpSpreadsheet break; case 0x04: // Bytes - // Not supported by PHPExcel + // Not supported by PhpSpreadsheet break; case 0x05: // Lines - // Not supported by PHPExcel + // Not supported by PhpSpreadsheet break; case 0x06: // Paragraphs - // Not supported by PHPExcel + // Not supported by PhpSpreadsheet break; case 0x07: // Slides - // Not supported by PHPExcel + // Not supported by PhpSpreadsheet break; case 0x08: // Notes - // Not supported by PHPExcel + // Not supported by PhpSpreadsheet break; case 0x09: // Hidden Slides - // Not supported by PHPExcel + // Not supported by PhpSpreadsheet break; case 0x0A: // MM Clips - // Not supported by PHPExcel + // Not supported by PhpSpreadsheet break; case 0x0B: // Scale Crop - // Not supported by PHPExcel + // Not supported by PhpSpreadsheet break; case 0x0C: // Heading Pairs - // Not supported by PHPExcel + // Not supported by PhpSpreadsheet break; case 0x0D: // Titles of Parts - // Not supported by PHPExcel + // Not supported by PhpSpreadsheet break; case 0x0E: // Manager - $this->phpExcel->getProperties()->setManager($value); + $this->spreadsheet->getProperties()->setManager($value); break; case 0x0F: // Company - $this->phpExcel->getProperties()->setCompany($value); + $this->spreadsheet->getProperties()->setCompany($value); break; case 0x10: // Links up-to-date - // Not supported by PHPExcel + // Not supported by PhpSpreadsheet break; } } @@ -1762,7 +1759,7 @@ class Excel5 extends BaseReader implements IReader for ($i = 0; $i < 5; $i++) { $pwarray[$i] = $valContext[$i]; } - + $pwarray[5] = chr($block & 0xff); $pwarray[6] = chr(($block >> 8) & 0xff); $pwarray[7] = chr(($block >> 16) & 0xff); @@ -1851,7 +1848,7 @@ class Excel5 extends BaseReader implements IReader $salt = $key->RC4($salt_data); $hashedsalt = $key->RC4($hashedsalt_data); - + $salt .= "\x80" . str_repeat("\0", 47); $salt[56] = "\x80"; @@ -1882,7 +1879,7 @@ class Excel5 extends BaseReader implements IReader // offset: 0; size: 2; code page identifier $codepage = self::getInt2d($recordData, 0); - $this->codepage = \PHPExcel\Shared\CodePage::numberToName($codepage); + $this->codepage = \PhpSpreadsheet\Shared\CodePage::numberToName($codepage); } @@ -1907,9 +1904,9 @@ class Excel5 extends BaseReader implements IReader $this->pos += 4 + $length; // offset: 0; size: 2; 0 = base 1900, 1 = base 1904 - \PHPExcel\Shared\Date::setExcelCalendar(\PHPExcel\Shared\Date::CALENDAR_WINDOWS_1900); + \PhpSpreadsheet\Shared\Date::setExcelCalendar(\PhpSpreadsheet\Shared\Date::CALENDAR_WINDOWS_1900); if (ord($recordData{0}) == 1) { - \PHPExcel\Shared\Date::setExcelCalendar(\PHPExcel\Shared\Date::CALENDAR_MAC_1904); + \PhpSpreadsheet\Shared\Date::setExcelCalendar(\PhpSpreadsheet\Shared\Date::CALENDAR_MAC_1904); } } @@ -1926,7 +1923,7 @@ class Excel5 extends BaseReader implements IReader $this->pos += 4 + $length; if (!$this->readDataOnly) { - $objFont = new \PHPExcel\Style\Font(); + $objFont = new \PhpSpreadsheet\Style\Font(); // offset: 0; size: 2; height of the font (in twips = 1/20 of a point) $size = self::getInt2d($recordData, 0); @@ -1976,16 +1973,16 @@ class Excel5 extends BaseReader implements IReader case 0x00: break; // no underline case 0x01: - $objFont->setUnderline(\PHPExcel\Style\Font::UNDERLINE_SINGLE); + $objFont->setUnderline(\PhpSpreadsheet\Style\Font::UNDERLINE_SINGLE); break; case 0x02: - $objFont->setUnderline(\PHPExcel\Style\Font::UNDERLINE_DOUBLE); + $objFont->setUnderline(\PhpSpreadsheet\Style\Font::UNDERLINE_DOUBLE); break; case 0x21: - $objFont->setUnderline(\PHPExcel\Style\Font::UNDERLINE_SINGLEACCOUNTING); + $objFont->setUnderline(\PhpSpreadsheet\Style\Font::UNDERLINE_SINGLEACCOUNTING); break; case 0x22: - $objFont->setUnderline(\PHPExcel\Style\Font::UNDERLINE_DOUBLEACCOUNTING); + $objFont->setUnderline(\PhpSpreadsheet\Style\Font::UNDERLINE_DOUBLEACCOUNTING); break; } @@ -2065,7 +2062,7 @@ class Excel5 extends BaseReader implements IReader // move stream pointer to next record $this->pos += 4 + $length; - $objStyle = new \PHPExcel\Style(); + $objStyle = new \PhpSpreadsheet\Style(); if (!$this->readDataOnly) { // offset: 0; size: 2; Index to FONT record @@ -2083,7 +2080,7 @@ class Excel5 extends BaseReader implements IReader if (isset($this->formats[$numberFormatIndex])) { // then we have user-defined format code $numberformat = array('code' => $this->formats[$numberFormatIndex]); - } elseif (($code = \PHPExcel\Style\NumberFormat::builtInFormatCode($numberFormatIndex)) !== '') { + } elseif (($code = \PhpSpreadsheet\Style\NumberFormat::builtInFormatCode($numberFormatIndex)) !== '') { // then we have built-in format code $numberformat = array('code' => $code); } else { @@ -2097,11 +2094,11 @@ class Excel5 extends BaseReader implements IReader $xfTypeProt = self::getInt2d($recordData, 4); // bit 0; mask 0x01; 1 = cell is locked $isLocked = (0x01 & $xfTypeProt) >> 0; - $objStyle->getProtection()->setLocked($isLocked ? \PHPExcel\Style\Protection::PROTECTION_INHERIT : \PHPExcel\Style\Protection::PROTECTION_UNPROTECTED); + $objStyle->getProtection()->setLocked($isLocked ? \PhpSpreadsheet\Style\Protection::PROTECTION_INHERIT : \PhpSpreadsheet\Style\Protection::PROTECTION_UNPROTECTED); // bit 1; mask 0x02; 1 = Formula is hidden $isHidden = (0x02 & $xfTypeProt) >> 1; - $objStyle->getProtection()->setHidden($isHidden ? \PHPExcel\Style\Protection::PROTECTION_PROTECTED : \PHPExcel\Style\Protection::PROTECTION_UNPROTECTED); + $objStyle->getProtection()->setHidden($isHidden ? \PhpSpreadsheet\Style\Protection::PROTECTION_PROTECTED : \PhpSpreadsheet\Style\Protection::PROTECTION_UNPROTECTED); // bit 2; mask 0x04; 0 = Cell XF, 1 = Cell Style XF $isCellStyleXf = (0x04 & $xfTypeProt) >> 2; @@ -2111,25 +2108,25 @@ class Excel5 extends BaseReader implements IReader $horAlign = (0x07 & ord($recordData{6})) >> 0; switch ($horAlign) { case 0: - $objStyle->getAlignment()->setHorizontal(\PHPExcel\Style\Alignment::HORIZONTAL_GENERAL); + $objStyle->getAlignment()->setHorizontal(\PhpSpreadsheet\Style\Alignment::HORIZONTAL_GENERAL); break; case 1: - $objStyle->getAlignment()->setHorizontal(\PHPExcel\Style\Alignment::HORIZONTAL_LEFT); + $objStyle->getAlignment()->setHorizontal(\PhpSpreadsheet\Style\Alignment::HORIZONTAL_LEFT); break; case 2: - $objStyle->getAlignment()->setHorizontal(\PHPExcel\Style\Alignment::HORIZONTAL_CENTER); + $objStyle->getAlignment()->setHorizontal(\PhpSpreadsheet\Style\Alignment::HORIZONTAL_CENTER); break; case 3: - $objStyle->getAlignment()->setHorizontal(\PHPExcel\Style\Alignment::HORIZONTAL_RIGHT); + $objStyle->getAlignment()->setHorizontal(\PhpSpreadsheet\Style\Alignment::HORIZONTAL_RIGHT); break; case 4: - $objStyle->getAlignment()->setHorizontal(\PHPExcel\Style\Alignment::HORIZONTAL_FILL); + $objStyle->getAlignment()->setHorizontal(\PhpSpreadsheet\Style\Alignment::HORIZONTAL_FILL); break; case 5: - $objStyle->getAlignment()->setHorizontal(\PHPExcel\Style\Alignment::HORIZONTAL_JUSTIFY); + $objStyle->getAlignment()->setHorizontal(\PhpSpreadsheet\Style\Alignment::HORIZONTAL_JUSTIFY); break; case 6: - $objStyle->getAlignment()->setHorizontal(\PHPExcel\Style\Alignment::HORIZONTAL_CENTER_CONTINUOUS); + $objStyle->getAlignment()->setHorizontal(\PhpSpreadsheet\Style\Alignment::HORIZONTAL_CENTER_CONTINUOUS); break; } // bit 3, mask 0x08; wrap text @@ -2146,16 +2143,16 @@ class Excel5 extends BaseReader implements IReader $vertAlign = (0x70 & ord($recordData{6})) >> 4; switch ($vertAlign) { case 0: - $objStyle->getAlignment()->setVertical(\PHPExcel\Style\Alignment::VERTICAL_TOP); + $objStyle->getAlignment()->setVertical(\PhpSpreadsheet\Style\Alignment::VERTICAL_TOP); break; case 1: - $objStyle->getAlignment()->setVertical(\PHPExcel\Style\Alignment::VERTICAL_CENTER); + $objStyle->getAlignment()->setVertical(\PhpSpreadsheet\Style\Alignment::VERTICAL_CENTER); break; case 2: - $objStyle->getAlignment()->setVertical(\PHPExcel\Style\Alignment::VERTICAL_BOTTOM); + $objStyle->getAlignment()->setVertical(\PhpSpreadsheet\Style\Alignment::VERTICAL_BOTTOM); break; case 3: - $objStyle->getAlignment()->setVertical(\PHPExcel\Style\Alignment::VERTICAL_JUSTIFY); + $objStyle->getAlignment()->setVertical(\PhpSpreadsheet\Style\Alignment::VERTICAL_JUSTIFY); break; } @@ -2220,13 +2217,13 @@ class Excel5 extends BaseReader implements IReader $diagonalUp = (0x80000000 & self::getInt4d($recordData, 10)) >> 31 ? true : false; if ($diagonalUp == false && $diagonalDown == false) { - $objStyle->getBorders()->setDiagonalDirection(\PHPExcel\Style\Borders::DIAGONAL_NONE); + $objStyle->getBorders()->setDiagonalDirection(\PhpSpreadsheet\Style\Borders::DIAGONAL_NONE); } elseif ($diagonalUp == true && $diagonalDown == false) { - $objStyle->getBorders()->setDiagonalDirection(\PHPExcel\Style\Borders::DIAGONAL_UP); + $objStyle->getBorders()->setDiagonalDirection(\PhpSpreadsheet\Style\Borders::DIAGONAL_UP); } elseif ($diagonalUp == false && $diagonalDown == true) { - $objStyle->getBorders()->setDiagonalDirection(\PHPExcel\Style\Borders::DIAGONAL_DOWN); + $objStyle->getBorders()->setDiagonalDirection(\PhpSpreadsheet\Style\Borders::DIAGONAL_DOWN); } elseif ($diagonalUp == true && $diagonalDown == true) { - $objStyle->getBorders()->setDiagonalDirection(\PHPExcel\Style\Borders::DIAGONAL_BOTH); + $objStyle->getBorders()->setDiagonalDirection(\PhpSpreadsheet\Style\Borders::DIAGONAL_BOTH); } // offset: 14; size: 4; @@ -2321,13 +2318,13 @@ class Excel5 extends BaseReader implements IReader if ($isCellStyleXf) { // we only read one style XF record which is always the first if ($this->xfIndex == 0) { - $this->phpExcel->addCellStyleXf($objStyle); + $this->spreadsheet->addCellStyleXf($objStyle); $this->mapCellStyleXfIndex[$this->xfIndex] = 0; } } else { // we read all cell XF records - $this->phpExcel->addCellXf($objStyle); - $this->mapCellXfIndex[$this->xfIndex] = count($this->phpExcel->getCellXfCollection()) - 1; + $this->spreadsheet->addCellXf($objStyle); + $this->mapCellXfIndex[$this->xfIndex] = count($this->spreadsheet->getCellXfCollection()) - 1; } // update XF index for when we read next record @@ -2386,7 +2383,7 @@ class Excel5 extends BaseReader implements IReader // modify the relevant style property if (isset($this->mapCellXfIndex[$ixfe])) { - $fill = $this->phpExcel->getCellXfByIndex($this->mapCellXfIndex[$ixfe])->getFill(); + $fill = $this->spreadsheet->getCellXfByIndex($this->mapCellXfIndex[$ixfe])->getFill(); $fill->getStartColor()->setRGB($rgb); unset($fill->startcolorIndex); // normal color index does not apply, discard } @@ -2401,7 +2398,7 @@ class Excel5 extends BaseReader implements IReader // modify the relevant style property if (isset($this->mapCellXfIndex[$ixfe])) { - $fill = $this->phpExcel->getCellXfByIndex($this->mapCellXfIndex[$ixfe])->getFill(); + $fill = $this->spreadsheet->getCellXfByIndex($this->mapCellXfIndex[$ixfe])->getFill(); $fill->getEndColor()->setRGB($rgb); unset($fill->endcolorIndex); // normal color index does not apply, discard } @@ -2416,7 +2413,7 @@ class Excel5 extends BaseReader implements IReader // modify the relevant style property if (isset($this->mapCellXfIndex[$ixfe])) { - $top = $this->phpExcel->getCellXfByIndex($this->mapCellXfIndex[$ixfe])->getBorders()->getTop(); + $top = $this->spreadsheet->getCellXfByIndex($this->mapCellXfIndex[$ixfe])->getBorders()->getTop(); $top->getColor()->setRGB($rgb); unset($top->colorIndex); // normal color index does not apply, discard } @@ -2431,7 +2428,7 @@ class Excel5 extends BaseReader implements IReader // modify the relevant style property if (isset($this->mapCellXfIndex[$ixfe])) { - $bottom = $this->phpExcel->getCellXfByIndex($this->mapCellXfIndex[$ixfe])->getBorders()->getBottom(); + $bottom = $this->spreadsheet->getCellXfByIndex($this->mapCellXfIndex[$ixfe])->getBorders()->getBottom(); $bottom->getColor()->setRGB($rgb); unset($bottom->colorIndex); // normal color index does not apply, discard } @@ -2446,7 +2443,7 @@ class Excel5 extends BaseReader implements IReader // modify the relevant style property if (isset($this->mapCellXfIndex[$ixfe])) { - $left = $this->phpExcel->getCellXfByIndex($this->mapCellXfIndex[$ixfe])->getBorders()->getLeft(); + $left = $this->spreadsheet->getCellXfByIndex($this->mapCellXfIndex[$ixfe])->getBorders()->getLeft(); $left->getColor()->setRGB($rgb); unset($left->colorIndex); // normal color index does not apply, discard } @@ -2461,7 +2458,7 @@ class Excel5 extends BaseReader implements IReader // modify the relevant style property if (isset($this->mapCellXfIndex[$ixfe])) { - $right = $this->phpExcel->getCellXfByIndex($this->mapCellXfIndex[$ixfe])->getBorders()->getRight(); + $right = $this->spreadsheet->getCellXfByIndex($this->mapCellXfIndex[$ixfe])->getBorders()->getRight(); $right->getColor()->setRGB($rgb); unset($right->colorIndex); // normal color index does not apply, discard } @@ -2476,7 +2473,7 @@ class Excel5 extends BaseReader implements IReader // modify the relevant style property if (isset($this->mapCellXfIndex[$ixfe])) { - $diagonal = $this->phpExcel->getCellXfByIndex($this->mapCellXfIndex[$ixfe])->getBorders()->getDiagonal(); + $diagonal = $this->spreadsheet->getCellXfByIndex($this->mapCellXfIndex[$ixfe])->getBorders()->getDiagonal(); $diagonal->getColor()->setRGB($rgb); unset($diagonal->colorIndex); // normal color index does not apply, discard } @@ -2491,7 +2488,7 @@ class Excel5 extends BaseReader implements IReader // modify the relevant style property if (isset($this->mapCellXfIndex[$ixfe])) { - $font = $this->phpExcel->getCellXfByIndex($this->mapCellXfIndex[$ixfe])->getFont(); + $font = $this->spreadsheet->getCellXfByIndex($this->mapCellXfIndex[$ixfe])->getFont(); $font->getColor()->setRGB($rgb); unset($font->colorIndex); // normal color index does not apply, discard } @@ -2538,7 +2535,7 @@ class Excel5 extends BaseReader implements IReader break; } } else { - // user-defined; not supported by PHPExcel + // user-defined; not supported by PhpSpreadsheet } } } @@ -2595,16 +2592,16 @@ class Excel5 extends BaseReader implements IReader // offset: 4; size: 1; sheet state switch (ord($recordData{4})) { case 0x00: - $sheetState = \PHPExcel\Worksheet::SHEETSTATE_VISIBLE; + $sheetState = \PhpSpreadsheet\Worksheet::SHEETSTATE_VISIBLE; break; case 0x01: - $sheetState = \PHPExcel\Worksheet::SHEETSTATE_HIDDEN; + $sheetState = \PhpSpreadsheet\Worksheet::SHEETSTATE_HIDDEN; break; case 0x02: - $sheetState = \PHPExcel\Worksheet::SHEETSTATE_VERYHIDDEN; + $sheetState = \PhpSpreadsheet\Worksheet::SHEETSTATE_VERYHIDDEN; break; default: - $sheetState = \PHPExcel\Worksheet::SHEETSTATE_VISIBLE; + $sheetState = \PhpSpreadsheet\Worksheet::SHEETSTATE_VISIBLE; break; } @@ -2805,7 +2802,7 @@ class Excel5 extends BaseReader implements IReader try { $formula = $this->getFormulaFromStructure($formulaStructure); - } catch (\PHPExcel\Exception $e) { + } catch (\PhpSpreadsheet\Exception $e) { $formula = ''; } @@ -3106,7 +3103,7 @@ class Excel5 extends BaseReader implements IReader $cl = self::getInt2d($recordData, 2 + 6 * $i + 4); // not sure why two column indexes are necessary? - $this->phpSheet->setBreakByColumnAndRow($cf, $r, \PHPExcel\Worksheet::BREAK_ROW); + $this->phpSheet->setBreakByColumnAndRow($cf, $r, \PhpSpreadsheet\Worksheet::BREAK_ROW); } } } @@ -3134,7 +3131,7 @@ class Excel5 extends BaseReader implements IReader $rl = self::getInt2d($recordData, 2 + 6 * $i + 4); // not sure why two row indexes are necessary? - $this->phpSheet->setBreakByColumnAndRow($c, $rf, \PHPExcel\Worksheet::BREAK_COLUMN); + $this->phpSheet->setBreakByColumnAndRow($c, $rf, \PhpSpreadsheet\Worksheet::BREAK_COLUMN); } } } @@ -3344,10 +3341,10 @@ class Excel5 extends BaseReader implements IReader $this->phpSheet->getPageSetup()->setPaperSize($paperSize); switch ($isPortrait) { case 0: - $this->phpSheet->getPageSetup()->setOrientation(\PHPExcel\Worksheet\PageSetup::ORIENTATION_LANDSCAPE); + $this->phpSheet->getPageSetup()->setOrientation(\PhpSpreadsheet\Worksheet\PageSetup::ORIENTATION_LANDSCAPE); break; case 1: - $this->phpSheet->getPageSetup()->setOrientation(\PHPExcel\Worksheet\PageSetup::ORIENTATION_PORTRAIT); + $this->phpSheet->getPageSetup()->setOrientation(\PhpSpreadsheet\Worksheet\PageSetup::ORIENTATION_PORTRAIT); break; } @@ -3622,7 +3619,7 @@ class Excel5 extends BaseReader implements IReader // offset: 2; size: 2; index to column $column = self::getInt2d($recordData, 2); - $columnString = \PHPExcel\Cell::stringFromColumnIndex($column); + $columnString = \PhpSpreadsheet\Cell::stringFromColumnIndex($column); // Read cell? if (($this->getReadFilter() !== null) && $this->getReadFilter()->readCell($columnString, $row + 1, $this->phpSheet->getTitle())) { @@ -3640,7 +3637,7 @@ class Excel5 extends BaseReader implements IReader } // add cell - $cell->setValueExplicit($numValue, \PHPExcel\Cell\DataType::TYPE_NUMERIC); + $cell->setValueExplicit($numValue, \PhpSpreadsheet\Cell\DataType::TYPE_NUMERIC); } } @@ -3667,7 +3664,7 @@ class Excel5 extends BaseReader implements IReader // offset: 2; size: 2; index to column $column = self::getInt2d($recordData, 2); - $columnString = \PHPExcel\Cell::stringFromColumnIndex($column); + $columnString = \PhpSpreadsheet\Cell::stringFromColumnIndex($column); $emptyCell = true; // Read cell? @@ -3681,18 +3678,18 @@ class Excel5 extends BaseReader implements IReader // add cell if (($fmtRuns = $this->sst[$index]['fmtRuns']) && !$this->readDataOnly) { // then we should treat as rich text - $richText = new \PHPExcel\RichText(); + $richText = new \PhpSpreadsheet\RichText(); $charPos = 0; $sstCount = count($this->sst[$index]['fmtRuns']); for ($i = 0; $i <= $sstCount; ++$i) { if (isset($fmtRuns[$i])) { - $text = \PHPExcel\Shared\StringHelper::substring($this->sst[$index]['value'], $charPos, $fmtRuns[$i]['charPos'] - $charPos); + $text = \PhpSpreadsheet\Shared\StringHelper::substring($this->sst[$index]['value'], $charPos, $fmtRuns[$i]['charPos'] - $charPos); $charPos = $fmtRuns[$i]['charPos']; } else { - $text = \PHPExcel\Shared\StringHelper::substring($this->sst[$index]['value'], $charPos, \PHPExcel\Shared\StringHelper::countCharacters($this->sst[$index]['value'])); + $text = \PhpSpreadsheet\Shared\StringHelper::substring($this->sst[$index]['value'], $charPos, \PhpSpreadsheet\Shared\StringHelper::countCharacters($this->sst[$index]['value'])); } - if (\PHPExcel\Shared\StringHelper::countCharacters($text) > 0) { + if (\PhpSpreadsheet\Shared\StringHelper::countCharacters($text) > 0) { if ($i == 0) { // first text run, no style $richText->createText($text); } else { @@ -3712,13 +3709,13 @@ class Excel5 extends BaseReader implements IReader } if ($this->readEmptyCells || trim($richText->getPlainText()) !== '') { $cell = $this->phpSheet->getCell($columnString . ($row + 1)); - $cell->setValueExplicit($richText, \PHPExcel\Cell\DataType::TYPE_STRING); + $cell->setValueExplicit($richText, \PhpSpreadsheet\Cell\DataType::TYPE_STRING); $emptyCell = false; } } else { if ($this->readEmptyCells || trim($this->sst[$index]['value']) !== '') { $cell = $this->phpSheet->getCell($columnString . ($row + 1)); - $cell->setValueExplicit($this->sst[$index]['value'], \PHPExcel\Cell\DataType::TYPE_STRING); + $cell->setValueExplicit($this->sst[$index]['value'], \PhpSpreadsheet\Cell\DataType::TYPE_STRING); $emptyCell = false; } } @@ -3761,7 +3758,7 @@ class Excel5 extends BaseReader implements IReader $offset = 4; for ($i = 0; $i < $columns; ++$i) { - $columnString = \PHPExcel\Cell::stringFromColumnIndex($colFirst + $i); + $columnString = \PhpSpreadsheet\Cell::stringFromColumnIndex($colFirst + $i); // Read cell? if (($this->getReadFilter() !== null) && $this->getReadFilter()->readCell($columnString, $row + 1, $this->phpSheet->getTitle())) { @@ -3777,7 +3774,7 @@ class Excel5 extends BaseReader implements IReader } // add cell value - $cell->setValueExplicit($numValue, \PHPExcel\Cell\DataType::TYPE_NUMERIC); + $cell->setValueExplicit($numValue, \PhpSpreadsheet\Cell\DataType::TYPE_NUMERIC); } $offset += 6; @@ -3806,7 +3803,7 @@ class Excel5 extends BaseReader implements IReader // offset: 2; size 2; index to column $column = self::getInt2d($recordData, 2); - $columnString = \PHPExcel\Cell::stringFromColumnIndex($column); + $columnString = \PhpSpreadsheet\Cell::stringFromColumnIndex($column); // Read cell? if (($this->getReadFilter() !== null) && $this->getReadFilter()->readCell($columnString, $row + 1, $this->phpSheet->getTitle())) { @@ -3822,7 +3819,7 @@ class Excel5 extends BaseReader implements IReader } // add cell value - $cell->setValueExplicit($numValue, \PHPExcel\Cell\DataType::TYPE_NUMERIC); + $cell->setValueExplicit($numValue, \PhpSpreadsheet\Cell\DataType::TYPE_NUMERIC); } } @@ -3848,7 +3845,7 @@ class Excel5 extends BaseReader implements IReader // offset: 2; size: 2; col index $column = self::getInt2d($recordData, 2); - $columnString = \PHPExcel\Cell::stringFromColumnIndex($column); + $columnString = \PhpSpreadsheet\Cell::stringFromColumnIndex($column); // offset: 20: size: variable; formula structure $formulaStructure = substr($recordData, 20); @@ -3872,7 +3869,7 @@ class Excel5 extends BaseReader implements IReader // get the base cell, grab tExp token $baseRow = self::getInt2d($formulaStructure, 3); $baseCol = self::getInt2d($formulaStructure, 5); - $this->_baseCell = \PHPExcel\Cell::stringFromColumnIndex($baseCol). ($baseRow + 1); + $this->_baseCell = \PhpSpreadsheet\Cell::stringFromColumnIndex($baseCol). ($baseRow + 1); } // Read cell? @@ -3890,7 +3887,7 @@ class Excel5 extends BaseReader implements IReader // offset: 6; size: 8; result of the formula if ((ord($recordData{6}) == 0) && (ord($recordData{12}) == 255) && (ord($recordData{13}) == 255)) { // String formula. Result follows in appended STRING record - $dataType = \PHPExcel\Cell\DataType::TYPE_STRING; + $dataType = \PhpSpreadsheet\Cell\DataType::TYPE_STRING; // read possible SHAREDFMLA record $code = self::getInt2d($this->data, $this->pos); @@ -3904,23 +3901,23 @@ class Excel5 extends BaseReader implements IReader && (ord($recordData{12}) == 255) && (ord($recordData{13}) == 255)) { // Boolean formula. Result is in +2; 0=false, 1=true - $dataType = \PHPExcel\Cell\DataType::TYPE_BOOL; + $dataType = \PhpSpreadsheet\Cell\DataType::TYPE_BOOL; $value = (bool) ord($recordData{8}); } elseif ((ord($recordData{6}) == 2) && (ord($recordData{12}) == 255) && (ord($recordData{13}) == 255)) { // Error formula. Error code is in +2 - $dataType = \PHPExcel\Cell\DataType::TYPE_ERROR; + $dataType = \PhpSpreadsheet\Cell\DataType::TYPE_ERROR; $value = Excel5\ErrorCode::lookup(ord($recordData{8})); } elseif ((ord($recordData{6}) == 3) && (ord($recordData{12}) == 255) && (ord($recordData{13}) == 255)) { // Formula result is a null string - $dataType = \PHPExcel\Cell\DataType::TYPE_NULL; + $dataType = \PhpSpreadsheet\Cell\DataType::TYPE_NULL; $value = ''; } else { // forumla result is a number, first 14 bytes like _NUMBER record - $dataType = \PHPExcel\Cell\DataType::TYPE_NUMERIC; + $dataType = \PhpSpreadsheet\Cell\DataType::TYPE_NUMERIC; $value = self::extractNumber(substr($recordData, 6, 8)); } @@ -3939,8 +3936,8 @@ class Excel5 extends BaseReader implements IReader throw new Exception('Not BIFF8. Can only read BIFF8 formulas'); } $formula = $this->getFormulaFromStructure($formulaStructure); // get formula in human language - $cell->setValueExplicit('=' . $formula, \PHPExcel\Cell\DataType::TYPE_FORMULA); - } catch (\PHPExcel\Exception $e) { + $cell->setValueExplicit('=' . $formula, \PhpSpreadsheet\Cell\DataType::TYPE_FORMULA); + } catch (\PhpSpreadsheet\Exception $e) { $cell->setValueExplicit($value, $dataType); } } else { @@ -4035,7 +4032,7 @@ class Excel5 extends BaseReader implements IReader // offset: 2; size: 2; column index $column = self::getInt2d($recordData, 2); - $columnString = \PHPExcel\Cell::stringFromColumnIndex($column); + $columnString = \PhpSpreadsheet\Cell::stringFromColumnIndex($column); // Read cell? if (($this->getReadFilter() !== null) && $this->getReadFilter()->readCell($columnString, $row + 1, $this->phpSheet->getTitle())) { @@ -4054,13 +4051,13 @@ class Excel5 extends BaseReader implements IReader $value = (bool) $boolErr; // add cell value - $cell->setValueExplicit($value, \PHPExcel\Cell\DataType::TYPE_BOOL); + $cell->setValueExplicit($value, \PhpSpreadsheet\Cell\DataType::TYPE_BOOL); break; case 1: // error type $value = Excel5\ErrorCode::lookup($boolErr); // add cell value - $cell->setValueExplicit($value, \PHPExcel\Cell\DataType::TYPE_ERROR); + $cell->setValueExplicit($value, \PhpSpreadsheet\Cell\DataType::TYPE_ERROR); break; } @@ -4098,7 +4095,7 @@ class Excel5 extends BaseReader implements IReader // add style information if (!$this->readDataOnly && $this->readEmptyCells) { for ($i = 0; $i < $length / 2 - 3; ++$i) { - $columnString = \PHPExcel\Cell::stringFromColumnIndex($fc + $i); + $columnString = \PhpSpreadsheet\Cell::stringFromColumnIndex($fc + $i); // Read cell? if (($this->getReadFilter() !== null) && $this->getReadFilter()->readCell($columnString, $row + 1, $this->phpSheet->getTitle())) { @@ -4135,7 +4132,7 @@ class Excel5 extends BaseReader implements IReader // offset: 2; size: 2; index to column $column = self::getInt2d($recordData, 2); - $columnString = \PHPExcel\Cell::stringFromColumnIndex($column); + $columnString = \PhpSpreadsheet\Cell::stringFromColumnIndex($column); // Read cell? if (($this->getReadFilter() !== null) && $this->getReadFilter()->readCell($columnString, $row + 1, $this->phpSheet->getTitle())) { @@ -4153,7 +4150,7 @@ class Excel5 extends BaseReader implements IReader } if ($this->readEmptyCells || trim($value) !== '') { $cell = $this->phpSheet->getCell($columnString . ($row + 1)); - $cell->setValueExplicit($value, \PHPExcel\Cell\DataType::TYPE_STRING); + $cell->setValueExplicit($value, \PhpSpreadsheet\Cell\DataType::TYPE_STRING); if (!$this->readDataOnly) { // add cell style @@ -4180,7 +4177,7 @@ class Excel5 extends BaseReader implements IReader // offset: 2; size: 2; col index $col = self::getInt2d($recordData, 2); - $columnString = \PHPExcel\Cell::stringFromColumnIndex($col); + $columnString = \PhpSpreadsheet\Cell::stringFromColumnIndex($col); // Read cell? if (($this->getReadFilter() !== null) && $this->getReadFilter()->readCell($columnString, $row + 1, $this->phpSheet->getTitle())) { @@ -4306,7 +4303,7 @@ class Excel5 extends BaseReader implements IReader // bit: 10; mask: 0x0400; 0 = sheet not active, 1 = sheet active $isActive = (bool) ((0x0400 & $options) >> 10); if ($isActive) { - $this->phpExcel->setActiveSheetIndex($this->phpExcel->getIndex($this->phpSheet)); + $this->spreadsheet->setActiveSheetIndex($this->spreadsheet->getIndex($this->phpSheet)); } // bit: 11; mask: 0x0800; 0 = normal view, 1 = page break view @@ -4314,9 +4311,9 @@ class Excel5 extends BaseReader implements IReader //FIXME: set $firstVisibleRow and $firstVisibleColumn - if ($this->phpSheet->getSheetView()->getView() !== \PHPExcel\Worksheet\SheetView::SHEETVIEW_PAGE_LAYOUT) { + if ($this->phpSheet->getSheetView()->getView() !== \PhpSpreadsheet\Worksheet\SheetView::SHEETVIEW_PAGE_LAYOUT) { //NOTE: this setting is inferior to page layout view(Excel2007-) - $view = $isPageBreakPreview ? \PHPExcel\Worksheet\SheetView::SHEETVIEW_PAGE_BREAK_PREVIEW : \PHPExcel\Worksheet\SheetView::SHEETVIEW_NORMAL; + $view = $isPageBreakPreview ? \PhpSpreadsheet\Worksheet\SheetView::SHEETVIEW_PAGE_BREAK_PREVIEW : \PhpSpreadsheet\Worksheet\SheetView::SHEETVIEW_NORMAL; $this->phpSheet->getSheetView()->setView($view); if ($this->version === self::XLS_BIFF8) { $zoomScale = $isPageBreakPreview ? $zoomscaleInPageBreakPreview : $zoomscaleInNormalView; @@ -4359,7 +4356,7 @@ class Excel5 extends BaseReader implements IReader $fWhitespaceHidden = ($grbit >> 3) & 0x01; //no support if ($fPageLayoutView === 1) { - $this->phpSheet->getSheetView()->setView(\PHPExcel\Worksheet\SheetView::SHEETVIEW_PAGE_LAYOUT); + $this->phpSheet->getSheetView()->setView(\PhpSpreadsheet\Worksheet\SheetView::SHEETVIEW_PAGE_LAYOUT); $this->phpSheet->getSheetView()->setZoomScale($wScalePLV); //set by Excel2007 only if SHEETVIEW_PAGE_LAYOUT } //otherwise, we cannot know whether SHEETVIEW_PAGE_LAYOUT or SHEETVIEW_PAGE_BREAK_PREVIEW. @@ -4407,9 +4404,9 @@ class Excel5 extends BaseReader implements IReader if ($this->frozen) { // frozen panes - $this->phpSheet->freezePane(\PHPExcel\Cell::stringFromColumnIndex($px) . ($py + 1)); + $this->phpSheet->freezePane(\PhpSpreadsheet\Cell::stringFromColumnIndex($px) . ($py + 1)); } else { - // unfrozen panes; split windows; not supported by PHPExcel core + // unfrozen panes; split windows; not supported by PhpSpreadsheet core } } } @@ -4471,7 +4468,7 @@ class Excel5 extends BaseReader implements IReader $includeCellRange = true; if ($this->getReadFilter() !== null) { $includeCellRange = false; - $rangeBoundaries = \PHPExcel\Cell::getRangeBoundaries($cellRangeAddress); + $rangeBoundaries = \PhpSpreadsheet\Cell::getRangeBoundaries($cellRangeAddress); $rangeBoundaries[1][0]++; for ($row = $rangeBoundaries[0][1]; $row <= $rangeBoundaries[1][1]; $row++) { for ($column = $rangeBoundaries[0][0]; $column != $rangeBoundaries[1][0]; $column++) { @@ -4530,7 +4527,7 @@ class Excel5 extends BaseReader implements IReader // offset: 0; size: 8; cell range address of all cells containing this hyperlink try { $cellRange = $this->readBIFF8CellRangeAddressFixed($recordData, 0, 8); - } catch (\PHPExcel\Exception $e) { + } catch (\PhpSpreadsheet\Exception $e) { return; } @@ -4680,7 +4677,7 @@ class Excel5 extends BaseReader implements IReader } // apply the hyperlink to all the relevant cells - foreach (\PHPExcel\Cell::extractAllCellReferencesInRange($cellRange) as $coordinate) { + foreach (\PhpSpreadsheet\Cell::extractAllCellReferencesInRange($cellRange) as $coordinate) { $this->phpSheet->getCell($coordinate)->getHyperLink()->setUrl($url); } } @@ -4722,28 +4719,28 @@ class Excel5 extends BaseReader implements IReader $type = (0x0000000F & $options) >> 0; switch ($type) { case 0x00: - $type = \PHPExcel\Cell\DataValidation::TYPE_NONE; + $type = \PhpSpreadsheet\Cell\DataValidation::TYPE_NONE; break; case 0x01: - $type = \PHPExcel\Cell\DataValidation::TYPE_WHOLE; + $type = \PhpSpreadsheet\Cell\DataValidation::TYPE_WHOLE; break; case 0x02: - $type = \PHPExcel\Cell\DataValidation::TYPE_DECIMAL; + $type = \PhpSpreadsheet\Cell\DataValidation::TYPE_DECIMAL; break; case 0x03: - $type = \PHPExcel\Cell\DataValidation::TYPE_LIST; + $type = \PhpSpreadsheet\Cell\DataValidation::TYPE_LIST; break; case 0x04: - $type = \PHPExcel\Cell\DataValidation::TYPE_DATE; + $type = \PhpSpreadsheet\Cell\DataValidation::TYPE_DATE; break; case 0x05: - $type = \PHPExcel\Cell\DataValidation::TYPE_TIME; + $type = \PhpSpreadsheet\Cell\DataValidation::TYPE_TIME; break; case 0x06: - $type = \PHPExcel\Cell\DataValidation::TYPE_TEXTLENGTH; + $type = \PhpSpreadsheet\Cell\DataValidation::TYPE_TEXTLENGTH; break; case 0x07: - $type = \PHPExcel\Cell\DataValidation::TYPE_CUSTOM; + $type = \PhpSpreadsheet\Cell\DataValidation::TYPE_CUSTOM; break; } @@ -4751,13 +4748,13 @@ class Excel5 extends BaseReader implements IReader $errorStyle = (0x00000070 & $options) >> 4; switch ($errorStyle) { case 0x00: - $errorStyle = \PHPExcel\Cell\DataValidation::STYLE_STOP; + $errorStyle = \PhpSpreadsheet\Cell\DataValidation::STYLE_STOP; break; case 0x01: - $errorStyle = \PHPExcel\Cell\DataValidation::STYLE_WARNING; + $errorStyle = \PhpSpreadsheet\Cell\DataValidation::STYLE_WARNING; break; case 0x02: - $errorStyle = \PHPExcel\Cell\DataValidation::STYLE_INFORMATION; + $errorStyle = \PhpSpreadsheet\Cell\DataValidation::STYLE_INFORMATION; break; } @@ -4781,28 +4778,28 @@ class Excel5 extends BaseReader implements IReader $operator = (0x00F00000 & $options) >> 20; switch ($operator) { case 0x00: - $operator = \PHPExcel\Cell\DataValidation::OPERATOR_BETWEEN; + $operator = \PhpSpreadsheet\Cell\DataValidation::OPERATOR_BETWEEN; break; case 0x01: - $operator = \PHPExcel\Cell\DataValidation::OPERATOR_NOTBETWEEN; + $operator = \PhpSpreadsheet\Cell\DataValidation::OPERATOR_NOTBETWEEN; break; case 0x02: - $operator = \PHPExcel\Cell\DataValidation::OPERATOR_EQUAL; + $operator = \PhpSpreadsheet\Cell\DataValidation::OPERATOR_EQUAL; break; case 0x03: - $operator = \PHPExcel\Cell\DataValidation::OPERATOR_NOTEQUAL; + $operator = \PhpSpreadsheet\Cell\DataValidation::OPERATOR_NOTEQUAL; break; case 0x04: - $operator = \PHPExcel\Cell\DataValidation::OPERATOR_GREATERTHAN; + $operator = \PhpSpreadsheet\Cell\DataValidation::OPERATOR_GREATERTHAN; break; case 0x05: - $operator = \PHPExcel\Cell\DataValidation::OPERATOR_LESSTHAN; + $operator = \PhpSpreadsheet\Cell\DataValidation::OPERATOR_LESSTHAN; break; case 0x06: - $operator = \PHPExcel\Cell\DataValidation::OPERATOR_GREATERTHANOREQUAL; + $operator = \PhpSpreadsheet\Cell\DataValidation::OPERATOR_GREATERTHANOREQUAL; break; case 0x07: - $operator = \PHPExcel\Cell\DataValidation::OPERATOR_LESSTHANOREQUAL; + $operator = \PhpSpreadsheet\Cell\DataValidation::OPERATOR_LESSTHANOREQUAL; break; } @@ -4841,10 +4838,10 @@ class Excel5 extends BaseReader implements IReader $formula1 = $this->getFormulaFromStructure($formula1); // in list type validity, null characters are used as item separators - if ($type == \PHPExcel\Cell\DataValidation::TYPE_LIST) { + if ($type == \PhpSpreadsheet\Cell\DataValidation::TYPE_LIST) { $formula1 = str_replace(chr(0), ',', $formula1); } - } catch (\PHPExcel\Exception $e) { + } catch (\PhpSpreadsheet\Exception $e) { return; } $offset += $sz1; @@ -4861,7 +4858,7 @@ class Excel5 extends BaseReader implements IReader $formula2 = pack('v', $sz2) . $formula2; // prepend the length try { $formula2 = $this->getFormulaFromStructure($formula2); - } catch (\PHPExcel\Exception $e) { + } catch (\PhpSpreadsheet\Exception $e) { return; } $offset += $sz2; @@ -4872,7 +4869,7 @@ class Excel5 extends BaseReader implements IReader foreach ($cellRangeAddresses as $cellRange) { $stRange = $this->phpSheet->shrinkRangeToFit($cellRange); - foreach (\PHPExcel\Cell::extractAllCellReferencesInRange($stRange) as $coordinate) { + foreach (\PhpSpreadsheet\Cell::extractAllCellReferencesInRange($stRange) as $coordinate) { $objValidation = $this->phpSheet->getCell($coordinate)->getDataValidation(); $objValidation->setType($type); $objValidation->setErrorStyle($errorStyle); @@ -5069,7 +5066,7 @@ class Excel5 extends BaseReader implements IReader for ($i = 0; $i < $cref; ++$i) { try { $cellRange = $this->readBIFF8CellRangeAddressFixed(substr($recordData, 27 + 8 * $i, 8)); - } catch (\PHPExcel\Exception $e) { + } catch (\PhpSpreadsheet\Exception $e) { return; } $cellRanges[] = $cellRange; @@ -5156,7 +5153,7 @@ class Excel5 extends BaseReader implements IReader } //imagepng($ih, 'image.png'); - $drawing = new \PHPExcel\Worksheet\Drawing(); + $drawing = new \PhpSpreadsheet\Worksheet\Drawing(); $drawing->setPath($filename); $drawing->setWorksheet($this->phpSheet); break; @@ -6738,7 +6735,7 @@ class Excel5 extends BaseReader implements IReader $cellAddress = $this->readBIFF8CellAddress(substr($formulaData, 3, 4)); $data = "$sheetRange!$cellAddress"; - } catch (\PHPExcel\Exception $e) { + } catch (\PhpSpreadsheet\Exception $e) { // deleted sheet reference $data = '#REF!'; } @@ -6756,7 +6753,7 @@ class Excel5 extends BaseReader implements IReader $cellRangeAddress = $this->readBIFF8CellRangeAddress(substr($formulaData, 3, 8)); $data = "$sheetRange!$cellRangeAddress"; - } catch (\PHPExcel\Exception $e) { + } catch (\PhpSpreadsheet\Exception $e) { // deleted sheet reference $data = '#REF!'; } @@ -6790,7 +6787,7 @@ class Excel5 extends BaseReader implements IReader // offset: 2; size: 2; index to column or column offset + relative flags // bit: 7-0; mask 0x00FF; column index - $column = \PHPExcel\Cell::stringFromColumnIndex(0x00FF & self::getInt2d($cellAddressStructure, 2)); + $column = \PhpSpreadsheet\Cell::stringFromColumnIndex(0x00FF & self::getInt2d($cellAddressStructure, 2)); // bit: 14; mask 0x4000; (1 = relative column index, 0 = absolute column index) if (!(0x4000 & self::getInt2d($cellAddressStructure, 2))) { @@ -6816,8 +6813,8 @@ class Excel5 extends BaseReader implements IReader */ private function readBIFF8CellAddressB($cellAddressStructure, $baseCell = 'A1') { - list($baseCol, $baseRow) = \PHPExcel\Cell::coordinateFromString($baseCell); - $baseCol = \PHPExcel\Cell::columnIndexFromString($baseCol) - 1; + list($baseCol, $baseRow) = \PhpSpreadsheet\Cell::coordinateFromString($baseCell); + $baseCol = \PhpSpreadsheet\Cell::columnIndexFromString($baseCol) - 1; // offset: 0; size: 2; index to row (0... 65535) (or offset (-32768... 32767)) $rowIndex = self::getInt2d($cellAddressStructure, 0); @@ -6829,11 +6826,11 @@ class Excel5 extends BaseReader implements IReader // bit: 14; mask 0x4000; (1 = relative column index, 0 = absolute column index) if (!(0x4000 & self::getInt2d($cellAddressStructure, 2))) { - $column = \PHPExcel\Cell::stringFromColumnIndex($colIndex); + $column = \PhpSpreadsheet\Cell::stringFromColumnIndex($colIndex); $column = '$' . $column; } else { $colIndex = ($colIndex <= 127) ? $colIndex : $colIndex - 256; - $column = \PHPExcel\Cell::stringFromColumnIndex($baseCol + $colIndex); + $column = \PhpSpreadsheet\Cell::stringFromColumnIndex($baseCol + $colIndex); } // bit: 15; mask 0x8000; (1 = relative row index, 0 = absolute row index) @@ -6877,8 +6874,8 @@ class Excel5 extends BaseReader implements IReader } // column index to letter - $fc = \PHPExcel\Cell::stringFromColumnIndex($fc); - $lc = \PHPExcel\Cell::stringFromColumnIndex($lc); + $fc = \PhpSpreadsheet\Cell::stringFromColumnIndex($fc); + $lc = \PhpSpreadsheet\Cell::stringFromColumnIndex($lc); if ($fr == $lr and $fc == $lc) { return "$fc$fr"; @@ -6916,8 +6913,8 @@ class Excel5 extends BaseReader implements IReader } // column index to letter - $fc = \PHPExcel\Cell::stringFromColumnIndex($fc); - $lc = \PHPExcel\Cell::stringFromColumnIndex($lc); + $fc = \PhpSpreadsheet\Cell::stringFromColumnIndex($fc); + $lc = \PhpSpreadsheet\Cell::stringFromColumnIndex($lc); if ($fr == $lr and $fc == $lc) { return "$fc$fr"; @@ -6948,7 +6945,7 @@ class Excel5 extends BaseReader implements IReader // offset: 4; size: 2; index to first column or column offset + relative flags // bit: 7-0; mask 0x00FF; column index - $fc = \PHPExcel\Cell::stringFromColumnIndex(0x00FF & self::getInt2d($subData, 4)); + $fc = \PhpSpreadsheet\Cell::stringFromColumnIndex(0x00FF & self::getInt2d($subData, 4)); // bit: 14; mask 0x4000; (1 = relative column index, 0 = absolute column index) if (!(0x4000 & self::getInt2d($subData, 4))) { @@ -6963,7 +6960,7 @@ class Excel5 extends BaseReader implements IReader // offset: 6; size: 2; index to last column or column offset + relative flags // bit: 7-0; mask 0x00FF; column index - $lc = \PHPExcel\Cell::stringFromColumnIndex(0x00FF & self::getInt2d($subData, 6)); + $lc = \PhpSpreadsheet\Cell::stringFromColumnIndex(0x00FF & self::getInt2d($subData, 6)); // bit: 14; mask 0x4000; (1 = relative column index, 0 = absolute column index) if (!(0x4000 & self::getInt2d($subData, 6))) { @@ -6990,8 +6987,8 @@ class Excel5 extends BaseReader implements IReader */ private function readBIFF8CellRangeAddressB($subData, $baseCell = 'A1') { - list($baseCol, $baseRow) = \PHPExcel\Cell::coordinateFromString($baseCell); - $baseCol = \PHPExcel\Cell::columnIndexFromString($baseCol) - 1; + list($baseCol, $baseRow) = \PhpSpreadsheet\Cell::coordinateFromString($baseCell); + $baseCol = \PhpSpreadsheet\Cell::columnIndexFromString($baseCol) - 1; // TODO: if cell range is just a single cell, should this funciton // not just return e.g. 'A1' and not 'A1:A1' ? @@ -7010,12 +7007,12 @@ class Excel5 extends BaseReader implements IReader // bit: 14; mask 0x4000; (1 = relative column index, 0 = absolute column index) if (!(0x4000 & self::getInt2d($subData, 4))) { // absolute column index - $fc = \PHPExcel\Cell::stringFromColumnIndex($fcIndex); + $fc = \PhpSpreadsheet\Cell::stringFromColumnIndex($fcIndex); $fc = '$' . $fc; } else { // column offset $fcIndex = ($fcIndex <= 127) ? $fcIndex : $fcIndex - 256; - $fc = \PHPExcel\Cell::stringFromColumnIndex($baseCol + $fcIndex); + $fc = \PhpSpreadsheet\Cell::stringFromColumnIndex($baseCol + $fcIndex); } // bit: 15; mask 0x8000; (1 = relative row index, 0 = absolute row index) @@ -7034,17 +7031,17 @@ class Excel5 extends BaseReader implements IReader // bit: 7-0; mask 0x00FF; column index $lcIndex = 0x00FF & self::getInt2d($subData, 6); $lcIndex = ($lcIndex <= 127) ? $lcIndex : $lcIndex - 256; - $lc = \PHPExcel\Cell::stringFromColumnIndex($baseCol + $lcIndex); + $lc = \PhpSpreadsheet\Cell::stringFromColumnIndex($baseCol + $lcIndex); // bit: 14; mask 0x4000; (1 = relative column index, 0 = absolute column index) if (!(0x4000 & self::getInt2d($subData, 6))) { // absolute column index - $lc = \PHPExcel\Cell::stringFromColumnIndex($lcIndex); + $lc = \PhpSpreadsheet\Cell::stringFromColumnIndex($lcIndex); $lc = '$' . $lc; } else { // column offset $lcIndex = ($lcIndex <= 127) ? $lcIndex : $lcIndex - 256; - $lc = \PHPExcel\Cell::stringFromColumnIndex($baseCol + $lcIndex); + $lc = \PhpSpreadsheet\Cell::stringFromColumnIndex($baseCol + $lcIndex); } // bit: 15; mask 0x8000; (1 = relative row index, 0 = absolute row index) @@ -7499,7 +7496,7 @@ class Excel5 extends BaseReader implements IReader $string = self::uncompressByteString($string); } - return \PHPExcel\Shared\StringHelper::convertEncoding($string, 'UTF-8', 'UTF-16LE'); + return \PhpSpreadsheet\Shared\StringHelper::convertEncoding($string, 'UTF-8', 'UTF-16LE'); } @@ -7529,7 +7526,7 @@ class Excel5 extends BaseReader implements IReader */ private function decodeCodepage($string) { - return \PHPExcel\Shared\StringHelper::convertEncoding($string, 'UTF-8', $this->codepage); + return \PhpSpreadsheet\Shared\StringHelper::convertEncoding($string, 'UTF-8', $this->codepage); } @@ -7571,7 +7568,7 @@ class Excel5 extends BaseReader implements IReader private function parseRichText($is = '') { - $value = new \PHPExcel\RichText(); + $value = new \PhpSpreadsheet\RichText(); $value->createText($is); return $value; diff --git a/src/PhpSpreadsheet/Reader/Excel5/Color.php b/src/PhpSpreadsheet/Reader/Excel5/Color.php index 4b7e1f80..7b042c4b 100644 --- a/src/PhpSpreadsheet/Reader/Excel5/Color.php +++ b/src/PhpSpreadsheet/Reader/Excel5/Color.php @@ -1,6 +1,6 @@ pos < $this->dataSize) { // offset: 2; size: 2: Record Type - $fbt = \PHPExcel\Reader\Excel5::getInt2d($this->data, $this->pos + 2); + $fbt = \PhpSpreadsheet\Reader\Excel5::getInt2d($this->data, $this->pos + 2); switch ($fbt) { case self::DGGCONTAINER: @@ -175,15 +172,15 @@ class Escher private function readDefault() { // offset 0; size: 2; recVer and recInstance - $verInstance = \PHPExcel\Reader\Excel5::getInt2d($this->data, $this->pos); + $verInstance = \PhpSpreadsheet\Reader\Excel5::getInt2d($this->data, $this->pos); // offset: 2; size: 2: Record Type - $fbt = \PHPExcel\Reader\Excel5::getInt2d($this->data, $this->pos + 2); + $fbt = \PhpSpreadsheet\Reader\Excel5::getInt2d($this->data, $this->pos + 2); // bit: 0-3; mask: 0x000F; recVer $recVer = (0x000F & $verInstance) >> 0; - $length = \PHPExcel\Reader\Excel5::getInt4d($this->data, $this->pos + 4); + $length = \PhpSpreadsheet\Reader\Excel5::getInt4d($this->data, $this->pos + 4); $recordData = substr($this->data, $this->pos + 8, $length); // move stream pointer to next record @@ -195,14 +192,14 @@ class Escher */ private function readDggContainer() { - $length = \PHPExcel\Reader\Excel5::getInt4d($this->data, $this->pos + 4); + $length = \PhpSpreadsheet\Reader\Excel5::getInt4d($this->data, $this->pos + 4); $recordData = substr($this->data, $this->pos + 8, $length); // move stream pointer to next record $this->pos += 8 + $length; // record is a container, read contents - $dggContainer = new \PHPExcel\Shared\Escher\DggContainer(); + $dggContainer = new \PhpSpreadsheet\Shared\Escher\DggContainer(); $this->object->setDggContainer($dggContainer); $reader = new Escher($dggContainer); $reader->load($recordData); @@ -213,7 +210,7 @@ class Escher */ private function readDgg() { - $length = \PHPExcel\Reader\Excel5::getInt4d($this->data, $this->pos + 4); + $length = \PhpSpreadsheet\Reader\Excel5::getInt4d($this->data, $this->pos + 4); $recordData = substr($this->data, $this->pos + 8, $length); // move stream pointer to next record @@ -225,14 +222,14 @@ class Escher */ private function readBstoreContainer() { - $length = \PHPExcel\Reader\Excel5::getInt4d($this->data, $this->pos + 4); + $length = \PhpSpreadsheet\Reader\Excel5::getInt4d($this->data, $this->pos + 4); $recordData = substr($this->data, $this->pos + 8, $length); // move stream pointer to next record $this->pos += 8 + $length; // record is a container, read contents - $bstoreContainer = new \PHPExcel\Shared\Escher\DggContainer\BstoreContainer(); + $bstoreContainer = new \PhpSpreadsheet\Shared\Escher\DggContainer\BstoreContainer(); $this->object->setBstoreContainer($bstoreContainer); $reader = new Escher($bstoreContainer); $reader->load($recordData); @@ -246,16 +243,16 @@ class Escher // offset: 0; size: 2; recVer and recInstance // bit: 4-15; mask: 0xFFF0; recInstance - $recInstance = (0xFFF0 & \PHPExcel\Reader\Excel5::getInt2d($this->data, $this->pos)) >> 4; + $recInstance = (0xFFF0 & \PhpSpreadsheet\Reader\Excel5::getInt2d($this->data, $this->pos)) >> 4; - $length = \PHPExcel\Reader\Excel5::getInt4d($this->data, $this->pos + 4); + $length = \PhpSpreadsheet\Reader\Excel5::getInt4d($this->data, $this->pos + 4); $recordData = substr($this->data, $this->pos + 8, $length); // move stream pointer to next record $this->pos += 8 + $length; // add BSE to BstoreContainer - $BSE = new \PHPExcel\Shared\Escher\DggContainer\BstoreContainer\BSE(); + $BSE = new \PhpSpreadsheet\Shared\Escher\DggContainer\BstoreContainer\BSE(); $this->object->addBSE($BSE); $BSE->setBLIPType($recInstance); @@ -270,16 +267,16 @@ class Escher $rgbUid = substr($recordData, 2, 16); // offset: 18; size: 2; tag - $tag = \PHPExcel\Reader\Excel5::getInt2d($recordData, 18); + $tag = \PhpSpreadsheet\Reader\Excel5::getInt2d($recordData, 18); // offset: 20; size: 4; size of BLIP in bytes - $size = \PHPExcel\Reader\Excel5::getInt4d($recordData, 20); + $size = \PhpSpreadsheet\Reader\Excel5::getInt4d($recordData, 20); // offset: 24; size: 4; number of references to this BLIP - $cRef = \PHPExcel\Reader\Excel5::getInt4d($recordData, 24); + $cRef = \PhpSpreadsheet\Reader\Excel5::getInt4d($recordData, 24); // offset: 28; size: 4; MSOFO file offset - $foDelay = \PHPExcel\Reader\Excel5::getInt4d($recordData, 28); + $foDelay = \PhpSpreadsheet\Reader\Excel5::getInt4d($recordData, 28); // offset: 32; size: 1; unused1 $unused1 = ord($recordData{32}); @@ -300,7 +297,7 @@ class Escher $blipData = substr($recordData, 36 + $cbName); // record is a container, read contents - $reader = new \PHPExcel\Reader\Excel5\Escher($BSE); + $reader = new \PhpSpreadsheet\Reader\Excel5\Escher($BSE); $reader->load($blipData); } @@ -312,9 +309,9 @@ class Escher // offset: 0; size: 2; recVer and recInstance // bit: 4-15; mask: 0xFFF0; recInstance - $recInstance = (0xFFF0 & \PHPExcel\Reader\Excel5::getInt2d($this->data, $this->pos)) >> 4; + $recInstance = (0xFFF0 & \PhpSpreadsheet\Reader\Excel5::getInt2d($this->data, $this->pos)) >> 4; - $length = \PHPExcel\Reader\Excel5::getInt4d($this->data, $this->pos + 4); + $length = \PhpSpreadsheet\Reader\Excel5::getInt4d($this->data, $this->pos + 4); $recordData = substr($this->data, $this->pos + 8, $length); // move stream pointer to next record @@ -339,7 +336,7 @@ class Escher // offset: var; size: var; the raw image data $data = substr($recordData, $pos); - $blip = new \PHPExcel\Shared\Escher\DggContainer\BstoreContainer\BSE\Blip(); + $blip = new \PhpSpreadsheet\Shared\Escher\DggContainer\BstoreContainer\BSE\Blip(); $blip->setData($data); $this->object->setBlip($blip); @@ -353,9 +350,9 @@ class Escher // offset: 0; size: 2; recVer and recInstance // bit: 4-15; mask: 0xFFF0; recInstance - $recInstance = (0xFFF0 & \PHPExcel\Reader\Excel5::getInt2d($this->data, $this->pos)) >> 4; + $recInstance = (0xFFF0 & \PhpSpreadsheet\Reader\Excel5::getInt2d($this->data, $this->pos)) >> 4; - $length = \PHPExcel\Reader\Excel5::getInt4d($this->data, $this->pos + 4); + $length = \PhpSpreadsheet\Reader\Excel5::getInt4d($this->data, $this->pos + 4); $recordData = substr($this->data, $this->pos + 8, $length); // move stream pointer to next record @@ -380,7 +377,7 @@ class Escher // offset: var; size: var; the raw image data $data = substr($recordData, $pos); - $blip = new \PHPExcel\Shared\Escher\DggContainer\BstoreContainer\BSE\Blip(); + $blip = new \PhpSpreadsheet\Shared\Escher\DggContainer\BstoreContainer\BSE\Blip(); $blip->setData($data); $this->object->setBlip($blip); @@ -394,9 +391,9 @@ class Escher // offset: 0; size: 2; recVer and recInstance // bit: 4-15; mask: 0xFFF0; recInstance - $recInstance = (0xFFF0 & \PHPExcel\Reader\Excel5::getInt2d($this->data, $this->pos)) >> 4; + $recInstance = (0xFFF0 & \PhpSpreadsheet\Reader\Excel5::getInt2d($this->data, $this->pos)) >> 4; - $length = \PHPExcel\Reader\Excel5::getInt4d($this->data, $this->pos + 4); + $length = \PhpSpreadsheet\Reader\Excel5::getInt4d($this->data, $this->pos + 4); $recordData = substr($this->data, $this->pos + 8, $length); // move stream pointer to next record @@ -413,9 +410,9 @@ class Escher // offset: 0; size: 2; recVer and recInstance // bit: 4-15; mask: 0xFFF0; recInstance - $recInstance = (0xFFF0 & \PHPExcel\Reader\Excel5::getInt2d($this->data, $this->pos)) >> 4; + $recInstance = (0xFFF0 & \PhpSpreadsheet\Reader\Excel5::getInt2d($this->data, $this->pos)) >> 4; - $length = \PHPExcel\Reader\Excel5::getInt4d($this->data, $this->pos + 4); + $length = \PhpSpreadsheet\Reader\Excel5::getInt4d($this->data, $this->pos + 4); $recordData = substr($this->data, $this->pos + 8, $length); // move stream pointer to next record @@ -427,7 +424,7 @@ class Escher */ private function readSplitMenuColors() { - $length = \PHPExcel\Reader\Excel5::getInt4d($this->data, $this->pos + 4); + $length = \PhpSpreadsheet\Reader\Excel5::getInt4d($this->data, $this->pos + 4); $recordData = substr($this->data, $this->pos + 8, $length); // move stream pointer to next record @@ -439,16 +436,16 @@ class Escher */ private function readDgContainer() { - $length = \PHPExcel\Reader\Excel5::getInt4d($this->data, $this->pos + 4); + $length = \PhpSpreadsheet\Reader\Excel5::getInt4d($this->data, $this->pos + 4); $recordData = substr($this->data, $this->pos + 8, $length); // move stream pointer to next record $this->pos += 8 + $length; // record is a container, read contents - $dgContainer = new \PHPExcel\Shared\Escher\DgContainer(); + $dgContainer = new \PhpSpreadsheet\Shared\Escher\DgContainer(); $this->object->setDgContainer($dgContainer); - $reader = new \PHPExcel\Reader\Excel5\Escher($dgContainer); + $reader = new \PhpSpreadsheet\Reader\Excel5\Escher($dgContainer); $escher = $reader->load($recordData); } @@ -457,7 +454,7 @@ class Escher */ private function readDg() { - $length = \PHPExcel\Reader\Excel5::getInt4d($this->data, $this->pos + 4); + $length = \PhpSpreadsheet\Reader\Excel5::getInt4d($this->data, $this->pos + 4); $recordData = substr($this->data, $this->pos + 8, $length); // move stream pointer to next record @@ -471,16 +468,16 @@ class Escher { // context is either context DgContainer or SpgrContainer - $length = \PHPExcel\Reader\Excel5::getInt4d($this->data, $this->pos + 4); + $length = \PhpSpreadsheet\Reader\Excel5::getInt4d($this->data, $this->pos + 4); $recordData = substr($this->data, $this->pos + 8, $length); // move stream pointer to next record $this->pos += 8 + $length; // record is a container, read contents - $spgrContainer = new \PHPExcel\Shared\Escher\DgContainer\SpgrContainer(); + $spgrContainer = new \PhpSpreadsheet\Shared\Escher\DgContainer\SpgrContainer(); - if ($this->object instanceof \PHPExcel\Shared\Escher\DgContainer) { + if ($this->object instanceof \PhpSpreadsheet\Shared\Escher\DgContainer) { // DgContainer $this->object->setSpgrContainer($spgrContainer); } else { @@ -497,11 +494,11 @@ class Escher */ private function readSpContainer() { - $length = \PHPExcel\Reader\Excel5::getInt4d($this->data, $this->pos + 4); + $length = \PhpSpreadsheet\Reader\Excel5::getInt4d($this->data, $this->pos + 4); $recordData = substr($this->data, $this->pos + 8, $length); // add spContainer to spgrContainer - $spContainer = new \PHPExcel\Shared\Escher\DgContainer\SpgrContainer\SpContainer(); + $spContainer = new \PhpSpreadsheet\Shared\Escher\DgContainer\SpgrContainer\SpContainer(); $this->object->addChild($spContainer); // move stream pointer to next record @@ -517,7 +514,7 @@ class Escher */ private function readSpgr() { - $length = \PHPExcel\Reader\Excel5::getInt4d($this->data, $this->pos + 4); + $length = \PhpSpreadsheet\Reader\Excel5::getInt4d($this->data, $this->pos + 4); $recordData = substr($this->data, $this->pos + 8, $length); // move stream pointer to next record @@ -532,9 +529,9 @@ class Escher // offset: 0; size: 2; recVer and recInstance // bit: 4-15; mask: 0xFFF0; recInstance - $recInstance = (0xFFF0 & \PHPExcel\Reader\Excel5::getInt2d($this->data, $this->pos)) >> 4; + $recInstance = (0xFFF0 & \PhpSpreadsheet\Reader\Excel5::getInt2d($this->data, $this->pos)) >> 4; - $length = \PHPExcel\Reader\Excel5::getInt4d($this->data, $this->pos + 4); + $length = \PhpSpreadsheet\Reader\Excel5::getInt4d($this->data, $this->pos + 4); $recordData = substr($this->data, $this->pos + 8, $length); // move stream pointer to next record @@ -549,9 +546,9 @@ class Escher // offset: 0; size: 2; recVer and recInstance // bit: 4-15; mask: 0xFFF0; recInstance - $recInstance = (0xFFF0 & \PHPExcel\Reader\Excel5::getInt2d($this->data, $this->pos)) >> 4; + $recInstance = (0xFFF0 & \PhpSpreadsheet\Reader\Excel5::getInt2d($this->data, $this->pos)) >> 4; - $length = \PHPExcel\Reader\Excel5::getInt4d($this->data, $this->pos + 4); + $length = \PhpSpreadsheet\Reader\Excel5::getInt4d($this->data, $this->pos + 4); $recordData = substr($this->data, $this->pos + 8, $length); // move stream pointer to next record @@ -563,38 +560,38 @@ class Escher */ private function readClientAnchor() { - $length = \PHPExcel\Reader\Excel5::getInt4d($this->data, $this->pos + 4); + $length = \PhpSpreadsheet\Reader\Excel5::getInt4d($this->data, $this->pos + 4); $recordData = substr($this->data, $this->pos + 8, $length); // move stream pointer to next record $this->pos += 8 + $length; // offset: 2; size: 2; upper-left corner column index (0-based) - $c1 = \PHPExcel\Reader\Excel5::getInt2d($recordData, 2); + $c1 = \PhpSpreadsheet\Reader\Excel5::getInt2d($recordData, 2); // offset: 4; size: 2; upper-left corner horizontal offset in 1/1024 of column width - $startOffsetX = \PHPExcel\Reader\Excel5::getInt2d($recordData, 4); + $startOffsetX = \PhpSpreadsheet\Reader\Excel5::getInt2d($recordData, 4); // offset: 6; size: 2; upper-left corner row index (0-based) - $r1 = \PHPExcel\Reader\Excel5::getInt2d($recordData, 6); + $r1 = \PhpSpreadsheet\Reader\Excel5::getInt2d($recordData, 6); // offset: 8; size: 2; upper-left corner vertical offset in 1/256 of row height - $startOffsetY = \PHPExcel\Reader\Excel5::getInt2d($recordData, 8); + $startOffsetY = \PhpSpreadsheet\Reader\Excel5::getInt2d($recordData, 8); // offset: 10; size: 2; bottom-right corner column index (0-based) - $c2 = \PHPExcel\Reader\Excel5::getInt2d($recordData, 10); + $c2 = \PhpSpreadsheet\Reader\Excel5::getInt2d($recordData, 10); // offset: 12; size: 2; bottom-right corner horizontal offset in 1/1024 of column width - $endOffsetX = \PHPExcel\Reader\Excel5::getInt2d($recordData, 12); + $endOffsetX = \PhpSpreadsheet\Reader\Excel5::getInt2d($recordData, 12); // offset: 14; size: 2; bottom-right corner row index (0-based) - $r2 = \PHPExcel\Reader\Excel5::getInt2d($recordData, 14); + $r2 = \PhpSpreadsheet\Reader\Excel5::getInt2d($recordData, 14); // offset: 16; size: 2; bottom-right corner vertical offset in 1/256 of row height - $endOffsetY = \PHPExcel\Reader\Excel5::getInt2d($recordData, 16); + $endOffsetY = \PhpSpreadsheet\Reader\Excel5::getInt2d($recordData, 16); // set the start coordinates - $this->object->setStartCoordinates(\PHPExcel\Cell::stringFromColumnIndex($c1) . ($r1 + 1)); + $this->object->setStartCoordinates(\PhpSpreadsheet\Cell::stringFromColumnIndex($c1) . ($r1 + 1)); // set the start offsetX $this->object->setStartOffsetX($startOffsetX); @@ -603,7 +600,7 @@ class Escher $this->object->setStartOffsetY($startOffsetY); // set the end coordinates - $this->object->setEndCoordinates(\PHPExcel\Cell::stringFromColumnIndex($c2) . ($r2 + 1)); + $this->object->setEndCoordinates(\PhpSpreadsheet\Cell::stringFromColumnIndex($c2) . ($r2 + 1)); // set the end offsetX $this->object->setEndOffsetX($endOffsetX); @@ -617,7 +614,7 @@ class Escher */ private function readClientData() { - $length = \PHPExcel\Reader\Excel5::getInt4d($this->data, $this->pos + 4); + $length = \PhpSpreadsheet\Reader\Excel5::getInt4d($this->data, $this->pos + 4); $recordData = substr($this->data, $this->pos + 8, $length); // move stream pointer to next record @@ -640,7 +637,7 @@ class Escher $fopte = substr($data, 6 * $i, 6); // offset: 0; size: 2; opid - $opid = \PHPExcel\Reader\Excel5::getInt2d($fopte, 0); + $opid = \PhpSpreadsheet\Reader\Excel5::getInt2d($fopte, 0); // bit: 0-13; mask: 0x3FFF; opid.opid $opidOpid = (0x3FFF & $opid) >> 0; @@ -652,7 +649,7 @@ class Escher $opidFComplex = (0x8000 & $opid) >> 15; // offset: 2; size: 4; the value for this property - $op = \PHPExcel\Reader\Excel5::getInt4d($fopte, 2); + $op = \PhpSpreadsheet\Reader\Excel5::getInt4d($fopte, 2); if ($opidFComplex) { $complexData = substr($splicedComplexData, 0, $op); diff --git a/src/PhpSpreadsheet/Reader/Excel5/MD5.php b/src/PhpSpreadsheet/Reader/Excel5/MD5.php index dc174bcd..e2dd51b0 100644 --- a/src/PhpSpreadsheet/Reader/Excel5/MD5.php +++ b/src/PhpSpreadsheet/Reader/Excel5/MD5.php @@ -1,11 +1,9 @@ readFilter = new DefaultReadFilter(); - $this->referenceHelper = \PHPExcel\ReferenceHelper::getInstance(); + $this->referenceHelper = \PhpSpreadsheet\ReferenceHelper::getInstance(); } /** @@ -86,7 +83,7 @@ class Gnumeric extends BaseReader implements IReader } /** - * Reads names of the worksheets from a file, without parsing the whole file to a PHPExcel object + * Reads names of the worksheets from a file, without parsing the whole file to a PhpSpreadsheet object * * @param string $pFilename * @throws Exception @@ -99,7 +96,7 @@ class Gnumeric extends BaseReader implements IReader } $xml = new XMLReader(); - $xml->xml($this->securityScanFile('compress.zlib://'.realpath($pFilename)), null, \PHPExcel\Settings::getLibXmlLoaderOptions()); + $xml->xml($this->securityScanFile('compress.zlib://'.realpath($pFilename)), null, \PhpSpreadsheet\Settings::getLibXmlLoaderOptions()); $xml->setParserProperty(2, true); $worksheetNames = array(); @@ -130,7 +127,7 @@ class Gnumeric extends BaseReader implements IReader } $xml = new XMLReader(); - $xml->xml($this->securityScanFile('compress.zlib://'.realpath($pFilename)), null, \PHPExcel\Settings::getLibXmlLoaderOptions()); + $xml->xml($this->securityScanFile('compress.zlib://'.realpath($pFilename)), null, \PhpSpreadsheet\Settings::getLibXmlLoaderOptions()); $xml->setParserProperty(2, true); $worksheetInfo = array(); @@ -158,7 +155,7 @@ class Gnumeric extends BaseReader implements IReader break; } } - $tmpInfo['lastColumnLetter'] = \PHPExcel\Cell::stringFromColumnIndex($tmpInfo['lastColumnIndex']); + $tmpInfo['lastColumnLetter'] = \PhpSpreadsheet\Cell::stringFromColumnIndex($tmpInfo['lastColumnIndex']); $worksheetInfo[] = $tmpInfo; } } @@ -180,30 +177,30 @@ class Gnumeric extends BaseReader implements IReader } /** - * Loads PHPExcel from file + * Loads PhpSpreadsheet from file * * @param string $pFilename - * @return PHPExcel + * @return PhpSpreadsheet * @throws Exception */ public function load($pFilename) { - // Create new PHPExcel - $objPHPExcel = new PHPExcel(); + // Create new PhpSpreadsheet + $spreadsheet = new PhpSpreadsheet(); // Load into this instance - return $this->loadIntoExisting($pFilename, $objPHPExcel); + return $this->loadIntoExisting($pFilename, $spreadsheet); } /** - * Loads PHPExcel from file into PHPExcel instance + * Loads PhpSpreadsheet from file into PhpSpreadsheet instance * * @param string $pFilename - * @param PHPExcel $objPHPExcel - * @return PHPExcel + * @param \PhpSpreadsheet\Spreadsheet $spreadsheet + * @return PhpSpreadsheet * @throws Exception */ - public function loadIntoExisting($pFilename, PHPExcel $objPHPExcel) + public function loadIntoExisting($pFilename, \PhpSpreadsheet\Spreadsheet $spreadsheet) { // Check if file exists if (!file_exists($pFilename)) { @@ -219,14 +216,14 @@ class Gnumeric extends BaseReader implements IReader // echo htmlentities($gFileData,ENT_QUOTES,'UTF-8'); // echo '
'; // - $xml = simplexml_load_string($this->securityScan($gFileData), 'SimpleXMLElement', \PHPExcel\Settings::getLibXmlLoaderOptions()); + $xml = simplexml_load_string($this->securityScan($gFileData), 'SimpleXMLElement', \PhpSpreadsheet\Settings::getLibXmlLoaderOptions()); $namespacesMeta = $xml->getNamespaces(true); // var_dump($namespacesMeta); // $gnmXML = $xml->children($namespacesMeta['gnm']); - $docProps = $objPHPExcel->getProperties(); + $docProps = $spreadsheet->getProperties(); // Document Properties are held differently, depending on the version of Gnumeric if (isset($namespacesMeta['office'])) { $officeXML = $xml->children($namespacesMeta['office']); @@ -340,12 +337,12 @@ class Gnumeric extends BaseReader implements IReader $maxRow = $maxCol = 0; // Create new Worksheet - $objPHPExcel->createSheet(); - $objPHPExcel->setActiveSheetIndex($worksheetID); + $spreadsheet->createSheet(); + $spreadsheet->setActiveSheetIndex($worksheetID); // Use false for $updateFormulaCellReferences to prevent adjustment of worksheet references in formula // cells... during the load, all formulae should be correct, and we're simply bringing the worksheet // name in line with the formula, not the reverse - $objPHPExcel->getActiveSheet()->setTitle($worksheetName, false); + $spreadsheet->getActiveSheet()->setTitle($worksheetName, false); if ((!$this->readDataOnly) && (isset($sheet->PrintInformation))) { if (isset($sheet->PrintInformation->Margins)) { @@ -359,22 +356,22 @@ class Gnumeric extends BaseReader implements IReader } switch ($key) { case 'top': - $objPHPExcel->getActiveSheet()->getPageMargins()->setTop($marginSize); + $spreadsheet->getActiveSheet()->getPageMargins()->setTop($marginSize); break; case 'bottom': - $objPHPExcel->getActiveSheet()->getPageMargins()->setBottom($marginSize); + $spreadsheet->getActiveSheet()->getPageMargins()->setBottom($marginSize); break; case 'left': - $objPHPExcel->getActiveSheet()->getPageMargins()->setLeft($marginSize); + $spreadsheet->getActiveSheet()->getPageMargins()->setLeft($marginSize); break; case 'right': - $objPHPExcel->getActiveSheet()->getPageMargins()->setRight($marginSize); + $spreadsheet->getActiveSheet()->getPageMargins()->setRight($marginSize); break; case 'header': - $objPHPExcel->getActiveSheet()->getPageMargins()->setHeader($marginSize); + $spreadsheet->getActiveSheet()->getPageMargins()->setHeader($marginSize); break; case 'footer': - $objPHPExcel->getActiveSheet()->getPageMargins()->setFooter($marginSize); + $spreadsheet->getActiveSheet()->getPageMargins()->setFooter($marginSize); break; } } @@ -393,7 +390,7 @@ class Gnumeric extends BaseReader implements IReader $maxCol = $column; } - $column = \PHPExcel\Cell::stringFromColumnIndex($column); + $column = \PhpSpreadsheet\Cell::stringFromColumnIndex($column); // Read cell? if ($this->getReadFilter() !== null) { @@ -407,7 +404,7 @@ class Gnumeric extends BaseReader implements IReader // echo 'Cell ', $column, $row,'
'; // echo 'Type is ', $ValueType,'
'; // echo 'Value is ', $cell,'
'; - $type = \PHPExcel\Cell\DataType::TYPE_FORMULA; + $type = \PhpSpreadsheet\Cell\DataType::TYPE_FORMULA; if ($ExprID > '') { if (((string) $cell) > '') { $this->expressions[$ExprID] = array( @@ -429,33 +426,33 @@ class Gnumeric extends BaseReader implements IReader // echo 'SHARED EXPRESSION ', $ExprID,'
'; // echo 'New Value is ', $cell,'
'; } - $type = \PHPExcel\Cell\DataType::TYPE_FORMULA; + $type = \PhpSpreadsheet\Cell\DataType::TYPE_FORMULA; } else { switch ($ValueType) { case '10': // NULL - $type = \PHPExcel\Cell\DataType::TYPE_NULL; + $type = \PhpSpreadsheet\Cell\DataType::TYPE_NULL; break; case '20': // Boolean - $type = \PHPExcel\Cell\DataType::TYPE_BOOL; + $type = \PhpSpreadsheet\Cell\DataType::TYPE_BOOL; $cell = ($cell == 'TRUE') ? true: false; break; case '30': // Integer $cell = intval($cell); // Excel 2007+ doesn't differentiate between integer and float, so set the value and dropthru to the next (numeric) case case '40': // Float - $type = \PHPExcel\Cell\DataType::TYPE_NUMERIC; + $type = \PhpSpreadsheet\Cell\DataType::TYPE_NUMERIC; break; case '50': // Error - $type = \PHPExcel\Cell\DataType::TYPE_ERROR; + $type = \PhpSpreadsheet\Cell\DataType::TYPE_ERROR; break; case '60': // String - $type = \PHPExcel\Cell\DataType::TYPE_STRING; + $type = \PhpSpreadsheet\Cell\DataType::TYPE_STRING; break; case '70': // Cell Range case '80': // Array } } - $objPHPExcel->getActiveSheet()->getCell($column.$row)->setValueExplicit($cell, $type); + $spreadsheet->getActiveSheet()->getCell($column.$row)->setValueExplicit($cell, $type); } if ((!$this->readDataOnly) && (isset($sheet->Objects))) { @@ -463,7 +460,7 @@ class Gnumeric extends BaseReader implements IReader $commentAttributes = $comment->attributes(); // Only comment objects are handled at the moment if ($commentAttributes->Text) { - $objPHPExcel->getActiveSheet()->getComment((string)$commentAttributes->ObjectBound)->setAuthor((string)$commentAttributes->Author)->setText($this->parseRichText((string)$commentAttributes->Text)); + $spreadsheet->getActiveSheet()->getComment((string)$commentAttributes->ObjectBound)->setAuthor((string)$commentAttributes->Author)->setText($this->parseRichText((string)$commentAttributes->Text)); } } } @@ -473,11 +470,11 @@ class Gnumeric extends BaseReader implements IReader $styleAttributes = $styleRegion->attributes(); if (($styleAttributes['startRow'] <= $maxRow) && ($styleAttributes['startCol'] <= $maxCol)) { - $startColumn = \PHPExcel\Cell::stringFromColumnIndex((int) $styleAttributes['startCol']); + $startColumn = \PhpSpreadsheet\Cell::stringFromColumnIndex((int) $styleAttributes['startCol']); $startRow = $styleAttributes['startRow'] + 1; $endColumn = ($styleAttributes['endCol'] > $maxCol) ? $maxCol : (int) $styleAttributes['endCol']; - $endColumn = \PHPExcel\Cell::stringFromColumnIndex($endColumn); + $endColumn = \PhpSpreadsheet\Cell::stringFromColumnIndex($endColumn); $endRow = ($styleAttributes['endRow'] > $maxRow) ? $maxRow : $styleAttributes['endRow']; $endRow += 1; $cellRange = $startColumn.$startRow.':'.$endColumn.$endRow; @@ -489,45 +486,45 @@ class Gnumeric extends BaseReader implements IReader // We still set the number format mask for date/time values, even if readDataOnly is true if ((!$this->readDataOnly) || - (\PHPExcel\Shared\Date::isDateTimeFormatCode((string) $styleAttributes['Format']))) { + (\PhpSpreadsheet\Shared\Date::isDateTimeFormatCode((string) $styleAttributes['Format']))) { $styleArray = array(); $styleArray['numberformat']['code'] = (string) $styleAttributes['Format']; // If readDataOnly is false, we set all formatting information if (!$this->readDataOnly) { switch ($styleAttributes['HAlign']) { case '1': - $styleArray['alignment']['horizontal'] = \PHPExcel\Style\Alignment::HORIZONTAL_GENERAL; + $styleArray['alignment']['horizontal'] = \PhpSpreadsheet\Style\Alignment::HORIZONTAL_GENERAL; break; case '2': - $styleArray['alignment']['horizontal'] = \PHPExcel\Style\Alignment::HORIZONTAL_LEFT; + $styleArray['alignment']['horizontal'] = \PhpSpreadsheet\Style\Alignment::HORIZONTAL_LEFT; break; case '4': - $styleArray['alignment']['horizontal'] = \PHPExcel\Style\Alignment::HORIZONTAL_RIGHT; + $styleArray['alignment']['horizontal'] = \PhpSpreadsheet\Style\Alignment::HORIZONTAL_RIGHT; break; case '8': - $styleArray['alignment']['horizontal'] = \PHPExcel\Style\Alignment::HORIZONTAL_CENTER; + $styleArray['alignment']['horizontal'] = \PhpSpreadsheet\Style\Alignment::HORIZONTAL_CENTER; break; case '16': case '64': - $styleArray['alignment']['horizontal'] = \PHPExcel\Style\Alignment::HORIZONTAL_CENTER_CONTINUOUS; + $styleArray['alignment']['horizontal'] = \PhpSpreadsheet\Style\Alignment::HORIZONTAL_CENTER_CONTINUOUS; break; case '32': - $styleArray['alignment']['horizontal'] = \PHPExcel\Style\Alignment::HORIZONTAL_JUSTIFY; + $styleArray['alignment']['horizontal'] = \PhpSpreadsheet\Style\Alignment::HORIZONTAL_JUSTIFY; break; } switch ($styleAttributes['VAlign']) { case '1': - $styleArray['alignment']['vertical'] = \PHPExcel\Style\Alignment::VERTICAL_TOP; + $styleArray['alignment']['vertical'] = \PhpSpreadsheet\Style\Alignment::VERTICAL_TOP; break; case '2': - $styleArray['alignment']['vertical'] = \PHPExcel\Style\Alignment::VERTICAL_BOTTOM; + $styleArray['alignment']['vertical'] = \PhpSpreadsheet\Style\Alignment::VERTICAL_BOTTOM; break; case '4': - $styleArray['alignment']['vertical'] = \PHPExcel\Style\Alignment::VERTICAL_CENTER; + $styleArray['alignment']['vertical'] = \PhpSpreadsheet\Style\Alignment::VERTICAL_CENTER; break; case '8': - $styleArray['alignment']['vertical'] = \PHPExcel\Style\Alignment::VERTICAL_JUSTIFY; + $styleArray['alignment']['vertical'] = \PhpSpreadsheet\Style\Alignment::VERTICAL_JUSTIFY; break; } @@ -545,64 +542,64 @@ class Gnumeric extends BaseReader implements IReader $styleArray['fill']['endcolor']['rgb'] = $RGB2; switch ($shade) { case '1': - $styleArray['fill']['type'] = \PHPExcel\Style\Fill::FILL_SOLID; + $styleArray['fill']['type'] = \PhpSpreadsheet\Style\Fill::FILL_SOLID; break; case '2': - $styleArray['fill']['type'] = \PHPExcel\Style\Fill::FILL_GRADIENT_LINEAR; + $styleArray['fill']['type'] = \PhpSpreadsheet\Style\Fill::FILL_GRADIENT_LINEAR; break; case '3': - $styleArray['fill']['type'] = \PHPExcel\Style\Fill::FILL_GRADIENT_PATH; + $styleArray['fill']['type'] = \PhpSpreadsheet\Style\Fill::FILL_GRADIENT_PATH; break; case '4': - $styleArray['fill']['type'] = \PHPExcel\Style\Fill::FILL_PATTERN_DARKDOWN; + $styleArray['fill']['type'] = \PhpSpreadsheet\Style\Fill::FILL_PATTERN_DARKDOWN; break; case '5': - $styleArray['fill']['type'] = \PHPExcel\Style\Fill::FILL_PATTERN_DARKGRAY; + $styleArray['fill']['type'] = \PhpSpreadsheet\Style\Fill::FILL_PATTERN_DARKGRAY; break; case '6': - $styleArray['fill']['type'] = \PHPExcel\Style\Fill::FILL_PATTERN_DARKGRID; + $styleArray['fill']['type'] = \PhpSpreadsheet\Style\Fill::FILL_PATTERN_DARKGRID; break; case '7': - $styleArray['fill']['type'] = \PHPExcel\Style\Fill::FILL_PATTERN_DARKHORIZONTAL; + $styleArray['fill']['type'] = \PhpSpreadsheet\Style\Fill::FILL_PATTERN_DARKHORIZONTAL; break; case '8': - $styleArray['fill']['type'] = \PHPExcel\Style\Fill::FILL_PATTERN_DARKTRELLIS; + $styleArray['fill']['type'] = \PhpSpreadsheet\Style\Fill::FILL_PATTERN_DARKTRELLIS; break; case '9': - $styleArray['fill']['type'] = \PHPExcel\Style\Fill::FILL_PATTERN_DARKUP; + $styleArray['fill']['type'] = \PhpSpreadsheet\Style\Fill::FILL_PATTERN_DARKUP; break; case '10': - $styleArray['fill']['type'] = \PHPExcel\Style\Fill::FILL_PATTERN_DARKVERTICAL; + $styleArray['fill']['type'] = \PhpSpreadsheet\Style\Fill::FILL_PATTERN_DARKVERTICAL; break; case '11': - $styleArray['fill']['type'] = \PHPExcel\Style\Fill::FILL_PATTERN_GRAY0625; + $styleArray['fill']['type'] = \PhpSpreadsheet\Style\Fill::FILL_PATTERN_GRAY0625; break; case '12': - $styleArray['fill']['type'] = \PHPExcel\Style\Fill::FILL_PATTERN_GRAY125; + $styleArray['fill']['type'] = \PhpSpreadsheet\Style\Fill::FILL_PATTERN_GRAY125; break; case '13': - $styleArray['fill']['type'] = \PHPExcel\Style\Fill::FILL_PATTERN_LIGHTDOWN; + $styleArray['fill']['type'] = \PhpSpreadsheet\Style\Fill::FILL_PATTERN_LIGHTDOWN; break; case '14': - $styleArray['fill']['type'] = \PHPExcel\Style\Fill::FILL_PATTERN_LIGHTGRAY; + $styleArray['fill']['type'] = \PhpSpreadsheet\Style\Fill::FILL_PATTERN_LIGHTGRAY; break; case '15': - $styleArray['fill']['type'] = \PHPExcel\Style\Fill::FILL_PATTERN_LIGHTGRID; + $styleArray['fill']['type'] = \PhpSpreadsheet\Style\Fill::FILL_PATTERN_LIGHTGRID; break; case '16': - $styleArray['fill']['type'] = \PHPExcel\Style\Fill::FILL_PATTERN_LIGHTHORIZONTAL; + $styleArray['fill']['type'] = \PhpSpreadsheet\Style\Fill::FILL_PATTERN_LIGHTHORIZONTAL; break; case '17': - $styleArray['fill']['type'] = \PHPExcel\Style\Fill::FILL_PATTERN_LIGHTTRELLIS; + $styleArray['fill']['type'] = \PhpSpreadsheet\Style\Fill::FILL_PATTERN_LIGHTTRELLIS; break; case '18': - $styleArray['fill']['type'] = \PHPExcel\Style\Fill::FILL_PATTERN_LIGHTUP; + $styleArray['fill']['type'] = \PhpSpreadsheet\Style\Fill::FILL_PATTERN_LIGHTUP; break; case '19': - $styleArray['fill']['type'] = \PHPExcel\Style\Fill::FILL_PATTERN_LIGHTVERTICAL; + $styleArray['fill']['type'] = \PhpSpreadsheet\Style\Fill::FILL_PATTERN_LIGHTVERTICAL; break; case '20': - $styleArray['fill']['type'] = \PHPExcel\Style\Fill::FILL_PATTERN_MEDIUMGRAY; + $styleArray['fill']['type'] = \PhpSpreadsheet\Style\Fill::FILL_PATTERN_MEDIUMGRAY; break; } } @@ -617,19 +614,19 @@ class Gnumeric extends BaseReader implements IReader $styleArray['font']['strike'] = ($fontAttributes['StrikeThrough'] == '1') ? true : false; switch ($fontAttributes['Underline']) { case '1': - $styleArray['font']['underline'] = \PHPExcel\Style\Font::UNDERLINE_SINGLE; + $styleArray['font']['underline'] = \PhpSpreadsheet\Style\Font::UNDERLINE_SINGLE; break; case '2': - $styleArray['font']['underline'] = \PHPExcel\Style\Font::UNDERLINE_DOUBLE; + $styleArray['font']['underline'] = \PhpSpreadsheet\Style\Font::UNDERLINE_DOUBLE; break; case '3': - $styleArray['font']['underline'] = \PHPExcel\Style\Font::UNDERLINE_SINGLEACCOUNTING; + $styleArray['font']['underline'] = \PhpSpreadsheet\Style\Font::UNDERLINE_SINGLEACCOUNTING; break; case '4': - $styleArray['font']['underline'] = \PHPExcel\Style\Font::UNDERLINE_DOUBLEACCOUNTING; + $styleArray['font']['underline'] = \PhpSpreadsheet\Style\Font::UNDERLINE_DOUBLEACCOUNTING; break; default: - $styleArray['font']['underline'] = \PHPExcel\Style\Font::UNDERLINE_NONE; + $styleArray['font']['underline'] = \PhpSpreadsheet\Style\Font::UNDERLINE_NONE; break; } switch ($fontAttributes['Script']) { @@ -656,13 +653,13 @@ class Gnumeric extends BaseReader implements IReader } if ((isset($styleRegion->Style->StyleBorder->Diagonal)) && (isset($styleRegion->Style->StyleBorder->{'Rev-Diagonal'}))) { $styleArray['borders']['diagonal'] = self::parseBorderAttributes($styleRegion->Style->StyleBorder->Diagonal->attributes()); - $styleArray['borders']['diagonaldirection'] = \PHPExcel\Style\Borders::DIAGONAL_BOTH; + $styleArray['borders']['diagonaldirection'] = \PhpSpreadsheet\Style\Borders::DIAGONAL_BOTH; } elseif (isset($styleRegion->Style->StyleBorder->Diagonal)) { $styleArray['borders']['diagonal'] = self::parseBorderAttributes($styleRegion->Style->StyleBorder->Diagonal->attributes()); - $styleArray['borders']['diagonaldirection'] = \PHPExcel\Style\Borders::DIAGONAL_UP; + $styleArray['borders']['diagonaldirection'] = \PhpSpreadsheet\Style\Borders::DIAGONAL_UP; } elseif (isset($styleRegion->Style->StyleBorder->{'Rev-Diagonal'})) { $styleArray['borders']['diagonal'] = self::parseBorderAttributes($styleRegion->Style->StyleBorder->{'Rev-Diagonal'}->attributes()); - $styleArray['borders']['diagonaldirection'] = \PHPExcel\Style\Borders::DIAGONAL_DOWN; + $styleArray['borders']['diagonaldirection'] = \PhpSpreadsheet\Style\Borders::DIAGONAL_DOWN; } } if (isset($styleRegion->Style->HyperLink)) { @@ -672,7 +669,7 @@ class Gnumeric extends BaseReader implements IReader } // var_dump($styleArray); // echo '
'; - $objPHPExcel->getActiveSheet()->getStyle($cellRange)->applyFromArray($styleArray); + $spreadsheet->getActiveSheet()->getStyle($cellRange)->applyFromArray($styleArray); } } } @@ -689,19 +686,19 @@ class Gnumeric extends BaseReader implements IReader $hidden = ((isset($columnAttributes['Hidden'])) && ($columnAttributes['Hidden'] == '1')) ? true : false; $columnCount = (isset($columnAttributes['Count'])) ? $columnAttributes['Count'] : 1; while ($c < $column) { - $objPHPExcel->getActiveSheet()->getColumnDimension(\PHPExcel\Cell::stringFromColumnIndex($c))->setWidth($defaultWidth); + $spreadsheet->getActiveSheet()->getColumnDimension(\PhpSpreadsheet\Cell::stringFromColumnIndex($c))->setWidth($defaultWidth); ++$c; } while (($c < ($column+$columnCount)) && ($c <= $maxCol)) { - $objPHPExcel->getActiveSheet()->getColumnDimension(\PHPExcel\Cell::stringFromColumnIndex($c))->setWidth($columnWidth); + $spreadsheet->getActiveSheet()->getColumnDimension(\PhpSpreadsheet\Cell::stringFromColumnIndex($c))->setWidth($columnWidth); if ($hidden) { - $objPHPExcel->getActiveSheet()->getColumnDimension(\PHPExcel\Cell::stringFromColumnIndex($c))->setVisible(false); + $spreadsheet->getActiveSheet()->getColumnDimension(\PhpSpreadsheet\Cell::stringFromColumnIndex($c))->setVisible(false); } ++$c; } } while ($c <= $maxCol) { - $objPHPExcel->getActiveSheet()->getColumnDimension(\PHPExcel\Cell::stringFromColumnIndex($c))->setWidth($defaultWidth); + $spreadsheet->getActiveSheet()->getColumnDimension(\PhpSpreadsheet\Cell::stringFromColumnIndex($c))->setWidth($defaultWidth); ++$c; } } @@ -720,19 +717,19 @@ class Gnumeric extends BaseReader implements IReader $rowCount = (isset($rowAttributes['Count'])) ? $rowAttributes['Count'] : 1; while ($r < $row) { ++$r; - $objPHPExcel->getActiveSheet()->getRowDimension($r)->setRowHeight($defaultHeight); + $spreadsheet->getActiveSheet()->getRowDimension($r)->setRowHeight($defaultHeight); } while (($r < ($row+$rowCount)) && ($r < $maxRow)) { ++$r; - $objPHPExcel->getActiveSheet()->getRowDimension($r)->setRowHeight($rowHeight); + $spreadsheet->getActiveSheet()->getRowDimension($r)->setRowHeight($rowHeight); if ($hidden) { - $objPHPExcel->getActiveSheet()->getRowDimension($r)->setVisible(false); + $spreadsheet->getActiveSheet()->getRowDimension($r)->setVisible(false); } } } while ($r < $maxRow) { ++$r; - $objPHPExcel->getActiveSheet()->getRowDimension($r)->setRowHeight($defaultHeight); + $spreadsheet->getActiveSheet()->getRowDimension($r)->setRowHeight($defaultHeight); } } @@ -740,7 +737,7 @@ class Gnumeric extends BaseReader implements IReader if (isset($sheet->MergedRegions)) { foreach ($sheet->MergedRegions->Merge as $mergeCells) { if (strpos($mergeCells, ':') !== false) { - $objPHPExcel->getActiveSheet()->mergeCells($mergeCells); + $spreadsheet->getActiveSheet()->mergeCells($mergeCells); } } } @@ -759,15 +756,15 @@ class Gnumeric extends BaseReader implements IReader $range = explode('!', $range); $range[0] = trim($range[0], "'"); - if ($worksheet = $objPHPExcel->getSheetByName($range[0])) { + if ($worksheet = $spreadsheet->getSheetByName($range[0])) { $extractedRange = str_replace('$', '', $range[1]); - $objPHPExcel->addNamedRange(new \PHPExcel\NamedRange($name, $worksheet, $extractedRange)); + $spreadsheet->addNamedRange(new \PhpSpreadsheet\NamedRange($name, $worksheet, $extractedRange)); } } } // Return - return $objPHPExcel; + return $spreadsheet; } private static function parseBorderAttributes($borderAttributes) @@ -779,46 +776,46 @@ class Gnumeric extends BaseReader implements IReader switch ($borderAttributes["Style"]) { case '0': - $styleArray['style'] = \PHPExcel\Style\Border::BORDER_NONE; + $styleArray['style'] = \PhpSpreadsheet\Style\Border::BORDER_NONE; break; case '1': - $styleArray['style'] = \PHPExcel\Style\Border::BORDER_THIN; + $styleArray['style'] = \PhpSpreadsheet\Style\Border::BORDER_THIN; break; case '2': - $styleArray['style'] = \PHPExcel\Style\Border::BORDER_MEDIUM; + $styleArray['style'] = \PhpSpreadsheet\Style\Border::BORDER_MEDIUM; break; case '3': - $styleArray['style'] = \PHPExcel\Style\Border::BORDER_SLANTDASHDOT; + $styleArray['style'] = \PhpSpreadsheet\Style\Border::BORDER_SLANTDASHDOT; break; case '4': - $styleArray['style'] = \PHPExcel\Style\Border::BORDER_DASHED; + $styleArray['style'] = \PhpSpreadsheet\Style\Border::BORDER_DASHED; break; case '5': - $styleArray['style'] = \PHPExcel\Style\Border::BORDER_THICK; + $styleArray['style'] = \PhpSpreadsheet\Style\Border::BORDER_THICK; break; case '6': - $styleArray['style'] = \PHPExcel\Style\Border::BORDER_DOUBLE; + $styleArray['style'] = \PhpSpreadsheet\Style\Border::BORDER_DOUBLE; break; case '7': - $styleArray['style'] = \PHPExcel\Style\Border::BORDER_DOTTED; + $styleArray['style'] = \PhpSpreadsheet\Style\Border::BORDER_DOTTED; break; case '8': - $styleArray['style'] = \PHPExcel\Style\Border::BORDER_MEDIUMDASHED; + $styleArray['style'] = \PhpSpreadsheet\Style\Border::BORDER_MEDIUMDASHED; break; case '9': - $styleArray['style'] = \PHPExcel\Style\Border::BORDER_DASHDOT; + $styleArray['style'] = \PhpSpreadsheet\Style\Border::BORDER_DASHDOT; break; case '10': - $styleArray['style'] = \PHPExcel\Style\Border::BORDER_MEDIUMDASHDOT; + $styleArray['style'] = \PhpSpreadsheet\Style\Border::BORDER_MEDIUMDASHDOT; break; case '11': - $styleArray['style'] = \PHPExcel\Style\Border::BORDER_DASHDOTDOT; + $styleArray['style'] = \PhpSpreadsheet\Style\Border::BORDER_DASHDOTDOT; break; case '12': - $styleArray['style'] = \PHPExcel\Style\Border::BORDER_MEDIUMDASHDOTDOT; + $styleArray['style'] = \PhpSpreadsheet\Style\Border::BORDER_MEDIUMDASHDOTDOT; break; case '13': - $styleArray['style'] = \PHPExcel\Style\Border::BORDER_MEDIUMDASHDOTDOT; + $styleArray['style'] = \PhpSpreadsheet\Style\Border::BORDER_MEDIUMDASHDOTDOT; break; } return $styleArray; @@ -826,7 +823,7 @@ class Gnumeric extends BaseReader implements IReader private function parseRichText($is = '') { - $value = new \PHPExcel\RichText(); + $value = new \PhpSpreadsheet\RichText(); $value->createText($is); return $value; diff --git a/src/PhpSpreadsheet/Reader/HTML.php b/src/PhpSpreadsheet/Reader/HTML.php index dccf8ec8..323250fe 100644 --- a/src/PhpSpreadsheet/Reader/HTML.php +++ b/src/PhpSpreadsheet/Reader/HTML.php @@ -1,11 +1,9 @@ array( 'underline' => true, 'color' => array( - 'argb' => \PHPExcel\Style\Color::COLOR_BLUE, + 'argb' => \PhpSpreadsheet\Style\Color::COLOR_BLUE, ), ), ), // Blue underlined 'hr' => array( 'borders' => array( 'bottom' => array( - 'style' => \PHPExcel\Style\Border::BORDER_THIN, + 'style' => \PhpSpreadsheet\Style\Border::BORDER_THIN, 'color' => array( - \PHPExcel\Style\Color::COLOR_BLACK, + \PhpSpreadsheet\Style\Color::COLOR_BLACK, ), ), ), @@ -135,19 +132,19 @@ class HTML extends BaseReader implements IReader } /** - * Loads PHPExcel from file + * Loads PhpSpreadsheet from file * * @param string $pFilename - * @return PHPExcel + * @return PhpSpreadsheet * @throws Exception */ public function load($pFilename) { - // Create new PHPExcel - $objPHPExcel = new PHPExcel(); + // Create new PhpSpreadsheet + $spreadsheet = new PhpSpreadsheet(); // Load into this instance - return $this->loadIntoExisting($pFilename, $objPHPExcel); + return $this->loadIntoExisting($pFilename, $spreadsheet); } /** @@ -172,7 +169,7 @@ class HTML extends BaseReader implements IReader return $this->inputEncoding; } - // Data Array used for testing only, should write to PHPExcel object on completion of tests + // Data Array used for testing only, should write to PhpSpreadsheet object on completion of tests protected $dataArray = array(); protected $tableLevel = 0; protected $nestedColumn = array('A'); @@ -407,7 +404,7 @@ class HTML extends BaseReader implements IReader $this->flushCell($sheet, $column, $row, $cellContent); // if (isset($attributeArray['style']) && !empty($attributeArray['style'])) { -// $styleAry = $this->getPhpExcelStyleArray($attributeArray['style']); +// $styleAry = $this->getPhpSpreadsheetStyleArray($attributeArray['style']); // // if (!empty($styleAry)) { // $sheet->getStyle($column . $row)->applyFromArray($styleAry); @@ -421,7 +418,7 @@ class HTML extends BaseReader implements IReader ++$columnTo; } $range = $column . $row . ':' . $columnTo . ($row + $attributeArray['rowspan'] - 1); - foreach (\PHPExcel\Cell::extractAllCellReferencesInRange($range) as $value) { + foreach (\PhpSpreadsheet\Cell::extractAllCellReferencesInRange($range) as $value) { $this->rowspan[$value] = true; } $sheet->mergeCells($range); @@ -429,7 +426,7 @@ class HTML extends BaseReader implements IReader } elseif (isset($attributeArray['rowspan'])) { //create merging rowspan $range = $column . $row . ':' . $column . ($row + $attributeArray['rowspan'] - 1); - foreach (\PHPExcel\Cell::extractAllCellReferencesInRange($range) as $value) { + foreach (\PhpSpreadsheet\Cell::extractAllCellReferencesInRange($range) as $value) { $this->rowspan[$value] = true; } $sheet->mergeCells($range); @@ -459,14 +456,14 @@ class HTML extends BaseReader implements IReader } /** - * Loads PHPExcel from file into PHPExcel instance + * Loads PhpSpreadsheet from file into PhpSpreadsheet instance * * @param string $pFilename - * @param PHPExcel $objPHPExcel - * @return PHPExcel + * @param \PhpSpreadsheet\Spreadsheet $spreadsheet + * @return \PhpSpreadsheet\Spreadsheet * @throws Exception */ - public function loadIntoExisting($pFilename, PHPExcel $objPHPExcel) + public function loadIntoExisting($pFilename, \PhpSpreadsheet\Spreadsheet $spreadsheet) { // Open file to validate $this->openFile($pFilename); @@ -477,11 +474,11 @@ class HTML extends BaseReader implements IReader // Close after validating fclose($this->fileHandle); - // Create new PHPExcel - while ($objPHPExcel->getSheetCount() <= $this->sheetIndex) { - $objPHPExcel->createSheet(); + // Create new PhpSpreadsheet + while ($spreadsheet->getSheetCount() <= $this->sheetIndex) { + $spreadsheet->createSheet(); } - $objPHPExcel->setActiveSheetIndex($this->sheetIndex); + $spreadsheet->setActiveSheetIndex($this->sheetIndex); // Create a new DOM object $dom = new domDocument; @@ -497,10 +494,10 @@ class HTML extends BaseReader implements IReader $row = 0; $column = 'A'; $content = ''; - $this->processDomElement($dom, $objPHPExcel->getActiveSheet(), $row, $column, $content); + $this->processDomElement($dom, $spreadsheet->getActiveSheet(), $row, $column, $content); // Return - return $objPHPExcel; + return $spreadsheet; } /** diff --git a/src/PhpSpreadsheet/Reader/IReadFilter.php b/src/PhpSpreadsheet/Reader/IReadFilter.php index 1c119f76..1a87f776 100644 --- a/src/PhpSpreadsheet/Reader/IReadFilter.php +++ b/src/PhpSpreadsheet/Reader/IReadFilter.php @@ -1,11 +1,9 @@ securityScan($zip->getFromName('META-INF/manifest.xml')), 'SimpleXMLElement', - \PHPExcel\Settings::getLibXmlLoaderOptions() + \PhpSpreadsheet\Settings::getLibXmlLoaderOptions() ); $namespacesContent = $xml->getNamespaces(true); if (isset($namespacesContent['manifest'])) { @@ -102,7 +99,7 @@ class OOCalc extends BaseReader implements IReader /** - * Reads names of the worksheets from a file, without parsing the whole file to a PHPExcel object + * Reads names of the worksheets from a file, without parsing the whole file to a PhpSpreadsheet object * * @param string $pFilename * @throws Exception @@ -114,7 +111,7 @@ class OOCalc extends BaseReader implements IReader throw new Exception("Could not open " . $pFilename . " for reading! File does not exist."); } - $zipClass = \PHPExcel\Settings::getZipClass(); + $zipClass = \PhpSpreadsheet\Settings::getZipClass(); $zip = new $zipClass; if (!$zip->open($pFilename)) { @@ -127,7 +124,7 @@ class OOCalc extends BaseReader implements IReader $res = $xml->xml( $this->securityScanFile('zip://'.realpath($pFilename).'#content.xml'), null, - \PHPExcel\Settings::getLibXmlLoaderOptions() + \PhpSpreadsheet\Settings::getLibXmlLoaderOptions() ); $xml->setParserProperty(2, true); @@ -172,7 +169,7 @@ class OOCalc extends BaseReader implements IReader $worksheetInfo = array(); - $zipClass = \PHPExcel\Settings::getZipClass(); + $zipClass = \PhpSpreadsheet\Settings::getZipClass(); $zip = new $zipClass; if (!$zip->open($pFilename)) { @@ -183,7 +180,7 @@ class OOCalc extends BaseReader implements IReader $res = $xml->xml( $this->securityScanFile('zip://'.realpath($pFilename).'#content.xml'), null, - \PHPExcel\Settings::getLibXmlLoaderOptions() + \PhpSpreadsheet\Settings::getLibXmlLoaderOptions() ); $xml->setParserProperty(2, true); @@ -242,7 +239,7 @@ class OOCalc extends BaseReader implements IReader $tmpInfo['totalColumns'] = max($tmpInfo['totalColumns'], $currCells); $tmpInfo['lastColumnIndex'] = $tmpInfo['totalColumns'] - 1; - $tmpInfo['lastColumnLetter'] = \PHPExcel\Cell::stringFromColumnIndex($tmpInfo['lastColumnIndex']); + $tmpInfo['lastColumnLetter'] = \PhpSpreadsheet\Cell::stringFromColumnIndex($tmpInfo['lastColumnIndex']); $worksheetInfo[] = $tmpInfo; } } @@ -276,7 +273,7 @@ class OOCalc extends BaseReader implements IReader // } // } // -// $tmpInfo['lastColumnLetter'] = \PHPExcel\Cell::stringFromColumnIndex($tmpInfo['lastColumnIndex']); +// $tmpInfo['lastColumnLetter'] = \PhpSpreadsheet\Cell::stringFromColumnIndex($tmpInfo['lastColumnIndex']); // $tmpInfo['totalColumns'] = $tmpInfo['lastColumnIndex'] + 1; // // } @@ -287,19 +284,19 @@ class OOCalc extends BaseReader implements IReader } /** - * Loads PHPExcel from file + * Loads PhpSpreadsheet from file * * @param string $pFilename - * @return \PHPExcel\Spreadsheet + * @return \PhpSpreadsheet\Spreadsheet * @throws Exception */ public function load($pFilename) { // Create new Spreadsheet - $objPHPExcel = new \PHPExcel\Spreadsheet(); + $spreadsheet = new \PhpSpreadsheet\Spreadsheet(); // Load into this instance - return $this->loadIntoExisting($pFilename, $objPHPExcel); + return $this->loadIntoExisting($pFilename, $spreadsheet); } private static function identifyFixedStyleValue($styleList, &$styleAttributeValue) @@ -315,14 +312,14 @@ class OOCalc extends BaseReader implements IReader } /** - * Loads PHPExcel from file into PHPExcel instance + * Loads PhpSpreadsheet from file into PhpSpreadsheet instance * * @param string $pFilename - * @param \PHPExcel\Spreadsheet $objPHPExcel - * @return \PHPExcel\Spreadsheet + * @param \PhpSpreadsheet\Spreadsheet $spreadsheet + * @return \PhpSpreadsheet\Spreadsheet * @throws Exception */ - public function loadIntoExisting($pFilename, PHPExcel $objPHPExcel) + public function loadIntoExisting($pFilename, \PhpSpreadsheet\Spreadsheet $spreadsheet) { // Check if file exists if (!file_exists($pFilename)) { @@ -332,7 +329,7 @@ class OOCalc extends BaseReader implements IReader $timezoneObj = new DateTimeZone('Europe/London'); $GMT = new \DateTimeZone('UTC'); - $zipClass = \PHPExcel\Settings::getZipClass(); + $zipClass = \PhpSpreadsheet\Settings::getZipClass(); $zip = new $zipClass; if (!$zip->open($pFilename)) { @@ -343,14 +340,14 @@ class OOCalc extends BaseReader implements IReader $xml = simplexml_load_string( $this->securityScan($zip->getFromName("meta.xml")), 'SimpleXMLElement', - \PHPExcel\Settings::getLibXmlLoaderOptions() + \PhpSpreadsheet\Settings::getLibXmlLoaderOptions() ); $namespacesMeta = $xml->getNamespaces(true); // echo '
';
 //        print_r($namespacesMeta);
 //        echo '

'; - $docProps = $objPHPExcel->getProperties(); + $docProps = $spreadsheet->getProperties(); $officeProperty = $xml->children($namespacesMeta['office']); foreach ($officeProperty as $officePropertyData) { $officePropertyDC = array(); @@ -399,26 +396,26 @@ class OOCalc extends BaseReader implements IReader $docProps->setCreated($creationDate); break; case 'user-defined': - $propertyValueType = \PHPExcel\Document\Properties::PROPERTY_TYPE_STRING; + $propertyValueType = \PhpSpreadsheet\Document\Properties::PROPERTY_TYPE_STRING; foreach ($propertyValueAttributes as $key => $value) { if ($key == 'name') { $propertyValueName = (string) $value; } elseif ($key == 'value-type') { switch ($value) { case 'date': - $propertyValue = \PHPExcel\Document\Properties::convertProperty($propertyValue, 'date'); - $propertyValueType = \PHPExcel\Document\Properties::PROPERTY_TYPE_DATE; + $propertyValue = \PhpSpreadsheet\Document\Properties::convertProperty($propertyValue, 'date'); + $propertyValueType = \PhpSpreadsheet\Document\Properties::PROPERTY_TYPE_DATE; break; case 'boolean': - $propertyValue = \PHPExcel\Document\Properties::convertProperty($propertyValue, 'bool'); - $propertyValueType = \PHPExcel\Document\Properties::PROPERTY_TYPE_BOOLEAN; + $propertyValue = \PhpSpreadsheet\Document\Properties::convertProperty($propertyValue, 'bool'); + $propertyValueType = \PhpSpreadsheet\Document\Properties::PROPERTY_TYPE_BOOLEAN; break; case 'float': - $propertyValue = \PHPExcel\Document\Properties::convertProperty($propertyValue, 'r4'); - $propertyValueType = \PHPExcel\Document\Properties::PROPERTY_TYPE_FLOAT; + $propertyValue = \PhpSpreadsheet\Document\Properties::convertProperty($propertyValue, 'r4'); + $propertyValueType = \PhpSpreadsheet\Document\Properties::PROPERTY_TYPE_FLOAT; break; default: - $propertyValueType = \PHPExcel\Document\Properties::PROPERTY_TYPE_STRING; + $propertyValueType = \PhpSpreadsheet\Document\Properties::PROPERTY_TYPE_STRING; } } } @@ -433,7 +430,7 @@ class OOCalc extends BaseReader implements IReader $xml = simplexml_load_string( $this->securityScan($zip->getFromName("content.xml")), 'SimpleXMLElement', - \PHPExcel\Settings::getLibXmlLoaderOptions() + \PhpSpreadsheet\Settings::getLibXmlLoaderOptions() ); $namespacesContent = $xml->getNamespaces(true); // echo '
';
@@ -458,14 +455,14 @@ class OOCalc extends BaseReader implements IReader
 
 //                echo '

Worksheet '.$worksheetDataAttributes['name'].'

'; // Create new Worksheet - $objPHPExcel->createSheet(); - $objPHPExcel->setActiveSheetIndex($worksheetID); + $spreadsheet->createSheet(); + $spreadsheet->setActiveSheetIndex($worksheetID); if (isset($worksheetDataAttributes['name'])) { $worksheetName = (string) $worksheetDataAttributes['name']; // Use false for $updateFormulaCellReferences to prevent adjustment of worksheet references in // formula cells... during the load, all formulae should be correct, and we're simply // bringing the worksheet name in line with the formula, not the reverse - $objPHPExcel->getActiveSheet()->setTitle($worksheetName, false); + $spreadsheet->getActiveSheet()->setTitle($worksheetName, false); } $rowID = 1; @@ -526,7 +523,7 @@ class OOCalc extends BaseReader implements IReader } $text = implode("\n", $textArray); // echo $text, '
'; - $objPHPExcel->getActiveSheet()->getComment($columnID.$rowID)->setText($this->parseRichText($text)); + $spreadsheet->getActiveSheet()->getComment($columnID.$rowID)->setText($this->parseRichText($text)); // ->setAuthor( $author ) } @@ -554,7 +551,7 @@ class OOCalc extends BaseReader implements IReader // echo 'Value Type is '.$cellDataOfficeAttributes['value-type'].'
'; switch ($cellDataOfficeAttributes['value-type']) { case 'string': - $type = \PHPExcel\Cell\DataType::TYPE_STRING; + $type = \PhpSpreadsheet\Cell\DataType::TYPE_STRING; $dataValue = $allCellDataText; if (isset($dataValue->a)) { $dataValue = $dataValue->a; @@ -563,27 +560,27 @@ class OOCalc extends BaseReader implements IReader } break; case 'boolean': - $type = \PHPExcel\Cell\DataType::TYPE_BOOL; + $type = \PhpSpreadsheet\Cell\DataType::TYPE_BOOL; $dataValue = ($allCellDataText == 'TRUE') ? true : false; break; case 'percentage': - $type = \PHPExcel\Cell\DataType::TYPE_NUMERIC; + $type = \PhpSpreadsheet\Cell\DataType::TYPE_NUMERIC; $dataValue = (float) $cellDataOfficeAttributes['value']; if (floor($dataValue) == $dataValue) { $dataValue = (integer) $dataValue; } - $formatting = \PHPExcel\Style\NumberFormat::FORMAT_PERCENTAGE_00; + $formatting = \PhpSpreadsheet\Style\NumberFormat::FORMAT_PERCENTAGE_00; break; case 'currency': - $type = \PHPExcel\Cell\DataType::TYPE_NUMERIC; + $type = \PhpSpreadsheet\Cell\DataType::TYPE_NUMERIC; $dataValue = (float) $cellDataOfficeAttributes['value']; if (floor($dataValue) == $dataValue) { $dataValue = (integer) $dataValue; } - $formatting = \PHPExcel\Style\NumberFormat::FORMAT_CURRENCY_USD_SIMPLE; + $formatting = \PhpSpreadsheet\Style\NumberFormat::FORMAT_CURRENCY_USD_SIMPLE; break; case 'float': - $type = \PHPExcel\Cell\DataType::TYPE_NUMERIC; + $type = \PhpSpreadsheet\Cell\DataType::TYPE_NUMERIC; $dataValue = (float) $cellDataOfficeAttributes['value']; if (floor($dataValue) == $dataValue) { if ($dataValue == (integer) $dataValue) { @@ -594,21 +591,21 @@ class OOCalc extends BaseReader implements IReader } break; case 'date': - $type = \PHPExcel\Cell\DataType::TYPE_NUMERIC; + $type = \PhpSpreadsheet\Cell\DataType::TYPE_NUMERIC; $dateObj = new DateTime($cellDataOfficeAttributes['date-value'], $GMT); $dateObj->setTimeZone($timezoneObj); list($year, $month, $day, $hour, $minute, $second) = explode(' ', $dateObj->format('Y m d H i s')); - $dataValue = \PHPExcel\Shared\Date::formattedPHPToExcel($year, $month, $day, $hour, $minute, $second); + $dataValue = \PhpSpreadsheet\Shared\Date::formattedPHPToExcel($year, $month, $day, $hour, $minute, $second); if ($dataValue != floor($dataValue)) { - $formatting = \PHPExcel\Style\NumberFormat::FORMAT_DATE_XLSX15.' '.\PHPExcel\Style\NumberFormat::FORMAT_DATE_TIME4; + $formatting = \PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_XLSX15.' '.\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_TIME4; } else { - $formatting = \PHPExcel\Style\NumberFormat::FORMAT_DATE_XLSX15; + $formatting = \PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_XLSX15; } break; case 'time': - $type = \PHPExcel\Cell\DataType::TYPE_NUMERIC; - $dataValue = \PHPExcel\Shared\Date::PHPToExcel(strtotime('01-01-1970 '.implode(':', sscanf($cellDataOfficeAttributes['time-value'], 'PT%dH%dM%dS')))); - $formatting = \PHPExcel\Style\NumberFormat::FORMAT_DATE_TIME4; + $type = \PhpSpreadsheet\Cell\DataType::TYPE_NUMERIC; + $dataValue = \PhpSpreadsheet\Shared\Date::PHPToExcel(strtotime('01-01-1970 '.implode(':', sscanf($cellDataOfficeAttributes['time-value'], 'PT%dH%dM%dS')))); + $formatting = \PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_TIME4; break; } // echo 'Data value is '.$dataValue.'
'; @@ -616,12 +613,12 @@ class OOCalc extends BaseReader implements IReader // echo 'Hyperlink is '.$hyperlink.'
'; // } } else { - $type = \PHPExcel\Cell\DataType::TYPE_NULL; + $type = \PhpSpreadsheet\Cell\DataType::TYPE_NULL; $dataValue = null; } if ($hasCalculatedValue) { - $type = \PHPExcel\Cell\DataType::TYPE_FORMULA; + $type = \PhpSpreadsheet\Cell\DataType::TYPE_FORMULA; // echo 'Formula: ', $cellDataFormula, PHP_EOL; $cellDataFormula = substr($cellDataFormula, strpos($cellDataFormula, ':=')+1); $temp = explode('"', $cellDataFormula); @@ -633,7 +630,7 @@ class OOCalc extends BaseReader implements IReader $value = preg_replace('/\[([^\.]+)\.([^\.]+)\]/Ui', '$1!$2', $value); // Cell reference in another sheet $value = preg_replace('/\[\.([^\.]+):\.([^\.]+)\]/Ui', '$1:$2', $value); // Cell range reference $value = preg_replace('/\[\.([^\.]+)\]/Ui', '$1', $value); // Simple cell reference - $value = \PHPExcel\Calculation::translateSeparator(';', ',', $value, $inBraces); + $value = \PhpSpreadsheet\Calculation::translateSeparator(';', ',', $value, $inBraces); } } unset($value); @@ -648,21 +645,21 @@ class OOCalc extends BaseReader implements IReader if ($i > 0) { ++$columnID; } - if ($type !== \PHPExcel\Cell\DataType::TYPE_NULL) { + if ($type !== \PhpSpreadsheet\Cell\DataType::TYPE_NULL) { for ($rowAdjust = 0; $rowAdjust < $rowRepeats; ++$rowAdjust) { $rID = $rowID + $rowAdjust; - $objPHPExcel->getActiveSheet()->getCell($columnID.$rID)->setValueExplicit((($hasCalculatedValue) ? $cellDataFormula : $dataValue), $type); + $spreadsheet->getActiveSheet()->getCell($columnID.$rID)->setValueExplicit((($hasCalculatedValue) ? $cellDataFormula : $dataValue), $type); if ($hasCalculatedValue) { // echo 'Forumla result is '.$dataValue.'
'; - $objPHPExcel->getActiveSheet()->getCell($columnID.$rID)->setCalculatedValue($dataValue); + $spreadsheet->getActiveSheet()->getCell($columnID.$rID)->setCalculatedValue($dataValue); } if ($formatting !== null) { - $objPHPExcel->getActiveSheet()->getStyle($columnID.$rID)->getNumberFormat()->setFormatCode($formatting); + $spreadsheet->getActiveSheet()->getStyle($columnID.$rID)->getNumberFormat()->setFormatCode($formatting); } else { - $objPHPExcel->getActiveSheet()->getStyle($columnID.$rID)->getNumberFormat()->setFormatCode(\PHPExcel\Style\NumberFormat::FORMAT_GENERAL); + $spreadsheet->getActiveSheet()->getStyle($columnID.$rID)->getNumberFormat()->setFormatCode(\PhpSpreadsheet\Style\NumberFormat::FORMAT_GENERAL); } if ($hyperlink !== null) { - $objPHPExcel->getActiveSheet()->getCell($columnID.$rID)->getHyperlink()->setUrl($hyperlink); + $spreadsheet->getActiveSheet()->getCell($columnID.$rID)->getHyperlink()->setUrl($hyperlink); } } } @@ -671,17 +668,17 @@ class OOCalc extends BaseReader implements IReader // Merged cells if ((isset($cellDataTableAttributes['number-columns-spanned'])) || (isset($cellDataTableAttributes['number-rows-spanned']))) { - if (($type !== \PHPExcel\Cell\DataType::TYPE_NULL) || (!$this->readDataOnly)) { + if (($type !== \PhpSpreadsheet\Cell\DataType::TYPE_NULL) || (!$this->readDataOnly)) { $columnTo = $columnID; if (isset($cellDataTableAttributes['number-columns-spanned'])) { - $columnTo = \PHPExcel\Cell::stringFromColumnIndex(\PHPExcel\Cell::columnIndexFromString($columnID) + $cellDataTableAttributes['number-columns-spanned'] -2); + $columnTo = \PhpSpreadsheet\Cell::stringFromColumnIndex(\PhpSpreadsheet\Cell::columnIndexFromString($columnID) + $cellDataTableAttributes['number-columns-spanned'] -2); } $rowTo = $rowID; if (isset($cellDataTableAttributes['number-rows-spanned'])) { $rowTo = $rowTo + $cellDataTableAttributes['number-rows-spanned'] - 1; } $cellRange = $columnID.$rowID.':'.$columnTo.$rowTo; - $objPHPExcel->getActiveSheet()->mergeCells($cellRange); + $spreadsheet->getActiveSheet()->mergeCells($cellRange); } } @@ -696,12 +693,12 @@ class OOCalc extends BaseReader implements IReader } // Return - return $objPHPExcel; + return $spreadsheet; } private function parseRichText($is = '') { - $value = new \PHPExcel\RichText(); + $value = new \PhpSpreadsheet\RichText(); $value->createText($is); diff --git a/src/PhpSpreadsheet/Reader/SYLK.php b/src/PhpSpreadsheet/Reader/SYLK.php index f544b23b..019cc4f1 100644 --- a/src/PhpSpreadsheet/Reader/SYLK.php +++ b/src/PhpSpreadsheet/Reader/SYLK.php @@ -1,11 +1,9 @@ loadIntoExisting($pFilename, $objPHPExcel); + return $this->loadIntoExisting($pFilename, $spreadsheet); } /** - * Loads PHPExcel from file into PHPExcel instance + * Loads PhpSpreadsheet from file into PhpSpreadsheet instance * * @param string $pFilename - * @param \PHPExcel\Spreadsheet $objPHPExcel - * @return \PHPExcel\Spreadsheet + * @param \PhpSpreadsheet\Spreadsheet $spreadsheet + * @return \PhpSpreadsheet\Spreadsheet * @throws Exception */ - public function loadIntoExisting($pFilename, \PHPExcel\Spreadsheet $objPHPExcel) + public function loadIntoExisting($pFilename, \PhpSpreadsheet\Spreadsheet $spreadsheet) { // Open file $this->openFile($pFilename); @@ -216,10 +213,10 @@ class SYLK extends BaseReader implements IReader rewind($fileHandle); // Create new Worksheets - while ($objPHPExcel->getSheetCount() <= $this->sheetIndex) { - $objPHPExcel->createSheet(); + while ($spreadsheet->getSheetCount() <= $this->sheetIndex) { + $spreadsheet->createSheet(); } - $objPHPExcel->setActiveSheetIndex($this->sheetIndex); + $spreadsheet->setActiveSheetIndex($this->sheetIndex); $fromFormats = array('\-', '\ '); $toFormats = array('-', ' '); @@ -231,7 +228,7 @@ class SYLK extends BaseReader implements IReader // loop through one row (line) at a time in the file while (($rowData = fgets($fileHandle)) !== false) { // convert SYLK encoded $rowData to UTF-8 - $rowData = \PHPExcel\Shared\StringHelper::SYLKtoUTF8($rowData); + $rowData = \PhpSpreadsheet\Shared\StringHelper::SYLKtoUTF8($rowData); // explode each row at semicolons while taking into account that literal semicolon (;) // is escaped like this (;;) @@ -264,16 +261,16 @@ class SYLK extends BaseReader implements IReader $formatArray['font']['bold'] = true; break; case 'T': - $formatArray['borders']['top']['style'] = \PHPExcel\Style\Border::BORDER_THIN; + $formatArray['borders']['top']['style'] = \PhpSpreadsheet\Style\Border::BORDER_THIN; break; case 'B': - $formatArray['borders']['bottom']['style'] = \PHPExcel\Style\Border::BORDER_THIN; + $formatArray['borders']['bottom']['style'] = \PhpSpreadsheet\Style\Border::BORDER_THIN; break; case 'L': - $formatArray['borders']['left']['style'] = \PHPExcel\Style\Border::BORDER_THIN; + $formatArray['borders']['left']['style'] = \PhpSpreadsheet\Style\Border::BORDER_THIN; break; case 'R': - $formatArray['borders']['right']['style'] = \PHPExcel\Style\Border::BORDER_THIN; + $formatArray['borders']['right']['style'] = \PhpSpreadsheet\Style\Border::BORDER_THIN; break; } } @@ -332,7 +329,7 @@ class SYLK extends BaseReader implements IReader if ($columnReference{0} == '[') { $columnReference = $column + trim($columnReference, '[]'); } - $A1CellReference = \PHPExcel\Cell::stringFromColumnIndex($columnReference-1).$rowReference; + $A1CellReference = \PhpSpreadsheet\Cell::stringFromColumnIndex($columnReference-1).$rowReference; $value = substr_replace($value, $A1CellReference, $cellReference[0][1], strlen($cellReference[0][0])); } @@ -345,14 +342,14 @@ class SYLK extends BaseReader implements IReader break; } } - $columnLetter = \PHPExcel\Cell::stringFromColumnIndex($column-1); - $cellData = \PHPExcel\Calculation::unwrapResult($cellData); + $columnLetter = \PhpSpreadsheet\Cell::stringFromColumnIndex($column-1); + $cellData = \PhpSpreadsheet\Calculation::unwrapResult($cellData); // Set cell value - $objPHPExcel->getActiveSheet()->getCell($columnLetter.$row)->setValue(($hasCalculatedValue) ? $cellDataFormula : $cellData); + $spreadsheet->getActiveSheet()->getCell($columnLetter.$row)->setValue(($hasCalculatedValue) ? $cellDataFormula : $cellData); if ($hasCalculatedValue) { - $cellData = \PHPExcel\Calculation::unwrapResult($cellData); - $objPHPExcel->getActiveSheet()->getCell($columnLetter.$row)->setCalculatedValue($cellData); + $cellData = \PhpSpreadsheet\Calculation::unwrapResult($cellData); + $spreadsheet->getActiveSheet()->getCell($columnLetter.$row)->setCalculatedValue($cellData); } // Read cell formatting } elseif ($dataType == 'F') { @@ -385,16 +382,16 @@ class SYLK extends BaseReader implements IReader $styleData['font']['bold'] = true; break; case 'T': - $styleData['borders']['top']['style'] = \PHPExcel\Style\Border::BORDER_THIN; + $styleData['borders']['top']['style'] = \PhpSpreadsheet\Style\Border::BORDER_THIN; break; case 'B': - $styleData['borders']['bottom']['style'] = \PHPExcel\Style\Border::BORDER_THIN; + $styleData['borders']['bottom']['style'] = \PhpSpreadsheet\Style\Border::BORDER_THIN; break; case 'L': - $styleData['borders']['left']['style'] = \PHPExcel\Style\Border::BORDER_THIN; + $styleData['borders']['left']['style'] = \PhpSpreadsheet\Style\Border::BORDER_THIN; break; case 'R': - $styleData['borders']['right']['style'] = \PHPExcel\Style\Border::BORDER_THIN; + $styleData['borders']['right']['style'] = \PhpSpreadsheet\Style\Border::BORDER_THIN; break; } } @@ -402,25 +399,25 @@ class SYLK extends BaseReader implements IReader } } if (($formatStyle > '') && ($column > '') && ($row > '')) { - $columnLetter = \PHPExcel\Cell::stringFromColumnIndex($column-1); + $columnLetter = \PhpSpreadsheet\Cell::stringFromColumnIndex($column-1); if (isset($this->formats[$formatStyle])) { - $objPHPExcel->getActiveSheet()->getStyle($columnLetter.$row)->applyFromArray($this->formats[$formatStyle]); + $spreadsheet->getActiveSheet()->getStyle($columnLetter.$row)->applyFromArray($this->formats[$formatStyle]); } } if ((!empty($styleData)) && ($column > '') && ($row > '')) { - $columnLetter = \PHPExcel\Cell::stringFromColumnIndex($column-1); - $objPHPExcel->getActiveSheet()->getStyle($columnLetter.$row)->applyFromArray($styleData); + $columnLetter = \PhpSpreadsheet\Cell::stringFromColumnIndex($column-1); + $spreadsheet->getActiveSheet()->getStyle($columnLetter.$row)->applyFromArray($styleData); } if ($columnWidth > '') { if ($startCol == $endCol) { - $startCol = \PHPExcel\Cell::stringFromColumnIndex($startCol-1); - $objPHPExcel->getActiveSheet()->getColumnDimension($startCol)->setWidth($columnWidth); + $startCol = \PhpSpreadsheet\Cell::stringFromColumnIndex($startCol-1); + $spreadsheet->getActiveSheet()->getColumnDimension($startCol)->setWidth($columnWidth); } else { - $startCol = \PHPExcel\Cell::stringFromColumnIndex($startCol-1); - $endCol = \PHPExcel\Cell::stringFromColumnIndex($endCol-1); - $objPHPExcel->getActiveSheet()->getColumnDimension($startCol)->setWidth($columnWidth); + $startCol = \PhpSpreadsheet\Cell::stringFromColumnIndex($startCol-1); + $endCol = \PhpSpreadsheet\Cell::stringFromColumnIndex($endCol-1); + $spreadsheet->getActiveSheet()->getColumnDimension($startCol)->setWidth($columnWidth); do { - $objPHPExcel->getActiveSheet()->getColumnDimension(++$startCol)->setWidth($columnWidth); + $spreadsheet->getActiveSheet()->getColumnDimension(++$startCol)->setWidth($columnWidth); } while ($startCol != $endCol); } } @@ -444,7 +441,7 @@ class SYLK extends BaseReader implements IReader fclose($fileHandle); // Return - return $objPHPExcel; + return $spreadsheet; } /** diff --git a/src/PhpSpreadsheet/ReferenceHelper.php b/src/PhpSpreadsheet/ReferenceHelper.php index 1810f504..60d69fd7 100644 --- a/src/PhpSpreadsheet/ReferenceHelper.php +++ b/src/PhpSpreadsheet/ReferenceHelper.php @@ -1,11 +1,9 @@ 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); if ($key != $newReference) { @@ -802,17 +799,17 @@ class ReferenceHelper /** * Update named formulas (i.e. containing worksheet references / named ranges) * - * @param PHPExcel $pPhpExcel Object to update + * @param \PhpSpreadsheet\Spreadsheet $spreadsheet Object to update * @param string $oldName Old name (name to replace) * @param string $newName New name */ - public function updateNamedFormulas(Spreadsheet $pPhpExcel, $oldName = '', $newName = '') + public function updateNamedFormulas(Spreadsheet $spreadsheet, $oldName = '', $newName = '') { if ($oldName == '') { return; } - foreach ($pPhpExcel->getWorksheetIterator() as $sheet) { + foreach ($spreadsheet->getWorksheetIterator() as $sheet) { foreach ($sheet->getCellCollection(false) as $cellID) { $cell = $sheet->getCell($cellID); if (($cell !== null) && ($cell->getDataType() == Cell\DataType::TYPE_FORMULA)) { diff --git a/src/PhpSpreadsheet/RichText.php b/src/PhpSpreadsheet/RichText.php index 0e1ea6c5..8bbba5da 100644 --- a/src/PhpSpreadsheet/RichText.php +++ b/src/PhpSpreadsheet/RichText.php @@ -1,11 +1,9 @@ richTextElements = $pElements; } else { - throw new Exception("Invalid \PHPExcel\RichText\ITextElement[] array passed."); + throw new Exception("Invalid \PhpSpreadsheet\RichText\ITextElement[] array passed."); } return $this; } diff --git a/src/PhpSpreadsheet/RichText/ITextElement.php b/src/PhpSpreadsheet/RichText/ITextElement.php index 33db88d6..749c2567 100644 --- a/src/PhpSpreadsheet/RichText/ITextElement.php +++ b/src/PhpSpreadsheet/RichText/ITextElement.php @@ -1,10 +1,8 @@ setText($pText); - $this->font = new \PHPExcel\Style\Font(); + $this->font = new \PhpSpreadsheet\Style\Font(); } /** * Get font * - * @return \PHPExcel\Style\Font + * @return \PhpSpreadsheet\Style\Font */ public function getFont() { @@ -59,11 +56,11 @@ class Run extends TextElement implements ITextElement /** * Set font * - * @param \PHPExcel\Style\Font $pFont Font - * @throws \PHPExcel\Exception + * @param \PhpSpreadsheet\Style\Font $pFont Font + * @throws \PhpSpreadsheet\Exception * @return ITextElement */ - public function setFont(\PHPExcel\Style\Font $pFont = null) + public function setFont(\PhpSpreadsheet\Style\Font $pFont = null) { $this->font = $pFont; return $this; diff --git a/src/PhpSpreadsheet/RichText/TextElement.php b/src/PhpSpreadsheet/RichText/TextElement.php index df7cc149..99be025a 100644 --- a/src/PhpSpreadsheet/RichText/TextElement.php +++ b/src/PhpSpreadsheet/RichText/TextElement.php @@ -1,10 +1,8 @@ getWorksheet()->getStyle( @@ -327,10 +326,10 @@ class Date /** * Is a given number format a date/time? * - * @param \PHPExcel\Style\NumberFormat $pFormat + * @param \PhpSpreadsheet\Style\NumberFormat $pFormat * @return boolean */ - public static function isDateTimeFormat(\PHPExcel\Style\NumberFormat $pFormat) + public static function isDateTimeFormat(\PhpSpreadsheet\Style\NumberFormat $pFormat) { return self::isDateTimeFormatCode($pFormat->getFormatCode()); } @@ -346,7 +345,7 @@ class Date */ public static function isDateTimeFormatCode($pFormatCode = '') { - if (strtolower($pFormatCode) === strtolower(\PHPExcel\Style\NumberFormat::FORMAT_GENERAL)) { + if (strtolower($pFormatCode) === strtolower(\PhpSpreadsheet\Style\NumberFormat::FORMAT_GENERAL)) { // "General" contains an epoch letter 'e', so we trap for it explicitly here (case-insensitive check) return false; } @@ -358,28 +357,28 @@ class Date // Switch on formatcode switch ($pFormatCode) { // Explicitly defined date formats - case \PHPExcel\Style\NumberFormat::FORMAT_DATE_YYYYMMDD: - case \PHPExcel\Style\NumberFormat::FORMAT_DATE_YYYYMMDD2: - case \PHPExcel\Style\NumberFormat::FORMAT_DATE_DDMMYYYY: - case \PHPExcel\Style\NumberFormat::FORMAT_DATE_DMYSLASH: - case \PHPExcel\Style\NumberFormat::FORMAT_DATE_DMYMINUS: - case \PHPExcel\Style\NumberFormat::FORMAT_DATE_DMMINUS: - case \PHPExcel\Style\NumberFormat::FORMAT_DATE_MYMINUS: - case \PHPExcel\Style\NumberFormat::FORMAT_DATE_DATETIME: - case \PHPExcel\Style\NumberFormat::FORMAT_DATE_TIME1: - case \PHPExcel\Style\NumberFormat::FORMAT_DATE_TIME2: - case \PHPExcel\Style\NumberFormat::FORMAT_DATE_TIME3: - case \PHPExcel\Style\NumberFormat::FORMAT_DATE_TIME4: - case \PHPExcel\Style\NumberFormat::FORMAT_DATE_TIME5: - case \PHPExcel\Style\NumberFormat::FORMAT_DATE_TIME6: - case \PHPExcel\Style\NumberFormat::FORMAT_DATE_TIME7: - case \PHPExcel\Style\NumberFormat::FORMAT_DATE_TIME8: - case \PHPExcel\Style\NumberFormat::FORMAT_DATE_YYYYMMDDSLASH: - case \PHPExcel\Style\NumberFormat::FORMAT_DATE_XLSX14: - case \PHPExcel\Style\NumberFormat::FORMAT_DATE_XLSX15: - case \PHPExcel\Style\NumberFormat::FORMAT_DATE_XLSX16: - case \PHPExcel\Style\NumberFormat::FORMAT_DATE_XLSX17: - case \PHPExcel\Style\NumberFormat::FORMAT_DATE_XLSX22: + case \PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_YYYYMMDD: + case \PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_YYYYMMDD2: + case \PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_DDMMYYYY: + case \PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_DMYSLASH: + case \PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_DMYMINUS: + case \PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_DMMINUS: + case \PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_MYMINUS: + case \PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_DATETIME: + case \PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_TIME1: + case \PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_TIME2: + case \PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_TIME3: + case \PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_TIME4: + case \PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_TIME5: + case \PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_TIME6: + case \PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_TIME7: + case \PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_TIME8: + case \PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_YYYYMMDDSLASH: + case \PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_XLSX14: + case \PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_XLSX15: + case \PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_XLSX16: + case \PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_XLSX17: + case \PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_XLSX22: return true; } @@ -425,15 +424,15 @@ class Date return false; } - $dateValueNew = \PHPExcel\Calculation\DateTime::DATEVALUE($dateValue); + $dateValueNew = \PhpSpreadsheet\Calculation\DateTime::DATEVALUE($dateValue); - if ($dateValueNew === \PHPExcel\Calculation\Functions::VALUE()) { + if ($dateValueNew === \PhpSpreadsheet\Calculation\Functions::VALUE()) { return false; } if (strpos($dateValue, ':') !== false) { - $timeValue = \PHPExcel\Calculation\DateTime::TIMEVALUE($dateValue); - if ($timeValue === \PHPExcel\Calculation\Functions::VALUE()) { + $timeValue = \PhpSpreadsheet\Calculation\DateTime::TIMEVALUE($dateValue); + if ($timeValue === \PhpSpreadsheet\Calculation\Functions::VALUE()) { return false; } $dateValueNew += $timeValue; diff --git a/src/PhpSpreadsheet/Shared/Drawing.php b/src/PhpSpreadsheet/Shared/Drawing.php index 73f3533f..f4cec48f 100644 --- a/src/PhpSpreadsheet/Shared/Drawing.php +++ b/src/PhpSpreadsheet/Shared/Drawing.php @@ -1,11 +1,9 @@ getName(); $size = $pDefaultFont->getSize(); - if (isset(\PHPExcel\Shared\Font::$defaultColumnWidths[$name][$size])) { + if (isset(\PhpSpreadsheet\Shared\Font::$defaultColumnWidths[$name][$size])) { // Exact width can be determined - $colWidth = $pValue * \PHPExcel\Shared\Font::$defaultColumnWidths[$name][$size]['width'] / \PHPExcel\Shared\Font::$defaultColumnWidths[$name][$size]['px']; + $colWidth = $pValue * \PhpSpreadsheet\Shared\Font::$defaultColumnWidths[$name][$size]['width'] / \PhpSpreadsheet\Shared\Font::$defaultColumnWidths[$name][$size]['px']; } else { // We don't have data for this particular font and size, use approximation by // extrapolating from Calibri 11 - $colWidth = $pValue * 11 * \PHPExcel\Shared\Font::$defaultColumnWidths['Calibri'][11]['width'] / \PHPExcel\Shared\Font::$defaultColumnWidths['Calibri'][11]['px'] / $size; + $colWidth = $pValue * 11 * \PhpSpreadsheet\Shared\Font::$defaultColumnWidths['Calibri'][11]['width'] / \PhpSpreadsheet\Shared\Font::$defaultColumnWidths['Calibri'][11]['px'] / $size; } return $colWidth; @@ -86,22 +83,22 @@ class Drawing * Convert column width from (intrinsic) Excel units to pixels * * @param float $pValue Value in cell dimension - * @param \PHPExcel\Style\Font $pDefaultFont Default font of the workbook + * @param \PhpSpreadsheet\Style\Font $pDefaultFont Default font of the workbook * @return int Value in pixels */ - public static function cellDimensionToPixels($pValue, \PHPExcel\Style\Font $pDefaultFont) + public static function cellDimensionToPixels($pValue, \PhpSpreadsheet\Style\Font $pDefaultFont) { // Font name and size $name = $pDefaultFont->getName(); $size = $pDefaultFont->getSize(); - if (isset(\PHPExcel\Shared\Font::$defaultColumnWidths[$name][$size])) { + if (isset(\PhpSpreadsheet\Shared\Font::$defaultColumnWidths[$name][$size])) { // Exact width can be determined - $colWidth = $pValue * \PHPExcel\Shared\Font::$defaultColumnWidths[$name][$size]['px'] / \PHPExcel\Shared\Font::$defaultColumnWidths[$name][$size]['width']; + $colWidth = $pValue * \PhpSpreadsheet\Shared\Font::$defaultColumnWidths[$name][$size]['px'] / \PhpSpreadsheet\Shared\Font::$defaultColumnWidths[$name][$size]['width']; } else { // We don't have data for this particular font and size, use approximation by // extrapolating from Calibri 11 - $colWidth = $pValue * $size * \PHPExcel\Shared\Font::$defaultColumnWidths['Calibri'][11]['px'] / \PHPExcel\Shared\Font::$defaultColumnWidths['Calibri'][11]['width'] / 11; + $colWidth = $pValue * $size * \PhpSpreadsheet\Shared\Font::$defaultColumnWidths['Calibri'][11]['px'] / \PhpSpreadsheet\Shared\Font::$defaultColumnWidths['Calibri'][11]['width'] / 11; } // Round pixels to closest integer diff --git a/src/PhpSpreadsheet/Shared/Escher.php b/src/PhpSpreadsheet/Shared/Escher.php index 901795fa..3a233905 100644 --- a/src/PhpSpreadsheet/Shared/Escher.php +++ b/src/PhpSpreadsheet/Shared/Escher.php @@ -1,11 +1,9 @@ getParent(); - while ($parent instanceof \PHPExcel\Shared\Escher\DgContainer\SpgrContainer) { + while ($parent instanceof \PhpSpreadsheet\Shared\Escher\DgContainer\SpgrContainer) { ++$nestingLevel; $parent = $parent->getParent(); } diff --git a/src/PhpSpreadsheet/Shared/Escher/DggContainer.php b/src/PhpSpreadsheet/Shared/Escher/DggContainer.php index d82a330a..b0970829 100644 --- a/src/PhpSpreadsheet/Shared/Escher/DggContainer.php +++ b/src/PhpSpreadsheet/Shared/Escher/DggContainer.php @@ -1,11 +1,9 @@ getWidth(); - $pixelWidth = \PHPExcel\Shared\Drawing::cellDimensionToPixels($width, $font); + $pixelWidth = \PhpSpreadsheet\Shared\Drawing::cellDimensionToPixels($width, $font); } elseif ($sheet->getDefaultColumnDimension()->getWidth() != -1) { // then we have default column dimension with explicit width $defaultColumnDimension = $sheet->getDefaultColumnDimension(); $width = $defaultColumnDimension->getWidth(); - $pixelWidth = \PHPExcel\Shared\Drawing::cellDimensionToPixels($width, $font); + $pixelWidth = \PhpSpreadsheet\Shared\Drawing::cellDimensionToPixels($width, $font); } else { // we don't even have any default column dimension. Width depends on default font - $pixelWidth = \PHPExcel\Shared\Font::getDefaultColumnWidthByFont($font, true); + $pixelWidth = \PhpSpreadsheet\Shared\Font::getDefaultColumnWidthByFont($font, true); } // now find the effective column width in pixels @@ -76,7 +73,7 @@ class Excel5 * the relationship is: y = 4/3x. If the height hasn't been set by the user we * use the default value. If the row is hidden we use a value of zero. * - * @param \PHPExcel\Worksheet $sheet The sheet + * @param \PhpSpreadsheet\Worksheet $sheet The sheet * @param integer $row The row index (1-based) * @return integer The width in pixels */ @@ -97,11 +94,11 @@ class Excel5 // then we have a default row dimension with explicit height $defaultRowDimension = $sheet->getDefaultRowDimension(); $rowHeight = $defaultRowDimension->getRowHeight(); - $pixelRowHeight = \PHPExcel\Shared\Drawing::pointsToPixels($rowHeight); + $pixelRowHeight = \PhpSpreadsheet\Shared\Drawing::pointsToPixels($rowHeight); } else { // we don't even have any default row dimension. Height depends on default font - $pointRowHeight = \PHPExcel\Shared\Font::getDefaultRowHeightByFont($font); - $pixelRowHeight = \PHPExcel\Shared\Font::fontSizeToPixels($pointRowHeight); + $pointRowHeight = \PhpSpreadsheet\Shared\Font::getDefaultRowHeightByFont($font); + $pixelRowHeight = \PhpSpreadsheet\Shared\Font::fontSizeToPixels($pointRowHeight); } // now find the effective row height in pixels @@ -118,22 +115,22 @@ class Excel5 * Get the horizontal distance in pixels between two anchors * The distanceX is found as sum of all the spanning columns widths minus correction for the two offsets * - * @param \PHPExcel\Worksheet $sheet + * @param \PhpSpreadsheet\Worksheet $sheet * @param string $startColumn * @param integer $startOffsetX Offset within start cell measured in 1/1024 of the cell width * @param string $endColumn * @param integer $endOffsetX Offset within end cell measured in 1/1024 of the cell width * @return integer Horizontal measured in pixels */ - public static function getDistanceX(\PHPExcel\Worksheet $sheet, $startColumn = 'A', $startOffsetX = 0, $endColumn = 'A', $endOffsetX = 0) + public static function getDistanceX(\PhpSpreadsheet\Worksheet $sheet, $startColumn = 'A', $startOffsetX = 0, $endColumn = 'A', $endOffsetX = 0) { $distanceX = 0; // add the widths of the spanning columns - $startColumnIndex = \PHPExcel\Cell::columnIndexFromString($startColumn) - 1; // 1-based - $endColumnIndex = \PHPExcel\Cell::columnIndexFromString($endColumn) - 1; // 1-based + $startColumnIndex = \PhpSpreadsheet\Cell::columnIndexFromString($startColumn) - 1; // 1-based + $endColumnIndex = \PhpSpreadsheet\Cell::columnIndexFromString($endColumn) - 1; // 1-based for ($i = $startColumnIndex; $i <= $endColumnIndex; ++$i) { - $distanceX += self::sizeCol($sheet, \PHPExcel\Cell::stringFromColumnIndex($i)); + $distanceX += self::sizeCol($sheet, \PhpSpreadsheet\Cell::stringFromColumnIndex($i)); } // correct for offsetX in startcell @@ -149,14 +146,14 @@ class Excel5 * Get the vertical distance in pixels between two anchors * The distanceY is found as sum of all the spanning rows minus two offsets * - * @param \PHPExcel\Worksheet $sheet + * @param \PhpSpreadsheet\Worksheet $sheet * @param integer $startRow (1-based) * @param integer $startOffsetY Offset within start cell measured in 1/256 of the cell height * @param integer $endRow (1-based) * @param integer $endOffsetY Offset within end cell measured in 1/256 of the cell height * @return integer Vertical distance measured in pixels */ - public static function getDistanceY(\PHPExcel\Worksheet $sheet, $startRow = 1, $startOffsetY = 0, $endRow = 1, $endOffsetY = 0) + public static function getDistanceY(\PhpSpreadsheet\Worksheet $sheet, $startRow = 1, $startOffsetY = 0, $endRow = 1, $endOffsetY = 0) { $distanceY = 0; @@ -218,7 +215,7 @@ class Excel5 * W is the width of the cell * H is the height of the cell * - * @param \PHPExcel\Worksheet $sheet + * @param \PhpSpreadsheet\Worksheet $sheet * @param string $coordinates E.g. 'A1' * @param integer $offsetX Horizontal offset in pixels * @param integer $offsetY Vertical offset in pixels @@ -228,8 +225,8 @@ class Excel5 */ public static function oneAnchor2twoAnchor($sheet, $coordinates, $offsetX, $offsetY, $width, $height) { - list($column, $row) = \PHPExcel\Cell::coordinateFromString($coordinates); - $col_start = \PHPExcel\Cell::columnIndexFromString($column) - 1; + list($column, $row) = \PhpSpreadsheet\Cell::coordinateFromString($coordinates); + $col_start = \PhpSpreadsheet\Cell::columnIndexFromString($column) - 1; $row_start = $row - 1; $x1 = $offsetX; @@ -240,7 +237,7 @@ class Excel5 $row_end = $row_start; // Row containing bottom right corner of object // Zero the specified offset if greater than the cell dimensions - if ($x1 >= self::sizeCol($sheet, \PHPExcel\Cell::stringFromColumnIndex($col_start))) { + if ($x1 >= self::sizeCol($sheet, \PhpSpreadsheet\Cell::stringFromColumnIndex($col_start))) { $x1 = 0; } if ($y1 >= self::sizeRow($sheet, $row_start + 1)) { @@ -251,8 +248,8 @@ class Excel5 $height = $height + $y1 -1; // Subtract the underlying cell widths to find the end cell of the image - while ($width >= self::sizeCol($sheet, \PHPExcel\Cell::stringFromColumnIndex($col_end))) { - $width -= self::sizeCol($sheet, \PHPExcel\Cell::stringFromColumnIndex($col_end)); + while ($width >= self::sizeCol($sheet, \PhpSpreadsheet\Cell::stringFromColumnIndex($col_end))) { + $width -= self::sizeCol($sheet, \PhpSpreadsheet\Cell::stringFromColumnIndex($col_end)); ++$col_end; } @@ -264,10 +261,10 @@ class Excel5 // Bitmap isn't allowed to start or finish in a hidden cell, i.e. a cell // with zero height or width. - if (self::sizeCol($sheet, \PHPExcel\Cell::stringFromColumnIndex($col_start)) == 0) { + if (self::sizeCol($sheet, \PhpSpreadsheet\Cell::stringFromColumnIndex($col_start)) == 0) { return; } - if (self::sizeCol($sheet, \PHPExcel\Cell::stringFromColumnIndex($col_end)) == 0) { + if (self::sizeCol($sheet, \PhpSpreadsheet\Cell::stringFromColumnIndex($col_end)) == 0) { return; } if (self::sizeRow($sheet, $row_start + 1) == 0) { @@ -278,13 +275,13 @@ class Excel5 } // Convert the pixel values to the percentage value expected by Excel - $x1 = $x1 / self::sizeCol($sheet, \PHPExcel\Cell::stringFromColumnIndex($col_start)) * 1024; + $x1 = $x1 / self::sizeCol($sheet, \PhpSpreadsheet\Cell::stringFromColumnIndex($col_start)) * 1024; $y1 = $y1 / self::sizeRow($sheet, $row_start + 1) * 256; - $x2 = ($width + 1) / self::sizeCol($sheet, \PHPExcel\Cell::stringFromColumnIndex($col_end)) * 1024; // Distance to right side of object + $x2 = ($width + 1) / self::sizeCol($sheet, \PhpSpreadsheet\Cell::stringFromColumnIndex($col_end)) * 1024; // Distance to right side of object $y2 = ($height + 1) / self::sizeRow($sheet, $row_end + 1) * 256; // Distance to bottom of object - $startCoordinates = \PHPExcel\Cell::stringFromColumnIndex($col_start) . ($row_start + 1); - $endCoordinates = \PHPExcel\Cell::stringFromColumnIndex($col_end) . ($row_end + 1); + $startCoordinates = \PhpSpreadsheet\Cell::stringFromColumnIndex($col_start) . ($row_start + 1); + $endCoordinates = \PhpSpreadsheet\Cell::stringFromColumnIndex($col_end) . ($row_end + 1); $twoAnchor = array( 'startCoordinates' => $startCoordinates, diff --git a/src/PhpSpreadsheet/Shared/File.php b/src/PhpSpreadsheet/Shared/File.php index 1914f728..f94ec985 100644 --- a/src/PhpSpreadsheet/Shared/File.php +++ b/src/PhpSpreadsheet/Shared/File.php @@ -1,11 +1,11 @@ open($zipFile) === true) { $returnValue = ($zip->getFromName($archiveFile) !== false); diff --git a/src/PhpSpreadsheet/Shared/Font.php b/src/PhpSpreadsheet/Shared/Font.php index 05dbfe44..b1f41747 100644 --- a/src/PhpSpreadsheet/Shared/Font.php +++ b/src/PhpSpreadsheet/Shared/Font.php @@ -1,11 +1,11 @@ getPlainText(); } @@ -268,7 +267,7 @@ class Font // Width of text in pixels excl. padding // and addition because Excel adds some padding, just use approx width of 'n' glyph $columnWidth = self::getTextWidthPixelsExact($cellText, $font, $rotation) + $columnWidthAdjust; - } catch (\PHPExcel\Exception $e) { + } catch (\PhpSpreadsheet\Exception $e) { $approximate = true; } } @@ -291,15 +290,15 @@ class Font * Get GD text width in pixels for a string of text in a certain font at a certain rotation angle * * @param string $text - * @param \PHPExcel\Style\Font + * @param \PhpSpreadsheet\Style\Font * @param int $rotation * @return int - * @throws \PHPExcel\Exception + * @throws \PhpSpreadsheet\Exception */ - public static function getTextWidthPixelsExact($text, \PHPExcel\Style\Font $font, $rotation = 0) + public static function getTextWidthPixelsExact($text, \PhpSpreadsheet\Style\Font $font, $rotation = 0) { if (!function_exists('imagettfbbox')) { - throw new \PHPExcel\Exception('GD library needs to be enabled'); + throw new \PhpSpreadsheet\Exception('GD library needs to be enabled'); } // font size should really be supplied in pixels in GD2, @@ -327,11 +326,11 @@ class Font * Get approximate width in pixels for a string of text in a certain font at a certain rotation angle * * @param string $columnText - * @param \PHPExcel\Style\Font $font + * @param \PhpSpreadsheet\Style\Font $font * @param int $rotation * @return int Text width in pixels (no padding added) */ - public static function getTextWidthPixelsApprox($columnText, \PHPExcel\Style\Font $font = null, $rotation = 0) + public static function getTextWidthPixelsApprox($columnText, \PhpSpreadsheet\Style\Font $font = null, $rotation = 0) { $fontName = $font->getName(); $fontSize = $font->getSize(); @@ -417,13 +416,13 @@ class Font /** * Returns the font path given the font * - * @param \PHPExcel\Style\Font + * @param \PhpSpreadsheet\Style\Font * @return string Path to TrueType font file */ public static function getTrueTypeFontFileFromFont($font) { if (!file_exists(self::$trueTypeFontPath) || !is_dir(self::$trueTypeFontPath)) { - throw new \PHPExcel\Exception('Valid directory to TrueType Font files not specified'); + throw new \PhpSpreadsheet\Exception('Valid directory to TrueType Font files not specified'); } $name = $font->getName(); @@ -512,7 +511,7 @@ class Font ); break; default: - throw new \PHPExcel\Exception('Unknown font name "'. $name .'". Cannot map to TrueType font file'); + throw new \PhpSpreadsheet\Exception('Unknown font name "'. $name .'". Cannot map to TrueType font file'); break; } @@ -520,7 +519,7 @@ class Font // Check if file actually exists if (!file_exists($fontFile)) { - throw new \PHPExcel\Exception('TrueType Font file not found'); + throw new \PhpSpreadsheet\Exception('TrueType Font file not found'); } return $fontFile; @@ -553,11 +552,11 @@ class Font * Get the effective column width for columns without a column dimension or column with width -1 * For example, for Calibri 11 this is 9.140625 (64 px) * - * @param \PHPExcel\Style\Font $font The workbooks default font + * @param \PhpSpreadsheet\Style\Font $font The workbooks default font * @param boolean $pPixels true = return column width in pixels, false = return in OOXML units * @return mixed Column width */ - public static function getDefaultColumnWidthByFont(\PHPExcel\Style\Font $font, $pPixels = false) + public static function getDefaultColumnWidthByFont(\PhpSpreadsheet\Style\Font $font, $pPixels = false) { if (isset(self::$defaultColumnWidths[$font->getName()][$font->getSize()])) { // Exact width can be determined @@ -585,10 +584,10 @@ class Font * Get the effective row height for rows without a row dimension or rows with height -1 * For example, for Calibri 11 this is 15 points * - * @param \PHPExcel\Style\Font $font The workbooks default font + * @param \PhpSpreadsheet\Style\Font $font The workbooks default font * @return float Row height in points */ - public static function getDefaultRowHeightByFont(\PHPExcel\Style\Font $font) + public static function getDefaultRowHeightByFont(\PhpSpreadsheet\Style\Font $font) { switch ($font->getName()) { case 'Arial': diff --git a/src/PhpSpreadsheet/Shared/JAMA/CholeskyDecomposition.php b/src/PhpSpreadsheet/Shared/JAMA/CholeskyDecomposition.php index d30d2c17..3ad5dfa8 100644 --- a/src/PhpSpreadsheet/Shared/JAMA/CholeskyDecomposition.php +++ b/src/PhpSpreadsheet/Shared/JAMA/CholeskyDecomposition.php @@ -1,9 +1,8 @@ m, $nx); } else { - throw new \PHPExcel\Calculation\Exception(JAMAError(MatrixSPDException)); + throw new \PhpSpreadsheet\Calculation\Exception(JAMAError(MatrixSPDException)); } } else { - throw new \PHPExcel\Calculation\Exception(JAMAError(MATRIX_DIMENSION_EXCEPTION)); + throw new \PhpSpreadsheet\Calculation\Exception(JAMAError(MATRIX_DIMENSION_EXCEPTION)); } } else { - throw new \PHPExcel\Calculation\Exception(JAMAError(ARGUMENT_TYPE_EXCEPTION)); + throw new \PhpSpreadsheet\Calculation\Exception(JAMAError(ARGUMENT_TYPE_EXCEPTION)); } } // function solve() } diff --git a/src/PhpSpreadsheet/Shared/JAMA/EigenvalueDecomposition.php b/src/PhpSpreadsheet/Shared/JAMA/EigenvalueDecomposition.php index bcecfdd4..55dfc749 100644 --- a/src/PhpSpreadsheet/Shared/JAMA/EigenvalueDecomposition.php +++ b/src/PhpSpreadsheet/Shared/JAMA/EigenvalueDecomposition.php @@ -1,9 +1,8 @@ = n, the LU decomposition is an m-by-n * unit lower triangular matrix L, an n-by-n upper triangular matrix U, @@ -118,7 +117,7 @@ class LUDecomposition } } } else { - throw new \PHPExcel\Calculation\Exception(Matrix::ARGUMENT_TYPE_EXCEPTION); + throw new \PhpSpreadsheet\Calculation\Exception(Matrix::ARGUMENT_TYPE_EXCEPTION); } } // function __construct() @@ -211,7 +210,7 @@ class LUDecomposition } return $d; } else { - throw new \PHPExcel\Calculation\Exception(Matrix::MATRIX_DIMENSION_EXCEPTION); + throw new \PhpSpreadsheet\Calculation\Exception(Matrix::MATRIX_DIMENSION_EXCEPTION); } } // function det() @@ -220,8 +219,8 @@ class LUDecomposition * * @param $B A Matrix with as many rows as A and any number of columns. * @return X so that L*U*X = B(piv,:) - * @\PHPExcel\Calculation\Exception IllegalArgumentException Matrix row dimensions must agree. - * @\PHPExcel\Calculation\Exception RuntimeException Matrix is singular. + * @\PhpSpreadsheet\Calculation\Exception IllegalArgumentException Matrix row dimensions must agree. + * @\PhpSpreadsheet\Calculation\Exception RuntimeException Matrix is singular. */ public function solve($B) { @@ -251,10 +250,10 @@ class LUDecomposition } return $X; } else { - throw new \PHPExcel\Calculation\Exception(self::MATRIX_SINGULAR_EXCEPTION); + throw new \PhpSpreadsheet\Calculation\Exception(self::MATRIX_SINGULAR_EXCEPTION); } } else { - throw new \PHPExcel\Calculation\Exception(self::MATRIX_SQUARE_EXCEPTION); + throw new \PhpSpreadsheet\Calculation\Exception(self::MATRIX_SQUARE_EXCEPTION); } } } diff --git a/src/PhpSpreadsheet/Shared/JAMA/Matrix.php b/src/PhpSpreadsheet/Shared/JAMA/Matrix.php index 9473a3e1..bd384123 100644 --- a/src/PhpSpreadsheet/Shared/JAMA/Matrix.php +++ b/src/PhpSpreadsheet/Shared/JAMA/Matrix.php @@ -1,6 +1,6 @@ = 0) { $m = $this->m - $i0; } else { - throw new \PHPExcel\Calculation\Exception(self::ARGUMENT_BOUNDS_EXCEPTION); + throw new \PhpSpreadsheet\Calculation\Exception(self::ARGUMENT_BOUNDS_EXCEPTION); } if ($j0 >= 0) { $n = $this->n - $j0; } else { - throw new \PHPExcel\Calculation\Exception(self::ARGUMENT_BOUNDS_EXCEPTION); + throw new \PhpSpreadsheet\Calculation\Exception(self::ARGUMENT_BOUNDS_EXCEPTION); } $R = new Matrix($m, $n); for ($i = $i0; $i < $this->m; ++$i) { @@ -189,12 +189,12 @@ class Matrix if (($iF > $i0) && ($this->m >= $iF) && ($i0 >= 0)) { $m = $iF - $i0; } else { - throw new \PHPExcel\Calculation\Exception(self::ARGUMENT_BOUNDS_EXCEPTION); + throw new \PhpSpreadsheet\Calculation\Exception(self::ARGUMENT_BOUNDS_EXCEPTION); } if (($jF > $j0) && ($this->n >= $jF) && ($j0 >= 0)) { $n = $jF - $j0; } else { - throw new \PHPExcel\Calculation\Exception(self::ARGUMENT_BOUNDS_EXCEPTION); + throw new \PhpSpreadsheet\Calculation\Exception(self::ARGUMENT_BOUNDS_EXCEPTION); } $R = new Matrix($m+1, $n+1); for ($i = $i0; $i <= $iF; ++$i) { @@ -210,12 +210,12 @@ class Matrix if (count($RL) > 0) { $m = count($RL); } else { - throw new \PHPExcel\Calculation\Exception(self::ARGUMENT_BOUNDS_EXCEPTION); + throw new \PhpSpreadsheet\Calculation\Exception(self::ARGUMENT_BOUNDS_EXCEPTION); } if (count($CL) > 0) { $n = count($CL); } else { - throw new \PHPExcel\Calculation\Exception(self::ARGUMENT_BOUNDS_EXCEPTION); + throw new \PhpSpreadsheet\Calculation\Exception(self::ARGUMENT_BOUNDS_EXCEPTION); } $R = new Matrix($m, $n); for ($i = 0; $i < $m; ++$i) { @@ -231,12 +231,12 @@ class Matrix if (count($RL) > 0) { $m = count($RL); } else { - throw new \PHPExcel\Calculation\Exception(self::ARGUMENT_BOUNDS_EXCEPTION); + throw new \PhpSpreadsheet\Calculation\Exception(self::ARGUMENT_BOUNDS_EXCEPTION); } if (count($CL) > 0) { $n = count($CL); } else { - throw new \PHPExcel\Calculation\Exception(self::ARGUMENT_BOUNDS_EXCEPTION); + throw new \PhpSpreadsheet\Calculation\Exception(self::ARGUMENT_BOUNDS_EXCEPTION); } $R = new Matrix($m, $n); for ($i = 0; $i < $m; ++$i) { @@ -252,12 +252,12 @@ class Matrix if (($iF > $i0) && ($this->m >= $iF) && ($i0 >= 0)) { $m = $iF - $i0; } else { - throw new \PHPExcel\Calculation\Exception(self::ARGUMENT_BOUNDS_EXCEPTION); + throw new \PhpSpreadsheet\Calculation\Exception(self::ARGUMENT_BOUNDS_EXCEPTION); } if (count($CL) > 0) { $n = count($CL); } else { - throw new \PHPExcel\Calculation\Exception(self::ARGUMENT_BOUNDS_EXCEPTION); + throw new \PhpSpreadsheet\Calculation\Exception(self::ARGUMENT_BOUNDS_EXCEPTION); } $R = new Matrix($m, $n); for ($i = $i0; $i < $iF; ++$i) { @@ -273,12 +273,12 @@ class Matrix if (count($RL) > 0) { $m = count($RL); } else { - throw new \PHPExcel\Calculation\Exception(self::ARGUMENT_BOUNDS_EXCEPTION); + throw new \PhpSpreadsheet\Calculation\Exception(self::ARGUMENT_BOUNDS_EXCEPTION); } if (($jF >= $j0) && ($this->n >= $jF) && ($j0 >= 0)) { $n = $jF - $j0; } else { - throw new \PHPExcel\Calculation\Exception(self::ARGUMENT_BOUNDS_EXCEPTION); + throw new \PhpSpreadsheet\Calculation\Exception(self::ARGUMENT_BOUNDS_EXCEPTION); } $R = new Matrix($m, $n+1); for ($i = 0; $i < $m; ++$i) { @@ -289,11 +289,11 @@ class Matrix return $R; break; default: - throw new \PHPExcel\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + throw new \PhpSpreadsheet\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); break; } } else { - throw new \PHPExcel\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + throw new \PhpSpreadsheet\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); } } @@ -310,10 +310,10 @@ class Matrix if (($this->m == $B->getRowDimension()) && ($this->n == $B->getColumnDimension())) { return true; } else { - throw new \PHPExcel\Calculation\Exception(self::MATRIX_DIMENSION_EXCEPTION); + throw new \PhpSpreadsheet\Calculation\Exception(self::MATRIX_DIMENSION_EXCEPTION); } } else { - throw new \PHPExcel\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION); + throw new \PhpSpreadsheet\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION); } } // function checkMatrixDimensions() @@ -380,7 +380,7 @@ class Matrix return $this->getMatrix($i0, 0, $i0 + 1, $this->n); } } else { - throw new \PHPExcel\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION); + throw new \PhpSpreadsheet\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION); } } @@ -401,7 +401,7 @@ class Matrix return $this->getMatrix(0, $j0, $this->m, $j0 + 1); } } else { - throw new \PHPExcel\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION); + throw new \PhpSpreadsheet\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION); } } @@ -466,14 +466,14 @@ class Matrix if ($args[0] instanceof Matrix) { $M = $args[0]; } else { - throw new \PHPExcel\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION); + throw new \PhpSpreadsheet\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION); } break; case 'array': $M = new Matrix($args[0]); break; default: - throw new \PHPExcel\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + throw new \PhpSpreadsheet\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); break; } $this->checkMatrixDimensions($M); @@ -484,7 +484,7 @@ class Matrix } return $M; } else { - throw new \PHPExcel\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + throw new \PhpSpreadsheet\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); } } @@ -506,14 +506,14 @@ class Matrix if ($args[0] instanceof Matrix) { $M = $args[0]; } else { - throw new \PHPExcel\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION); + throw new \PhpSpreadsheet\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION); } break; case 'array': $M = new Matrix($args[0]); break; default: - throw new \PHPExcel\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + throw new \PhpSpreadsheet\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); break; } $this->checkMatrixDimensions($M); @@ -523,22 +523,22 @@ class Matrix $value = $M->get($i, $j); if ((is_string($this->A[$i][$j])) && (strlen($this->A[$i][$j]) > 0) && (!is_numeric($this->A[$i][$j]))) { $this->A[$i][$j] = trim($this->A[$i][$j], '"'); - $validValues &= \PHPExcel\Shared\StringHelper::convertToNumberIfFraction($this->A[$i][$j]); + $validValues &= \PhpSpreadsheet\Shared\StringHelper::convertToNumberIfFraction($this->A[$i][$j]); } if ((is_string($value)) && (strlen($value) > 0) && (!is_numeric($value))) { $value = trim($value, '"'); - $validValues &= \PHPExcel\Shared\StringHelper::convertToNumberIfFraction($value); + $validValues &= \PhpSpreadsheet\Shared\StringHelper::convertToNumberIfFraction($value); } if ($validValues) { $this->A[$i][$j] += $value; } else { - $this->A[$i][$j] = PHPExcel_Calculation_Functions::NAN(); + $this->A[$i][$j] = \PhpSpreadsheet\Calculation\Functions::NAN(); } } } return $this; } else { - throw new \PHPExcel\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + throw new \PhpSpreadsheet\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); } } @@ -560,14 +560,14 @@ class Matrix if ($args[0] instanceof Matrix) { $M = $args[0]; } else { - throw new \PHPExcel\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION); + throw new \PhpSpreadsheet\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION); } break; case 'array': $M = new Matrix($args[0]); break; default: - throw new \PHPExcel\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + throw new \PhpSpreadsheet\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); break; } $this->checkMatrixDimensions($M); @@ -578,7 +578,7 @@ class Matrix } return $M; } else { - throw new \PHPExcel\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + throw new \PhpSpreadsheet\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); } } @@ -600,14 +600,14 @@ class Matrix if ($args[0] instanceof Matrix) { $M = $args[0]; } else { - throw new \PHPExcel\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION); + throw new \PhpSpreadsheet\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION); } break; case 'array': $M = new Matrix($args[0]); break; default: - throw new \PHPExcel\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + throw new \PhpSpreadsheet\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); break; } $this->checkMatrixDimensions($M); @@ -617,22 +617,22 @@ class Matrix $value = $M->get($i, $j); if ((is_string($this->A[$i][$j])) && (strlen($this->A[$i][$j]) > 0) && (!is_numeric($this->A[$i][$j]))) { $this->A[$i][$j] = trim($this->A[$i][$j], '"'); - $validValues &= \PHPExcel\Shared\StringHelper::convertToNumberIfFraction($this->A[$i][$j]); + $validValues &= \PhpSpreadsheet\Shared\StringHelper::convertToNumberIfFraction($this->A[$i][$j]); } if ((is_string($value)) && (strlen($value) > 0) && (!is_numeric($value))) { $value = trim($value, '"'); - $validValues &= \PHPExcel\Shared\StringHelper::convertToNumberIfFraction($value); + $validValues &= \PhpSpreadsheet\Shared\StringHelper::convertToNumberIfFraction($value); } if ($validValues) { $this->A[$i][$j] -= $value; } else { - $this->A[$i][$j] = PHPExcel_Calculation_Functions::NAN(); + $this->A[$i][$j] = \PhpSpreadsheet\Calculation\Functions::NAN(); } } } return $this; } else { - throw new \PHPExcel\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + throw new \PhpSpreadsheet\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); } } @@ -655,14 +655,14 @@ class Matrix if ($args[0] instanceof Matrix) { $M = $args[0]; } else { - throw new \PHPExcel\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION); + throw new \PhpSpreadsheet\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION); } break; case 'array': $M = new Matrix($args[0]); break; default: - throw new \PHPExcel\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + throw new \PhpSpreadsheet\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); break; } $this->checkMatrixDimensions($M); @@ -673,7 +673,7 @@ class Matrix } return $M; } else { - throw new \PHPExcel\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + throw new \PhpSpreadsheet\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); } } @@ -696,14 +696,14 @@ class Matrix if ($args[0] instanceof Matrix) { $M = $args[0]; } else { - throw new \PHPExcel\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION); + throw new \PhpSpreadsheet\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION); } break; case 'array': $M = new Matrix($args[0]); break; default: - throw new \PHPExcel\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + throw new \PhpSpreadsheet\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); break; } $this->checkMatrixDimensions($M); @@ -713,22 +713,22 @@ class Matrix $value = $M->get($i, $j); if ((is_string($this->A[$i][$j])) && (strlen($this->A[$i][$j]) > 0) && (!is_numeric($this->A[$i][$j]))) { $this->A[$i][$j] = trim($this->A[$i][$j], '"'); - $validValues &= \PHPExcel\Shared\StringHelper::convertToNumberIfFraction($this->A[$i][$j]); + $validValues &= \PhpSpreadsheet\Shared\StringHelper::convertToNumberIfFraction($this->A[$i][$j]); } if ((is_string($value)) && (strlen($value) > 0) && (!is_numeric($value))) { $value = trim($value, '"'); - $validValues &= \PHPExcel\Shared\StringHelper::convertToNumberIfFraction($value); + $validValues &= \PhpSpreadsheet\Shared\StringHelper::convertToNumberIfFraction($value); } if ($validValues) { $this->A[$i][$j] *= $value; } else { - $this->A[$i][$j] = PHPExcel_Calculation_Functions::NAN(); + $this->A[$i][$j] = \PhpSpreadsheet\Calculation\Functions::NAN(); } } } return $this; } else { - throw new \PHPExcel\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + throw new \PhpSpreadsheet\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); } } @@ -751,14 +751,14 @@ class Matrix if ($args[0] instanceof Matrix) { $M = $args[0]; } else { - throw new \PHPExcel\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION); + throw new \PhpSpreadsheet\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION); } break; case 'array': $M = new Matrix($args[0]); break; default: - throw new \PHPExcel\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + throw new \PhpSpreadsheet\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); break; } $this->checkMatrixDimensions($M); @@ -768,11 +768,11 @@ class Matrix $value = $M->get($i, $j); if ((is_string($this->A[$i][$j])) && (strlen($this->A[$i][$j]) > 0) && (!is_numeric($this->A[$i][$j]))) { $this->A[$i][$j] = trim($this->A[$i][$j], '"'); - $validValues &= \PHPExcel\Shared\StringHelper::convertToNumberIfFraction($this->A[$i][$j]); + $validValues &= \PhpSpreadsheet\Shared\StringHelper::convertToNumberIfFraction($this->A[$i][$j]); } if ((is_string($value)) && (strlen($value) > 0) && (!is_numeric($value))) { $value = trim($value, '"'); - $validValues &= \PHPExcel\Shared\StringHelper::convertToNumberIfFraction($value); + $validValues &= \PhpSpreadsheet\Shared\StringHelper::convertToNumberIfFraction($value); } if ($validValues) { if ($value == 0) { @@ -782,13 +782,13 @@ class Matrix $M->set($i, $j, $this->A[$i][$j] / $value); } } else { - $M->set($i, $j, PHPExcel_Calculation_Functions::NAN()); + $M->set($i, $j, \PhpSpreadsheet\Calculation\Functions::NAN()); } } } return $M; } else { - throw new \PHPExcel\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + throw new \PhpSpreadsheet\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); } } @@ -812,14 +812,14 @@ class Matrix if ($args[0] instanceof Matrix) { $M = $args[0]; } else { - throw new \PHPExcel\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION); + throw new \PhpSpreadsheet\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION); } break; case 'array': $M = new Matrix($args[0]); break; default: - throw new \PHPExcel\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + throw new \PhpSpreadsheet\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); break; } $this->checkMatrixDimensions($M); @@ -830,7 +830,7 @@ class Matrix } return $M; } else { - throw new \PHPExcel\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + throw new \PhpSpreadsheet\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); } } @@ -854,14 +854,14 @@ class Matrix if ($args[0] instanceof Matrix) { $M = $args[0]; } else { - throw new \PHPExcel\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION); + throw new \PhpSpreadsheet\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION); } break; case 'array': $M = new Matrix($args[0]); break; default: - throw new \PHPExcel\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + throw new \PhpSpreadsheet\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); break; } $this->checkMatrixDimensions($M); @@ -872,7 +872,7 @@ class Matrix } return $M; } else { - throw new \PHPExcel\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + throw new \PhpSpreadsheet\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); } } @@ -896,14 +896,14 @@ class Matrix if ($args[0] instanceof Matrix) { $M = $args[0]; } else { - throw new \PHPExcel\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION); + throw new \PhpSpreadsheet\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION); } break; case 'array': $M = new Matrix($args[0]); break; default: - throw new \PHPExcel\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + throw new \PhpSpreadsheet\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); break; } $this->checkMatrixDimensions($M); @@ -914,7 +914,7 @@ class Matrix } return $M; } else { - throw new \PHPExcel\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + throw new \PhpSpreadsheet\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); } } @@ -937,7 +937,7 @@ class Matrix if ($args[0] instanceof Matrix) { $B = $args[0]; } else { - throw new \PHPExcel\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION); + throw new \PhpSpreadsheet\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION); } if ($this->n == $B->m) { $C = new Matrix($this->m, $B->n); @@ -956,7 +956,7 @@ class Matrix } return $C; } else { - throw new \PHPExcel\Calculation\Exception(JAMAError(MatrixDimensionMismatch)); + throw new \PhpSpreadsheet\Calculation\Exception(JAMAError(MatrixDimensionMismatch)); } break; case 'array': @@ -974,7 +974,7 @@ class Matrix } return $C; } else { - throw new \PHPExcel\Calculation\Exception(JAMAError(MatrixDimensionMismatch)); + throw new \PhpSpreadsheet\Calculation\Exception(JAMAError(MatrixDimensionMismatch)); } return $M; break; @@ -1006,11 +1006,11 @@ class Matrix return $C; break; default: - throw new \PHPExcel\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + throw new \PhpSpreadsheet\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); break; } } else { - throw new \PHPExcel\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + throw new \PhpSpreadsheet\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); } } @@ -1032,14 +1032,14 @@ class Matrix if ($args[0] instanceof Matrix) { $M = $args[0]; } else { - throw new \PHPExcel\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION); + throw new \PhpSpreadsheet\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION); } break; case 'array': $M = new Matrix($args[0]); break; default: - throw new \PHPExcel\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + throw new \PhpSpreadsheet\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); break; } $this->checkMatrixDimensions($M); @@ -1049,22 +1049,22 @@ class Matrix $value = $M->get($i, $j); if ((is_string($this->A[$i][$j])) && (strlen($this->A[$i][$j]) > 0) && (!is_numeric($this->A[$i][$j]))) { $this->A[$i][$j] = trim($this->A[$i][$j], '"'); - $validValues &= \PHPExcel\Shared\StringHelper::convertToNumberIfFraction($this->A[$i][$j]); + $validValues &= \PhpSpreadsheet\Shared\StringHelper::convertToNumberIfFraction($this->A[$i][$j]); } if ((is_string($value)) && (strlen($value) > 0) && (!is_numeric($value))) { $value = trim($value, '"'); - $validValues &= \PHPExcel\Shared\StringHelper::convertToNumberIfFraction($value); + $validValues &= \PhpSpreadsheet\Shared\StringHelper::convertToNumberIfFraction($value); } if ($validValues) { $this->A[$i][$j] = pow($this->A[$i][$j], $value); } else { - $this->A[$i][$j] = PHPExcel_Calculation_Functions::NAN(); + $this->A[$i][$j] = \PhpSpreadsheet\Calculation\Functions::NAN(); } } } return $this; } else { - throw new \PHPExcel\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + throw new \PhpSpreadsheet\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); } } @@ -1086,14 +1086,14 @@ class Matrix if ($args[0] instanceof Matrix) { $M = $args[0]; } else { - throw new \PHPExcel\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION); + throw new \PhpSpreadsheet\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION); } break; case 'array': $M = new Matrix($args[0]); break; default: - throw new \PHPExcel\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + throw new \PhpSpreadsheet\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); break; } $this->checkMatrixDimensions($M); @@ -1104,7 +1104,7 @@ class Matrix } return $this; } else { - throw new \PHPExcel\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + throw new \PhpSpreadsheet\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); } } @@ -1120,7 +1120,7 @@ class Matrix $LU = new LUDecomposition($this); return $LU->solve($B); } else { - $QR = new PHPExcel_Shared_JAMA_QRDecomposition($this); + $QR = new QRDecomposition($this); return $QR->solve($B); } } diff --git a/src/PhpSpreadsheet/Shared/JAMA/QRDecomposition.php b/src/PhpSpreadsheet/Shared/JAMA/QRDecomposition.php index 9178ce72..92461460 100644 --- a/src/PhpSpreadsheet/Shared/JAMA/QRDecomposition.php +++ b/src/PhpSpreadsheet/Shared/JAMA/QRDecomposition.php @@ -1,9 +1,8 @@ = n, the QR decomposition is an m-by-n * orthogonal matrix Q and an n-by-n upper triangular matrix R so that @@ -92,7 +91,7 @@ class QRDecomposition $this->Rdiag[$k] = -$nrm; } } else { - throw new \PHPExcel\Calculation\Exception(Matrix::ARGUMENT_TYPE_EXCEPTION); + throw new \PhpSpreadsheet\Calculation\Exception(Matrix::ARGUMENT_TYPE_EXCEPTION); } } // function __construct() @@ -229,10 +228,10 @@ class QRDecomposition $X = new Matrix($X); return ($X->getMatrix(0, $this->n-1, 0, $nx)); } else { - throw new \PHPExcel\Calculation\Exception(self::MATRIX_RANK_EXCEPTION); + throw new \PhpSpreadsheet\Calculation\Exception(self::MATRIX_RANK_EXCEPTION); } } else { - throw new \PHPExcel\Calculation\Exception(Matrix::MATRIX_DIMENSION_EXCEPTION); + throw new \PhpSpreadsheet\Calculation\Exception(Matrix::MATRIX_DIMENSION_EXCEPTION); } } } diff --git a/src/PhpSpreadsheet/Shared/JAMA/SingularValueDecomposition.php b/src/PhpSpreadsheet/Shared/JAMA/SingularValueDecomposition.php index 9daa4d97..7bd6ddbc 100644 --- a/src/PhpSpreadsheet/Shared/JAMA/SingularValueDecomposition.php +++ b/src/PhpSpreadsheet/Shared/JAMA/SingularValueDecomposition.php @@ -1,9 +1,8 @@ = n, the singular value decomposition is * an m-by-n orthogonal matrix U, an n-by-n diagonal matrix S, and diff --git a/src/PhpSpreadsheet/Shared/JAMA/utils/Error.php b/src/PhpSpreadsheet/Shared/JAMA/utils/Error.php index 71b8c994..48bc8936 100644 --- a/src/PhpSpreadsheet/Shared/JAMA/utils/Error.php +++ b/src/PhpSpreadsheet/Shared/JAMA/utils/Error.php @@ -1,6 +1,5 @@ * @author Christian Schmidt -* @category PHPExcel -* @package PHPExcel_Shared_OLE +* @category PhpSpreadsheet */ class OLE { @@ -95,24 +94,24 @@ class OLE * @acces public * @param string $file * @return mixed true on success, PEAR_Error on failure - * @throws \PHPExcel\Reader\Exception + * @throws \PhpSpreadsheet\Reader\Exception */ public function read($file) { $fh = fopen($file, "r"); if (!$fh) { - throw new \PHPExcel\Reader\Exception("Can't open file $file"); + throw new \PhpSpreadsheet\Reader\Exception("Can't open file $file"); } $this->_file_handle = $fh; $signature = fread($fh, 8); if ("\xD0\xCF\x11\xE0\xA1\xB1\x1A\xE1" != $signature) { - throw new \PHPExcel\Reader\Exception("File doesn't seem to be an OLE container."); + throw new \PhpSpreadsheet\Reader\Exception("File doesn't seem to be an OLE container."); } fseek($fh, 28); if (fread($fh, 2) != "\xFE\xFF") { // This shouldn't be a problem in practice - throw new \PHPExcel\Reader\Exception("Only Little-Endian encoding is supported."); + throw new \PhpSpreadsheet\Reader\Exception("Only Little-Endian encoding is supported."); } // Size of blocks and short blocks in bytes $this->bigBlockSize = pow(2, self::_readInt2($fh)); @@ -194,7 +193,7 @@ class OLE /** * Returns a stream for use with fread() etc. External callers should - * use \PHPExcel\Shared\OLE\PPS\File::getStream(). + * use \PhpSpreadsheet\Shared\OLE\PPS\File::getStream(). * @param int|PPS block id or PPS * @return resource read-only stream */ @@ -202,7 +201,7 @@ class OLE { static $isRegistered = false; if (!$isRegistered) { - stream_wrapper_register('ole-chainedblockstream', '\\PHPExcel\\Shared\\OLE\\ChainedBlockStream'); + stream_wrapper_register('ole-chainedblockstream', '\\PhpSpreadsheet\\Shared\\OLE\\ChainedBlockStream'); $isRegistered = true; } diff --git a/src/PhpSpreadsheet/Shared/OLE/ChainedBlockStream.php b/src/PhpSpreadsheet/Shared/OLE/ChainedBlockStream.php index 0a03575d..89a64f08 100644 --- a/src/PhpSpreadsheet/Shared/OLE/ChainedBlockStream.php +++ b/src/PhpSpreadsheet/Shared/OLE/ChainedBlockStream.php @@ -1,11 +1,9 @@ -* @category PHPExcel -* @package PHPExcel_Shared_OLE +* @category PhpSpreadsheet */ class PPS { @@ -185,8 +184,8 @@ class PPS . "\xc0\x00\x00\x00" // 92 . "\x00\x00\x00\x46" // 96 // Seems to be ok only for Root . "\x00\x00\x00\x00" // 100 - . \PHPExcel\Shared\OLE::localDateToOLE($this->Time1st) // 108 - . \PHPExcel\Shared\OLE::localDateToOLE($this->Time2nd) // 116 + . \PhpSpreadsheet\Shared\OLE::localDateToOLE($this->Time1st) // 108 + . \PhpSpreadsheet\Shared\OLE::localDateToOLE($this->Time2nd) // 116 . pack("V", isset($this->startBlock) ? $this->startBlock : 0) // 120 . pack("V", $this->Size) // 124 . pack("V", 0); // 128 diff --git a/src/PhpSpreadsheet/Shared/OLE/PPS/File.php b/src/PhpSpreadsheet/Shared/OLE/PPS/File.php index 667854a1..21fd7b5d 100644 --- a/src/PhpSpreadsheet/Shared/OLE/PPS/File.php +++ b/src/PhpSpreadsheet/Shared/OLE/PPS/File.php @@ -1,6 +1,6 @@ -* @category PHPExcel -* @package PHPExcel_Shared_OLE +* @category PhpSpreadsheet */ -class File extends \PHPExcel\Shared\OLE\PPS +class File extends \PhpSpreadsheet\Shared\OLE\PPS { /** * The constructor @@ -41,7 +40,7 @@ class File extends \PHPExcel\Shared\OLE\PPS */ public function __construct($name) { - parent::__construct(null, $name, \PHPExcel\Shared\OLE::OLE_PPS_TYPE_FILE, null, null, null, null, null, '', array()); + parent::__construct(null, $name, \PhpSpreadsheet\Shared\OLE::OLE_PPS_TYPE_FILE, null, null, null, null, null, '', array()); } /** diff --git a/src/PhpSpreadsheet/Shared/OLE/PPS/Root.php b/src/PhpSpreadsheet/Shared/OLE/PPS/Root.php index 5bac27ae..4296cb48 100644 --- a/src/PhpSpreadsheet/Shared/OLE/PPS/Root.php +++ b/src/PhpSpreadsheet/Shared/OLE/PPS/Root.php @@ -1,6 +1,6 @@ -* @category PHPExcel -* @package PHPExcel_Shared_OLE +* @category PhpSpreadsheet */ -class Root extends \PHPExcel\Shared\OLE\PPS +class Root extends \PhpSpreadsheet\Shared\OLE\PPS { /** @@ -45,9 +44,9 @@ class Root extends \PHPExcel\Shared\OLE\PPS */ public function __construct($time_1st, $time_2nd, $raChild) { - $this->_tempDir = \PHPExcel\Shared\File::sysGetTempDir(); + $this->_tempDir = \PhpSpreadsheet\Shared\File::sysGetTempDir(); - parent::__construct(null, \PHPExcel\Shared\OLE::ascToUcs('Root Entry'), \PHPExcel\Shared\OLE::OLE_PPS_TYPE_ROOT, null, null, null, $time_1st, $time_2nd, null, $raChild); + parent::__construct(null, \PhpSpreadsheet\Shared\OLE::ascToUcs('Root Entry'), \PhpSpreadsheet\Shared\OLE::OLE_PPS_TYPE_ROOT, null, null, null, $time_1st, $time_2nd, null, $raChild); } /** @@ -60,7 +59,7 @@ class Root extends \PHPExcel\Shared\OLE\PPS * @param string|resource $filename The name of the file or stream where to save the OLE container. * @access public * @return mixed true on success - * @throws \PHPExcel\Writer\Exception + * @throws \PhpSpreadsheet\Writer\Exception */ public function save($filename) { @@ -78,22 +77,22 @@ class Root extends \PHPExcel\Shared\OLE\PPS $this->_FILEH_ = $filename; } elseif ($filename == '-' || $filename == '') { if ($this->tempDirectory === null) { - $this->tempDirectory = \PHPExcel\Shared\File::sysGetTempDir(); + $this->tempDirectory = \PhpSpreadsheet\Shared\File::sysGetTempDir(); } $this->_tmp_filename = tempnam($this->tempDirectory, "OLE_PPS_Root"); $this->_FILEH_ = fopen($this->_tmp_filename, "w+b"); if ($this->_FILEH_ == false) { - throw new \PHPExcel\Writer\Exception("Can't create temporary file."); + throw new \PhpSpreadsheet\Writer\Exception("Can't create temporary file."); } } else { $this->_FILEH_ = fopen($filename, "wb"); } if ($this->_FILEH_ == false) { - throw new \PHPExcel\Writer\Exception("Can't open $filename. It may be in use or protected."); + throw new \PhpSpreadsheet\Writer\Exception("Can't open $filename. It may be in use or protected."); } // Make an array of PPS's (for Save) $aList = array(); - \PHPExcel\Shared\OLE\PPS::_savePpsSetPnt($aList, array($this)); + \PhpSpreadsheet\Shared\OLE\PPS::_savePpsSetPnt($aList, array($this)); // calculate values for header list($iSBDcnt, $iBBcnt, $iPPScnt) = $this->_calcSize($aList); //, $rhInfo); // Save Header @@ -131,9 +130,9 @@ class Root extends \PHPExcel\Shared\OLE\PPS $iSBcnt = 0; $iCount = count($raList); for ($i = 0; $i < $iCount; ++$i) { - if ($raList[$i]->Type == \PHPExcel\Shared\OLE::OLE_PPS_TYPE_FILE) { + if ($raList[$i]->Type == \PhpSpreadsheet\Shared\OLE::OLE_PPS_TYPE_FILE) { $raList[$i]->Size = $raList[$i]->getDataLen(); - if ($raList[$i]->Size < \PHPExcel\Shared\OLE::OLE_DATA_SIZE_SMALL) { + if ($raList[$i]->Size < \PhpSpreadsheet\Shared\OLE::OLE_DATA_SIZE_SMALL) { $iSBcnt += floor($raList[$i]->Size / $this->_SMALL_BLOCK_SIZE) + (($raList[$i]->Size % $this->_SMALL_BLOCK_SIZE)? 1: 0); } else { @@ -143,12 +142,12 @@ class Root extends \PHPExcel\Shared\OLE\PPS } } $iSmallLen = $iSBcnt * $this->_SMALL_BLOCK_SIZE; - $iSlCnt = floor($this->_BIG_BLOCK_SIZE / \PHPExcel\Shared\OLE::OLE_LONG_INT_SIZE); + $iSlCnt = floor($this->_BIG_BLOCK_SIZE / \PhpSpreadsheet\Shared\OLE::OLE_LONG_INT_SIZE); $iSBDcnt = floor($iSBcnt / $iSlCnt) + (($iSBcnt % $iSlCnt)? 1:0); $iBBcnt += (floor($iSmallLen / $this->_BIG_BLOCK_SIZE) + (( $iSmallLen % $this->_BIG_BLOCK_SIZE)? 1: 0)); $iCnt = count($raList); - $iBdCnt = $this->_BIG_BLOCK_SIZE / \PHPExcel\Shared\OLE::OLE_PPS_SIZE; + $iBdCnt = $this->_BIG_BLOCK_SIZE / \PhpSpreadsheet\Shared\OLE::OLE_PPS_SIZE; $iPPScnt = (floor($iCnt/$iBdCnt) + (($iCnt % $iBdCnt)? 1: 0)); return array($iSBDcnt, $iBBcnt, $iPPScnt); @@ -181,8 +180,8 @@ class Root extends \PHPExcel\Shared\OLE\PPS $FILE = $this->_FILEH_; // Calculate Basic Setting - $iBlCnt = $this->_BIG_BLOCK_SIZE / \PHPExcel\Shared\OLE::OLE_LONG_INT_SIZE; - $i1stBdL = ($this->_BIG_BLOCK_SIZE - 0x4C) / \PHPExcel\Shared\OLE::OLE_LONG_INT_SIZE; + $iBlCnt = $this->_BIG_BLOCK_SIZE / \PhpSpreadsheet\Shared\OLE::OLE_LONG_INT_SIZE; + $i1stBdL = ($this->_BIG_BLOCK_SIZE - 0x4C) / \PhpSpreadsheet\Shared\OLE::OLE_LONG_INT_SIZE; $iBdExL = 0; $iAll = $iBBcnt + $iPPScnt + $iSBDcnt; @@ -250,7 +249,7 @@ class Root extends \PHPExcel\Shared\OLE\PPS } /** - * Saving big data (PPS's with data bigger than \PHPExcel\Shared\OLE::OLE_DATA_SIZE_SMALL) + * Saving big data (PPS's with data bigger than \PhpSpreadsheet\Shared\OLE::OLE_DATA_SIZE_SMALL) * * @access public * @param integer $iStBlk @@ -263,9 +262,9 @@ class Root extends \PHPExcel\Shared\OLE\PPS // cycle through PPS's $iCount = count($raList); for ($i = 0; $i < $iCount; ++$i) { - if ($raList[$i]->Type != \PHPExcel\Shared\OLE::OLE_PPS_TYPE_DIR) { + if ($raList[$i]->Type != \PhpSpreadsheet\Shared\OLE::OLE_PPS_TYPE_DIR) { $raList[$i]->Size = $raList[$i]->getDataLen(); - if (($raList[$i]->Size >= \PHPExcel\Shared\OLE::OLE_DATA_SIZE_SMALL) || (($raList[$i]->Type == \PHPExcel\Shared\OLE::OLE_PPS_TYPE_ROOT) && isset($raList[$i]->_data))) { + if (($raList[$i]->Size >= \PhpSpreadsheet\Shared\OLE::OLE_DATA_SIZE_SMALL) || (($raList[$i]->Type == \PhpSpreadsheet\Shared\OLE::OLE_PPS_TYPE_ROOT) && isset($raList[$i]->_data))) { // Write Data //if (isset($raList[$i]->_PPS_FILE)) { // $iLen = 0; @@ -298,7 +297,7 @@ class Root extends \PHPExcel\Shared\OLE\PPS } /** - * get small data (PPS's with data smaller than \PHPExcel\Shared\OLE::OLE_DATA_SIZE_SMALL) + * get small data (PPS's with data smaller than \PhpSpreadsheet\Shared\OLE::OLE_DATA_SIZE_SMALL) * * @access public * @param array &$raList Reference to array of PPS's @@ -312,11 +311,11 @@ class Root extends \PHPExcel\Shared\OLE\PPS $iCount = count($raList); for ($i = 0; $i < $iCount; ++$i) { // Make SBD, small data string - if ($raList[$i]->Type == \PHPExcel\Shared\OLE::OLE_PPS_TYPE_FILE) { + if ($raList[$i]->Type == \PhpSpreadsheet\Shared\OLE::OLE_PPS_TYPE_FILE) { if ($raList[$i]->Size <= 0) { continue; } - if ($raList[$i]->Size < \PHPExcel\Shared\OLE::OLE_DATA_SIZE_SMALL) { + if ($raList[$i]->Size < \PhpSpreadsheet\Shared\OLE::OLE_DATA_SIZE_SMALL) { $iSmbCnt = floor($raList[$i]->Size / $this->_SMALL_BLOCK_SIZE) + (($raList[$i]->Size % $this->_SMALL_BLOCK_SIZE)? 1: 0); // Add to SBD @@ -344,7 +343,7 @@ class Root extends \PHPExcel\Shared\OLE\PPS } } } - $iSbCnt = floor($this->_BIG_BLOCK_SIZE / \PHPExcel\Shared\OLE::OLE_LONG_INT_SIZE); + $iSbCnt = floor($this->_BIG_BLOCK_SIZE / \PhpSpreadsheet\Shared\OLE::OLE_LONG_INT_SIZE); if ($iSmBlk % $iSbCnt) { $iB = $iSbCnt - ($iSmBlk % $iSbCnt); for ($i = 0; $i < $iB; ++$i) { @@ -369,9 +368,9 @@ class Root extends \PHPExcel\Shared\OLE\PPS } // Adjust for Block $iCnt = count($raList); - $iBCnt = $this->_BIG_BLOCK_SIZE / \PHPExcel\Shared\OLE::OLE_PPS_SIZE; + $iBCnt = $this->_BIG_BLOCK_SIZE / \PhpSpreadsheet\Shared\OLE::OLE_PPS_SIZE; if ($iCnt % $iBCnt) { - fwrite($this->_FILEH_, str_repeat("\x00", ($iBCnt - ($iCnt % $iBCnt)) * \PHPExcel\Shared\OLE::OLE_PPS_SIZE)); + fwrite($this->_FILEH_, str_repeat("\x00", ($iBCnt - ($iCnt % $iBCnt)) * \PhpSpreadsheet\Shared\OLE::OLE_PPS_SIZE)); } } @@ -387,8 +386,8 @@ class Root extends \PHPExcel\Shared\OLE\PPS { $FILE = $this->_FILEH_; // Calculate Basic Setting - $iBbCnt = $this->_BIG_BLOCK_SIZE / \PHPExcel\Shared\OLE::OLE_LONG_INT_SIZE; - $i1stBdL = ($this->_BIG_BLOCK_SIZE - 0x4C) / \PHPExcel\Shared\OLE::OLE_LONG_INT_SIZE; + $iBbCnt = $this->_BIG_BLOCK_SIZE / \PhpSpreadsheet\Shared\OLE::OLE_LONG_INT_SIZE; + $i1stBdL = ($this->_BIG_BLOCK_SIZE - 0x4C) / \PhpSpreadsheet\Shared\OLE::OLE_LONG_INT_SIZE; $iBdExL = 0; $iAll = $iBsize + $iPpsCnt + $iSbdSize; diff --git a/src/PhpSpreadsheet/Shared/OLERead.php b/src/PhpSpreadsheet/Shared/OLERead.php index 9d53978c..5927d63b 100644 --- a/src/PhpSpreadsheet/Shared/OLERead.php +++ b/src/PhpSpreadsheet/Shared/OLERead.php @@ -1,11 +1,11 @@ data != self::IDENTIFIER_OLE) { - throw new \PHPExcel\Reader\Exception('The filename ' . $sFileName . ' is not recognised as an OLE file'); + throw new \PhpSpreadsheet\Reader\Exception('The filename ' . $sFileName . ' is not recognised as an OLE file'); } // Get the file data diff --git a/src/PhpSpreadsheet/Shared/PCLZip/PclZip.php b/src/PhpSpreadsheet/Shared/PCLZip/PclZip.php index 119d2044..7e1b7699 100644 --- a/src/PhpSpreadsheet/Shared/PCLZip/PclZip.php +++ b/src/PhpSpreadsheet/Shared/PCLZip/PclZip.php @@ -1,6 +1,6 @@ _calculateFormulaValue($fractionFormula); + $operand = \PhpSpreadsheet\Calculation::getInstance()->_calculateFormulaValue($fractionFormula); return true; } return false; @@ -709,8 +708,8 @@ class StringHelper } /** - * Set the decimal separator. Only used by \PHPExcel\Style\NumberFormat::toFormattedString() - * to format output by \PHPExcel\Writer\HTML and \PHPExcel\Writer\PDF + * Set the decimal separator. Only used by \PhpSpreadsheet\Style\NumberFormat::toFormattedString() + * to format output by \PhpSpreadsheet\Writer\HTML and \PhpSpreadsheet\Writer\PDF * * @param string $pValue Character for decimal separator */ @@ -741,8 +740,8 @@ class StringHelper } /** - * Set the thousands separator. Only used by \PHPExcel\Style\NumberFormat::toFormattedString() - * to format output by \PHPExcel\Writer\HTML and \PHPExcel\Writer\PDF + * Set the thousands separator. Only used by \PhpSpreadsheet\Style\NumberFormat::toFormattedString() + * to format output by \PhpSpreadsheet\Writer\HTML and \PhpSpreadsheet\Writer\PDF * * @param string $pValue Character for thousands separator */ @@ -776,8 +775,8 @@ class StringHelper } /** - * Set the currency code. Only used by \PHPExcel\Style\NumberFormat::toFormattedString() - * to format output by \PHPExcel\Writer\HTML and \PHPExcel\Writer\PDF + * Set the currency code. Only used by \PhpSpreadsheet\Style\NumberFormat::toFormattedString() + * to format output by \PhpSpreadsheet\Writer\HTML and \PhpSpreadsheet\Writer\PDF * * @param string $pValue Character for currency code */ diff --git a/src/PhpSpreadsheet/Shared/TimeZone.php b/src/PhpSpreadsheet/Shared/TimeZone.php index 69634fc4..9b0ac31f 100644 --- a/src/PhpSpreadsheet/Shared/TimeZone.php +++ b/src/PhpSpreadsheet/Shared/TimeZone.php @@ -1,11 +1,11 @@ getGoodnessOfFit(); } diff --git a/src/PhpSpreadsheet/Shared/XMLWriter.php b/src/PhpSpreadsheet/Shared/XMLWriter.php index 94a2ffd1..7a67c667 100644 --- a/src/PhpSpreadsheet/Shared/XMLWriter.php +++ b/src/PhpSpreadsheet/Shared/XMLWriter.php @@ -1,6 +1,6 @@ zip->add($this->tempDir.'/'.$filenameParts["basename"], PCLZIP_OPT_REMOVE_PATH, $this->tempDir, PCLZIP_OPT_ADD_PATH, $filenameParts["dirname"]); if ($res == 0) { - throw new \PHPExcel\Writer\Exception("Error zipping files : " . $this->zip->errorInfo(true)); + throw new \PhpSpreadsheet\Writer\Exception("Error zipping files : " . $this->zip->errorInfo(true)); } unlink($this->tempDir.'/'.$filenameParts["basename"]); diff --git a/src/PhpSpreadsheet/Shared/ZipStreamWrapper.php b/src/PhpSpreadsheet/Shared/ZipStreamWrapper.php index 63d20517..763bf19f 100644 --- a/src/PhpSpreadsheet/Shared/ZipStreamWrapper.php +++ b/src/PhpSpreadsheet/Shared/ZipStreamWrapper.php @@ -1,11 +1,9 @@ archive = new $zipClass(); $this->archive->open($url['host']); diff --git a/src/PhpSpreadsheet/Spreadsheet.php b/src/PhpSpreadsheet/Spreadsheet.php index 7d8a06a8..54f4d825 100644 --- a/src/PhpSpreadsheet/Spreadsheet.php +++ b/src/PhpSpreadsheet/Spreadsheet.php @@ -1,11 +1,11 @@ - * $objPHPExcel->getActiveSheet()->getStyle('B2')->applyFromArray( + * $spreadsheet->getActiveSheet()->getStyle('B2')->applyFromArray( * array( * 'font' => array( * 'name' => 'Arial', * 'bold' => true, * 'italic' => false, - * 'underline' => \PHPExcel\Style\Font::UNDERLINE_DOUBLE, + * 'underline' => \PhpSpreadsheet\Style\Font::UNDERLINE_DOUBLE, * 'strike' => false, * 'color' => array( * 'rgb' => '808080' @@ -186,13 +183,13 @@ class Style extends Style\Supervisor implements IComparable * ), * 'borders' => array( * 'bottom' => array( - * 'style' => \PHPExcel\Style\Border::BORDER_DASHDOT, + * 'style' => \PhpSpreadsheet\Style\Border::BORDER_DASHDOT, * 'color' => array( * 'rgb' => '808080' * ) * ), * 'top' => array( - * 'style' => \PHPExcel\Style\Border::BORDER_DASHDOT, + * 'style' => \PhpSpreadsheet\Style\Border::BORDER_DASHDOT, * 'color' => array( * 'rgb' => '808080' * ) diff --git a/src/PhpSpreadsheet/Style/Alignment.php b/src/PhpSpreadsheet/Style/Alignment.php index 2da86ab9..1bb34dd8 100644 --- a/src/PhpSpreadsheet/Style/Alignment.php +++ b/src/PhpSpreadsheet/Style/Alignment.php @@ -1,11 +1,9 @@ - * $objPHPExcel->getActiveSheet()->getStyle('B2')->getAlignment()->applyFromArray( + * $spreadsheet->getActiveSheet()->getStyle('B2')->getAlignment()->applyFromArray( * array( - * 'horizontal' => \PHPExcel\Style\Alignment::HORIZONTAL_CENTER, - * 'vertical' => \PHPExcel\Style\Alignment::VERTICAL_CENTER, + * 'horizontal' => \PhpSpreadsheet\Style\Alignment::HORIZONTAL_CENTER, + * 'vertical' => \PhpSpreadsheet\Style\Alignment::VERTICAL_CENTER, * 'rotation' => 0, * 'wrap' => TRUE * ) @@ -159,7 +156,7 @@ class Alignment extends Supervisor implements \PHPExcel\IComparable * * * @param array $pStyles Array containing style information - * @throws \PHPExcel\Exception + * @throws \PhpSpreadsheet\Exception * @return Alignment */ public function applyFromArray($pStyles = null) @@ -192,7 +189,7 @@ class Alignment extends Supervisor implements \PHPExcel\IComparable } } } else { - throw new \PHPExcel\Exception("Invalid style array passed."); + throw new \PhpSpreadsheet\Exception("Invalid style array passed."); } return $this; } @@ -282,12 +279,12 @@ class Alignment extends Supervisor implements \PHPExcel\IComparable * Set TextRotation * * @param int $pValue - * @throws \PHPExcel\Exception + * @throws \PhpSpreadsheet\Exception * @return Alignment */ public function setTextRotation($pValue = 0) { - // Excel2007 value 255 => PHPExcel value -165 + // Excel2007 value 255 => PhpSpreadsheet value -165 if ($pValue == 255) { $pValue = -165; } @@ -301,7 +298,7 @@ class Alignment extends Supervisor implements \PHPExcel\IComparable $this->textRotation = $pValue; } } else { - throw new \PHPExcel\Exception("Text rotation should be a value between -90 and 90."); + throw new \PhpSpreadsheet\Exception("Text rotation should be a value between -90 and 90."); } return $this; diff --git a/src/PhpSpreadsheet/Style/Border.php b/src/PhpSpreadsheet/Style/Border.php index a220945b..fef0adc0 100644 --- a/src/PhpSpreadsheet/Style/Border.php +++ b/src/PhpSpreadsheet/Style/Border.php @@ -1,11 +1,9 @@ parent->getSharedComponent()->getBottom(); @@ -163,9 +160,9 @@ class Border extends Supervisor implements \PHPExcel\IComparable * Apply styles from array * * - * $objPHPExcel->getActiveSheet()->getStyle('B2')->getBorders()->getTop()->applyFromArray( + * $spreadsheet->getActiveSheet()->getStyle('B2')->getBorders()->getTop()->applyFromArray( * array( - * 'style' => \PHPExcel\Style\Border::BORDER_DASHDOT, + * 'style' => \PhpSpreadsheet\Style\Border::BORDER_DASHDOT, * 'color' => array( * 'rgb' => '808080' * ) @@ -174,7 +171,7 @@ class Border extends Supervisor implements \PHPExcel\IComparable * * * @param array $pStyles Array containing style information - * @throws \PHPExcel\Exception + * @throws \PhpSpreadsheet\Exception * @return Border */ public function applyFromArray($pStyles = null) @@ -191,7 +188,7 @@ class Border extends Supervisor implements \PHPExcel\IComparable } } } else { - throw new \PHPExcel\Exception("Invalid style array passed."); + throw new \PhpSpreadsheet\Exception("Invalid style array passed."); } return $this; } @@ -248,7 +245,7 @@ class Border extends Supervisor implements \PHPExcel\IComparable * Set Border Color * * @param Color $pValue - * @throws \PHPExcel\Exception + * @throws \PhpSpreadsheet\Exception * @return Border */ public function setColor(Color $pValue = null) diff --git a/src/PhpSpreadsheet/Style/Borders.php b/src/PhpSpreadsheet/Style/Borders.php index 8b72d7f4..6e3bf37c 100644 --- a/src/PhpSpreadsheet/Style/Borders.php +++ b/src/PhpSpreadsheet/Style/Borders.php @@ -1,11 +1,9 @@ - * $objPHPExcel->getActiveSheet()->getStyle('B2')->getBorders()->applyFromArray( + * $spreadsheet->getActiveSheet()->getStyle('B2')->getBorders()->applyFromArray( * array( * 'bottom' => array( - * 'style' => \PHPExcel\Style\Border::BORDER_DASHDOT, + * 'style' => \PhpSpreadsheet\Style\Border::BORDER_DASHDOT, * 'color' => array( * 'rgb' => '808080' * ) * ), * 'top' => array( - * 'style' => \PHPExcel\Style\Border::BORDER_DASHDOT, + * 'style' => \PhpSpreadsheet\Style\Border::BORDER_DASHDOT, * 'color' => array( * 'rgb' => '808080' * ) @@ -202,10 +199,10 @@ class Borders extends Supervisor implements \PHPExcel\IComparable * ); * * - * $objPHPExcel->getActiveSheet()->getStyle('B2')->getBorders()->applyFromArray( + * $spreadsheet->getActiveSheet()->getStyle('B2')->getBorders()->applyFromArray( * array( * 'allborders' => array( - * 'style' => \PHPExcel\Style\Border::BORDER_DASHDOT, + * 'style' => \PhpSpreadsheet\Style\Border::BORDER_DASHDOT, * 'color' => array( * 'rgb' => '808080' * ) @@ -215,7 +212,7 @@ class Borders extends Supervisor implements \PHPExcel\IComparable * * * @param array $pStyles Array containing style information - * @throws \PHPExcel\Exception + * @throws \PhpSpreadsheet\Exception * @return Borders */ public function applyFromArray($pStyles = null) @@ -250,7 +247,7 @@ class Borders extends Supervisor implements \PHPExcel\IComparable } } } else { - throw new \PHPExcel\Exception("Invalid style array passed."); + throw new \PhpSpreadsheet\Exception("Invalid style array passed."); } return $this; } @@ -309,12 +306,12 @@ class Borders extends Supervisor implements \PHPExcel\IComparable * Get AllBorders (pseudo-border). Only applies to supervisor. * * @return Border - * @throws \PHPExcel\Exception + * @throws \PhpSpreadsheet\Exception */ public function getAllBorders() { if (!$this->isSupervisor) { - throw new \PHPExcel\Exception('Can only get pseudo-border for supervisor.'); + throw new \PhpSpreadsheet\Exception('Can only get pseudo-border for supervisor.'); } return $this->allBorders; } @@ -323,12 +320,12 @@ class Borders extends Supervisor implements \PHPExcel\IComparable * Get Outline (pseudo-border). Only applies to supervisor. * * @return boolean - * @throws \PHPExcel\Exception + * @throws \PhpSpreadsheet\Exception */ public function getOutline() { if (!$this->isSupervisor) { - throw new \PHPExcel\Exception('Can only get pseudo-border for supervisor.'); + throw new \PhpSpreadsheet\Exception('Can only get pseudo-border for supervisor.'); } return $this->outline; } @@ -337,12 +334,12 @@ class Borders extends Supervisor implements \PHPExcel\IComparable * Get Inside (pseudo-border). Only applies to supervisor. * * @return boolean - * @throws \PHPExcel\Exception + * @throws \PhpSpreadsheet\Exception */ public function getInside() { if (!$this->isSupervisor) { - throw new \PHPExcel\Exception('Can only get pseudo-border for supervisor.'); + throw new \PhpSpreadsheet\Exception('Can only get pseudo-border for supervisor.'); } return $this->inside; } @@ -351,12 +348,12 @@ class Borders extends Supervisor implements \PHPExcel\IComparable * Get Vertical (pseudo-border). Only applies to supervisor. * * @return Border - * @throws \PHPExcel\Exception + * @throws \PhpSpreadsheet\Exception */ public function getVertical() { if (!$this->isSupervisor) { - throw new \PHPExcel\Exception('Can only get pseudo-border for supervisor.'); + throw new \PhpSpreadsheet\Exception('Can only get pseudo-border for supervisor.'); } return $this->vertical; } @@ -365,12 +362,12 @@ class Borders extends Supervisor implements \PHPExcel\IComparable * Get Horizontal (pseudo-border). Only applies to supervisor. * * @return Border - * @throws \PHPExcel\Exception + * @throws \PhpSpreadsheet\Exception */ public function getHorizontal() { if (!$this->isSupervisor) { - throw new \PHPExcel\Exception('Can only get pseudo-border for supervisor.'); + throw new \PhpSpreadsheet\Exception('Can only get pseudo-border for supervisor.'); } return $this->horizontal; } diff --git a/src/PhpSpreadsheet/Style/Color.php b/src/PhpSpreadsheet/Style/Color.php index db5ff8cc..8329bf22 100644 --- a/src/PhpSpreadsheet/Style/Color.php +++ b/src/PhpSpreadsheet/Style/Color.php @@ -1,11 +1,9 @@ - * $objPHPExcel->getActiveSheet()->getStyle('B2')->getFont()->getColor()->applyFromArray( array('rgb' => '808080') ); + * $spreadsheet->getActiveSheet()->getStyle('B2')->getFont()->getColor()->applyFromArray( array('rgb' => '808080') ); * * * @param array $pStyles Array containing style information - * @throws \PHPExcel\Exception + * @throws \PhpSpreadsheet\Exception * @return Color */ public function applyFromArray($pStyles = null) @@ -164,7 +161,7 @@ class Color extends Supervisor implements \PHPExcel\IComparable } } } else { - throw new \PHPExcel\Exception("Invalid style array passed."); + throw new \PhpSpreadsheet\Exception("Invalid style array passed."); } return $this; } diff --git a/src/PhpSpreadsheet/Style/Conditional.php b/src/PhpSpreadsheet/Style/Conditional.php index e05a3742..a6c738e0 100644 --- a/src/PhpSpreadsheet/Style/Conditional.php +++ b/src/PhpSpreadsheet/Style/Conditional.php @@ -1,11 +1,9 @@ operatorType = self::OPERATOR_NONE; $this->text = null; $this->condition = array(); - $this->style = new \PHPExcel\Style(false, true); + $this->style = new \PhpSpreadsheet\Style(false, true); } /** @@ -234,7 +231,7 @@ class Conditional implements \PHPExcel\IComparable /** * Get Style * - * @return \PHPExcel\Style + * @return \PhpSpreadsheet\Style */ public function getStyle() { @@ -244,11 +241,11 @@ class Conditional implements \PHPExcel\IComparable /** * Set Style * - * @param \PHPExcel\Style $pValue - * @throws \PHPExcel\Exception + * @param \PhpSpreadsheet\Style $pValue + * @throws \PhpSpreadsheet\Exception * @return Conditional */ - public function setStyle(\PHPExcel\Style $pValue = null) + public function setStyle(\PhpSpreadsheet\Style $pValue = null) { $this->style = $pValue; return $this; diff --git a/src/PhpSpreadsheet/Style/Fill.php b/src/PhpSpreadsheet/Style/Fill.php index aadc146e..afa6b448 100644 --- a/src/PhpSpreadsheet/Style/Fill.php +++ b/src/PhpSpreadsheet/Style/Fill.php @@ -1,11 +1,9 @@ - * $objPHPExcel->getActiveSheet()->getStyle('B2')->getFill()->applyFromArray( + * $spreadsheet->getActiveSheet()->getStyle('B2')->getFill()->applyFromArray( * array( - * 'type' => \PHPExcel\Style\Fill::FILL_GRADIENT_LINEAR, + * 'type' => \PhpSpreadsheet\Style\Fill::FILL_GRADIENT_LINEAR, * 'rotation' => 0, * 'startcolor' => array( * 'rgb' => '000000' @@ -150,7 +147,7 @@ class Fill extends Supervisor implements \PHPExcel\IComparable * * * @param array $pStyles Array containing style information - * @throws \PHPExcel\Exception + * @throws \PhpSpreadsheet\Exception * @return Fill */ public function applyFromArray($pStyles = null) @@ -176,7 +173,7 @@ class Fill extends Supervisor implements \PHPExcel\IComparable } } } else { - throw new \PHPExcel\Exception("Invalid style array passed."); + throw new \PhpSpreadsheet\Exception("Invalid style array passed."); } return $this; } @@ -255,7 +252,7 @@ class Fill extends Supervisor implements \PHPExcel\IComparable * Set Start Color * * @param Color $pValue - * @throws \PHPExcel\Exception + * @throws \PhpSpreadsheet\Exception * @return Fill */ public function setStartColor(Color $pValue = null) @@ -286,7 +283,7 @@ class Fill extends Supervisor implements \PHPExcel\IComparable * Set End Color * * @param Color $pValue - * @throws \PHPExcel\Exception + * @throws \PhpSpreadsheet\Exception * @return Fill */ public function setEndColor(Color $pValue = null) diff --git a/src/PhpSpreadsheet/Style/Font.php b/src/PhpSpreadsheet/Style/Font.php index 5653a57e..97075fe4 100644 --- a/src/PhpSpreadsheet/Style/Font.php +++ b/src/PhpSpreadsheet/Style/Font.php @@ -1,11 +1,9 @@ - * $objPHPExcel->getActiveSheet()->getStyle('B2')->getFont()->applyFromArray( + * $spreadsheet->getActiveSheet()->getStyle('B2')->getFont()->applyFromArray( * array( * 'name' => 'Arial', * 'bold' => TRUE, * 'italic' => FALSE, - * 'underline' => \PHPExcel\Style\Font::UNDERLINE_DOUBLE, + * 'underline' => \PhpSpreadsheet\Style\Font::UNDERLINE_DOUBLE, * 'strike' => FALSE, * 'color' => array( * 'rgb' => '808080' @@ -175,7 +172,7 @@ class Font extends Supervisor implements \PHPExcel\IComparable * * * @param array $pStyles Array containing style information - * @throws \PHPExcel\Exception + * @throws \PhpSpreadsheet\Exception * @return Font */ public function applyFromArray($pStyles = null) @@ -213,7 +210,7 @@ class Font extends Supervisor implements \PHPExcel\IComparable } } } else { - throw new \PHPExcel\Exception("Invalid style array passed."); + throw new \PhpSpreadsheet\Exception("Invalid style array passed."); } return $this; } @@ -434,7 +431,7 @@ class Font extends Supervisor implements \PHPExcel\IComparable /** * Set Underline * - * @param string|boolean $pValue \PHPExcel\Style\Font underline type + * @param string|boolean $pValue \PhpSpreadsheet\Style\Font underline type * If a boolean is passed, then TRUE equates to UNDERLINE_SINGLE, * false equates to UNDERLINE_NONE * @return Font @@ -502,7 +499,7 @@ class Font extends Supervisor implements \PHPExcel\IComparable * Set Color * * @param Color $pValue - * @throws \PHPExcel\Exception + * @throws \PhpSpreadsheet\Exception * @return Font */ public function setColor(Color $pValue = null) diff --git a/src/PhpSpreadsheet/Style/NumberFormat.php b/src/PhpSpreadsheet/Style/NumberFormat.php index 44a98e15..098be074 100644 --- a/src/PhpSpreadsheet/Style/NumberFormat.php +++ b/src/PhpSpreadsheet/Style/NumberFormat.php @@ -1,11 +1,11 @@ - * $objPHPExcel->getActiveSheet()->getStyle('B2')->getNumberFormat()->applyFromArray( + * $spreadsheet->getActiveSheet()->getStyle('B2')->getNumberFormat()->applyFromArray( * array( - * 'code' => \PHPExcel\Style\NumberFormat::FORMAT_CURRENCY_EUR_SIMPLE + * 'code' => \PhpSpreadsheet\Style\NumberFormat::FORMAT_CURRENCY_EUR_SIMPLE * ) * ); * * * @param array $pStyles Array containing style information - * @throws \PHPExcel\Exception + * @throws \PhpSpreadsheet\Exception * @return NumberFormat */ public function applyFromArray($pStyles = null) @@ -166,7 +165,7 @@ class NumberFormat extends Supervisor implements \PHPExcel\IComparable } } } else { - throw new \PHPExcel\Exception("Invalid style array passed."); + throw new \PhpSpreadsheet\Exception("Invalid style array passed."); } return $this; } @@ -487,7 +486,7 @@ class NumberFormat extends Supervisor implements \PHPExcel\IComparable // escape any quoted characters so that DateTime format() will render them correctly $format = preg_replace_callback('/"(.*)"/U', ['self', 'escapeQuotesCallback'], $format); - $dateObj = \PHPExcel\Shared\Date::excelToDateTimeObject($value); + $dateObj = \PhpSpreadsheet\Shared\Date::excelToDateTimeObject($value); $value = $dateObj->format($format); } @@ -518,7 +517,7 @@ class NumberFormat extends Supervisor implements \PHPExcel\IComparable $decimalLength = strlen($decimalPart); $decimalDivisor = pow(10, $decimalLength); - $GCD = \PHPExcel\Calculation\MathTrig::GCD($decimalPart, $decimalDivisor); + $GCD = \PhpSpreadsheet\Calculation\MathTrig::GCD($decimalPart, $decimalDivisor); $adjustedDecimalPart = $decimalPart/$GCD; $adjustedDecimalDivisor = $decimalDivisor/$GCD; @@ -710,8 +709,8 @@ class NumberFormat extends Supervisor implements \PHPExcel\IComparable $value = number_format( $value, strlen($right), - \PHPExcel\Shared\StringHelper::getDecimalSeparator(), - \PHPExcel\Shared\StringHelper::getThousandsSeparator() + \PhpSpreadsheet\Shared\StringHelper::getDecimalSeparator(), + \PhpSpreadsheet\Shared\StringHelper::getThousandsSeparator() ); $value = preg_replace($number_regex, $value, $format); } else { @@ -734,7 +733,7 @@ class NumberFormat extends Supervisor implements \PHPExcel\IComparable $currencyCode = $m[1]; list($currencyCode) = explode('-', $currencyCode); if ($currencyCode == '') { - $currencyCode = \PHPExcel\Shared\StringHelper::getCurrencyCode(); + $currencyCode = \PhpSpreadsheet\Shared\StringHelper::getCurrencyCode(); } $value = preg_replace('/\[\$([^\]]*)\]/u', $currencyCode, $value); } diff --git a/src/PhpSpreadsheet/Style/Protection.php b/src/PhpSpreadsheet/Style/Protection.php index 4b218a10..f30ad6d7 100644 --- a/src/PhpSpreadsheet/Style/Protection.php +++ b/src/PhpSpreadsheet/Style/Protection.php @@ -1,11 +1,9 @@ - * $objPHPExcel->getActiveSheet()->getStyle('B2')->getLocked()->applyFromArray( + * $spreadsheet->getActiveSheet()->getStyle('B2')->getLocked()->applyFromArray( * array( * 'locked' => TRUE, * 'hidden' => FALSE @@ -105,7 +102,7 @@ class Protection extends Supervisor implements \PHPExcel\IComparable * * * @param array $pStyles Array containing style information - * @throws \PHPExcel\Exception + * @throws \PhpSpreadsheet\Exception * @return Protection */ public function applyFromArray($pStyles = null) @@ -122,7 +119,7 @@ class Protection extends Supervisor implements \PHPExcel\IComparable } } } else { - throw new \PHPExcel\Exception("Invalid style array passed."); + throw new \PhpSpreadsheet\Exception("Invalid style array passed."); } return $this; } diff --git a/src/PhpSpreadsheet/Style/Supervisor.php b/src/PhpSpreadsheet/Style/Supervisor.php index 6f83c306..15a4e5b4 100644 --- a/src/PhpSpreadsheet/Style/Supervisor.php +++ b/src/PhpSpreadsheet/Style/Supervisor.php @@ -1,11 +1,9 @@ range = $pRange; $this->workSheet = $pSheet; @@ -68,7 +67,7 @@ class AutoFilter /** * Get AutoFilter Parent Worksheet * - * @return \PHPExcel\Worksheet + * @return \PhpSpreadsheet\Worksheet */ public function getParent() { @@ -78,10 +77,10 @@ class AutoFilter /** * Set AutoFilter Parent Worksheet * - * @param \PHPExcel\Worksheet $pSheet + * @param \PhpSpreadsheet\Worksheet $pSheet * @return AutoFilter */ - public function setParent(\PHPExcel\Worksheet $pSheet = null) + public function setParent(\PhpSpreadsheet\Worksheet $pSheet = null) { $this->workSheet = $pSheet; @@ -102,7 +101,7 @@ class AutoFilter * Set AutoFilter Range * * @param string $pRange Cell range (i.e. A1:E10) - * @throws \PHPExcel\Exception + * @throws \PhpSpreadsheet\Exception * @return AutoFilter */ public function setRange($pRange = '') @@ -118,7 +117,7 @@ class AutoFilter } elseif (empty($pRange)) { $this->range = ''; } else { - throw new \PHPExcel\Exception('Autofilter must be set on a range of cells.'); + throw new \PhpSpreadsheet\Exception('Autofilter must be set on a range of cells.'); } if (empty($pRange)) { @@ -126,9 +125,9 @@ class AutoFilter $this->columns = array(); } else { // Discard any column rules that are no longer valid within this range - list($rangeStart, $rangeEnd) = \PHPExcel\Cell::rangeBoundaries($this->range); + list($rangeStart, $rangeEnd) = \PhpSpreadsheet\Cell::rangeBoundaries($this->range); foreach ($this->columns as $key => $value) { - $colIndex = \PHPExcel\Cell::columnIndexFromString($key); + $colIndex = \PhpSpreadsheet\Cell::columnIndexFromString($key); if (($rangeStart[0] > $colIndex) || ($rangeEnd[0] < $colIndex)) { unset($this->columns[$key]); } @@ -141,7 +140,7 @@ class AutoFilter /** * Get all AutoFilter Columns * - * @throws \PHPExcel\Exception + * @throws \PhpSpreadsheet\Exception * @return AutoFilter\Column[] */ public function getColumns() @@ -153,19 +152,19 @@ class AutoFilter * Validate that the specified column is in the AutoFilter range * * @param string $column Column name (e.g. A) - * @throws \PHPExcel\Exception + * @throws \PhpSpreadsheet\Exception * @return integer The column offset within the autofilter range */ public function testColumnInRange($column) { if (empty($this->range)) { - throw new \PHPExcel\Exception("No autofilter range is defined."); + throw new \PhpSpreadsheet\Exception("No autofilter range is defined."); } - $columnIndex = \PHPExcel\Cell::columnIndexFromString($column); - list($rangeStart, $rangeEnd) = \PHPExcel\Cell::rangeBoundaries($this->range); + $columnIndex = \PhpSpreadsheet\Cell::columnIndexFromString($column); + list($rangeStart, $rangeEnd) = \PhpSpreadsheet\Cell::rangeBoundaries($this->range); if (($rangeStart[0] > $columnIndex) || ($rangeEnd[0] < $columnIndex)) { - throw new \PHPExcel\Exception("Column is outside of current autofilter range."); + throw new \PhpSpreadsheet\Exception("Column is outside of current autofilter range."); } return $columnIndex - $rangeStart[0]; @@ -175,7 +174,7 @@ class AutoFilter * Get a specified AutoFilter Column Offset within the defined AutoFilter range * * @param string $pColumn Column name (e.g. A) - * @throws \PHPExcel\Exception + * @throws \PhpSpreadsheet\Exception * @return integer The offset of the specified column within the autofilter range */ public function getColumnOffset($pColumn) @@ -187,7 +186,7 @@ class AutoFilter * Get a specified AutoFilter Column * * @param string $pColumn Column name (e.g. A) - * @throws \PHPExcel\Exception + * @throws \PhpSpreadsheet\Exception * @return AutoFilter\Column */ public function getColumn($pColumn) @@ -205,13 +204,13 @@ class AutoFilter * Get a specified AutoFilter Column by it's offset * * @param integer $pColumnOffset Column offset within range (starting from 0) - * @throws \PHPExcel\Exception + * @throws \PhpSpreadsheet\Exception * @return AutoFilter\Column */ public function getColumnByOffset($pColumnOffset = 0) { - list($rangeStart, $rangeEnd) = \PHPExcel\Cell::rangeBoundaries($this->range); - $pColumn = \PHPExcel\Cell::stringFromColumnIndex($rangeStart[0] + $pColumnOffset - 1); + list($rangeStart, $rangeEnd) = \PhpSpreadsheet\Cell::rangeBoundaries($this->range); + $pColumn = \PhpSpreadsheet\Cell::stringFromColumnIndex($rangeStart[0] + $pColumnOffset - 1); return $this->getColumn($pColumn); } @@ -221,7 +220,7 @@ class AutoFilter * * @param AutoFilter\Column|string $pColumn * A simple string containing a Column ID like 'A' is permitted - * @throws \PHPExcel\Exception + * @throws \PhpSpreadsheet\Exception * @return AutoFilter */ public function setColumn($pColumn) @@ -231,7 +230,7 @@ class AutoFilter } elseif (is_object($pColumn) && ($pColumn instanceof AutoFilter\Column)) { $column = $pColumn->getColumnIndex(); } else { - throw new \PHPExcel\Exception("Column is not within the autofilter range."); + throw new \PhpSpreadsheet\Exception("Column is not within the autofilter range."); } $this->testColumnInRange($column); @@ -250,7 +249,7 @@ class AutoFilter * Clear a specified AutoFilter Column * * @param string $pColumn Column name (e.g. A) - * @throws \PHPExcel\Exception + * @throws \PhpSpreadsheet\Exception * @return AutoFilter */ public function clearColumn($pColumn) @@ -327,7 +326,7 @@ class AutoFilter } if (is_numeric($cellValue)) { - $dateValue = \PHPExcel\Shared\Date::excelToTimestamp($cellValue); + $dateValue = \PhpSpreadsheet\Shared\Date::excelToTimestamp($cellValue); if ($cellValue < 1) { // Just the time part $dtVal = date('His', $dateValue); @@ -444,7 +443,7 @@ class AutoFilter } if (is_numeric($cellValue)) { - $dateValue = date('m', \PHPExcel\Shared\Date::excelToTimestamp($cellValue)); + $dateValue = date('m', \PhpSpreadsheet\Shared\Date::excelToTimestamp($cellValue)); if (in_array($dateValue, $monthSet)) { return true; } @@ -471,12 +470,12 @@ class AutoFilter */ private function dynamicFilterDateRange($dynamicRuleType, &$filterColumn) { - $rDateType = \PHPExcel\Calculation\Functions::getReturnDateType(); - \PHPExcel\Calculation\Functions::setReturnDateType(\PHPExcel\Calculation\Functions::RETURNDATE_PHP_NUMERIC); + $rDateType = \PhpSpreadsheet\Calculation\Functions::getReturnDateType(); + \PhpSpreadsheet\Calculation\Functions::setReturnDateType(\PhpSpreadsheet\Calculation\Functions::RETURNDATE_PHP_NUMERIC); $val = $maxVal = null; $ruleValues = array(); - $baseDate = \PHPExcel\Calculation\DateTime::DATENOW(); + $baseDate = \PhpSpreadsheet\Calculation\DateTime::DATENOW(); // Calculate start/end dates for the required date range based on current date switch ($dynamicRuleType) { case AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_LASTWEEK: @@ -509,41 +508,41 @@ class AutoFilter case AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_TODAY: case AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_YESTERDAY: case AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_TOMORROW: - $maxVal = (int) \PHPExcel\Shared\Date::PHPtoExcel(strtotime('+1 day', $baseDate)); - $val = (int) \PHPExcel\Shared\Date::PHPToExcel($baseDate); + $maxVal = (int) \PhpSpreadsheet\Shared\Date::PHPtoExcel(strtotime('+1 day', $baseDate)); + $val = (int) \PhpSpreadsheet\Shared\Date::PHPToExcel($baseDate); break; case AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_YEARTODATE: - $maxVal = (int) \PHPExcel\Shared\Date::PHPtoExcel(strtotime('+1 day', $baseDate)); - $val = (int) \PHPExcel\Shared\Date::PHPToExcel(gmmktime(0, 0, 0, 1, 1, date('Y', $baseDate))); + $maxVal = (int) \PhpSpreadsheet\Shared\Date::PHPtoExcel(strtotime('+1 day', $baseDate)); + $val = (int) \PhpSpreadsheet\Shared\Date::PHPToExcel(gmmktime(0, 0, 0, 1, 1, date('Y', $baseDate))); break; case AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_THISYEAR: case AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_LASTYEAR: case AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_NEXTYEAR: - $maxVal = (int) \PHPExcel\Shared\Date::PHPToExcel(gmmktime(0, 0, 0, 31, 12, date('Y', $baseDate))); + $maxVal = (int) \PhpSpreadsheet\Shared\Date::PHPToExcel(gmmktime(0, 0, 0, 31, 12, date('Y', $baseDate))); ++$maxVal; - $val = (int) \PHPExcel\Shared\Date::PHPToExcel(gmmktime(0, 0, 0, 1, 1, date('Y', $baseDate))); + $val = (int) \PhpSpreadsheet\Shared\Date::PHPToExcel(gmmktime(0, 0, 0, 1, 1, date('Y', $baseDate))); break; case AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_THISQUARTER: case AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_LASTQUARTER: case AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_NEXTQUARTER: $thisMonth = date('m', $baseDate); $thisQuarter = floor(--$thisMonth / 3); - $maxVal = (int) \PHPExcel\Shared\Date::PHPtoExcel(gmmktime(0, 0, 0, date('t', $baseDate), (1+$thisQuarter)*3, date('Y', $baseDate))); + $maxVal = (int) \PhpSpreadsheet\Shared\Date::PHPtoExcel(gmmktime(0, 0, 0, date('t', $baseDate), (1+$thisQuarter)*3, date('Y', $baseDate))); ++$maxVal; - $val = (int) \PHPExcel\Shared\Date::PHPToExcel(gmmktime(0, 0, 0, 1, 1+$thisQuarter*3, date('Y', $baseDate))); + $val = (int) \PhpSpreadsheet\Shared\Date::PHPToExcel(gmmktime(0, 0, 0, 1, 1+$thisQuarter*3, date('Y', $baseDate))); break; case AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_THISMONTH: case AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_LASTMONTH: case AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_NEXTMONTH: - $maxVal = (int) \PHPExcel\Shared\Date::PHPtoExcel(gmmktime(0, 0, 0, date('t', $baseDate), date('m', $baseDate), date('Y', $baseDate))); + $maxVal = (int) \PhpSpreadsheet\Shared\Date::PHPtoExcel(gmmktime(0, 0, 0, date('t', $baseDate), date('m', $baseDate), date('Y', $baseDate))); ++$maxVal; - $val = (int) \PHPExcel\Shared\Date::PHPToExcel(gmmktime(0, 0, 0, 1, date('m', $baseDate), date('Y', $baseDate))); + $val = (int) \PhpSpreadsheet\Shared\Date::PHPToExcel(gmmktime(0, 0, 0, 1, date('m', $baseDate), date('Y', $baseDate))); break; case AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_THISWEEK: case AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_LASTWEEK: case AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_NEXTWEEK: $dayOfWeek = date('w', $baseDate); - $val = (int) \PHPExcel\Shared\Date::PHPToExcel($baseDate) - $dayOfWeek; + $val = (int) \PhpSpreadsheet\Shared\Date::PHPToExcel($baseDate) - $dayOfWeek; $maxVal = $val + 7; break; } @@ -566,7 +565,7 @@ class AutoFilter // Set the rules for identifying rows for hide/show $ruleValues[] = array('operator' => AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_GREATERTHANOREQUAL, 'value' => $val); $ruleValues[] = array('operator' => AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_LESSTHAN, 'value' => $maxVal); - \PHPExcel\Calculation\Functions::setReturnDateType($rDateType); + \PhpSpreadsheet\Calculation\Functions::setReturnDateType($rDateType); return array('method' => 'filterTestInCustomDataSet', 'arguments' => array('filterRules' => $ruleValues, 'join' => AutoFilter\Column::AUTOFILTER_COLUMN_JOIN_AND)); } @@ -574,7 +573,7 @@ class AutoFilter private function calculateTopTenValue($columnID, $startRow, $endRow, $ruleType, $ruleValue) { $range = $columnID.$startRow.':'.$columnID.$endRow; - $dataValues = \PHPExcel\Calculation\Functions::flattenArray($this->workSheet->rangeToArray($range, null, true, false)); + $dataValues = \PhpSpreadsheet\Calculation\Functions::flattenArray($this->workSheet->rangeToArray($range, null, true, false)); $dataValues = array_filter($dataValues); if ($ruleType == AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_TOP) { @@ -589,12 +588,12 @@ class AutoFilter /** * Apply the AutoFilter rules to the AutoFilter Range * - * @throws \PHPExcel\Exception + * @throws \PhpSpreadsheet\Exception * @return AutoFilter */ public function showHideRows() { - list($rangeStart, $rangeEnd) = \PHPExcel\Cell::rangeBoundaries($this->range); + list($rangeStart, $rangeEnd) = \PhpSpreadsheet\Cell::rangeBoundaries($this->range); // The heading row should always be visible // echo 'AutoFilter Heading Row ', $rangeStart[1],' is always SHOWN',PHP_EOL; @@ -705,7 +704,7 @@ class AutoFilter // Number (Average) based // Calculate the average $averageFormula = '=AVERAGE('.$columnID.($rangeStart[1]+1).':'.$columnID.$rangeEnd[1].')'; - $average = \PHPExcel\Calculation::getInstance()->calculateFormula($averageFormula, null, $this->workSheet->getCell('A1')); + $average = \PhpSpreadsheet\Calculation::getInstance()->calculateFormula($averageFormula, null, $this->workSheet->getCell('A1')); // Set above/below rule based on greaterThan or LessTan $operator = ($dynamicRuleType === AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_ABOVEAVERAGE) ? AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_GREATERTHAN @@ -791,7 +790,7 @@ class AutoFilter // Execute the filter test $result = $result && call_user_func_array( - array('\\PHPExcel\\Worksheet\\AutoFilter', $columnFilterTest['method']), + array('\\PhpSpreadsheet\\Worksheet\\AutoFilter', $columnFilterTest['method']), array($cellValue, $columnFilterTest['arguments']) ); // echo (($result) ? 'VALID' : 'INVALID'),PHP_EOL; @@ -824,7 +823,7 @@ class AutoFilter $this->{$key} = clone $value; } } elseif ((is_array($value)) && ($key == 'columns')) { - // The columns array of \PHPExcel\Worksheet\AutoFilter objects + // The columns array of \PhpSpreadsheet\Worksheet\AutoFilter objects $this->{$key} = array(); foreach ($value as $k => $v) { $this->{$key}[$k] = clone $v; diff --git a/src/PhpSpreadsheet/Worksheet/AutoFilter/Column.php b/src/PhpSpreadsheet/Worksheet/AutoFilter/Column.php index 9c59496c..33589163 100644 --- a/src/PhpSpreadsheet/Worksheet/AutoFilter/Column.php +++ b/src/PhpSpreadsheet/Worksheet/AutoFilter/Column.php @@ -1,11 +1,11 @@ columnIndex = $pColumn; $this->parent = $pParent; @@ -142,7 +141,7 @@ class Column * Set AutoFilter Column Index * * @param string $pColumn Column (e.g. A) - * @throws \PHPExcel\Exception + * @throws \PhpSpreadsheet\Exception * @return Column */ public function setColumnIndex($pColumn) @@ -161,7 +160,7 @@ class Column /** * Get this Column's AutoFilter Parent * - * @return \PHPExcel\Worksheet\AutoFilter + * @return \PhpSpreadsheet\Worksheet\AutoFilter */ public function getParent() { @@ -171,10 +170,10 @@ class Column /** * Set this Column's AutoFilter Parent * - * @param \PHPExcel\Worksheet\AutoFilter + * @param \PhpSpreadsheet\Worksheet\AutoFilter * @return Column */ - public function setParent(\PHPExcel\Worksheet\AutoFilter $pParent = null) + public function setParent(\PhpSpreadsheet\Worksheet\AutoFilter $pParent = null) { $this->parent = $pParent; @@ -195,13 +194,13 @@ class Column * Set AutoFilter Type * * @param string $pFilterType - * @throws \PHPExcel\Exception + * @throws \PhpSpreadsheet\Exception * @return Column */ public function setFilterType($pFilterType = self::AUTOFILTER_FILTERTYPE_FILTER) { if (!in_array($pFilterType, self::$filterTypes)) { - throw new \PHPExcel\Exception('Invalid filter type for column AutoFilter.'); + throw new \PhpSpreadsheet\Exception('Invalid filter type for column AutoFilter.'); } $this->filterType = $pFilterType; @@ -223,7 +222,7 @@ class Column * Set AutoFilter Multiple Rules And/Or * * @param string $pJoin And/Or - * @throws \PHPExcel\Exception + * @throws \PhpSpreadsheet\Exception * @return Column */ public function setJoin($pJoin = self::AUTOFILTER_COLUMN_JOIN_OR) @@ -231,7 +230,7 @@ class Column // Lowercase And/Or $pJoin = strtolower($pJoin); if (!in_array($pJoin, self::$ruleJoins)) { - throw new \PHPExcel\Exception('Invalid rule connection for column AutoFilter.'); + throw new \PhpSpreadsheet\Exception('Invalid rule connection for column AutoFilter.'); } $this->join = $pJoin; @@ -243,7 +242,7 @@ class Column * Set AutoFilter Attributes * * @param string[] $pAttributes - * @throws \PHPExcel\Exception + * @throws \PhpSpreadsheet\Exception * @return Column */ public function setAttributes($pAttributes = array()) @@ -258,7 +257,7 @@ class Column * * @param string $pName Attribute Name * @param string $pValue Attribute Value - * @throws \PHPExcel\Exception + * @throws \PhpSpreadsheet\Exception * @return Column */ public function setAttribute($pName, $pValue) @@ -295,7 +294,7 @@ class Column /** * Get all AutoFilter Column Rules * - * @throws \PHPExcel\Exception + * @throws \PhpSpreadsheet\Exception * @return Column\Rule[] */ public function getRules() @@ -392,7 +391,7 @@ class Column $this->$key = clone $value; } } elseif ((is_array($value)) && ($key == 'ruleset')) { - // The columns array of \PHPExcel\Worksheet\AutoFilter objects + // The columns array of \PhpSpreadsheet\Worksheet\AutoFilter objects $this->$key = array(); foreach ($value as $k => $v) { $this->$key[$k] = clone $v; diff --git a/src/PhpSpreadsheet/Worksheet/AutoFilter/Column/Rule.php b/src/PhpSpreadsheet/Worksheet/AutoFilter/Column/Rule.php index 6200a0f2..faba6316 100644 --- a/src/PhpSpreadsheet/Worksheet/AutoFilter/Column/Rule.php +++ b/src/PhpSpreadsheet/Worksheet/AutoFilter/Column/Rule.php @@ -1,11 +1,11 @@ parent = $pParent; } @@ -285,13 +284,13 @@ class Rule * Set AutoFilter Rule Type * * @param string $pRuleType - * @throws \PHPExcel\Exception - * @return \PHPExcel\Worksheet\AutoFilter\Column + * @throws \PhpSpreadsheet\Exception + * @return \PhpSpreadsheet\Worksheet\AutoFilter\Column */ public function setRuleType($pRuleType = self::AUTOFILTER_RULETYPE_FILTER) { if (!in_array($pRuleType, self::$ruleTypes)) { - throw new \PHPExcel\Exception('Invalid rule type for column AutoFilter Rule.'); + throw new \PhpSpreadsheet\Exception('Invalid rule type for column AutoFilter Rule.'); } $this->ruleType = $pRuleType; @@ -313,7 +312,7 @@ class Rule * Set AutoFilter Rule Value * * @param string|string[] $pValue - * @throws \PHPExcel\Exception + * @throws \PhpSpreadsheet\Exception * @return Rule */ public function setValue($pValue = '') @@ -331,7 +330,7 @@ class Rule } } if (count($pValue) == 0) { - throw new \PHPExcel\Exception('Invalid rule value for column AutoFilter Rule.'); + throw new \PhpSpreadsheet\Exception('Invalid rule value for column AutoFilter Rule.'); } // Set the dateTime grouping that we've anticipated $this->setGrouping(self::$dateTimeGroups[$grouping]); @@ -355,7 +354,7 @@ class Rule * Set AutoFilter Rule Operator * * @param string $pOperator - * @throws \PHPExcel\Exception + * @throws \PhpSpreadsheet\Exception * @return Rule */ public function setOperator($pOperator = self::AUTOFILTER_COLUMN_RULE_EQUAL) @@ -365,7 +364,7 @@ class Rule } if ((!in_array($pOperator, self::$operators)) && (!in_array($pOperator, self::$topTenValue))) { - throw new \PHPExcel\Exception('Invalid operator for column AutoFilter Rule.'); + throw new \PhpSpreadsheet\Exception('Invalid operator for column AutoFilter Rule.'); } $this->operator = $pOperator; @@ -386,7 +385,7 @@ class Rule * Set AutoFilter Rule Grouping * * @param string $pGrouping - * @throws \PHPExcel\Exception + * @throws \PhpSpreadsheet\Exception * @return Rule */ public function setGrouping($pGrouping = null) @@ -395,7 +394,7 @@ class Rule (!in_array($pGrouping, self::$dateTimeGroups)) && (!in_array($pGrouping, self::$dynamicTypes)) && (!in_array($pGrouping, self::$topTenType))) { - throw new \PHPExcel\Exception('Invalid rule type for column AutoFilter Rule.'); + throw new \PhpSpreadsheet\Exception('Invalid rule type for column AutoFilter Rule.'); } $this->grouping = $pGrouping; @@ -408,7 +407,7 @@ class Rule * @param string $pOperator * @param string|string[] $pValue * @param string $pGrouping - * @throws \PHPExcel\Exception + * @throws \PhpSpreadsheet\Exception * @return Rule */ public function setRule($pOperator = self::AUTOFILTER_COLUMN_RULE_EQUAL, $pValue = '', $pGrouping = null) @@ -428,7 +427,7 @@ class Rule /** * Get this Rule's AutoFilter Column Parent * - * @return \PHPExcel\Worksheet\AutoFilter\Column + * @return \PhpSpreadsheet\Worksheet\AutoFilter\Column */ public function getParent() { @@ -438,10 +437,10 @@ class Rule /** * Set this Rule's AutoFilter Column Parent * - * @param \PHPExcel\Worksheet\AutoFilter\Column + * @param \PhpSpreadsheet\Worksheet\AutoFilter\Column * @return Rule */ - public function setParent(\PHPExcel\Worksheet\AutoFilter\Column $pParent = null) + public function setParent(\PhpSpreadsheet\Worksheet\AutoFilter\Column $pParent = null) { $this->parent = $pParent; diff --git a/src/PhpSpreadsheet/Worksheet/BaseDrawing.php b/src/PhpSpreadsheet/Worksheet/BaseDrawing.php index d8bcbe7c..99130af5 100644 --- a/src/PhpSpreadsheet/Worksheet/BaseDrawing.php +++ b/src/PhpSpreadsheet/Worksheet/BaseDrawing.php @@ -1,11 +1,11 @@ worksheet)) { - // Add drawing to \PHPExcel\Worksheet + // Add drawing to \PhpSpreadsheet\Worksheet $this->worksheet = $pValue; $this->worksheet->getCell($this->coordinates); $this->worksheet->getDrawingCollection()->append($this); } else { if ($pOverrideOld) { - // Remove drawing from old \PHPExcel\Worksheet + // Remove drawing from old \PhpSpreadsheet\Worksheet $iterator = $this->worksheet->getDrawingCollection()->getIterator(); while ($iterator->valid()) { @@ -235,10 +234,10 @@ class BaseDrawing implements \PHPExcel\IComparable } } - // Set new \PHPExcel\Worksheet + // Set new \PhpSpreadsheet\Worksheet $this->setWorksheet($pValue); } else { - throw new \PHPExcel\Exception("A \PHPExcel\Worksheet has already been assigned. Drawings can only exist on one \PHPExcel\Worksheet."); + throw new \PhpSpreadsheet\Exception("A \PhpSpreadsheet\Worksheet has already been assigned. Drawings can only exist on one \PhpSpreadsheet\Worksheet."); } } return $this; @@ -461,7 +460,7 @@ class BaseDrawing implements \PHPExcel\IComparable * Set Shadow * * @param Drawing\Shadow $pValue - * @throws \PHPExcel\Exception + * @throws \PhpSpreadsheet\Exception * @return BaseDrawing */ public function setShadow(Drawing\Shadow $pValue = null) diff --git a/src/PhpSpreadsheet/Worksheet/CellIterator.php b/src/PhpSpreadsheet/Worksheet/CellIterator.php index 7dff127d..75494fe4 100644 --- a/src/PhpSpreadsheet/Worksheet/CellIterator.php +++ b/src/PhpSpreadsheet/Worksheet/CellIterator.php @@ -1,11 +1,11 @@ parent = $parent; diff --git a/src/PhpSpreadsheet/Worksheet/ColumnCellIterator.php b/src/PhpSpreadsheet/Worksheet/ColumnCellIterator.php index f228918a..ce21fa51 100644 --- a/src/PhpSpreadsheet/Worksheet/ColumnCellIterator.php +++ b/src/PhpSpreadsheet/Worksheet/ColumnCellIterator.php @@ -1,11 +1,11 @@ subject = $subject; - $this->columnIndex = \PHPExcel\Cell::columnIndexFromString($columnIndex) - 1; + $this->columnIndex = \PhpSpreadsheet\Cell::columnIndexFromString($columnIndex) - 1; $this->resetEnd($endRow); $this->resetStart($startRow); } @@ -80,7 +79,7 @@ class ColumnCellIterator extends CellIterator implements \Iterator * * @param integer $startRow The row number at which to start iterating * @return ColumnCellIterator - * @throws \PHPExcel\Exception + * @throws \PhpSpreadsheet\Exception */ public function resetStart($startRow = 1) { @@ -96,7 +95,7 @@ class ColumnCellIterator extends CellIterator implements \Iterator * * @param integer $endRow The row number at which to stop iterating * @return ColumnCellIterator - * @throws \PHPExcel\Exception + * @throws \PhpSpreadsheet\Exception */ public function resetEnd($endRow = null) { @@ -111,14 +110,14 @@ class ColumnCellIterator extends CellIterator implements \Iterator * * @param integer $row The row number to set the current pointer at * @return ColumnCellIterator - * @throws \PHPExcel\Exception + * @throws \PhpSpreadsheet\Exception */ public function seek($row = 1) { if (($row < $this->startRow) || ($row > $this->endRow)) { - throw new \PHPExcel\Exception("Row $row is out of range ({$this->startRow} - {$this->endRow})"); + throw new \PhpSpreadsheet\Exception("Row $row is out of range ({$this->startRow} - {$this->endRow})"); } elseif ($this->onlyExistingCells && !($this->subject->cellExistsByColumnAndRow($this->columnIndex, $row))) { - throw new \PHPExcel\Exception('In "IterateOnlyExistingCells" mode and Cell does not exist'); + throw new \PhpSpreadsheet\Exception('In "IterateOnlyExistingCells" mode and Cell does not exist'); } $this->position = $row; @@ -171,7 +170,7 @@ class ColumnCellIterator extends CellIterator implements \Iterator public function prev() { if ($this->position <= $this->startRow) { - throw new \PHPExcel\Exception("Row is already at the beginning of range ({$this->startRow} - {$this->endRow})"); + throw new \PhpSpreadsheet\Exception("Row is already at the beginning of range ({$this->startRow} - {$this->endRow})"); } do { @@ -194,7 +193,7 @@ class ColumnCellIterator extends CellIterator implements \Iterator /** * Validate start/end values for "IterateOnlyExistingCells" mode, and adjust if necessary * - * @throws \PHPExcel\Exception + * @throws \PhpSpreadsheet\Exception */ protected function adjustForExistingOnlyRange() { @@ -204,14 +203,14 @@ class ColumnCellIterator extends CellIterator implements \Iterator ++$this->startRow; } if ($this->startRow > $this->endRow) { - throw new \PHPExcel\Exception('No cells exist within the specified range'); + throw new \PhpSpreadsheet\Exception('No cells exist within the specified range'); } while ((!$this->subject->cellExistsByColumnAndRow($this->columnIndex, $this->endRow)) && ($this->endRow >= $this->startRow)) { --$this->endRow; } if ($this->endRow < $this->startRow) { - throw new \PHPExcel\Exception('No cells exist within the specified range'); + throw new \PhpSpreadsheet\Exception('No cells exist within the specified range'); } } } diff --git a/src/PhpSpreadsheet/Worksheet/ColumnDimension.php b/src/PhpSpreadsheet/Worksheet/ColumnDimension.php index 105b8dc5..7254ebdd 100644 --- a/src/PhpSpreadsheet/Worksheet/ColumnDimension.php +++ b/src/PhpSpreadsheet/Worksheet/ColumnDimension.php @@ -1,11 +1,11 @@ subject = $subject; @@ -94,7 +93,7 @@ class ColumnIterator implements \Iterator */ public function resetStart($startColumn = 'A') { - $startColumnIndex = \PHPExcel\Cell::columnIndexFromString($startColumn) - 1; + $startColumnIndex = \PhpSpreadsheet\Cell::columnIndexFromString($startColumn) - 1; if ($startColumnIndex > Cell::columnIndexFromString($this->subject->getHighestColumn()) - 1) { throw new Exception("Start column ({$startColumn}) is beyond highest column ({$this->subject->getHighestColumn()})"); } @@ -117,7 +116,7 @@ class ColumnIterator implements \Iterator public function resetEnd($endColumn = null) { $endColumn = ($endColumn) ? $endColumn : $this->subject->getHighestColumn(); - $this->endColumn = \PHPExcel\Cell::columnIndexFromString($endColumn) - 1; + $this->endColumn = \PhpSpreadsheet\Cell::columnIndexFromString($endColumn) - 1; return $this; } @@ -127,13 +126,13 @@ class ColumnIterator implements \Iterator * * @param string $column The column address to set the current pointer at * @return ColumnIterator - * @throws \PHPExcel\Exception + * @throws \PhpSpreadsheet\Exception */ public function seek($column = 'A') { - $column = \PHPExcel\Cell::columnIndexFromString($column) - 1; + $column = \PhpSpreadsheet\Cell::columnIndexFromString($column) - 1; if (($column < $this->startColumn) || ($column > $this->endColumn)) { - throw new \PHPExcel\Exception("Column $column is out of range ({$this->startColumn} - {$this->endColumn})"); + throw new \PhpSpreadsheet\Exception("Column $column is out of range ({$this->startColumn} - {$this->endColumn})"); } $this->position = $column; @@ -155,7 +154,7 @@ class ColumnIterator implements \Iterator */ public function current() { - return new Column($this->subject, \PHPExcel\Cell::stringFromColumnIndex($this->position)); + return new Column($this->subject, \PhpSpreadsheet\Cell::stringFromColumnIndex($this->position)); } /** @@ -165,7 +164,7 @@ class ColumnIterator implements \Iterator */ public function key() { - return \PHPExcel\Cell::stringFromColumnIndex($this->position); + return \PhpSpreadsheet\Cell::stringFromColumnIndex($this->position); } /** @@ -179,15 +178,15 @@ class ColumnIterator implements \Iterator /** * Set the iterator to its previous value * - * @throws \PHPExcel\Exception + * @throws \PhpSpreadsheet\Exception */ public function prev() { if ($this->position <= $this->startColumn) { - throw new \PHPExcel\Exception( + throw new \PhpSpreadsheet\Exception( "Column is already at the beginning of range (" . - \PHPExcel\Cell::stringFromColumnIndex($this->endColumn) . " - " . - \PHPExcel\Cell::stringFromColumnIndex($this->endColumn) . ")" + \PhpSpreadsheet\Cell::stringFromColumnIndex($this->endColumn) . " - " . + \PhpSpreadsheet\Cell::stringFromColumnIndex($this->endColumn) . ")" ); } diff --git a/src/PhpSpreadsheet/Worksheet/Dimension.php b/src/PhpSpreadsheet/Worksheet/Dimension.php index 2b33d5a8..13d196da 100644 --- a/src/PhpSpreadsheet/Worksheet/Dimension.php +++ b/src/PhpSpreadsheet/Worksheet/Dimension.php @@ -1,11 +1,11 @@ 7) { - throw new \PHPExcel\Exception("Outline level must range between 0 and 7."); + throw new \PhpSpreadsheet\Exception("Outline level must range between 0 and 7."); } $this->outlineLevel = $pValue; diff --git a/src/PhpSpreadsheet/Worksheet/Drawing.php b/src/PhpSpreadsheet/Worksheet/Drawing.php index fa6f02a4..025d1d1d 100644 --- a/src/PhpSpreadsheet/Worksheet/Drawing.php +++ b/src/PhpSpreadsheet/Worksheet/Drawing.php @@ -1,11 +1,11 @@ width, $this->height) = getimagesize($pValue); } } else { - throw new \PHPExcel\Exception("File $pValue not found!"); + throw new \PhpSpreadsheet\Exception("File $pValue not found!"); } } else { $this->path = $pValue; diff --git a/src/PhpSpreadsheet/Worksheet/Drawing/Shadow.php b/src/PhpSpreadsheet/Worksheet/Drawing/Shadow.php index 3139da9c..56194e0a 100644 --- a/src/PhpSpreadsheet/Worksheet/Drawing/Shadow.php +++ b/src/PhpSpreadsheet/Worksheet/Drawing/Shadow.php @@ -1,11 +1,11 @@ distance = 2; $this->direction = 0; $this->alignment = self::SHADOW_BOTTOM_RIGHT; - $this->color = new \PHPExcel\Style\Color(\PHPExcel\Style\Color::COLOR_BLACK); + $this->color = new \PhpSpreadsheet\Style\Color(\PhpSpreadsheet\Style\Color::COLOR_BLACK); $this->alpha = 50; } @@ -220,7 +219,7 @@ class Shadow implements \PHPExcel\IComparable /** * Get Color * - * @return \PHPExcel\Style\Color + * @return \PhpSpreadsheet\Style\Color */ public function getColor() { @@ -230,11 +229,11 @@ class Shadow implements \PHPExcel\IComparable /** * Set Color * - * @param \PHPExcel\Style_Color $pValue - * @throws \PHPExcel\Exception + * @param \PhpSpreadsheet\Style_Color $pValue + * @throws \PhpSpreadsheet\Exception * @return Shadow */ - public function setColor(\PHPExcel\Style\Color $pValue = null) + public function setColor(\PhpSpreadsheet\Style\Color $pValue = null) { $this->color = $pValue; return $this; diff --git a/src/PhpSpreadsheet/Worksheet/HeaderFooter.php b/src/PhpSpreadsheet/Worksheet/HeaderFooter.php index 8715ce8c..d075fe3e 100644 --- a/src/PhpSpreadsheet/Worksheet/HeaderFooter.php +++ b/src/PhpSpreadsheet/Worksheet/HeaderFooter.php @@ -1,11 +1,11 @@ headerFooterImages = $images; diff --git a/src/PhpSpreadsheet/Worksheet/HeaderFooterDrawing.php b/src/PhpSpreadsheet/Worksheet/HeaderFooterDrawing.php index f77ae6b6..26ad3ef4 100644 --- a/src/PhpSpreadsheet/Worksheet/HeaderFooterDrawing.php +++ b/src/PhpSpreadsheet/Worksheet/HeaderFooterDrawing.php @@ -1,11 +1,11 @@ width, $this->height) = getimagesize($pValue); } } else { - throw new \PHPExcel\Exception("File $pValue not found!"); + throw new \PhpSpreadsheet\Exception("File $pValue not found!"); } } else { $this->path = $pValue; diff --git a/src/PhpSpreadsheet/Worksheet/Iterator.php b/src/PhpSpreadsheet/Worksheet/Iterator.php index 03f50fa4..955051f7 100644 --- a/src/PhpSpreadsheet/Worksheet/Iterator.php +++ b/src/PhpSpreadsheet/Worksheet/Iterator.php @@ -1,11 +1,11 @@ subject = $subject; @@ -73,7 +72,7 @@ class Iterator implements \Iterator /** * Current Worksheet * - * @return \PHPExcel\Worksheet + * @return \PhpSpreadsheet\Worksheet */ public function current() { diff --git a/src/PhpSpreadsheet/Worksheet/MemoryDrawing.php b/src/PhpSpreadsheet/Worksheet/MemoryDrawing.php index 54ca8ec5..f952fc2f 100644 --- a/src/PhpSpreadsheet/Worksheet/MemoryDrawing.php +++ b/src/PhpSpreadsheet/Worksheet/MemoryDrawing.php @@ -1,11 +1,11 @@ * - * @category PHPExcel - * @package \PHPExcel\Worksheet - * @copyright Copyright (c) 2006 - 2015 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet) + * @category PhpSpreadsheet + * @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet) */ class PageSetup { @@ -342,7 +340,7 @@ class PageSetup * @param int? $pValue * @param boolean $pUpdate Update fitToPage so scaling applies rather than fitToHeight / fitToWidth * @return PageSetup - * @throws \PHPExcel\Exception + * @throws \PhpSpreadsheet\Exception */ public function setScale($pValue = 100, $pUpdate = true) { @@ -354,7 +352,7 @@ class PageSetup $this->fitToPage = false; } } else { - throw new \PHPExcel\Exception("Scale must not be negative"); + throw new \PhpSpreadsheet\Exception("Scale must not be negative"); } return $this; } @@ -590,7 +588,7 @@ class PageSetup * Default behaviour, or a index value of 0, will return all ranges as a comma-separated string * Otherwise, the specific range identified by the value of $index will be returned * Print areas are numbered from 1 - * @throws \PHPExcel\Exception + * @throws \PhpSpreadsheet\Exception * @return string */ public function getPrintArea($index = 0) @@ -602,7 +600,7 @@ class PageSetup if (isset($printAreas[$index-1])) { return $printAreas[$index-1]; } - throw new \PHPExcel\Exception("Requested Print Area does not exist"); + throw new \PhpSpreadsheet\Exception("Requested Print Area does not exist"); } /** @@ -665,16 +663,16 @@ class PageSetup * 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 PageSetup - * @throws \PHPExcel\Exception + * @throws \PhpSpreadsheet\Exception */ public function setPrintArea($value, $index = 0, $method = self::SETPRINTRANGE_OVERWRITE) { if (strpos($value, '!') !== false) { - throw new \PHPExcel\Exception('Cell coordinate must not specify a worksheet.'); + throw new \PhpSpreadsheet\Exception('Cell coordinate must not specify a worksheet.'); } elseif (strpos($value, ':') === false) { - throw new \PHPExcel\Exception('Cell coordinate must be a range of cells.'); + throw new \PhpSpreadsheet\Exception('Cell coordinate must be a range of cells.'); } elseif (strpos($value, '$') !== false) { - throw new \PHPExcel\Exception('Cell coordinate must not be absolute.'); + throw new \PhpSpreadsheet\Exception('Cell coordinate must not be absolute.'); } $value = strtoupper($value); @@ -687,7 +685,7 @@ class PageSetup $index = count($printAreas) - abs($index) + 1; } if (($index <= 0) || ($index > count($printAreas))) { - throw new \PHPExcel\Exception('Invalid index for setting print range.'); + throw new \PhpSpreadsheet\Exception('Invalid index for setting print range.'); } $printAreas[$index-1] = $value; $this->printArea = implode(',', $printAreas); @@ -701,13 +699,13 @@ class PageSetup $index = abs($index) - 1; } if ($index > count($printAreas)) { - throw new \PHPExcel\Exception('Invalid index for setting print range.'); + throw new \PhpSpreadsheet\Exception('Invalid index for setting print range.'); } $printAreas = array_merge(array_slice($printAreas, 0, $index), array($value), array_slice($printAreas, $index)); $this->printArea = implode(',', $printAreas); } } else { - throw new \PHPExcel\Exception('Invalid method for setting print range.'); + throw new \PhpSpreadsheet\Exception('Invalid method for setting print range.'); } return $this; @@ -724,7 +722,7 @@ class PageSetup * list. * Print areas are numbered from 1 * @return PageSetup - * @throws \PHPExcel\Exception + * @throws \PhpSpreadsheet\Exception */ public function addPrintArea($value, $index = -1) { @@ -752,12 +750,12 @@ class PageSetup * 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 PageSetup - * @throws \PHPExcel\Exception + * @throws \PhpSpreadsheet\Exception */ public function setPrintAreaByColumnAndRow($column1, $row1, $column2, $row2, $index = 0, $method = self::SETPRINTRANGE_OVERWRITE) { return $this->setPrintArea( - \PHPExcel\Cell::stringFromColumnIndex($column1) . $row1 . ':' . \PHPExcel\Cell::stringFromColumnIndex($column2) . $row2, + \PhpSpreadsheet\Cell::stringFromColumnIndex($column1) . $row1 . ':' . \PhpSpreadsheet\Cell::stringFromColumnIndex($column2) . $row2, $index, $method ); @@ -777,12 +775,12 @@ class PageSetup * list. * Print areas are numbered from 1 * @return PageSetup - * @throws \PHPExcel\Exception + * @throws \PhpSpreadsheet\Exception */ public function addPrintAreaByColumnAndRow($column1, $row1, $column2, $row2, $index = -1) { return $this->setPrintArea( - \PHPExcel\Cell::stringFromColumnIndex($column1) . $row1 . ':' . \PHPExcel\Cell::stringFromColumnIndex($column2) . $row2, + \PhpSpreadsheet\Cell::stringFromColumnIndex($column1) . $row1 . ':' . \PhpSpreadsheet\Cell::stringFromColumnIndex($column2) . $row2, $index, self::SETPRINTRANGE_INSERT ); diff --git a/src/PhpSpreadsheet/Worksheet/Protection.php b/src/PhpSpreadsheet/Worksheet/Protection.php index 7d765ead..a1a1f32b 100644 --- a/src/PhpSpreadsheet/Worksheet/Protection.php +++ b/src/PhpSpreadsheet/Worksheet/Protection.php @@ -1,11 +1,11 @@ password = $pValue; return $this; diff --git a/src/PhpSpreadsheet/Worksheet/Row.php b/src/PhpSpreadsheet/Worksheet/Row.php index 091fd589..7d1fd07a 100644 --- a/src/PhpSpreadsheet/Worksheet/Row.php +++ b/src/PhpSpreadsheet/Worksheet/Row.php @@ -1,11 +1,11 @@ parent = $parent; diff --git a/src/PhpSpreadsheet/Worksheet/RowCellIterator.php b/src/PhpSpreadsheet/Worksheet/RowCellIterator.php index 629e5875..634557cd 100644 --- a/src/PhpSpreadsheet/Worksheet/RowCellIterator.php +++ b/src/PhpSpreadsheet/Worksheet/RowCellIterator.php @@ -1,11 +1,11 @@ subject = $subject; @@ -80,14 +79,14 @@ class RowCellIterator extends CellIterator implements \Iterator * * @param integer $startColumn The column address at which to start iterating * @return RowCellIterator - * @throws \PHPExcel\Exception + * @throws \PhpSpreadsheet\Exception */ public function resetStart($startColumn = 'A') { - $startColumnIndex = \PHPExcel\Cell::columnIndexFromString($startColumn) - 1; + $startColumnIndex = \PhpSpreadsheet\Cell::columnIndexFromString($startColumn) - 1; $this->startColumn = $startColumnIndex; $this->adjustForExistingOnlyRange(); - $this->seek(\PHPExcel\Cell::stringFromColumnIndex($this->startColumn)); + $this->seek(\PhpSpreadsheet\Cell::stringFromColumnIndex($this->startColumn)); return $this; } @@ -97,12 +96,12 @@ class RowCellIterator extends CellIterator implements \Iterator * * @param string $endColumn The column address at which to stop iterating * @return RowCellIterator - * @throws \PHPExcel\Exception + * @throws \PhpSpreadsheet\Exception */ public function resetEnd($endColumn = null) { $endColumn = ($endColumn) ? $endColumn : $this->subject->getHighestColumn(); - $this->endColumn = \PHPExcel\Cell::columnIndexFromString($endColumn) - 1; + $this->endColumn = \PhpSpreadsheet\Cell::columnIndexFromString($endColumn) - 1; $this->adjustForExistingOnlyRange(); return $this; @@ -113,15 +112,15 @@ class RowCellIterator extends CellIterator implements \Iterator * * @param string $column The column address to set the current pointer at * @return RowCellIterator - * @throws \PHPExcel\Exception + * @throws \PhpSpreadsheet\Exception */ public function seek($column = 'A') { - $column = \PHPExcel\Cell::columnIndexFromString($column) - 1; + $column = \PhpSpreadsheet\Cell::columnIndexFromString($column) - 1; if (($column < $this->startColumn) || ($column > $this->endColumn)) { - throw new \PHPExcel\Exception("Column $column is out of range ({$this->startColumn} - {$this->endColumn})"); + throw new \PhpSpreadsheet\Exception("Column $column is out of range ({$this->startColumn} - {$this->endColumn})"); } elseif ($this->onlyExistingCells && !($this->subject->cellExistsByColumnAndRow($column, $this->rowIndex))) { - throw new \PHPExcel\Exception('In "IterateOnlyExistingCells" mode and Cell does not exist'); + throw new \PhpSpreadsheet\Exception('In "IterateOnlyExistingCells" mode and Cell does not exist'); } $this->position = $column; @@ -139,7 +138,7 @@ class RowCellIterator extends CellIterator implements \Iterator /** * Return the current cell in this worksheet row * - * @return \PHPExcel\Cell + * @return \PhpSpreadsheet\Cell */ public function current() { @@ -153,7 +152,7 @@ class RowCellIterator extends CellIterator implements \Iterator */ public function key() { - return \PHPExcel\Cell::stringFromColumnIndex($this->position); + return \PhpSpreadsheet\Cell::stringFromColumnIndex($this->position); } /** @@ -171,15 +170,15 @@ class RowCellIterator extends CellIterator implements \Iterator /** * Set the iterator to its previous value * - * @throws \PHPExcel\Exception + * @throws \PhpSpreadsheet\Exception */ public function prev() { if ($this->position <= $this->startColumn) { - throw new \PHPExcel\Exception( + throw new \PhpSpreadsheet\Exception( "Column is already at the beginning of range (" . - \PHPExcel\Cell::stringFromColumnIndex($this->endColumn) . " - " . - \PHPExcel\Cell::stringFromColumnIndex($this->endColumn) . ")" + \PhpSpreadsheet\Cell::stringFromColumnIndex($this->endColumn) . " - " . + \PhpSpreadsheet\Cell::stringFromColumnIndex($this->endColumn) . ")" ); } @@ -203,7 +202,7 @@ class RowCellIterator extends CellIterator implements \Iterator /** * Validate start/end values for "IterateOnlyExistingCells" mode, and adjust if necessary * - * @throws \PHPExcel\Exception + * @throws \PhpSpreadsheet\Exception */ protected function adjustForExistingOnlyRange() { @@ -213,14 +212,14 @@ class RowCellIterator extends CellIterator implements \Iterator ++$this->startColumn; } if ($this->startColumn > $this->endColumn) { - throw new \PHPExcel\Exception('No cells exist within the specified range'); + throw new \PhpSpreadsheet\Exception('No cells exist within the specified range'); } while ((!$this->subject->cellExistsByColumnAndRow($this->endColumn, $this->rowIndex)) && ($this->endColumn >= $this->startColumn)) { --$this->endColumn; } if ($this->endColumn < $this->startColumn) { - throw new \PHPExcel\Exception('No cells exist within the specified range'); + throw new \PhpSpreadsheet\Exception('No cells exist within the specified range'); } } } diff --git a/src/PhpSpreadsheet/Worksheet/RowDimension.php b/src/PhpSpreadsheet/Worksheet/RowDimension.php index 1c9fb030..a8c4cbb7 100644 --- a/src/PhpSpreadsheet/Worksheet/RowDimension.php +++ b/src/PhpSpreadsheet/Worksheet/RowDimension.php @@ -1,11 +1,11 @@ subject = $subject; @@ -87,12 +86,12 @@ class RowIterator implements \Iterator * * @param integer $startRow The row number at which to start iterating * @return RowIterator - * @throws \PHPExcel\Exception + * @throws \PhpSpreadsheet\Exception */ public function resetStart($startRow = 1) { if ($startRow > $this->subject->getHighestRow()) { - throw new \PHPExcel\Exception("Start row ({$startRow}) is beyond highest row ({$this->subject->getHighestRow()})"); + throw new \PhpSpreadsheet\Exception("Start row ({$startRow}) is beyond highest row ({$this->subject->getHighestRow()})"); } $this->startRow = $startRow; @@ -122,12 +121,12 @@ class RowIterator implements \Iterator * * @param integer $row The row number to set the current pointer at * @return RowIterator - * @throws \PHPExcel\Exception + * @throws \PhpSpreadsheet\Exception */ public function seek($row = 1) { if (($row < $this->startRow) || ($row > $this->endRow)) { - throw new \PHPExcel\Exception("Row $row is out of range ({$this->startRow} - {$this->endRow})"); + throw new \PhpSpreadsheet\Exception("Row $row is out of range ({$this->startRow} - {$this->endRow})"); } $this->position = $row; @@ -173,12 +172,12 @@ class RowIterator implements \Iterator /** * Set the iterator to its previous value * - * @throws \PHPExcel\Exception + * @throws \PhpSpreadsheet\Exception */ public function prev() { if ($this->position <= $this->startRow) { - throw new \PHPExcel\Exception("Row is already at the beginning of range ({$this->startRow} - {$this->endRow})"); + throw new \PhpSpreadsheet\Exception("Row is already at the beginning of range ({$this->startRow} - {$this->endRow})"); } --$this->position; diff --git a/src/PhpSpreadsheet/Worksheet/SheetView.php b/src/PhpSpreadsheet/Worksheet/SheetView.php index 107695fc..1e54db03 100644 --- a/src/PhpSpreadsheet/Worksheet/SheetView.php +++ b/src/PhpSpreadsheet/Worksheet/SheetView.php @@ -1,11 +1,11 @@ = 1) || is_null($pValue)) { $this->zoomScale = $pValue; } else { - throw new \PHPExcel\Exception("Scale must be greater than or equal to 1."); + throw new \PhpSpreadsheet\Exception("Scale must be greater than or equal to 1."); } return $this; } @@ -122,7 +121,7 @@ class SheetView * Valid values range from 10 to 400. * * @param int $pValue - * @throws \PHPExcel\Exception + * @throws \PhpSpreadsheet\Exception * @return SheetView */ public function setZoomScaleNormal($pValue = 100) @@ -130,7 +129,7 @@ class SheetView if (($pValue >= 1) || is_null($pValue)) { $this->zoomScaleNormal = $pValue; } else { - throw new \PHPExcel\Exception("Scale must be greater than or equal to 1."); + throw new \PhpSpreadsheet\Exception("Scale must be greater than or equal to 1."); } return $this; } @@ -154,7 +153,7 @@ class SheetView * 'pageBreakPreview' self::SHEETVIEW_PAGE_BREAK_PREVIEW * * @param string $pValue - * @throws \PHPExcel\Exception + * @throws \PhpSpreadsheet\Exception * @return SheetView */ public function setView($pValue = null) @@ -166,7 +165,7 @@ class SheetView if (in_array($pValue, self::$sheetViewTypes)) { $this->sheetviewType = $pValue; } else { - throw new \PHPExcel\Exception("Invalid sheetview layout type."); + throw new \PhpSpreadsheet\Exception("Invalid sheetview layout type."); } return $this; diff --git a/src/PhpSpreadsheet/Writer/BaseWriter.php b/src/PhpSpreadsheet/Writer/BaseWriter.php index b85efadf..82f524ea 100644 --- a/src/PhpSpreadsheet/Writer/BaseWriter.php +++ b/src/PhpSpreadsheet/Writer/BaseWriter.php @@ -1,11 +1,11 @@ phpExcel = $phpExcel; + $this->spreadsheet = $spreadsheet; } /** - * Save PHPExcel to file + * Save PhpSpreadsheet to file * * @param string $pFilename * @throws Exception @@ -105,12 +102,12 @@ class CSV extends BaseWriter implements IWriter public function save($pFilename = null) { // Fetch sheet - $sheet = $this->phpExcel->getSheet($this->sheetIndex); + $sheet = $this->spreadsheet->getSheet($this->sheetIndex); - $saveDebugLog = \PHPExcel\Calculation::getInstance($this->phpExcel)->getDebugLog()->getWriteDebugLog(); - \PHPExcel\Calculation::getInstance($this->phpExcel)->getDebugLog()->setWriteDebugLog(false); - $saveArrayReturnType = \PHPExcel\Calculation::getArrayReturnType(); - \PHPExcel\Calculation::setArrayReturnType(\PHPExcel\Calculation::RETURN_ARRAY_AS_VALUE); + $saveDebugLog = \PhpSpreadsheet\Calculation::getInstance($this->spreadsheet)->getDebugLog()->getWriteDebugLog(); + \PhpSpreadsheet\Calculation::getInstance($this->spreadsheet)->getDebugLog()->setWriteDebugLog(false); + $saveArrayReturnType = \PhpSpreadsheet\Calculation::getArrayReturnType(); + \PhpSpreadsheet\Calculation::setArrayReturnType(\PhpSpreadsheet\Calculation::RETURN_ARRAY_AS_VALUE); // Open file $fileHandle = fopen($pFilename, 'wb+'); @@ -149,8 +146,8 @@ class CSV extends BaseWriter implements IWriter // Close file fclose($fileHandle); - \PHPExcel\Calculation::setArrayReturnType($saveArrayReturnType); - \PHPExcel\Calculation::getInstance($this->phpExcel)->getDebugLog()->setWriteDebugLog($saveDebugLog); + \PhpSpreadsheet\Calculation::setArrayReturnType($saveArrayReturnType); + \PhpSpreadsheet\Calculation::getInstance($this->spreadsheet)->getDebugLog()->setWriteDebugLog($saveDebugLog); } /** @@ -258,7 +255,7 @@ class CSV extends BaseWriter implements IWriter * Set whether a separator line should be included as the first line of the file * * @param boolean $pValue Use separator line? Defaults to false - * @return PHPExcel_Writer_CSV + * @return CSV */ public function setIncludeSeparatorLine($pValue = false) { diff --git a/src/PhpSpreadsheet/Writer/Excel2007.php b/src/PhpSpreadsheet/Writer/Excel2007.php index 0ef13331..677c7f4f 100644 --- a/src/PhpSpreadsheet/Writer/Excel2007.php +++ b/src/PhpSpreadsheet/Writer/Excel2007.php @@ -1,11 +1,11 @@ setPHPExcel($pPHPExcel); + // Assign PhpSpreadsheet + $this->setPhpSpreadsheet($spreadsheet); $writerPartsArray = [ - 'stringtable' => '\\PHPExcel\\Writer\\Excel2007\\StringTable', - 'contenttypes' => '\\PHPExcel\\Writer\\Excel2007\\ContentTypes', - 'docprops' => '\\PHPExcel\\Writer\\Excel2007\\DocProps', - 'rels' => '\\PHPExcel\\Writer\\Excel2007\\Rels', - 'theme' => '\\PHPExcel\\Writer\\Excel2007\\Theme', - 'style' => '\\PHPExcel\\Writer\\Excel2007\\Style', - 'workbook' => '\\PHPExcel\\Writer\\Excel2007\\Workbook', - 'worksheet' => '\\PHPExcel\\Writer\\Excel2007\\Worksheet', - 'drawing' => '\\PHPExcel\\Writer\\Excel2007\\Drawing', - 'comments' => '\\PHPExcel\\Writer\\Excel2007\\Comments', - 'chart' => '\\PHPExcel\\Writer\\Excel2007\\Chart', - 'relsvba' => '\\PHPExcel\\Writer\\Excel2007\\RelsVBA', - 'relsribbonobjects' => '\\PHPExcel\\Writer\\Excel2007\\RelsRibbon' + 'stringtable' => '\\PhpSpreadsheet\\Writer\\Excel2007\\StringTable', + 'contenttypes' => '\\PhpSpreadsheet\\Writer\\Excel2007\\ContentTypes', + 'docprops' => '\\PhpSpreadsheet\\Writer\\Excel2007\\DocProps', + 'rels' => '\\PhpSpreadsheet\\Writer\\Excel2007\\Rels', + 'theme' => '\\PhpSpreadsheet\\Writer\\Excel2007\\Theme', + 'style' => '\\PhpSpreadsheet\\Writer\\Excel2007\\Style', + 'workbook' => '\\PhpSpreadsheet\\Writer\\Excel2007\\Workbook', + 'worksheet' => '\\PhpSpreadsheet\\Writer\\Excel2007\\Worksheet', + 'drawing' => '\\PhpSpreadsheet\\Writer\\Excel2007\\Drawing', + 'comments' => '\\PhpSpreadsheet\\Writer\\Excel2007\\Comments', + 'chart' => '\\PhpSpreadsheet\\Writer\\Excel2007\\Chart', + 'relsvba' => '\\PhpSpreadsheet\\Writer\\Excel2007\\RelsVBA', + 'relsribbonobjects' => '\\PhpSpreadsheet\\Writer\\Excel2007\\RelsRibbon' ]; // Initialise writer parts @@ -145,7 +144,7 @@ class Excel2007 extends BaseWriter implements IWriter // Set HashTable variables foreach ($hashTablesArray as $tableName) { - $this->$tableName = new \PHPExcel\HashTable(); + $this->$tableName = new \PhpSpreadsheet\HashTable(); } } @@ -153,7 +152,7 @@ class Excel2007 extends BaseWriter implements IWriter * Get writer part * * @param string $pPartName Writer part name - * @return \PHPExcel\Writer\Excel2007\WriterPart + * @return \PhpSpreadsheet\Writer\Excel2007\WriterPart */ public function getWriterPart($pPartName = '') { @@ -165,10 +164,10 @@ class Excel2007 extends BaseWriter implements IWriter } /** - * Save PHPExcel to file + * Save PhpSpreadsheet to file * * @param string $pFilename - * @throws \PHPExcel\Writer\Exception + * @throws \PhpSpreadsheet\Writer\Exception */ public function save($pFilename = null) { @@ -179,16 +178,16 @@ class Excel2007 extends BaseWriter implements IWriter // If $pFilename is php://output or php://stdout, make it a temporary file... $originalFilename = $pFilename; if (strtolower($pFilename) == 'php://output' || strtolower($pFilename) == 'php://stdout') { - $pFilename = @tempnam(\PHPExcel\Shared\File::sysGetTempDir(), 'phpxltmp'); + $pFilename = @tempnam(\PhpSpreadsheet\Shared\File::sysGetTempDir(), 'phpxltmp'); if ($pFilename == '') { $pFilename = $originalFilename; } } - $saveDebugLog = \PHPExcel\Calculation::getInstance($this->spreadSheet)->getDebugLog()->getWriteDebugLog(); - \PHPExcel\Calculation::getInstance($this->spreadSheet)->getDebugLog()->setWriteDebugLog(false); - $saveDateReturnType = \PHPExcel\Calculation\Functions::getReturnDateType(); - \PHPExcel\Calculation\Functions::setReturnDateType(\PHPExcel\Calculation\Functions::RETURNDATE_EXCEL); + $saveDebugLog = \PhpSpreadsheet\Calculation::getInstance($this->spreadSheet)->getDebugLog()->getWriteDebugLog(); + \PhpSpreadsheet\Calculation::getInstance($this->spreadSheet)->getDebugLog()->setWriteDebugLog(false); + $saveDateReturnType = \PhpSpreadsheet\Calculation\Functions::getReturnDateType(); + \PhpSpreadsheet\Calculation\Functions::setReturnDateType(\PhpSpreadsheet\Calculation\Functions::RETURNDATE_EXCEL); // Create string lookup table $this->stringTable = array(); @@ -208,7 +207,7 @@ class Excel2007 extends BaseWriter implements IWriter $this->drawingHashTable->addFromSource($this->getWriterPart('Drawing')->allDrawings($this->spreadSheet)); // Create new ZIP file and open it for writing - $zipClass = \PHPExcel\Settings::getZipClass(); + $zipClass = \PhpSpreadsheet\Settings::getZipClass(); /** @var \ZipArchive $objZip */ $objZip = new $zipClass(); @@ -224,7 +223,7 @@ class Excel2007 extends BaseWriter implements IWriter // Try opening the ZIP file if ($objZip->open($pFilename, $zipOverWrite) !== true) { if ($objZip->open($pFilename, $zipCreate) !== true) { - throw new \PHPExcel\Writer\Exception("Could not open " . $pFilename . " for writing."); + throw new \PhpSpreadsheet\Writer\Exception("Could not open " . $pFilename . " for writing."); } } @@ -344,14 +343,14 @@ class Excel2007 extends BaseWriter implements IWriter // Add media for ($i = 0; $i < $this->getDrawingHashTable()->count(); ++$i) { - if ($this->getDrawingHashTable()->getByIndex($i) instanceof \PHPExcel\Worksheet\Drawing) { + if ($this->getDrawingHashTable()->getByIndex($i) instanceof \PhpSpreadsheet\Worksheet\Drawing) { $imageContents = null; $imagePath = $this->getDrawingHashTable()->getByIndex($i)->getPath(); if (strpos($imagePath, 'zip://') !== false) { $imagePath = substr($imagePath, 6); $imagePathSplitted = explode('#', $imagePath); - $zipClass = \PHPExcel\Settings::getZipClass(); + $zipClass = \PhpSpreadsheet\Settings::getZipClass(); $imageZip = new $zipClass(); $imageZip->open($imagePathSplitted[0]); $imageContents = $imageZip->getFromName($imagePathSplitted[1]); @@ -362,7 +361,7 @@ class Excel2007 extends BaseWriter implements IWriter } $objZip->addFromString('xl/media/' . str_replace(' ', '_', $this->getDrawingHashTable()->getByIndex($i)->getIndexedFilename()), $imageContents); - } elseif ($this->getDrawingHashTable()->getByIndex($i) instanceof \PHPExcel\Worksheet\MemoryDrawing) { + } elseif ($this->getDrawingHashTable()->getByIndex($i) instanceof \PhpSpreadsheet\Worksheet\MemoryDrawing) { ob_start(); call_user_func( $this->getDrawingHashTable()->getByIndex($i)->getRenderingFunction(), @@ -375,51 +374,51 @@ class Excel2007 extends BaseWriter implements IWriter } } - \PHPExcel\Calculation\Functions::setReturnDateType($saveDateReturnType); - \PHPExcel\Calculation::getInstance($this->spreadSheet)->getDebugLog()->setWriteDebugLog($saveDebugLog); + \PhpSpreadsheet\Calculation\Functions::setReturnDateType($saveDateReturnType); + \PhpSpreadsheet\Calculation::getInstance($this->spreadSheet)->getDebugLog()->setWriteDebugLog($saveDebugLog); // Close file if ($objZip->close() === false) { - throw new \PHPExcel\Writer\Exception("Could not close zip file $pFilename."); + throw new \PhpSpreadsheet\Writer\Exception("Could not close zip file $pFilename."); } // If a temporary file was used, copy it to the correct file stream if ($originalFilename != $pFilename) { if (copy($pFilename, $originalFilename) === false) { - throw new \PHPExcel\Writer\Exception("Could not copy temporary zip file $pFilename to $originalFilename."); + throw new \PhpSpreadsheet\Writer\Exception("Could not copy temporary zip file $pFilename to $originalFilename."); } @unlink($pFilename); } } else { - throw new \PHPExcel\Writer\Exception("PHPExcel object unassigned."); + throw new \PhpSpreadsheet\Writer\Exception("PhpSpreadsheet object unassigned."); } } /** - * Get PHPExcel object + * Get PhpSpreadsheet object * - * @return PHPExcel - * @throws \PHPExcel\Writer\Exception + * @return PhpSpreadsheet + * @throws \PhpSpreadsheet\Writer\Exception */ - public function getPHPExcel() + public function getPhpSpreadsheet() { if ($this->spreadSheet !== null) { return $this->spreadSheet; } else { - throw new \PHPExcel\Writer\Exception("No PHPExcel object assigned."); + throw new \PhpSpreadsheet\Writer\Exception("No PhpSpreadsheet object assigned."); } } /** - * Set PHPExcel object + * Set PhpSpreadsheet object * - * @param \PHPExcel\Spreadsheet $pPHPExcel PHPExcel object + * @param \PhpSpreadsheet\Spreadsheet $spreadsheet PhpSpreadsheet object * @throws Exception * @return Excel2007 */ - public function setPHPExcel(\PHPExcel\Spreadsheet $pPHPExcel = null) + public function setPhpSpreadsheet(\PhpSpreadsheet\Spreadsheet $spreadsheet = null) { - $this->spreadSheet = $pPHPExcel; + $this->spreadSheet = $spreadsheet; return $this; } @@ -434,9 +433,9 @@ class Excel2007 extends BaseWriter implements IWriter } /** - * Get \PHPExcel\Style HashTable + * Get \PhpSpreadsheet\Style HashTable * - * @return \PHPExcel\HashTable + * @return \PhpSpreadsheet\HashTable */ public function getStyleHashTable() { @@ -444,9 +443,9 @@ class Excel2007 extends BaseWriter implements IWriter } /** - * Get \PHPExcel\Style\Conditional HashTable + * Get \PhpSpreadsheet\Style\Conditional HashTable * - * @return \PHPExcel\HashTable + * @return \PhpSpreadsheet\HashTable */ public function getStylesConditionalHashTable() { @@ -454,9 +453,9 @@ class Excel2007 extends BaseWriter implements IWriter } /** - * Get \PHPExcel\Style\Fill HashTable + * Get \PhpSpreadsheet\Style\Fill HashTable * - * @return \PHPExcel\HashTable + * @return \PhpSpreadsheet\HashTable */ public function getFillHashTable() { @@ -464,9 +463,9 @@ class Excel2007 extends BaseWriter implements IWriter } /** - * Get \PHPExcel\Style\Font HashTable + * Get \PhpSpreadsheet\Style\Font HashTable * - * @return \PHPExcel\HashTable + * @return \PhpSpreadsheet\HashTable */ public function getFontHashTable() { @@ -474,9 +473,9 @@ class Excel2007 extends BaseWriter implements IWriter } /** - * Get \PHPExcel\Style\Borders HashTable + * Get \PhpSpreadsheet\Style\Borders HashTable * - * @return \PHPExcel\HashTable + * @return \PhpSpreadsheet\HashTable */ public function getBordersHashTable() { @@ -484,9 +483,9 @@ class Excel2007 extends BaseWriter implements IWriter } /** - * Get \PHPExcel\Style\NumberFormat HashTable + * Get \PhpSpreadsheet\Style\NumberFormat HashTable * - * @return \PHPExcel\HashTable + * @return \PhpSpreadsheet\HashTable */ public function getNumFmtHashTable() { @@ -494,9 +493,9 @@ class Excel2007 extends BaseWriter implements IWriter } /** - * Get \PHPExcel\Worksheet\BaseDrawing HashTable + * Get \PhpSpreadsheet\Worksheet\BaseDrawing HashTable * - * @return \PHPExcel\HashTable + * @return \PhpSpreadsheet\HashTable */ public function getDrawingHashTable() { @@ -517,7 +516,7 @@ class Excel2007 extends BaseWriter implements IWriter * Set Office2003 compatibility * * @param boolean $pValue Office2003 compatibility? - * @return PHPExcel_Writer_Excel2007 + * @return Excel2007 */ public function setOffice2003Compatibility($pValue = false) { diff --git a/src/PhpSpreadsheet/Writer/Excel2007/Chart.php b/src/PhpSpreadsheet/Writer/Excel2007/Chart.php index 98677c18..af4217eb 100644 --- a/src/PhpSpreadsheet/Writer/Excel2007/Chart.php +++ b/src/PhpSpreadsheet/Writer/Excel2007/Chart.php @@ -1,19 +1,17 @@ calculateCellValues = $calculateCellValues; // Create XML writer $objWriter = null; if ($this->getParentWriter()->getUseDiskCaching()) { - $objWriter = new \PHPExcel\Shared\XMLWriter(\PHPExcel\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); + $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); } else { - $objWriter = new \PHPExcel\Shared\XMLWriter(\PHPExcel\Shared\XMLWriter::STORAGE_MEMORY); + $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_MEMORY); } // Ensure that data series values are up-to-date before we save if ($this->calculateCellValues) { @@ -121,12 +118,12 @@ class Chart extends WriterPart /** * Write Chart Title * - * @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer + * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer * @param Title $title * - * @throws \PHPExcel\Writer\Exception + * @throws \PhpSpreadsheet\Writer\Exception */ - private function writeTitle(\PHPExcel\Shared\XMLWriter $objWriter, Title $title = null) + private function writeTitle(\PhpSpreadsheet\Shared\XMLWriter $objWriter, Title $title = null) { if (is_null($title)) { return; @@ -166,12 +163,12 @@ class Chart extends WriterPart /** * Write Chart Legend * - * @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer + * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer * @param Legend $legend * - * @throws \PHPExcel\Writer\Exception + * @throws \PhpSpreadsheet\Writer\Exception */ - private function writeLegend(\PHPExcel\Shared\XMLWriter $objWriter, Legend $legend = null) + private function writeLegend(\PhpSpreadsheet\Shared\XMLWriter $objWriter, Legend $legend = null) { if (is_null($legend)) { return; @@ -217,17 +214,17 @@ class Chart extends WriterPart /** * Write Chart Plot Area * - * @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer - * @param \PHPExcel\Worksheet $pSheet + * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpSpreadsheet\Worksheet $pSheet * @param PlotArea $plotArea * @param Title $xAxisLabel * @param Title $yAxisLabel * @param Axis $xAxis * @param Axis $yAxis * - * @throws \PHPExcel\Writer\Exception + * @throws \PhpSpreadsheet\Writer\Exception */ - private function writePlotArea(\PHPExcel\Shared\XMLWriter $objWriter, \PHPExcel\Worksheet $pSheet, PlotArea $plotArea, Title $xAxisLabel = null, Title $yAxisLabel = null, Axis $xAxis = null, Axis $yAxis = null, GridLines $majorGridlines = null, GridLines $minorGridlines = null) + private function writePlotArea(\PhpSpreadsheet\Shared\XMLWriter $objWriter, \PhpSpreadsheet\Worksheet $pSheet, PlotArea $plotArea, Title $xAxisLabel = null, Title $yAxisLabel = null, Axis $xAxis = null, Axis $yAxis = null, GridLines $majorGridlines = null, GridLines $minorGridlines = null) { if (is_null($plotArea)) { return; @@ -357,10 +354,10 @@ class Chart extends WriterPart /** * Write Data Labels * - * @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer - * @param \PHPExcel\Chart\Layout $chartLayout Chart layout + * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpSpreadsheet\Chart\Layout $chartLayout Chart layout * - * @throws \PHPExcel\Writer\Exception + * @throws \PhpSpreadsheet\Writer\Exception */ private function writeDataLabels($objWriter, Layout $chartLayout = null) { @@ -407,15 +404,15 @@ class Chart extends WriterPart /** * Write Category Axis * - * @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer + * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer * @param PlotArea $plotArea - * @param PHPExcel_Chart_Title $xAxisLabel + * @param Title $xAxisLabel * @param string $groupType Chart type * @param string $id1 * @param string $id2 * @param boolean $isMultiLevelSeries * - * @throws \PHPExcel\Writer\Exception + * @throws \PhpSpreadsheet\Writer\Exception */ private function writeCategoryAxis($objWriter, PlotArea $plotArea, $xAxisLabel, $groupType, $id1, $id2, $isMultiLevelSeries, $xAxis, $yAxis) { @@ -461,7 +458,7 @@ class Chart extends WriterPart } $objWriter->startElement('a:t'); // $objWriter->writeAttribute('xml:space', 'preserve'); - $objWriter->writeRawData(\PHPExcel\Shared\StringHelper::controlCharacterPHP2OOXML($caption)); + $objWriter->writeRawData(\PhpSpreadsheet\Shared\StringHelper::controlCharacterPHP2OOXML($caption)); $objWriter->endElement(); $objWriter->endElement(); @@ -529,15 +526,15 @@ class Chart extends WriterPart /** * Write Value Axis * - * @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer - * @param PHPExcel_Chart_PlotArea $plotArea - * @param PHPExcel_Chart_Title $yAxisLabel + * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param PlotArea $plotArea + * @param Title $yAxisLabel * @param string $groupType Chart type * @param string $id1 * @param string $id2 * @param boolean $isMultiLevelSeries * - * @throws \PHPExcel\Writer\Exception + * @throws \PhpSpreadsheet\Writer\Exception */ private function writeValueAxis($objWriter, PlotArea $plotArea, $yAxisLabel, $groupType, $id1, $id2, $isMultiLevelSeries, $xAxis, $yAxis, $majorGridlines, $minorGridlines) { @@ -811,7 +808,7 @@ class Chart extends WriterPart $objWriter->startElement('a:t'); // $objWriter->writeAttribute('xml:space', 'preserve'); - $objWriter->writeRawData(\PHPExcel\Shared\StringHelper::controlCharacterPHP2OOXML($caption)); + $objWriter->writeRawData(\PhpSpreadsheet\Shared\StringHelper::controlCharacterPHP2OOXML($caption)); $objWriter->endElement(); $objWriter->endElement(); @@ -1016,10 +1013,10 @@ class Chart extends WriterPart /** * Get the data series type(s) for a chart plot series * - * @param PHPExcel_Chart_PlotArea $plotArea + * @param PlotArea $plotArea * * @return string|array - * @throws \PHPExcel\Writer\Exception + * @throws \PhpSpreadsheet\Writer\Exception */ private static function getChartType($plotArea) { @@ -1034,7 +1031,7 @@ class Chart extends WriterPart } $chartType = array_unique($chartTypes); if (count($chartTypes) == 0) { - throw new \PHPExcel\Writer\Exception('Chart is not yet implemented'); + throw new \PhpSpreadsheet\Writer\Exception('Chart is not yet implemented'); } } @@ -1046,15 +1043,15 @@ class Chart extends WriterPart * * @param DataSeries $plotGroup * @param string $groupType Type of plot for dataseries - * @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer + * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer * @param boolean &$catIsMultiLevelSeries Is category a multi-series category * @param boolean &$valIsMultiLevelSeries Is value set a multi-series set * @param string &$plotGroupingType Type of grouping for multi-series values - * @param \PHPExcel\Worksheet $pSheet + * @param \PhpSpreadsheet\Worksheet $pSheet * - * @throws \PHPExcel\Writer\Exception + * @throws \PhpSpreadsheet\Writer\Exception */ - private function writePlotGroup($plotGroup, $groupType, $objWriter, &$catIsMultiLevelSeries, &$valIsMultiLevelSeries, &$plotGroupingType, \PHPExcel\Worksheet $pSheet) + private function writePlotGroup($plotGroup, $groupType, $objWriter, &$catIsMultiLevelSeries, &$valIsMultiLevelSeries, &$plotGroupingType, \PhpSpreadsheet\Worksheet $pSheet) { if (is_null($plotGroup)) { return; @@ -1224,9 +1221,9 @@ class Chart extends WriterPart * Write Plot Series Label * * @param DataSeriesValues $plotSeriesLabel - * @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer + * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer * - * @throws \PHPExcel\Writer\Exception + * @throws \PhpSpreadsheet\Writer\Exception */ private function writePlotSeriesLabel($plotSeriesLabel, $objWriter) { @@ -1259,12 +1256,12 @@ class Chart extends WriterPart * Write Plot Series Values * * @param DataSeriesValues $plotSeriesValues - * @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer + * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer * @param string $groupType Type of plot for dataseries * @param string $dataType Datatype of series values - * @param \PHPExcel\Worksheet $pSheet + * @param \PhpSpreadsheet\Worksheet $pSheet * - * @throws \PHPExcel\Writer\Exception + * @throws \PhpSpreadsheet\Writer\Exception */ private function writePlotSeriesValues($plotSeriesValues, $objWriter, $groupType, $dataType = 'str') { @@ -1354,9 +1351,9 @@ class Chart extends WriterPart * Write Bubble Chart Details * * @param DataSeriesValues $plotSeriesValues - * @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer + * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer * - * @throws \PHPExcel\Writer\Exception + * @throws \PhpSpreadsheet\Writer\Exception */ private function writeBubbles($plotSeriesValues, $objWriter) { @@ -1400,12 +1397,12 @@ class Chart extends WriterPart /** * Write Layout * - * @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer + * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer * @param Layout $layout * - * @throws \PHPExcel\Writer\Exception + * @throws \PhpSpreadsheet\Writer\Exception */ - private function writeLayout(\PHPExcel\Shared\XMLWriter $objWriter, Layout $layout = null) + private function writeLayout(\PhpSpreadsheet\Shared\XMLWriter $objWriter, Layout $layout = null) { $objWriter->startElement('c:layout'); @@ -1470,9 +1467,9 @@ class Chart extends WriterPart /** * Write Alternate Content block * - * @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer + * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer * - * @throws \PHPExcel\Writer\Exception + * @throws \PhpSpreadsheet\Writer\Exception */ private function writeAlternateContent($objWriter) { @@ -1500,9 +1497,9 @@ class Chart extends WriterPart /** * Write Printer Settings * - * @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer + * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer * - * @throws \PHPExcel\Writer\Exception + * @throws \PhpSpreadsheet\Writer\Exception */ private function writePrintSettings($objWriter) { diff --git a/src/PhpSpreadsheet/Writer/Excel2007/Comments.php b/src/PhpSpreadsheet/Writer/Excel2007/Comments.php index d39d021c..4be5d18c 100644 --- a/src/PhpSpreadsheet/Writer/Excel2007/Comments.php +++ b/src/PhpSpreadsheet/Writer/Excel2007/Comments.php @@ -1,10 +1,8 @@ getParentWriter()->getUseDiskCaching()) { - $objWriter = new \PHPExcel\Shared\XMLWriter(\PHPExcel\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); + $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); } else { - $objWriter = new \PHPExcel\Shared\XMLWriter(\PHPExcel\Shared\XMLWriter::STORAGE_MEMORY); + $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_MEMORY); } // XML header @@ -87,13 +84,13 @@ class Comments extends WriterPart /** * Write comment to XML format * - * @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer + * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer * @param string $pCellReference Cell reference - * @param \PHPExcel\Comment $pComment Comment + * @param \PhpSpreadsheet\Comment $pComment Comment * @param array $pAuthors Array of authors - * @throws \PHPExcel\Writer\Exception + * @throws \PhpSpreadsheet\Writer\Exception */ - private function writeComment(\PHPExcel\Shared\XMLWriter $objWriter = null, $pCellReference = 'A1', \PHPExcel\Comment $pComment = null, $pAuthors = null) + private function writeComment(\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, $pCellReference = 'A1', \PhpSpreadsheet\Comment $pComment = null, $pAuthors = null) { // comment $objWriter->startElement('comment'); @@ -111,18 +108,18 @@ class Comments extends WriterPart /** * Write VML comments to XML format * - * @param \PHPExcel\Worksheet $pWorksheet + * @param \PhpSpreadsheet\Worksheet $pWorksheet * @return string XML Output - * @throws \PHPExcel\Writer\Exception + * @throws \PhpSpreadsheet\Writer\Exception */ - public function writeVMLComments(\PHPExcel\Worksheet $pWorksheet = null) + public function writeVMLComments(\PhpSpreadsheet\Worksheet $pWorksheet = null) { // Create XML writer $objWriter = null; if ($this->getParentWriter()->getUseDiskCaching()) { - $objWriter = new \PHPExcel\Shared\XMLWriter(\PHPExcel\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); + $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); } else { - $objWriter = new \PHPExcel\Shared\XMLWriter(\PHPExcel\Shared\XMLWriter::STORAGE_MEMORY); + $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_MEMORY); } // XML header @@ -183,16 +180,16 @@ class Comments extends WriterPart /** * Write VML comment to XML format * - * @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer + * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer * @param string $pCellReference Cell reference - * @param \PHPExcel\Comment $pComment Comment - * @throws \PHPExcel\Writer\Exception + * @param \PhpSpreadsheet\Comment $pComment Comment + * @throws \PhpSpreadsheet\Writer\Exception */ - private function writeVMLComment(\PHPExcel\Shared\XMLWriter $objWriter = null, $pCellReference = 'A1', \PHPExcel\Comment $pComment = null) + private function writeVMLComment(\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, $pCellReference = 'A1', \PhpSpreadsheet\Comment $pComment = null) { // Metadata - list($column, $row) = \PHPExcel\Cell::coordinateFromString($pCellReference); - $column = \PHPExcel\Cell::columnIndexFromString($column); + list($column, $row) = \PhpSpreadsheet\Cell::coordinateFromString($pCellReference); + $column = \PhpSpreadsheet\Cell::columnIndexFromString($column); $id = 1024 + $column + $row; $id = substr($id, 0, 4); diff --git a/src/PhpSpreadsheet/Writer/Excel2007/ContentTypes.php b/src/PhpSpreadsheet/Writer/Excel2007/ContentTypes.php index 98de65a4..32e2e957 100644 --- a/src/PhpSpreadsheet/Writer/Excel2007/ContentTypes.php +++ b/src/PhpSpreadsheet/Writer/Excel2007/ContentTypes.php @@ -1,10 +1,8 @@ getParentWriter()->getUseDiskCaching()) { - $objWriter = new \PHPExcel\Shared\XMLWriter(\PHPExcel\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); + $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); } else { - $objWriter = new \PHPExcel\Shared\XMLWriter(\PHPExcel\Shared\XMLWriter::STORAGE_MEMORY); + $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_MEMORY); } // XML header @@ -69,12 +66,12 @@ class ContentTypes extends WriterPart $this->writeDefaultContentType($objWriter, 'vml', 'application/vnd.openxmlformats-officedocument.vmlDrawing'); // Workbook - if ($pPHPExcel->hasMacros()) { //Macros in workbook ? + if ($spreadsheet->hasMacros()) { //Macros in workbook ? // Yes : not standard content but "macroEnabled" $this->writeOverrideContentType($objWriter, '/xl/workbook.xml', 'application/vnd.ms-excel.sheet.macroEnabled.main+xml'); //... and define a new type for the VBA project $this->writeDefaultContentType($objWriter, 'bin', 'application/vnd.ms-office.vbaProject'); - if ($pPHPExcel->hasMacrosCertificate()) {// signed macros ? + if ($spreadsheet->hasMacrosCertificate()) {// signed macros ? // Yes : add needed information $this->writeOverrideContentType($objWriter, '/xl/vbaProjectSignature.bin', 'application/vnd.ms-office.vbaProjectSignature'); } @@ -87,13 +84,13 @@ class ContentTypes extends WriterPart $this->writeOverrideContentType($objWriter, '/docProps/core.xml', 'application/vnd.openxmlformats-package.core-properties+xml'); - $customPropertyList = $pPHPExcel->getProperties()->getCustomProperties(); + $customPropertyList = $spreadsheet->getProperties()->getCustomProperties(); if (!empty($customPropertyList)) { $this->writeOverrideContentType($objWriter, '/docProps/custom.xml', 'application/vnd.openxmlformats-officedocument.custom-properties+xml'); } // Worksheets - $sheetCount = $pPHPExcel->getSheetCount(); + $sheetCount = $spreadsheet->getSheetCount(); for ($i = 0; $i < $sheetCount; ++$i) { $this->writeOverrideContentType($objWriter, '/xl/worksheets/sheet' . ($i + 1) . '.xml', 'application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml'); } @@ -104,9 +101,9 @@ class ContentTypes extends WriterPart // Add worksheet relationship content types $chart = 1; for ($i = 0; $i < $sheetCount; ++$i) { - $drawings = $pPHPExcel->getSheet($i)->getDrawingCollection(); + $drawings = $spreadsheet->getSheet($i)->getDrawingCollection(); $drawingCount = count($drawings); - $chartCount = ($includeCharts) ? $pPHPExcel->getSheet($i)->getChartCount() : 0; + $chartCount = ($includeCharts) ? $spreadsheet->getSheet($i)->getChartCount() : 0; // We need a drawing relationship for the worksheet if we have either drawings or charts if (($drawingCount > 0) || ($chartCount > 0)) { @@ -123,7 +120,7 @@ class ContentTypes extends WriterPart // Comments for ($i = 0; $i < $sheetCount; ++$i) { - if (count($pPHPExcel->getSheet($i)->getComments()) > 0) { + if (count($spreadsheet->getSheet($i)->getComments()) > 0) { $this->writeOverrideContentType($objWriter, '/xl/comments' . ($i + 1) . '.xml', 'application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml'); } } @@ -135,10 +132,10 @@ class ContentTypes extends WriterPart $extension = ''; $mimeType = ''; - if ($this->getParentWriter()->getDrawingHashTable()->getByIndex($i) instanceof \PHPExcel\Worksheet\Drawing) { + if ($this->getParentWriter()->getDrawingHashTable()->getByIndex($i) instanceof \PhpSpreadsheet\Worksheet\Drawing) { $extension = strtolower($this->getParentWriter()->getDrawingHashTable()->getByIndex($i)->getExtension()); $mimeType = $this->getImageMimeType($this->getParentWriter()->getDrawingHashTable()->getByIndex($i)->getPath()); - } elseif ($this->getParentWriter()->getDrawingHashTable()->getByIndex($i) instanceof \PHPExcel\Worksheet\MemoryDrawing) { + } elseif ($this->getParentWriter()->getDrawingHashTable()->getByIndex($i) instanceof \PhpSpreadsheet\Worksheet\MemoryDrawing) { $extension = strtolower($this->getParentWriter()->getDrawingHashTable()->getByIndex($i)->getMimeType()); $extension = explode('/', $extension); $extension = $extension[1]; @@ -152,19 +149,19 @@ class ContentTypes extends WriterPart $this->writeDefaultContentType($objWriter, $extension, $mimeType); } } - if ($pPHPExcel->hasRibbonBinObjects()) { + if ($spreadsheet->hasRibbonBinObjects()) { // Some additional objects in the ribbon ? // we need to write "Extension" but not already write for media content - $tabRibbonTypes=array_diff($pPHPExcel->getRibbonBinObjects('types'), array_keys($aMediaContentTypes)); + $tabRibbonTypes=array_diff($spreadsheet->getRibbonBinObjects('types'), array_keys($aMediaContentTypes)); foreach ($tabRibbonTypes as $aRibbonType) { $mimeType='image/.'.$aRibbonType;//we wrote $mimeType like customUI Editor $this->writeDefaultContentType($objWriter, $aRibbonType, $mimeType); } } - $sheetCount = $pPHPExcel->getSheetCount(); + $sheetCount = $spreadsheet->getSheetCount(); for ($i = 0; $i < $sheetCount; ++$i) { - if (count($pPHPExcel->getSheet()->getHeaderFooter()->getImages()) > 0) { - foreach ($pPHPExcel->getSheet()->getHeaderFooter()->getImages() as $image) { + if (count($spreadsheet->getSheet()->getHeaderFooter()->getImages()) > 0) { + foreach ($spreadsheet->getSheet()->getHeaderFooter()->getImages() as $image) { if (!isset($aMediaContentTypes[strtolower($image->getExtension())])) { $aMediaContentTypes[strtolower($image->getExtension())] = $this->getImageMimeType($image->getPath()); @@ -185,27 +182,27 @@ class ContentTypes extends WriterPart * * @param string $pFile Filename * @return string Mime Type - * @throws \PHPExcel\Writer\Exception + * @throws \PhpSpreadsheet\Writer\Exception */ private function getImageMimeType($pFile = '') { - if (\PHPExcel\Shared\File::fileExists($pFile)) { + if (\PhpSpreadsheet\Shared\File::fileExists($pFile)) { $image = getimagesize($pFile); return image_type_to_mime_type($image[2]); } else { - throw new \PHPExcel\Writer\Exception("File $pFile does not exist"); + throw new \PhpSpreadsheet\Writer\Exception("File $pFile does not exist"); } } /** * Write Default content type * - * @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer + * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer * @param string $pPartname Part name * @param string $pContentType Content type - * @throws \PHPExcel\Writer\Exception + * @throws \PhpSpreadsheet\Writer\Exception */ - private function writeDefaultContentType(\PHPExcel\Shared\XMLWriter $objWriter = null, $pPartname = '', $pContentType = '') + private function writeDefaultContentType(\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, $pPartname = '', $pContentType = '') { if ($pPartname != '' && $pContentType != '') { // Write content type @@ -214,19 +211,19 @@ class ContentTypes extends WriterPart $objWriter->writeAttribute('ContentType', $pContentType); $objWriter->endElement(); } else { - throw new \PHPExcel\Writer\Exception("Invalid parameters passed."); + throw new \PhpSpreadsheet\Writer\Exception("Invalid parameters passed."); } } /** * Write Override content type * - * @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer + * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer * @param string $pPartname Part name * @param string $pContentType Content type - * @throws \PHPExcel\Writer\Exception + * @throws \PhpSpreadsheet\Writer\Exception */ - private function writeOverrideContentType(\PHPExcel\Shared\XMLWriter $objWriter = null, $pPartname = '', $pContentType = '') + private function writeOverrideContentType(\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, $pPartname = '', $pContentType = '') { if ($pPartname != '' && $pContentType != '') { // Write content type @@ -235,7 +232,7 @@ class ContentTypes extends WriterPart $objWriter->writeAttribute('ContentType', $pContentType); $objWriter->endElement(); } else { - throw new \PHPExcel\Writer\Exception("Invalid parameters passed."); + throw new \PhpSpreadsheet\Writer\Exception("Invalid parameters passed."); } } } diff --git a/src/PhpSpreadsheet/Writer/Excel2007/DocProps.php b/src/PhpSpreadsheet/Writer/Excel2007/DocProps.php index 1b5e7709..767ee70c 100644 --- a/src/PhpSpreadsheet/Writer/Excel2007/DocProps.php +++ b/src/PhpSpreadsheet/Writer/Excel2007/DocProps.php @@ -1,10 +1,8 @@ getParentWriter()->getUseDiskCaching()) { - $objWriter = new \PHPExcel\Shared\XMLWriter(\PHPExcel\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); + $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); } else { - $objWriter = new \PHPExcel\Shared\XMLWriter(\PHPExcel\Shared\XMLWriter::STORAGE_MEMORY); + $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_MEMORY); } // XML header @@ -77,7 +74,7 @@ class DocProps extends WriterPart // Variant $objWriter->startElement('vt:variant'); - $objWriter->writeElement('vt:i4', $pPHPExcel->getSheetCount()); + $objWriter->writeElement('vt:i4', $spreadsheet->getSheetCount()); $objWriter->endElement(); $objWriter->endElement(); @@ -89,12 +86,12 @@ class DocProps extends WriterPart // Vector $objWriter->startElement('vt:vector'); - $objWriter->writeAttribute('size', $pPHPExcel->getSheetCount()); + $objWriter->writeAttribute('size', $spreadsheet->getSheetCount()); $objWriter->writeAttribute('baseType', 'lpstr'); - $sheetCount = $pPHPExcel->getSheetCount(); + $sheetCount = $spreadsheet->getSheetCount(); for ($i = 0; $i < $sheetCount; ++$i) { - $objWriter->writeElement('vt:lpstr', $pPHPExcel->getSheet($i)->getTitle()); + $objWriter->writeElement('vt:lpstr', $spreadsheet->getSheet($i)->getTitle()); } $objWriter->endElement(); @@ -102,10 +99,10 @@ class DocProps extends WriterPart $objWriter->endElement(); // Company - $objWriter->writeElement('Company', $pPHPExcel->getProperties()->getCompany()); + $objWriter->writeElement('Company', $spreadsheet->getProperties()->getCompany()); // Company - $objWriter->writeElement('Manager', $pPHPExcel->getProperties()->getManager()); + $objWriter->writeElement('Manager', $spreadsheet->getProperties()->getManager()); // LinksUpToDate $objWriter->writeElement('LinksUpToDate', 'false'); @@ -128,18 +125,18 @@ class DocProps extends WriterPart /** * Write docProps/core.xml to XML format * - * @param \PHPExcel\SpreadSheet $pPHPExcel + * @param \PhpSpreadsheet\SpreadSheet $spreadsheet * @return string XML Output - * @throws \PHPExcel\Writer\Exception + * @throws \PhpSpreadsheet\Writer\Exception */ - public function writeDocPropsCore(\PHPExcel\SpreadSheet $pPHPExcel = null) + public function writeDocPropsCore(\PhpSpreadsheet\SpreadSheet $spreadsheet = null) { // Create XML writer $objWriter = null; if ($this->getParentWriter()->getUseDiskCaching()) { - $objWriter = new \PHPExcel\Shared\XMLWriter(\PHPExcel\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); + $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); } else { - $objWriter = new \PHPExcel\Shared\XMLWriter(\PHPExcel\Shared\XMLWriter::STORAGE_MEMORY); + $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_MEMORY); } // XML header @@ -154,37 +151,37 @@ class DocProps extends WriterPart $objWriter->writeAttribute('xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance'); // dc:creator - $objWriter->writeElement('dc:creator', $pPHPExcel->getProperties()->getCreator()); + $objWriter->writeElement('dc:creator', $spreadsheet->getProperties()->getCreator()); // cp:lastModifiedBy - $objWriter->writeElement('cp:lastModifiedBy', $pPHPExcel->getProperties()->getLastModifiedBy()); + $objWriter->writeElement('cp:lastModifiedBy', $spreadsheet->getProperties()->getLastModifiedBy()); // dcterms:created $objWriter->startElement('dcterms:created'); $objWriter->writeAttribute('xsi:type', 'dcterms:W3CDTF'); - $objWriter->writeRawData(date(DATE_W3C, $pPHPExcel->getProperties()->getCreated())); + $objWriter->writeRawData(date(DATE_W3C, $spreadsheet->getProperties()->getCreated())); $objWriter->endElement(); // dcterms:modified $objWriter->startElement('dcterms:modified'); $objWriter->writeAttribute('xsi:type', 'dcterms:W3CDTF'); - $objWriter->writeRawData(date(DATE_W3C, $pPHPExcel->getProperties()->getModified())); + $objWriter->writeRawData(date(DATE_W3C, $spreadsheet->getProperties()->getModified())); $objWriter->endElement(); // dc:title - $objWriter->writeElement('dc:title', $pPHPExcel->getProperties()->getTitle()); + $objWriter->writeElement('dc:title', $spreadsheet->getProperties()->getTitle()); // dc:description - $objWriter->writeElement('dc:description', $pPHPExcel->getProperties()->getDescription()); + $objWriter->writeElement('dc:description', $spreadsheet->getProperties()->getDescription()); // dc:subject - $objWriter->writeElement('dc:subject', $pPHPExcel->getProperties()->getSubject()); + $objWriter->writeElement('dc:subject', $spreadsheet->getProperties()->getSubject()); // cp:keywords - $objWriter->writeElement('cp:keywords', $pPHPExcel->getProperties()->getKeywords()); + $objWriter->writeElement('cp:keywords', $spreadsheet->getProperties()->getKeywords()); // cp:category - $objWriter->writeElement('cp:category', $pPHPExcel->getProperties()->getCategory()); + $objWriter->writeElement('cp:category', $spreadsheet->getProperties()->getCategory()); $objWriter->endElement(); @@ -195,13 +192,13 @@ class DocProps extends WriterPart /** * Write docProps/custom.xml to XML format * - * @param \PHPExcel\SpreadSheet $pPHPExcel + * @param \PhpSpreadsheet\SpreadSheet $spreadsheet * @return string XML Output - * @throws \PHPExcel\Writer\Exception + * @throws \PhpSpreadsheet\Writer\Exception */ - public function writeDocPropsCustom(\PHPExcel\SpreadSheet $pPHPExcel = null) + public function writeDocPropsCustom(\PhpSpreadsheet\SpreadSheet $spreadsheet = null) { - $customPropertyList = $pPHPExcel->getProperties()->getCustomProperties(); + $customPropertyList = $spreadsheet->getProperties()->getCustomProperties(); if (empty($customPropertyList)) { return; } @@ -209,9 +206,9 @@ class DocProps extends WriterPart // Create XML writer $objWriter = null; if ($this->getParentWriter()->getUseDiskCaching()) { - $objWriter = new \PHPExcel\Shared\XMLWriter(\PHPExcel\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); + $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); } else { - $objWriter = new \PHPExcel\Shared\XMLWriter(\PHPExcel\Shared\XMLWriter::STORAGE_MEMORY); + $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_MEMORY); } // XML header @@ -224,8 +221,8 @@ class DocProps extends WriterPart foreach ($customPropertyList as $key => $customProperty) { - $propertyValue = $pPHPExcel->getProperties()->getCustomPropertyValue($customProperty); - $propertyType = $pPHPExcel->getProperties()->getCustomPropertyType($customProperty); + $propertyValue = $spreadsheet->getProperties()->getCustomPropertyValue($customProperty); + $propertyType = $spreadsheet->getProperties()->getCustomPropertyType($customProperty); $objWriter->startElement('property'); $objWriter->writeAttribute('fmtid', '{D5CDD505-2E9C-101B-9397-08002B2CF9AE}'); diff --git a/src/PhpSpreadsheet/Writer/Excel2007/Drawing.php b/src/PhpSpreadsheet/Writer/Excel2007/Drawing.php index f6240567..bab597f0 100644 --- a/src/PhpSpreadsheet/Writer/Excel2007/Drawing.php +++ b/src/PhpSpreadsheet/Writer/Excel2007/Drawing.php @@ -1,12 +1,10 @@ getParentWriter()->getUseDiskCaching()) { - $objWriter = new \PHPExcel\Shared\XMLWriter(\PHPExcel\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); + $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); } else { - $objWriter = new \PHPExcel\Shared\XMLWriter(\PHPExcel\Shared\XMLWriter::STORAGE_MEMORY); + $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_MEMORY); } // XML header @@ -86,31 +83,31 @@ class Drawing extends WriterPart /** * Write drawings to XML format * - * @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer + * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer * @param Chart $pChart * @param int $pRelationId - * @throws \PHPExcel\Writer\Exception + * @throws \PhpSpreadsheet\Writer\Exception */ - public function writeChart(\PHPExcel\Shared\XMLWriter $objWriter = null, Chart $pChart = null, $pRelationId = -1) + public function writeChart(\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, Chart $pChart = null, $pRelationId = -1) { $tl = $pChart->getTopLeftPosition(); - $tl['colRow'] = \PHPExcel\Cell::coordinateFromString($tl['cell']); + $tl['colRow'] = \PhpSpreadsheet\Cell::coordinateFromString($tl['cell']); $br = $pChart->getBottomRightPosition(); - $br['colRow'] = \PHPExcel\Cell::coordinateFromString($br['cell']); + $br['colRow'] = \PhpSpreadsheet\Cell::coordinateFromString($br['cell']); $objWriter->startElement('xdr:twoCellAnchor'); $objWriter->startElement('xdr:from'); - $objWriter->writeElement('xdr:col', \PHPExcel\Cell::columnIndexFromString($tl['colRow'][0]) - 1); - $objWriter->writeElement('xdr:colOff', \PHPExcel\Shared\Drawing::pixelsToEMU($tl['xOffset'])); + $objWriter->writeElement('xdr:col', \PhpSpreadsheet\Cell::columnIndexFromString($tl['colRow'][0]) - 1); + $objWriter->writeElement('xdr:colOff', \PhpSpreadsheet\Shared\Drawing::pixelsToEMU($tl['xOffset'])); $objWriter->writeElement('xdr:row', $tl['colRow'][1] - 1); - $objWriter->writeElement('xdr:rowOff', \PHPExcel\Shared\Drawing::pixelsToEMU($tl['yOffset'])); + $objWriter->writeElement('xdr:rowOff', \PhpSpreadsheet\Shared\Drawing::pixelsToEMU($tl['yOffset'])); $objWriter->endElement(); $objWriter->startElement('xdr:to'); - $objWriter->writeElement('xdr:col', \PHPExcel\Cell::columnIndexFromString($br['colRow'][0]) - 1); - $objWriter->writeElement('xdr:colOff', \PHPExcel\Shared\Drawing::pixelsToEMU($br['xOffset'])); + $objWriter->writeElement('xdr:col', \PhpSpreadsheet\Cell::columnIndexFromString($br['colRow'][0]) - 1); + $objWriter->writeElement('xdr:colOff', \PhpSpreadsheet\Shared\Drawing::pixelsToEMU($br['xOffset'])); $objWriter->writeElement('xdr:row', $br['colRow'][1] - 1); - $objWriter->writeElement('xdr:rowOff', \PHPExcel\Shared\Drawing::pixelsToEMU($br['yOffset'])); + $objWriter->writeElement('xdr:rowOff', \PhpSpreadsheet\Shared\Drawing::pixelsToEMU($br['yOffset'])); $objWriter->endElement(); $objWriter->startElement('xdr:graphicFrame'); @@ -158,32 +155,32 @@ class Drawing extends WriterPart /** * Write drawings to XML format * - * @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer - * @param \PHPExcel\Worksheet\BaseDrawing $pDrawing + * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpSpreadsheet\Worksheet\BaseDrawing $pDrawing * @param int $pRelationId - * @throws \PHPExcel\Writer\Exception + * @throws \PhpSpreadsheet\Writer\Exception */ - public function writeDrawing(\PHPExcel\Shared\XMLWriter $objWriter = null, \PHPExcel\Worksheet\BaseDrawing $pDrawing = null, $pRelationId = -1) + public function writeDrawing(\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpSpreadsheet\Worksheet\BaseDrawing $pDrawing = null, $pRelationId = -1) { if ($pRelationId >= 0) { // xdr:oneCellAnchor $objWriter->startElement('xdr:oneCellAnchor'); // Image location - $aCoordinates = \PHPExcel\Cell::coordinateFromString($pDrawing->getCoordinates()); - $aCoordinates[0] = \PHPExcel\Cell::columnIndexFromString($aCoordinates[0]); + $aCoordinates = \PhpSpreadsheet\Cell::coordinateFromString($pDrawing->getCoordinates()); + $aCoordinates[0] = \PhpSpreadsheet\Cell::columnIndexFromString($aCoordinates[0]); // xdr:from $objWriter->startElement('xdr:from'); $objWriter->writeElement('xdr:col', $aCoordinates[0] - 1); - $objWriter->writeElement('xdr:colOff', \PHPExcel\Shared\Drawing::pixelsToEMU($pDrawing->getOffsetX())); + $objWriter->writeElement('xdr:colOff', \PhpSpreadsheet\Shared\Drawing::pixelsToEMU($pDrawing->getOffsetX())); $objWriter->writeElement('xdr:row', $aCoordinates[1] - 1); - $objWriter->writeElement('xdr:rowOff', \PHPExcel\Shared\Drawing::pixelsToEMU($pDrawing->getOffsetY())); + $objWriter->writeElement('xdr:rowOff', \PhpSpreadsheet\Shared\Drawing::pixelsToEMU($pDrawing->getOffsetY())); $objWriter->endElement(); // xdr:ext $objWriter->startElement('xdr:ext'); - $objWriter->writeAttribute('cx', \PHPExcel\Shared\Drawing::pixelsToEMU($pDrawing->getWidth())); - $objWriter->writeAttribute('cy', \PHPExcel\Shared\Drawing::pixelsToEMU($pDrawing->getHeight())); + $objWriter->writeAttribute('cx', \PhpSpreadsheet\Shared\Drawing::pixelsToEMU($pDrawing->getWidth())); + $objWriter->writeAttribute('cy', \PhpSpreadsheet\Shared\Drawing::pixelsToEMU($pDrawing->getHeight())); $objWriter->endElement(); // xdr:pic @@ -232,7 +229,7 @@ class Drawing extends WriterPart // a:xfrm $objWriter->startElement('a:xfrm'); - $objWriter->writeAttribute('rot', \PHPExcel\Shared\Drawing::degreesToAngle($pDrawing->getRotation())); + $objWriter->writeAttribute('rot', \PhpSpreadsheet\Shared\Drawing::degreesToAngle($pDrawing->getRotation())); $objWriter->endElement(); // a:prstGeom @@ -291,9 +288,9 @@ class Drawing extends WriterPart // a:outerShdw $objWriter->startElement('a:outerShdw'); - $objWriter->writeAttribute('blurRad', \PHPExcel\Shared\Drawing::pixelsToEMU($pDrawing->getShadow()->getBlurRadius())); - $objWriter->writeAttribute('dist', \PHPExcel\Shared\Drawing::pixelsToEMU($pDrawing->getShadow()->getDistance())); - $objWriter->writeAttribute('dir', \PHPExcel\Shared\Drawing::degreesToAngle($pDrawing->getShadow()->getDirection())); + $objWriter->writeAttribute('blurRad', \PhpSpreadsheet\Shared\Drawing::pixelsToEMU($pDrawing->getShadow()->getBlurRadius())); + $objWriter->writeAttribute('dist', \PhpSpreadsheet\Shared\Drawing::pixelsToEMU($pDrawing->getShadow()->getDistance())); + $objWriter->writeAttribute('dir', \PhpSpreadsheet\Shared\Drawing::degreesToAngle($pDrawing->getShadow()->getDirection())); $objWriter->writeAttribute('algn', $pDrawing->getShadow()->getAlignment()); $objWriter->writeAttribute('rotWithShape', '0'); @@ -369,25 +366,25 @@ class Drawing extends WriterPart $objWriter->endElement(); } else { - throw new \PHPExcel\Writer\Exception("Invalid parameters passed."); + throw new \PhpSpreadsheet\Writer\Exception("Invalid parameters passed."); } } /** * Write VML header/footer images to XML format * - * @param \PHPExcel\Worksheet $pWorksheet + * @param \PhpSpreadsheet\Worksheet $pWorksheet * @return string XML Output - * @throws \PHPExcel\Writer\Exception + * @throws \PhpSpreadsheet\Writer\Exception */ - public function writeVMLHeaderFooterImages(\PHPExcel\Worksheet $pWorksheet = null) + public function writeVMLHeaderFooterImages(\PhpSpreadsheet\Worksheet $pWorksheet = null) { // Create XML writer $objWriter = null; if ($this->getParentWriter()->getUseDiskCaching()) { - $objWriter = new \PHPExcel\Shared\XMLWriter(\PHPExcel\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); + $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); } else { - $objWriter = new \PHPExcel\Shared\XMLWriter(\PHPExcel\Shared\XMLWriter::STORAGE_MEMORY); + $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_MEMORY); } // XML header @@ -523,12 +520,12 @@ class Drawing extends WriterPart /** * Write VML comment to XML format * - * @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer + * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer * @param string $pReference Reference - * @param \PHPExcel\Worksheet\HeaderFooterDrawing $pImage Image - * @throws \PHPExcel\Writer\Exception + * @param \PhpSpreadsheet\Worksheet\HeaderFooterDrawing $pImage Image + * @throws \PhpSpreadsheet\Writer\Exception */ - private function writeVMLHeaderFooterImage(\PHPExcel\Shared\XMLWriter $objWriter = null, $pReference = '', \PHPExcel\Worksheet\HeaderFooterDrawing $pImage = null) + private function writeVMLHeaderFooterImage(\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, $pReference = '', \PhpSpreadsheet\Worksheet\HeaderFooterDrawing $pImage = null) { // Calculate object id preg_match('{(\d+)}', md5($pReference), $m); @@ -566,20 +563,20 @@ class Drawing extends WriterPart /** * Get an array of all drawings * - * @param PHPExcel $pPHPExcel - * @return \PHPExcel\Worksheet\Drawing[] All drawings in PHPExcel - * @throws \PHPExcel\Writer\Exception + * @param \PhpSpreadsheet\SpreadSheet $spreadsheet + * @return \PhpSpreadsheet\Worksheet\Drawing[] All drawings in PhpSpreadsheet + * @throws \PhpSpreadsheet\Writer\Exception */ - public function allDrawings(\PHPExcel\SpreadSheet $pPHPExcel = null) + public function allDrawings(\PhpSpreadsheet\SpreadSheet $spreadsheet = null) { // Get an array of all drawings $aDrawings = array(); - // Loop through PHPExcel - $sheetCount = $pPHPExcel->getSheetCount(); + // Loop through PhpSpreadsheet + $sheetCount = $spreadsheet->getSheetCount(); for ($i = 0; $i < $sheetCount; ++$i) { // Loop through images and add to array - $iterator = $pPHPExcel->getSheet($i)->getDrawingCollection()->getIterator(); + $iterator = $spreadsheet->getSheet($i)->getDrawingCollection()->getIterator(); while ($iterator->valid()) { $aDrawings[] = $iterator->current(); diff --git a/src/PhpSpreadsheet/Writer/Excel2007/Rels.php b/src/PhpSpreadsheet/Writer/Excel2007/Rels.php index 7c5fc306..d8456dfe 100644 --- a/src/PhpSpreadsheet/Writer/Excel2007/Rels.php +++ b/src/PhpSpreadsheet/Writer/Excel2007/Rels.php @@ -1,10 +1,8 @@ getParentWriter()->getUseDiskCaching()) { - $objWriter = new \PHPExcel\Shared\XMLWriter(\PHPExcel\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); + $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); } else { - $objWriter = new \PHPExcel\Shared\XMLWriter(\PHPExcel\Shared\XMLWriter::STORAGE_MEMORY); + $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_MEMORY); } // XML header @@ -52,7 +49,7 @@ class Rels extends WriterPart $objWriter->startElement('Relationships'); $objWriter->writeAttribute('xmlns', 'http://schemas.openxmlformats.org/package/2006/relationships'); - $customPropertyList = $pPHPExcel->getProperties()->getCustomProperties(); + $customPropertyList = $spreadsheet->getProperties()->getCustomProperties(); if (!empty($customPropertyList)) { // Relationship docProps/app.xml $this->writeRelationship( @@ -87,12 +84,12 @@ class Rels extends WriterPart 'xl/workbook.xml' ); // a custom UI in workbook ? - if ($pPHPExcel->hasRibbon()) { + if ($spreadsheet->hasRibbon()) { $this->writeRelationShip( $objWriter, 5, 'http://schemas.microsoft.com/office/2006/relationships/ui/extensibility', - $pPHPExcel->getRibbonXMLData('target') + $spreadsheet->getRibbonXMLData('target') ); } @@ -104,18 +101,18 @@ class Rels extends WriterPart /** * Write workbook relationships to XML format * - * @param \PHPExcel\SpreadSheet $pPHPExcel + * @param \PhpSpreadsheet\SpreadSheet $spreadsheet * @return string XML Output - * @throws \PHPExcel\Writer\Exception + * @throws \PhpSpreadsheet\Writer\Exception */ - public function writeWorkbookRelationships(\PHPExcel\SpreadSheet $pPHPExcel = null) + public function writeWorkbookRelationships(\PhpSpreadsheet\SpreadSheet $spreadsheet = null) { // Create XML writer $objWriter = null; if ($this->getParentWriter()->getUseDiskCaching()) { - $objWriter = new \PHPExcel\Shared\XMLWriter(\PHPExcel\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); + $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); } else { - $objWriter = new \PHPExcel\Shared\XMLWriter(\PHPExcel\Shared\XMLWriter::STORAGE_MEMORY); + $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_MEMORY); } // XML header @@ -150,7 +147,7 @@ class Rels extends WriterPart ); // Relationships with sheets - $sheetCount = $pPHPExcel->getSheetCount(); + $sheetCount = $spreadsheet->getSheetCount(); for ($i = 0; $i < $sheetCount; ++$i) { $this->writeRelationship( $objWriter, @@ -161,7 +158,7 @@ class Rels extends WriterPart } // Relationships for vbaProject if needed // id : just after the last sheet - if ($pPHPExcel->hasMacros()) { + if ($spreadsheet->hasMacros()) { $this->writeRelationShip( $objWriter, ($i + 1 + 3), @@ -183,20 +180,20 @@ class Rels extends WriterPart * rId1 - Drawings * rId_hyperlink_x - Hyperlinks * - * @param \PHPExcel\Worksheet $pWorksheet + * @param \PhpSpreadsheet\Worksheet $pWorksheet * @param int $pWorksheetId * @param boolean $includeCharts Flag indicating if we should write charts * @return string XML Output - * @throws \PHPExcel\Writer\Exception + * @throws \PhpSpreadsheet\Writer\Exception */ - public function writeWorksheetRelationships(\PHPExcel\Worksheet $pWorksheet = null, $pWorksheetId = 1, $includeCharts = false) + public function writeWorksheetRelationships(\PhpSpreadsheet\Worksheet $pWorksheet = null, $pWorksheetId = 1, $includeCharts = false) { // Create XML writer $objWriter = null; if ($this->getParentWriter()->getUseDiskCaching()) { - $objWriter = new \PHPExcel\Shared\XMLWriter(\PHPExcel\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); + $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); } else { - $objWriter = new \PHPExcel\Shared\XMLWriter(\PHPExcel\Shared\XMLWriter::STORAGE_MEMORY); + $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_MEMORY); } // XML header @@ -291,20 +288,20 @@ class Rels extends WriterPart /** * Write drawing relationships to XML format * - * @param \PHPExcel\Worksheet $pWorksheet + * @param \PhpSpreadsheet\Worksheet $pWorksheet * @param int &$chartRef Chart ID * @param boolean $includeCharts Flag indicating if we should write charts * @return string XML Output - * @throws \PHPExcel\Writer\Exception + * @throws \PhpSpreadsheet\Writer\Exception */ - public function writeDrawingRelationships(\PHPExcel\Worksheet $pWorksheet, &$chartRef, $includeCharts = false) + public function writeDrawingRelationships(\PhpSpreadsheet\Worksheet $pWorksheet, &$chartRef, $includeCharts = false) { // Create XML writer $objWriter = null; if ($this->getParentWriter()->getUseDiskCaching()) { - $objWriter = new \PHPExcel\Shared\XMLWriter(\PHPExcel\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); + $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); } else { - $objWriter = new \PHPExcel\Shared\XMLWriter(\PHPExcel\Shared\XMLWriter::STORAGE_MEMORY); + $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_MEMORY); } // XML header @@ -318,8 +315,8 @@ class Rels extends WriterPart $i = 1; $iterator = $pWorksheet->getDrawingCollection()->getIterator(); while ($iterator->valid()) { - if ($iterator->current() instanceof \PHPExcel\Worksheet\Drawing - || $iterator->current() instanceof \PHPExcel\Worksheet\MemoryDrawing) { + if ($iterator->current() instanceof \PhpSpreadsheet\Worksheet\Drawing + || $iterator->current() instanceof \PhpSpreadsheet\Worksheet\MemoryDrawing) { // Write relationship for image drawing $this->writeRelationship( $objWriter, @@ -356,18 +353,18 @@ class Rels extends WriterPart /** * Write header/footer drawing relationships to XML format * - * @param \PHPExcel\Worksheet $pWorksheet + * @param \PhpSpreadsheet\Worksheet $pWorksheet * @return string XML Output - * @throws \PHPExcel\Writer\Exception + * @throws \PhpSpreadsheet\Writer\Exception */ - public function writeHeaderFooterDrawingRelationships(\PHPExcel\Worksheet $pWorksheet = null) + public function writeHeaderFooterDrawingRelationships(\PhpSpreadsheet\Worksheet $pWorksheet = null) { // Create XML writer $objWriter = null; if ($this->getParentWriter()->getUseDiskCaching()) { - $objWriter = new \PHPExcel\Shared\XMLWriter(\PHPExcel\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); + $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); } else { - $objWriter = new \PHPExcel\Shared\XMLWriter(\PHPExcel\Shared\XMLWriter::STORAGE_MEMORY); + $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_MEMORY); } // XML header @@ -396,14 +393,14 @@ class Rels extends WriterPart /** * Write Override content type * - * @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer + * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer * @param int $pId Relationship ID. rId will be prepended! * @param string $pType Relationship type * @param string $pTarget Relationship target * @param string $pTargetMode Relationship target mode - * @throws \PHPExcel\Writer\Exception + * @throws \PhpSpreadsheet\Writer\Exception */ - private function writeRelationship(\PHPExcel\Shared\XMLWriter $objWriter = null, $pId = 1, $pType = '', $pTarget = '', $pTargetMode = '') + private function writeRelationship(\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, $pId = 1, $pType = '', $pTarget = '', $pTargetMode = '') { if ($pType != '' && $pTarget != '') { // Write relationship @@ -418,7 +415,7 @@ class Rels extends WriterPart $objWriter->endElement(); } else { - throw new \PHPExcel\Writer\Exception("Invalid parameters passed."); + throw new \PhpSpreadsheet\Writer\Exception("Invalid parameters passed."); } } } diff --git a/src/PhpSpreadsheet/Writer/Excel2007/RelsRibbon.php b/src/PhpSpreadsheet/Writer/Excel2007/RelsRibbon.php index 95a7af37..b66f7548 100644 --- a/src/PhpSpreadsheet/Writer/Excel2007/RelsRibbon.php +++ b/src/PhpSpreadsheet/Writer/Excel2007/RelsRibbon.php @@ -1,10 +1,8 @@ getParentWriter()->getUseDiskCaching()) { - $objWriter = new \PHPExcel\Shared\XMLWriter(\PHPExcel\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); + $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); } else { - $objWriter = new \PHPExcel\Shared\XMLWriter(\PHPExcel\Shared\XMLWriter::STORAGE_MEMORY); + $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_MEMORY); } // XML header @@ -51,7 +48,7 @@ class RelsRibbon extends WriterPart // Relationships $objWriter->startElement('Relationships'); $objWriter->writeAttribute('xmlns', 'http://schemas.openxmlformats.org/package/2006/relationships'); - $localRels = $pPHPExcel->getRibbonBinObjects('names'); + $localRels = $spreadsheet->getRibbonBinObjects('names'); if (is_array($localRels)) { foreach ($localRels as $aId => $aTarget) { $objWriter->startElement('Relationship'); diff --git a/src/PhpSpreadsheet/Writer/Excel2007/RelsVBA.php b/src/PhpSpreadsheet/Writer/Excel2007/RelsVBA.php index bae1f425..147ad5e4 100644 --- a/src/PhpSpreadsheet/Writer/Excel2007/RelsVBA.php +++ b/src/PhpSpreadsheet/Writer/Excel2007/RelsVBA.php @@ -1,10 +1,8 @@ getParentWriter()->getUseDiskCaching()) { - $objWriter = new \PHPExcel\Shared\XMLWriter(\PHPExcel\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); + $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); } else { - $objWriter = new \PHPExcel\Shared\XMLWriter(\PHPExcel\Shared\XMLWriter::STORAGE_MEMORY); + $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_MEMORY); } // XML header diff --git a/src/PhpSpreadsheet/Writer/Excel2007/StringTable.php b/src/PhpSpreadsheet/Writer/Excel2007/StringTable.php index d0791582..2b02ea80 100644 --- a/src/PhpSpreadsheet/Writer/Excel2007/StringTable.php +++ b/src/PhpSpreadsheet/Writer/Excel2007/StringTable.php @@ -1,11 +1,9 @@ getDataType() == \PHPExcel\Cell\DataType::TYPE_STRING || $cell->getDataType() == \PHPExcel\Cell\DataType::TYPE_STRING2 || $cell->getDataType() == \PHPExcel\Cell\DataType::TYPE_NULL)) { + ($cell->getDataType() == \PhpSpreadsheet\Cell\DataType::TYPE_STRING || $cell->getDataType() == \PhpSpreadsheet\Cell\DataType::TYPE_STRING2 || $cell->getDataType() == \PhpSpreadsheet\Cell\DataType::TYPE_NULL)) { $aStringTable[] = $cellValue; $aFlippedStringTable[$cellValue] = true; - } elseif ($cellValue instanceof \PHPExcel\RichText && + } elseif ($cellValue instanceof \PhpSpreadsheet\RichText && ($cellValue !== null) && !isset($aFlippedStringTable[$cellValue->getHashCode()])) { $aStringTable[] = $cellValue; @@ -74,7 +71,7 @@ class StringTable extends WriterPart return $aStringTable; } else { - throw new \PHPExcel\Writer\Exception("Invalid \PHPExcel\Worksheet object passed."); + throw new \PhpSpreadsheet\Writer\Exception("Invalid \PhpSpreadsheet\Worksheet object passed."); } } @@ -83,7 +80,7 @@ class StringTable extends WriterPart * * @param string[] $pStringTable * @return string XML Output - * @throws \PHPExcel\Writer\Exception + * @throws \PhpSpreadsheet\Writer\Exception */ public function writeStringTable($pStringTable = null) { @@ -91,9 +88,9 @@ class StringTable extends WriterPart // Create XML writer $objWriter = null; if ($this->getParentWriter()->getUseDiskCaching()) { - $objWriter = new \PHPExcel\Shared\XMLWriter(\PHPExcel\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); + $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); } else { - $objWriter = new \PHPExcel\Shared\XMLWriter(\PHPExcel\Shared\XMLWriter::STORAGE_MEMORY); + $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_MEMORY); } // XML header @@ -108,15 +105,15 @@ class StringTable extends WriterPart foreach ($pStringTable as $textElement) { $objWriter->startElement('si'); - if (! $textElement instanceof \PHPExcel\RichText) { - $textToWrite = \PHPExcel\Shared\StringHelper::controlCharacterPHP2OOXML($textElement); + if (! $textElement instanceof \PhpSpreadsheet\RichText) { + $textToWrite = \PhpSpreadsheet\Shared\StringHelper::controlCharacterPHP2OOXML($textElement); $objWriter->startElement('t'); if ($textToWrite !== trim($textToWrite)) { $objWriter->writeAttribute('xml:space', 'preserve'); } $objWriter->writeRawData($textToWrite); $objWriter->endElement(); - } elseif ($textElement instanceof \PHPExcel\RichText) { + } elseif ($textElement instanceof \PhpSpreadsheet\RichText) { $this->writeRichText($objWriter, $textElement); } @@ -127,19 +124,19 @@ class StringTable extends WriterPart return $objWriter->getData(); } else { - throw new \PHPExcel\Writer\Exception("Invalid string table array passed."); + throw new \PhpSpreadsheet\Writer\Exception("Invalid string table array passed."); } } /** * Write Rich Text * - * @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer - * @param \PHPExcel\RichText $pRichText Rich text + * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpSpreadsheet\RichText $pRichText Rich text * @param string $prefix Optional Namespace prefix - * @throws \PHPExcel\Writer\Exception + * @throws \PhpSpreadsheet\Writer\Exception */ - public function writeRichText(\PHPExcel\Shared\XMLWriter $objWriter = null, \PHPExcel\RichText $pRichText = null, $prefix = null) + public function writeRichText(\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpSpreadsheet\RichText $pRichText = null, $prefix = null) { if ($prefix !== null) { $prefix .= ':'; @@ -152,7 +149,7 @@ class StringTable extends WriterPart $objWriter->startElement($prefix.'r'); // rPr - if ($element instanceof \PHPExcel\RichText\Run) { + if ($element instanceof \PhpSpreadsheet\RichText\Run) { // rPr $objWriter->startElement($prefix.'rPr'); @@ -208,7 +205,7 @@ class StringTable extends WriterPart // t $objWriter->startElement($prefix.'t'); $objWriter->writeAttribute('xml:space', 'preserve'); - $objWriter->writeRawData(\PHPExcel\Shared\StringHelper::controlCharacterPHP2OOXML($element->getText())); + $objWriter->writeRawData(\PhpSpreadsheet\Shared\StringHelper::controlCharacterPHP2OOXML($element->getText())); $objWriter->endElement(); $objWriter->endElement(); @@ -218,16 +215,16 @@ class StringTable extends WriterPart /** * Write Rich Text * - * @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer - * @param string|\PHPExcel\RichText $pRichText text string or Rich text + * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param string|\PhpSpreadsheet\RichText $pRichText text string or Rich text * @param string $prefix Optional Namespace prefix - * @throws \PHPExcel\Writer\Exception + * @throws \PhpSpreadsheet\Writer\Exception */ - public function writeRichTextForCharts(\PHPExcel\Shared\XMLWriter $objWriter = null, $pRichText = null, $prefix = null) + public function writeRichTextForCharts(\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, $pRichText = null, $prefix = null) { - if (!$pRichText instanceof \PHPExcel\RichText) { + if (!$pRichText instanceof \PhpSpreadsheet\RichText) { $textRun = $pRichText; - $pRichText = new \PHPExcel\RichText(); + $pRichText = new \PhpSpreadsheet\RichText(); $pRichText->createTextRun($textRun); } @@ -283,7 +280,7 @@ class StringTable extends WriterPart // t $objWriter->startElement($prefix.'t'); // $objWriter->writeAttribute('xml:space', 'preserve'); // Excel2010 accepts, Excel2007 complains - $objWriter->writeRawData(\PHPExcel\Shared\StringHelper::controlCharacterPHP2OOXML($element->getText())); + $objWriter->writeRawData(\PhpSpreadsheet\Shared\StringHelper::controlCharacterPHP2OOXML($element->getText())); $objWriter->endElement(); $objWriter->endElement(); @@ -303,9 +300,9 @@ class StringTable extends WriterPart // Loop through stringtable and add flipped items to $returnValue foreach ($stringTable as $key => $value) { - if (! $value instanceof \PHPExcel\RichText) { + if (! $value instanceof \PhpSpreadsheet\RichText) { $returnValue[$value] = $key; - } elseif ($value instanceof \PHPExcel\RichText) { + } elseif ($value instanceof \PhpSpreadsheet\RichText) { $returnValue[$value->getHashCode()] = $key; } } diff --git a/src/PhpSpreadsheet/Writer/Excel2007/Style.php b/src/PhpSpreadsheet/Writer/Excel2007/Style.php index 6f2c931d..180a4b79 100644 --- a/src/PhpSpreadsheet/Writer/Excel2007/Style.php +++ b/src/PhpSpreadsheet/Writer/Excel2007/Style.php @@ -1,10 +1,8 @@ getParentWriter()->getUseDiskCaching()) { - $objWriter = new \PHPExcel\Shared\XMLWriter(\PHPExcel\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); + $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); } else { - $objWriter = new \PHPExcel\Shared\XMLWriter(\PHPExcel\Shared\XMLWriter::STORAGE_MEMORY); + $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_MEMORY); } // XML header @@ -113,11 +110,11 @@ class Style extends WriterPart // cellXfs $objWriter->startElement('cellXfs'); - $objWriter->writeAttribute('count', count($pPHPExcel->getCellXfCollection())); + $objWriter->writeAttribute('count', count($spreadsheet->getCellXfCollection())); // xf - foreach ($pPHPExcel->getCellXfCollection() as $cellXf) { - $this->writeCellStyleXf($objWriter, $cellXf, $pPHPExcel); + foreach ($spreadsheet->getCellXfCollection() as $cellXf) { + $this->writeCellStyleXf($objWriter, $cellXf, $spreadsheet); } $objWriter->endElement(); @@ -161,15 +158,15 @@ class Style extends WriterPart /** * Write Fill * - * @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer - * @param \PHPExcel\Style\Fill $pFill Fill style - * @throws \PHPExcel\Writer\Exception + * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpSpreadsheet\Style\Fill $pFill Fill style + * @throws \PhpSpreadsheet\Writer\Exception */ - private function writeFill(\PHPExcel\Shared\XMLWriter $objWriter = null, \PHPExcel\Style\Fill $pFill = null) + private function writeFill(\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpSpreadsheet\Style\Fill $pFill = null) { // Check if this is a pattern type or gradient type - if ($pFill->getFillType() === \PHPExcel\Style\Fill::FILL_GRADIENT_LINEAR || - $pFill->getFillType() === \PHPExcel\Style\Fill::FILL_GRADIENT_PATH) { + if ($pFill->getFillType() === \PhpSpreadsheet\Style\Fill::FILL_GRADIENT_LINEAR || + $pFill->getFillType() === \PhpSpreadsheet\Style\Fill::FILL_GRADIENT_PATH) { // Gradient fill $this->writeGradientFill($objWriter, $pFill); } elseif ($pFill->getFillType() !== null) { @@ -181,11 +178,11 @@ class Style extends WriterPart /** * Write Gradient Fill * - * @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer - * @param \PHPExcel\Style\Fill $pFill Fill style - * @throws \PHPExcel\Writer\Exception + * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpSpreadsheet\Style\Fill $pFill Fill style + * @throws \PhpSpreadsheet\Writer\Exception */ - private function writeGradientFill(\PHPExcel\Shared\XMLWriter $objWriter = null, \PHPExcel\Style\Fill $pFill = null) + private function writeGradientFill(\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpSpreadsheet\Style\Fill $pFill = null) { // fill $objWriter->startElement('fill'); @@ -225,11 +222,11 @@ class Style extends WriterPart /** * Write Pattern Fill * - * @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer - * @param \PHPExcel\Style\Fill $pFill Fill style - * @throws \PHPExcel\Writer\Exception + * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpSpreadsheet\Style\Fill $pFill Fill style + * @throws \PhpSpreadsheet\Writer\Exception */ - private function writePatternFill(\PHPExcel\Shared\XMLWriter $objWriter = null, \PHPExcel\Style\Fill $pFill = null) + private function writePatternFill(\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpSpreadsheet\Style\Fill $pFill = null) { // fill $objWriter->startElement('fill'); @@ -238,7 +235,7 @@ class Style extends WriterPart $objWriter->startElement('patternFill'); $objWriter->writeAttribute('patternType', $pFill->getFillType()); - if ($pFill->getFillType() !== \PHPExcel\Style\Fill::FILL_NONE) { + if ($pFill->getFillType() !== \PhpSpreadsheet\Style\Fill::FILL_NONE) { // fgColor if ($pFill->getStartColor()->getARGB()) { $objWriter->startElement('fgColor'); @@ -246,7 +243,7 @@ class Style extends WriterPart $objWriter->endElement(); } } - if ($pFill->getFillType() !== \PHPExcel\Style\Fill::FILL_NONE) { + if ($pFill->getFillType() !== \PhpSpreadsheet\Style\Fill::FILL_NONE) { // bgColor if ($pFill->getEndColor()->getARGB()) { $objWriter->startElement('bgColor'); @@ -263,11 +260,11 @@ class Style extends WriterPart /** * Write Font * - * @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer - * @param \PHPExcel\Style\Font $pFont Font style - * @throws \PHPExcel\Writer\Exception + * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpSpreadsheet\Style\Font $pFont Font style + * @throws \PhpSpreadsheet\Writer\Exception */ - private function writeFont(\PHPExcel\Shared\XMLWriter $objWriter = null, \PHPExcel\Style\Font $pFont = null) + private function writeFont(\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpSpreadsheet\Style\Font $pFont = null) { // font $objWriter->startElement('font'); @@ -343,25 +340,25 @@ class Style extends WriterPart /** * Write Border * - * @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer - * @param \PHPExcel\Style\Borders $pBorders Borders style - * @throws \PHPExcel\Writer\Exception + * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpSpreadsheet\Style\Borders $pBorders Borders style + * @throws \PhpSpreadsheet\Writer\Exception */ - private function writeBorder(\PHPExcel\Shared\XMLWriter $objWriter = null, \PHPExcel\Style\Borders $pBorders = null) + private function writeBorder(\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpSpreadsheet\Style\Borders $pBorders = null) { // Write border $objWriter->startElement('border'); // Diagonal? switch ($pBorders->getDiagonalDirection()) { - case \PHPExcel\Style\Borders::DIAGONAL_UP: + case \PhpSpreadsheet\Style\Borders::DIAGONAL_UP: $objWriter->writeAttribute('diagonalUp', 'true'); $objWriter->writeAttribute('diagonalDown', 'false'); break; - case \PHPExcel\Style\Borders::DIAGONAL_DOWN: + case \PhpSpreadsheet\Style\Borders::DIAGONAL_DOWN: $objWriter->writeAttribute('diagonalUp', 'false'); $objWriter->writeAttribute('diagonalDown', 'true'); break; - case \PHPExcel\Style\Borders::DIAGONAL_BOTH: + case \PhpSpreadsheet\Style\Borders::DIAGONAL_BOTH: $objWriter->writeAttribute('diagonalUp', 'true'); $objWriter->writeAttribute('diagonalDown', 'true'); break; @@ -379,12 +376,12 @@ class Style extends WriterPart /** * Write Cell Style Xf * - * @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer - * @param \PHPExcel\Style $pStyle Style - * @param \PHPExcel\SpreadSheet $pPHPExcel Workbook - * @throws \PHPExcel\Writer\Exception + * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpSpreadsheet\Style $pStyle Style + * @param \PhpSpreadsheet\SpreadSheet $spreadsheet Workbook + * @throws \PhpSpreadsheet\Writer\Exception */ - private function writeCellStyleXf(\PHPExcel\Shared\XMLWriter $objWriter = null, \PHPExcel\Style $pStyle = null, \PHPExcel\SpreadSheet $pPHPExcel = null) + private function writeCellStyleXf(\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpSpreadsheet\Style $pStyle = null, \PhpSpreadsheet\SpreadSheet $spreadsheet = null) { // xf $objWriter->startElement('xf'); @@ -404,12 +401,12 @@ class Style extends WriterPart $objWriter->writeAttribute('borderId', (int)$this->getParentWriter()->getBordersHashTable()->getIndexForHashCode($pStyle->getBorders()->getHashCode())); // Apply styles? - $objWriter->writeAttribute('applyFont', ($pPHPExcel->getDefaultStyle()->getFont()->getHashCode() != $pStyle->getFont()->getHashCode()) ? '1' : '0'); - $objWriter->writeAttribute('applyNumberFormat', ($pPHPExcel->getDefaultStyle()->getNumberFormat()->getHashCode() != $pStyle->getNumberFormat()->getHashCode()) ? '1' : '0'); - $objWriter->writeAttribute('applyFill', ($pPHPExcel->getDefaultStyle()->getFill()->getHashCode() != $pStyle->getFill()->getHashCode()) ? '1' : '0'); - $objWriter->writeAttribute('applyBorder', ($pPHPExcel->getDefaultStyle()->getBorders()->getHashCode() != $pStyle->getBorders()->getHashCode()) ? '1' : '0'); - $objWriter->writeAttribute('applyAlignment', ($pPHPExcel->getDefaultStyle()->getAlignment()->getHashCode() != $pStyle->getAlignment()->getHashCode()) ? '1' : '0'); - if ($pStyle->getProtection()->getLocked() != \PHPExcel\Style\Protection::PROTECTION_INHERIT || $pStyle->getProtection()->getHidden() != \PHPExcel\Style\Protection::PROTECTION_INHERIT) { + $objWriter->writeAttribute('applyFont', ($spreadsheet->getDefaultStyle()->getFont()->getHashCode() != $pStyle->getFont()->getHashCode()) ? '1' : '0'); + $objWriter->writeAttribute('applyNumberFormat', ($spreadsheet->getDefaultStyle()->getNumberFormat()->getHashCode() != $pStyle->getNumberFormat()->getHashCode()) ? '1' : '0'); + $objWriter->writeAttribute('applyFill', ($spreadsheet->getDefaultStyle()->getFill()->getHashCode() != $pStyle->getFill()->getHashCode()) ? '1' : '0'); + $objWriter->writeAttribute('applyBorder', ($spreadsheet->getDefaultStyle()->getBorders()->getHashCode() != $pStyle->getBorders()->getHashCode()) ? '1' : '0'); + $objWriter->writeAttribute('applyAlignment', ($spreadsheet->getDefaultStyle()->getAlignment()->getHashCode() != $pStyle->getAlignment()->getHashCode()) ? '1' : '0'); + if ($pStyle->getProtection()->getLocked() != \PhpSpreadsheet\Style\Protection::PROTECTION_INHERIT || $pStyle->getProtection()->getHidden() != \PhpSpreadsheet\Style\Protection::PROTECTION_INHERIT) { $objWriter->writeAttribute('applyProtection', 'true'); } @@ -438,13 +435,13 @@ class Style extends WriterPart $objWriter->endElement(); // protection - if ($pStyle->getProtection()->getLocked() != \PHPExcel\Style\Protection::PROTECTION_INHERIT || $pStyle->getProtection()->getHidden() != \PHPExcel\Style\Protection::PROTECTION_INHERIT) { + if ($pStyle->getProtection()->getLocked() != \PhpSpreadsheet\Style\Protection::PROTECTION_INHERIT || $pStyle->getProtection()->getHidden() != \PhpSpreadsheet\Style\Protection::PROTECTION_INHERIT) { $objWriter->startElement('protection'); - if ($pStyle->getProtection()->getLocked() != \PHPExcel\Style\Protection::PROTECTION_INHERIT) { - $objWriter->writeAttribute('locked', ($pStyle->getProtection()->getLocked() == \PHPExcel\Style\Protection::PROTECTION_PROTECTED ? 'true' : 'false')); + if ($pStyle->getProtection()->getLocked() != \PhpSpreadsheet\Style\Protection::PROTECTION_INHERIT) { + $objWriter->writeAttribute('locked', ($pStyle->getProtection()->getLocked() == \PhpSpreadsheet\Style\Protection::PROTECTION_PROTECTED ? 'true' : 'false')); } - if ($pStyle->getProtection()->getHidden() != \PHPExcel\Style\Protection::PROTECTION_INHERIT) { - $objWriter->writeAttribute('hidden', ($pStyle->getProtection()->getHidden() == \PHPExcel\Style\Protection::PROTECTION_PROTECTED ? 'true' : 'false')); + if ($pStyle->getProtection()->getHidden() != \PhpSpreadsheet\Style\Protection::PROTECTION_INHERIT) { + $objWriter->writeAttribute('hidden', ($pStyle->getProtection()->getHidden() == \PhpSpreadsheet\Style\Protection::PROTECTION_PROTECTED ? 'true' : 'false')); } $objWriter->endElement(); } @@ -455,11 +452,11 @@ class Style extends WriterPart /** * Write Cell Style Dxf * - * @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer - * @param \PHPExcel\Style $pStyle Style - * @throws \PHPExcel\Writer\Exception + * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpSpreadsheet\Style $pStyle Style + * @throws \PhpSpreadsheet\Writer\Exception */ - private function writeCellStyleDxf(\PHPExcel\Shared\XMLWriter $objWriter = null, \PHPExcel\Style $pStyle = null) + private function writeCellStyleDxf(\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpSpreadsheet\Style $pStyle = null) { // dxf $objWriter->startElement('dxf'); @@ -498,16 +495,16 @@ class Style extends WriterPart // protection if (($pStyle->getProtection()->getLocked() !== null) || ($pStyle->getProtection()->getHidden() !== null)) { - if ($pStyle->getProtection()->getLocked() !== \PHPExcel\Style\Protection::PROTECTION_INHERIT || - $pStyle->getProtection()->getHidden() !== \PHPExcel\Style\Protection::PROTECTION_INHERIT) { + if ($pStyle->getProtection()->getLocked() !== \PhpSpreadsheet\Style\Protection::PROTECTION_INHERIT || + $pStyle->getProtection()->getHidden() !== \PhpSpreadsheet\Style\Protection::PROTECTION_INHERIT) { $objWriter->startElement('protection'); if (($pStyle->getProtection()->getLocked() !== null) && - ($pStyle->getProtection()->getLocked() !== \PHPExcel\Style\Protection::PROTECTION_INHERIT)) { - $objWriter->writeAttribute('locked', ($pStyle->getProtection()->getLocked() == \PHPExcel\Style\Protection::PROTECTION_PROTECTED ? 'true' : 'false')); + ($pStyle->getProtection()->getLocked() !== \PhpSpreadsheet\Style\Protection::PROTECTION_INHERIT)) { + $objWriter->writeAttribute('locked', ($pStyle->getProtection()->getLocked() == \PhpSpreadsheet\Style\Protection::PROTECTION_PROTECTED ? 'true' : 'false')); } if (($pStyle->getProtection()->getHidden() !== null) && - ($pStyle->getProtection()->getHidden() !== \PHPExcel\Style\Protection::PROTECTION_INHERIT)) { - $objWriter->writeAttribute('hidden', ($pStyle->getProtection()->getHidden() == \PHPExcel\Style\Protection::PROTECTION_PROTECTED ? 'true' : 'false')); + ($pStyle->getProtection()->getHidden() !== \PhpSpreadsheet\Style\Protection::PROTECTION_INHERIT)) { + $objWriter->writeAttribute('hidden', ($pStyle->getProtection()->getHidden() == \PhpSpreadsheet\Style\Protection::PROTECTION_PROTECTED ? 'true' : 'false')); } $objWriter->endElement(); } @@ -519,15 +516,15 @@ class Style extends WriterPart /** * Write BorderPr * - * @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer + * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer * @param string $pName Element name - * @param \PHPExcel\Style\Border $pBorder Border style - * @throws \PHPExcel\Writer\Exception + * @param \PhpSpreadsheet\Style\Border $pBorder Border style + * @throws \PhpSpreadsheet\Writer\Exception */ - private function writeBorderPr(\PHPExcel\Shared\XMLWriter $objWriter = null, $pName = 'left', \PHPExcel\Style\Border $pBorder = null) + private function writeBorderPr(\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, $pName = 'left', \PhpSpreadsheet\Style\Border $pBorder = null) { // Write BorderPr - if ($pBorder->getBorderStyle() != \PHPExcel\Style\Border::BORDER_NONE) { + if ($pBorder->getBorderStyle() != \PhpSpreadsheet\Style\Border::BORDER_NONE) { $objWriter->startElement($pName); $objWriter->writeAttribute('style', $pBorder->getBorderStyle()); @@ -543,12 +540,12 @@ class Style extends WriterPart /** * Write NumberFormat * - * @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer - * @param \PHPExcel\Style\NumberFormat $pNumberFormat Number Format + * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpSpreadsheet\Style\NumberFormat $pNumberFormat Number Format * @param int $pId Number Format identifier - * @throws \PHPExcel\Writer\Exception + * @throws \PhpSpreadsheet\Writer\Exception */ - private function writeNumFmt(\PHPExcel\Shared\XMLWriter $objWriter = null, \PHPExcel\Style\NumberFormat $pNumberFormat = null, $pId = 0) + private function writeNumFmt(\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpSpreadsheet\Style\NumberFormat $pNumberFormat = null, $pId = 0) { // Translate formatcode $formatCode = $pNumberFormat->getFormatCode(); @@ -565,30 +562,30 @@ class Style extends WriterPart /** * Get an array of all styles * - * @param PHPExcel $pPHPExcel - * @return PHPExcel_Style[] All styles in PHPExcel - * @throws \PHPExcel\Writer\Exception + * @param \PhpSpreadsheet\Spreadsheet $spreadsheet + * @return \PhpSpreadsheet\Style[] All styles in PhpSpreadsheet + * @throws \PhpSpreadsheet\Writer\Exception */ - public function allStyles(\PHPExcel\SpreadSheet $pPHPExcel = null) + public function allStyles(\PhpSpreadsheet\SpreadSheet $spreadsheet = null) { - return $pPHPExcel->getCellXfCollection(); + return $spreadsheet->getCellXfCollection(); } /** * Get an array of all conditional styles * - * @param \PHPExcel\SpreadSheet $pPHPExcel - * @return \PHPExcel\Style\Conditional[] All conditional styles in PHPExcel - * @throws \PHPExcel\Writer\Exception + * @param \PhpSpreadsheet\SpreadSheet $spreadsheet + * @return \PhpSpreadsheet\Style\Conditional[] All conditional styles in PhpSpreadsheet + * @throws \PhpSpreadsheet\Writer\Exception */ - public function allConditionalStyles(\PHPExcel\SpreadSheet $pPHPExcel = null) + public function allConditionalStyles(\PhpSpreadsheet\SpreadSheet $spreadsheet = null) { // Get an array of all styles $aStyles = array(); - $sheetCount = $pPHPExcel->getSheetCount(); + $sheetCount = $spreadsheet->getSheetCount(); for ($i = 0; $i < $sheetCount; ++$i) { - foreach ($pPHPExcel->getSheet($i)->getConditionalStylesCollection() as $conditionalStyles) { + foreach ($spreadsheet->getSheet($i)->getConditionalStylesCollection() as $conditionalStyles) { foreach ($conditionalStyles as $conditionalStyle) { $aStyles[] = $conditionalStyle; } @@ -601,26 +598,26 @@ class Style extends WriterPart /** * Get an array of all fills * - * @param \PHPExcel\SpreadSheet $pPHPExcel - * @return \PHPExcel\Style\Fill[] All fills in PHPExcel - * @throws \PHPExcel\Writer\Exception + * @param \PhpSpreadsheet\SpreadSheet $spreadsheet + * @return \PhpSpreadsheet\Style\Fill[] All fills in PhpSpreadsheet + * @throws \PhpSpreadsheet\Writer\Exception */ - public function allFills(\PHPExcel\SpreadSheet $pPHPExcel = null) + public function allFills(\PhpSpreadsheet\SpreadSheet $spreadsheet = null) { // Get an array of unique fills $aFills = array(); // Two first fills are predefined - $fill0 = new \PHPExcel\Style\Fill(); - $fill0->setFillType(\PHPExcel\Style\Fill::FILL_NONE); + $fill0 = new \PhpSpreadsheet\Style\Fill(); + $fill0->setFillType(\PhpSpreadsheet\Style\Fill::FILL_NONE); $aFills[] = $fill0; - $fill1 = new \PHPExcel\Style\Fill(); - $fill1->setFillType(\PHPExcel\Style\Fill::FILL_PATTERN_GRAY125); + $fill1 = new \PhpSpreadsheet\Style\Fill(); + $fill1->setFillType(\PhpSpreadsheet\Style\Fill::FILL_PATTERN_GRAY125); $aFills[] = $fill1; // The remaining fills - $aStyles = $this->allStyles($pPHPExcel); - /** @var \PHPExcel\Style $style */ + $aStyles = $this->allStyles($spreadsheet); + /** @var \PhpSpreadsheet\Style $style */ foreach ($aStyles as $style) { if (!array_key_exists($style->getFill()->getHashCode(), $aFills)) { $aFills[ $style->getFill()->getHashCode() ] = $style->getFill(); @@ -633,17 +630,17 @@ class Style extends WriterPart /** * Get an array of all fonts * - * @param \PHPExcel\SpreadSheet $pPHPExcel - * @return \PHPExcel\Style\Font[] All fonts in PHPExcel - * @throws \PHPExcel\Writer\Exception + * @param \PhpSpreadsheet\SpreadSheet $spreadsheet + * @return \PhpSpreadsheet\Style\Font[] All fonts in PhpSpreadsheet + * @throws \PhpSpreadsheet\Writer\Exception */ - public function allFonts(\PHPExcel\SpreadSheet $pPHPExcel = null) + public function allFonts(\PhpSpreadsheet\SpreadSheet $spreadsheet = null) { // Get an array of unique fonts $aFonts = array(); - $aStyles = $this->allStyles($pPHPExcel); + $aStyles = $this->allStyles($spreadsheet); - /** @var \PHPExcel\Style $style */ + /** @var \PhpSpreadsheet\Style $style */ foreach ($aStyles as $style) { if (!array_key_exists($style->getFont()->getHashCode(), $aFonts)) { $aFonts[ $style->getFont()->getHashCode() ] = $style->getFont(); @@ -656,17 +653,17 @@ class Style extends WriterPart /** * Get an array of all borders * - * @param \PHPExcel\SpreadSheet $pPHPExcel - * @return \PHPExcel\Style\Borders[] All borders in PHPExcel - * @throws \PHPExcel\Writer\Exception + * @param \PhpSpreadsheet\SpreadSheet $spreadsheet + * @return \PhpSpreadsheet\Style\Borders[] All borders in PhpSpreadsheet + * @throws \PhpSpreadsheet\Writer\Exception */ - public function allBorders(\PHPExcel\SpreadSheet $pPHPExcel = null) + public function allBorders(\PhpSpreadsheet\SpreadSheet $spreadsheet = null) { // Get an array of unique borders $aBorders = array(); - $aStyles = $this->allStyles($pPHPExcel); + $aStyles = $this->allStyles($spreadsheet); - /** @var \PHPExcel\Style $style */ + /** @var \PhpSpreadsheet\Style $style */ foreach ($aStyles as $style) { if (!array_key_exists($style->getBorders()->getHashCode(), $aBorders)) { $aBorders[ $style->getBorders()->getHashCode() ] = $style->getBorders(); @@ -679,17 +676,17 @@ class Style extends WriterPart /** * Get an array of all number formats * - * @param \PHPExcel\SpreadSheet $pPHPExcel - * @return \PHPExcel\Style\NumberFormat[] All number formats in PHPExcel - * @throws \PHPExcel\Writer\Exception + * @param \PhpSpreadsheet\SpreadSheet $spreadsheet + * @return \PhpSpreadsheet\Style\NumberFormat[] All number formats in PhpSpreadsheet + * @throws \PhpSpreadsheet\Writer\Exception */ - public function allNumberFormats(\PHPExcel\SpreadSheet $pPHPExcel = null) + public function allNumberFormats(\PhpSpreadsheet\SpreadSheet $spreadsheet = null) { // Get an array of unique number formats $aNumFmts = array(); - $aStyles = $this->allStyles($pPHPExcel); + $aStyles = $this->allStyles($spreadsheet); - /** @var \PHPExcel\Style $style */ + /** @var \PhpSpreadsheet\Style $style */ foreach ($aStyles as $style) { if ($style->getNumberFormat()->getBuiltInFormatCode() === false && !array_key_exists($style->getNumberFormat()->getHashCode(), $aNumFmts)) { $aNumFmts[ $style->getNumberFormat()->getHashCode() ] = $style->getNumberFormat(); diff --git a/src/PhpSpreadsheet/Writer/Excel2007/Theme.php b/src/PhpSpreadsheet/Writer/Excel2007/Theme.php index 4dca17b1..20a3a872 100644 --- a/src/PhpSpreadsheet/Writer/Excel2007/Theme.php +++ b/src/PhpSpreadsheet/Writer/Excel2007/Theme.php @@ -1,11 +1,11 @@ getParentWriter()->getUseDiskCaching()) { - $objWriter = new \PHPExcel\Shared\XMLWriter(\PHPExcel\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); + $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); } else { - $objWriter = new \PHPExcel\Shared\XMLWriter(\PHPExcel\Shared\XMLWriter::STORAGE_MEMORY); + $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_MEMORY); } // XML header @@ -819,11 +815,11 @@ class Theme extends WriterPart /** * Write fonts to XML format * - * @param \PHPExcel\Shared\XMLWriter $objWriter + * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter * @param string $latinFont * @param array of string $fontSet * @return string XML Output - * @throws \PHPExcel\Writer\Exception + * @throws \PhpSpreadsheet\Writer\Exception */ private function writeFonts($objWriter, $latinFont, $fontSet) { @@ -853,9 +849,9 @@ class Theme extends WriterPart /** * Write colour scheme to XML format * - * @param \PHPExcel\Shared\XMLWriter $objWriter + * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter * @return string XML Output - * @throws \PHPExcel\Writer\Exception + * @throws \PhpSpreadsheet\Writer\Exception */ private function writeColourScheme($objWriter) { diff --git a/src/PhpSpreadsheet/Writer/Excel2007/Workbook.php b/src/PhpSpreadsheet/Writer/Excel2007/Workbook.php index 5676b4f3..c5969131 100644 --- a/src/PhpSpreadsheet/Writer/Excel2007/Workbook.php +++ b/src/PhpSpreadsheet/Writer/Excel2007/Workbook.php @@ -1,10 +1,8 @@ getParentWriter()->getUseDiskCaching()) { - $objWriter = new \PHPExcel\Shared\XMLWriter(\PHPExcel\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); + $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); } else { - $objWriter = new \PHPExcel\Shared\XMLWriter(\PHPExcel\Shared\XMLWriter::STORAGE_MEMORY); + $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_MEMORY); } // XML header @@ -61,18 +58,18 @@ class Workbook extends WriterPart $this->writeWorkbookPr($objWriter); // workbookProtection - $this->writeWorkbookProtection($objWriter, $pPHPExcel); + $this->writeWorkbookProtection($objWriter, $spreadsheet); // bookViews if ($this->getParentWriter()->getOffice2003Compatibility() === false) { - $this->writeBookViews($objWriter, $pPHPExcel); + $this->writeBookViews($objWriter, $spreadsheet); } // sheets - $this->writeSheets($objWriter, $pPHPExcel); + $this->writeSheets($objWriter, $spreadsheet); // definedNames - $this->writeDefinedNames($objWriter, $pPHPExcel); + $this->writeDefinedNames($objWriter, $spreadsheet); // calcPr $this->writeCalcPr($objWriter, $recalcRequired); @@ -86,10 +83,10 @@ class Workbook extends WriterPart /** * Write file version * - * @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer - * @throws \PHPExcel\Writer\Exception + * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @throws \PhpSpreadsheet\Writer\Exception */ - private function writeFileVersion(\PHPExcel\Shared\XMLWriter $objWriter) + private function writeFileVersion(\PhpSpreadsheet\Shared\XMLWriter $objWriter) { $objWriter->startElement('fileVersion'); $objWriter->writeAttribute('appName', 'xl'); @@ -102,14 +99,14 @@ class Workbook extends WriterPart /** * Write WorkbookPr * - * @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer - * @throws \PHPExcel\Writer\Exception + * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @throws \PhpSpreadsheet\Writer\Exception */ - private function writeWorkbookPr(\PHPExcel\Shared\XMLWriter $objWriter) + private function writeWorkbookPr(\PhpSpreadsheet\Shared\XMLWriter $objWriter) { $objWriter->startElement('workbookPr'); - if (\PHPExcel\Shared\Date::getExcelCalendar() == \PHPExcel\Shared\Date::CALENDAR_MAC_1904) { + if (\PhpSpreadsheet\Shared\Date::getExcelCalendar() == \PhpSpreadsheet\Shared\Date::CALENDAR_MAC_1904) { $objWriter->writeAttribute('date1904', '1'); } @@ -121,11 +118,11 @@ class Workbook extends WriterPart /** * Write BookViews * - * @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer - * @param PHPExcel $pPHPExcel - * @throws \PHPExcel\Writer\Exception + * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpSpreadsheet\Spreadsheet $spreadsheet + * @throws \PhpSpreadsheet\Writer\Exception */ - private function writeBookViews(\PHPExcel\Shared\XMLWriter $objWriter, \PHPExcel\SpreadSheet $pPHPExcel = null) + private function writeBookViews(\PhpSpreadsheet\Shared\XMLWriter $objWriter, \PhpSpreadsheet\SpreadSheet $spreadsheet = null) { // bookViews $objWriter->startElement('bookViews'); @@ -133,7 +130,7 @@ class Workbook extends WriterPart // workbookView $objWriter->startElement('workbookView'); - $objWriter->writeAttribute('activeTab', $pPHPExcel->getActiveSheetIndex()); + $objWriter->writeAttribute('activeTab', $spreadsheet->getActiveSheetIndex()); $objWriter->writeAttribute('autoFilterDateGrouping', '1'); $objWriter->writeAttribute('firstSheet', '0'); $objWriter->writeAttribute('minimized', '0'); @@ -151,24 +148,24 @@ class Workbook extends WriterPart /** * Write WorkbookProtection * - * @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer - * @param PHPExcel $pPHPExcel - * @throws \PHPExcel\Writer\Exception + * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpSpreadsheet\Spreadsheet $spreadsheet + * @throws \PhpSpreadsheet\Writer\Exception */ - private function writeWorkbookProtection(\PHPExcel\Shared\XMLWriter $objWriter, \PHPExcel\SpreadSheet $pPHPExcel = null) + private function writeWorkbookProtection(\PhpSpreadsheet\Shared\XMLWriter $objWriter, \PhpSpreadsheet\SpreadSheet $spreadsheet = null) { - if ($pPHPExcel->getSecurity()->isSecurityEnabled()) { + if ($spreadsheet->getSecurity()->isSecurityEnabled()) { $objWriter->startElement('workbookProtection'); - $objWriter->writeAttribute('lockRevision', ($pPHPExcel->getSecurity()->getLockRevision() ? 'true' : 'false')); - $objWriter->writeAttribute('lockStructure', ($pPHPExcel->getSecurity()->getLockStructure() ? 'true' : 'false')); - $objWriter->writeAttribute('lockWindows', ($pPHPExcel->getSecurity()->getLockWindows() ? 'true' : 'false')); + $objWriter->writeAttribute('lockRevision', ($spreadsheet->getSecurity()->getLockRevision() ? 'true' : 'false')); + $objWriter->writeAttribute('lockStructure', ($spreadsheet->getSecurity()->getLockStructure() ? 'true' : 'false')); + $objWriter->writeAttribute('lockWindows', ($spreadsheet->getSecurity()->getLockWindows() ? 'true' : 'false')); - if ($pPHPExcel->getSecurity()->getRevisionsPassword() != '') { - $objWriter->writeAttribute('revisionsPassword', $pPHPExcel->getSecurity()->getRevisionsPassword()); + if ($spreadsheet->getSecurity()->getRevisionsPassword() != '') { + $objWriter->writeAttribute('revisionsPassword', $spreadsheet->getSecurity()->getRevisionsPassword()); } - if ($pPHPExcel->getSecurity()->getWorkbookPassword() != '') { - $objWriter->writeAttribute('workbookPassword', $pPHPExcel->getSecurity()->getWorkbookPassword()); + if ($spreadsheet->getSecurity()->getWorkbookPassword() != '') { + $objWriter->writeAttribute('workbookPassword', $spreadsheet->getSecurity()->getWorkbookPassword()); } $objWriter->endElement(); @@ -178,11 +175,11 @@ class Workbook extends WriterPart /** * Write calcPr * - * @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer + * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer * @param boolean $recalcRequired Indicate whether formulas should be recalculated before writing - * @throws \PHPExcel\Writer\Exception + * @throws \PhpSpreadsheet\Writer\Exception */ - private function writeCalcPr(\PHPExcel\Shared\XMLWriter $objWriter, $recalcRequired = true) + private function writeCalcPr(\PhpSpreadsheet\Shared\XMLWriter $objWriter, $recalcRequired = true) { $objWriter->startElement('calcPr'); @@ -201,23 +198,23 @@ class Workbook extends WriterPart /** * Write sheets * - * @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer - * @param PHPExcel $pPHPExcel - * @throws \PHPExcel\Writer\Exception + * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpSpreadsheet\Spreadsheet $spreadsheet + * @throws \PhpSpreadsheet\Writer\Exception */ - private function writeSheets(\PHPExcel\Shared\XMLWriter $objWriter, \PHPExcel\SpreadSheet $pPHPExcel = null) + private function writeSheets(\PhpSpreadsheet\Shared\XMLWriter $objWriter, \PhpSpreadsheet\SpreadSheet $spreadsheet = null) { // Write sheets $objWriter->startElement('sheets'); - $sheetCount = $pPHPExcel->getSheetCount(); + $sheetCount = $spreadsheet->getSheetCount(); for ($i = 0; $i < $sheetCount; ++$i) { // sheet $this->writeSheet( $objWriter, - $pPHPExcel->getSheet($i)->getTitle(), + $spreadsheet->getSheet($i)->getTitle(), ($i + 1), ($i + 1 + 3), - $pPHPExcel->getSheet($i)->getSheetState() + $spreadsheet->getSheet($i)->getSheetState() ); } @@ -227,14 +224,14 @@ class Workbook extends WriterPart /** * Write sheet * - * @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer + * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer * @param string $pSheetname Sheet name * @param int $pSheetId Sheet id * @param int $pRelId Relationship ID * @param string $sheetState Sheet state (visible, hidden, veryHidden) - * @throws \PHPExcel\Writer\Exception + * @throws \PhpSpreadsheet\Writer\Exception */ - private function writeSheet(\PHPExcel\Shared\XMLWriter $objWriter, $pSheetname = '', $pSheetId = 1, $pRelId = 1, $sheetState = 'visible') + private function writeSheet(\PhpSpreadsheet\Shared\XMLWriter $objWriter, $pSheetname = '', $pSheetId = 1, $pRelId = 1, $sheetState = 'visible') { if ($pSheetname != '') { // Write sheet @@ -247,39 +244,39 @@ class Workbook extends WriterPart $objWriter->writeAttribute('r:id', 'rId' . $pRelId); $objWriter->endElement(); } else { - throw new \PHPExcel\Writer\Exception("Invalid parameters passed."); + throw new \PhpSpreadsheet\Writer\Exception("Invalid parameters passed."); } } /** * Write Defined Names * - * @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer - * @param PHPExcel $pPHPExcel - * @throws \PHPExcel\Writer\Exception + * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpSpreadsheet\Spreadsheet $spreadsheet + * @throws \PhpSpreadsheet\Writer\Exception */ - private function writeDefinedNames(\PHPExcel\Shared\XMLWriter $objWriter, \PHPExcel\SpreadSheet $pPHPExcel = null) + private function writeDefinedNames(\PhpSpreadsheet\Shared\XMLWriter $objWriter, \PhpSpreadsheet\SpreadSheet $spreadsheet = null) { // Write defined names $objWriter->startElement('definedNames'); // Named ranges - if (count($pPHPExcel->getNamedRanges()) > 0) { + if (count($spreadsheet->getNamedRanges()) > 0) { // Named ranges - $this->writeNamedRanges($objWriter, $pPHPExcel); + $this->writeNamedRanges($objWriter, $spreadsheet); } // Other defined names - $sheetCount = $pPHPExcel->getSheetCount(); + $sheetCount = $spreadsheet->getSheetCount(); for ($i = 0; $i < $sheetCount; ++$i) { // definedName for autoFilter - $this->writeDefinedNameForAutofilter($objWriter, $pPHPExcel->getSheet($i), $i); + $this->writeDefinedNameForAutofilter($objWriter, $spreadsheet->getSheet($i), $i); // definedName for Print_Titles - $this->writeDefinedNameForPrintTitles($objWriter, $pPHPExcel->getSheet($i), $i); + $this->writeDefinedNameForPrintTitles($objWriter, $spreadsheet->getSheet($i), $i); // definedName for Print_Area - $this->writeDefinedNameForPrintArea($objWriter, $pPHPExcel->getSheet($i), $i); + $this->writeDefinedNameForPrintArea($objWriter, $spreadsheet->getSheet($i), $i); } $objWriter->endElement(); @@ -288,14 +285,14 @@ class Workbook extends WriterPart /** * Write named ranges * - * @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer - * @param \PHPExcel\SpreadSheet $pPHPExcel - * @throws \PHPExcel\Writer\Exception + * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpSpreadsheet\SpreadSheet $spreadsheet + * @throws \PhpSpreadsheet\Writer\Exception */ - private function writeNamedRanges(\PHPExcel\Shared\XMLWriter $objWriter, \PHPExcel\SpreadSheet $pPHPExcel) + private function writeNamedRanges(\PhpSpreadsheet\Shared\XMLWriter $objWriter, \PhpSpreadsheet\SpreadSheet $spreadsheet) { // Loop named ranges - $namedRanges = $pPHPExcel->getNamedRanges(); + $namedRanges = $spreadsheet->getNamedRanges(); foreach ($namedRanges as $namedRange) { $this->writeDefinedNameForNamedRange($objWriter, $namedRange); } @@ -304,11 +301,11 @@ class Workbook extends WriterPart /** * Write Defined Name for named range * - * @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer - * @param \PHPExcel\NamedRange $pNamedRange - * @throws \PHPExcel\Writer\Exception + * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpSpreadsheet\NamedRange $pNamedRange + * @throws \PhpSpreadsheet\Writer\Exception */ - private function writeDefinedNameForNamedRange(\PHPExcel\Shared\XMLWriter $objWriter, \PHPExcel\NamedRange $pNamedRange) + private function writeDefinedNameForNamedRange(\PhpSpreadsheet\Shared\XMLWriter $objWriter, \PhpSpreadsheet\NamedRange $pNamedRange) { // definedName for named range $objWriter->startElement('definedName'); @@ -318,14 +315,14 @@ class Workbook extends WriterPart } // Create absolute coordinate and write as raw text - $range = \PHPExcel\Cell::splitRange($pNamedRange->getRange()); + $range = \PhpSpreadsheet\Cell::splitRange($pNamedRange->getRange()); for ($i = 0; $i < count($range); $i++) { - $range[$i][0] = '\'' . str_replace("'", "''", $pNamedRange->getWorksheet()->getTitle()) . '\'!' . \PHPExcel\Cell::absoluteReference($range[$i][0]); + $range[$i][0] = '\'' . str_replace("'", "''", $pNamedRange->getWorksheet()->getTitle()) . '\'!' . \PhpSpreadsheet\Cell::absoluteReference($range[$i][0]); if (isset($range[$i][1])) { - $range[$i][1] = \PHPExcel\Cell::absoluteReference($range[$i][1]); + $range[$i][1] = \PhpSpreadsheet\Cell::absoluteReference($range[$i][1]); } } - $range = \PHPExcel\Cell::buildRange($range); + $range = \PhpSpreadsheet\Cell::buildRange($range); $objWriter->writeRawData($range); @@ -335,12 +332,12 @@ class Workbook extends WriterPart /** * Write Defined Name for autoFilter * - * @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer - * @param \PHPExcel\Worksheet $pSheet + * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpSpreadsheet\Worksheet $pSheet * @param int $pSheetId - * @throws \PHPExcel\Writer\Exception + * @throws \PhpSpreadsheet\Writer\Exception */ - private function writeDefinedNameForAutofilter(\PHPExcel\Shared\XMLWriter $objWriter, \PHPExcel\Worksheet $pSheet = null, $pSheetId = 0) + private function writeDefinedNameForAutofilter(\PhpSpreadsheet\Shared\XMLWriter $objWriter, \PhpSpreadsheet\Worksheet $pSheet = null, $pSheetId = 0) { // definedName for autoFilter $autoFilterRange = $pSheet->getAutoFilter()->getRange(); @@ -351,15 +348,15 @@ class Workbook extends WriterPart $objWriter->writeAttribute('hidden', '1'); // Create absolute coordinate and write as raw text - $range = \PHPExcel\Cell::splitRange($autoFilterRange); + $range = \PhpSpreadsheet\Cell::splitRange($autoFilterRange); $range = $range[0]; // Strip any worksheet ref so we can make the cell ref absolute if (strpos($range[0], '!') !== false) { list($ws, $range[0]) = explode('!', $range[0]); } - $range[0] = \PHPExcel\Cell::absoluteCoordinate($range[0]); - $range[1] = \PHPExcel\Cell::absoluteCoordinate($range[1]); + $range[0] = \PhpSpreadsheet\Cell::absoluteCoordinate($range[0]); + $range[1] = \PhpSpreadsheet\Cell::absoluteCoordinate($range[1]); $range = implode(':', $range); $objWriter->writeRawData('\'' . str_replace("'", "''", $pSheet->getTitle()) . '\'!' . $range); @@ -371,12 +368,12 @@ class Workbook extends WriterPart /** * Write Defined Name for PrintTitles * - * @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer - * @param \PHPExcel\Worksheet $pSheet + * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpSpreadsheet\Worksheet $pSheet * @param int $pSheetId - * @throws \PHPExcel\Writer\Exception + * @throws \PhpSpreadsheet\Writer\Exception */ - private function writeDefinedNameForPrintTitles(\PHPExcel\Shared\XMLWriter $objWriter, \PHPExcel\Worksheet $pSheet = null, $pSheetId = 0) + private function writeDefinedNameForPrintTitles(\PhpSpreadsheet\Shared\XMLWriter $objWriter, \PhpSpreadsheet\Worksheet $pSheet = null, $pSheetId = 0) { // definedName for PrintTitles if ($pSheet->getPageSetup()->isColumnsToRepeatAtLeftSet() || $pSheet->getPageSetup()->isRowsToRepeatAtTopSet()) { @@ -414,12 +411,12 @@ class Workbook extends WriterPart /** * Write Defined Name for PrintTitles * - * @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer - * @param \PHPExcel\Worksheet $pSheet + * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpSpreadsheet\Worksheet $pSheet * @param int $pSheetId - * @throws \PHPExcel\Writer\Exception + * @throws \PhpSpreadsheet\Writer\Exception */ - private function writeDefinedNameForPrintArea(\PHPExcel\Shared\XMLWriter $objWriter, \PHPExcel\Worksheet $pSheet = null, $pSheetId = 0) + private function writeDefinedNameForPrintArea(\PhpSpreadsheet\Shared\XMLWriter $objWriter, \PhpSpreadsheet\Worksheet $pSheet = null, $pSheetId = 0) { // definedName for PrintArea if ($pSheet->getPageSetup()->isPrintAreaSet()) { @@ -431,12 +428,12 @@ class Workbook extends WriterPart $settingString = ''; // Print area - $printArea = \PHPExcel\Cell::splitRange($pSheet->getPageSetup()->getPrintArea()); + $printArea = \PhpSpreadsheet\Cell::splitRange($pSheet->getPageSetup()->getPrintArea()); $chunks = array(); foreach ($printArea as $printAreaRect) { - $printAreaRect[0] = \PHPExcel\Cell::absoluteReference($printAreaRect[0]); - $printAreaRect[1] = \PHPExcel\Cell::absoluteReference($printAreaRect[1]); + $printAreaRect[0] = \PhpSpreadsheet\Cell::absoluteReference($printAreaRect[0]); + $printAreaRect[1] = \PhpSpreadsheet\Cell::absoluteReference($printAreaRect[1]); $chunks[] = '\'' . str_replace("'", "''", $pSheet->getTitle()) . '\'!' . implode(':', $printAreaRect); } diff --git a/src/PhpSpreadsheet/Writer/Excel2007/Worksheet.php b/src/PhpSpreadsheet/Writer/Excel2007/Worksheet.php index e4f1f2f3..6e8ae8ef 100644 --- a/src/PhpSpreadsheet/Writer/Excel2007/Worksheet.php +++ b/src/PhpSpreadsheet/Writer/Excel2007/Worksheet.php @@ -1,10 +1,10 @@ getParentWriter()->getUseDiskCaching()) { - $objWriter = new \PHPExcel\Shared\XMLWriter(\PHPExcel\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); + $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); } else { - $objWriter = new \PHPExcel\Shared\XMLWriter(\PHPExcel\Shared\XMLWriter::STORAGE_MEMORY); + $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_MEMORY); } // XML header @@ -134,18 +130,18 @@ class Worksheet extends WriterPart // Return return $objWriter->getData(); } else { - throw new \PHPExcel\Writer\Exception("Invalid \\PHPExcel\\Worksheet object passed."); + throw new \PhpSpreadsheet\Writer\Exception("Invalid \\PhpSpreadsheet\\Worksheet object passed."); } } /** * Write SheetPr * - * @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer - * @param \PHPExcel\Worksheet $pSheet Worksheet - * @throws \PHPExcel\Writer\Exception + * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpSpreadsheet\Worksheet $pSheet Worksheet + * @throws \PhpSpreadsheet\Writer\Exception */ - private function writeSheetPr(\PHPExcel\Shared\XMLWriter $objWriter = null, \PHPExcel\Worksheet $pSheet = null) + private function writeSheetPr(\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpSpreadsheet\Worksheet $pSheet = null) { // sheetPr $objWriter->startElement('sheetPr'); @@ -188,11 +184,11 @@ class Worksheet extends WriterPart /** * Write Dimension * - * @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer - * @param \PHPExcel\Worksheet $pSheet Worksheet - * @throws \PHPExcel\Writer\Exception + * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpSpreadsheet\Worksheet $pSheet Worksheet + * @throws \PhpSpreadsheet\Writer\Exception */ - private function writeDimension(\PHPExcel\Shared\XMLWriter $objWriter = null, \PHPExcel\Worksheet $pSheet = null) + private function writeDimension(\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpSpreadsheet\Worksheet $pSheet = null) { // dimension $objWriter->startElement('dimension'); @@ -203,18 +199,18 @@ class Worksheet extends WriterPart /** * Write SheetViews * - * @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer - * @param \PHPExcel\Worksheet $pSheet Worksheet - * @throws \PHPExcel\Writer\Exception + * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpSpreadsheet\Worksheet $pSheet Worksheet + * @throws \PhpSpreadsheet\Writer\Exception */ - private function writeSheetViews(\PHPExcel\Shared\XMLWriter $objWriter = null, \PHPExcel\Worksheet $pSheet = null) + private function writeSheetViews(\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpSpreadsheet\Worksheet $pSheet = null) { // sheetViews $objWriter->startElement('sheetViews'); // Sheet selected? $sheetSelected = false; - if ($this->getParentWriter()->getPHPExcel()->getIndex($pSheet) == $this->getParentWriter()->getPHPExcel()->getActiveSheetIndex()) { + if ($this->getParentWriter()->getPhpSpreadsheet()->getIndex($pSheet) == $this->getParentWriter()->getPhpSpreadsheet()->getActiveSheetIndex()) { $sheetSelected = true; } @@ -232,7 +228,7 @@ class Worksheet extends WriterPart } // View Layout Type - if ($pSheet->getSheetView()->getView() !== \PHPExcel\Worksheet\SheetView::SHEETVIEW_NORMAL) { + if ($pSheet->getSheetView()->getView() !== \PhpSpreadsheet\Worksheet\SheetView::SHEETVIEW_NORMAL) { $objWriter->writeAttribute('view', $pSheet->getSheetView()->getView()); } @@ -265,8 +261,8 @@ class Worksheet extends WriterPart // Calculate freeze coordinates $xSplit = $ySplit = 0; - list($xSplit, $ySplit) = \PHPExcel\Cell::coordinateFromString($topLeftCell); - $xSplit = \PHPExcel\Cell::columnIndexFromString($xSplit); + list($xSplit, $ySplit) = \PhpSpreadsheet\Cell::coordinateFromString($topLeftCell); + $xSplit = \PhpSpreadsheet\Cell::columnIndexFromString($xSplit); // pane $pane = 'topRight'; @@ -315,11 +311,11 @@ class Worksheet extends WriterPart /** * Write SheetFormatPr * - * @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer - * @param \PHPExcel\Worksheet $pSheet Worksheet - * @throws \PHPExcel\Writer\Exception + * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpSpreadsheet\Worksheet $pSheet Worksheet + * @throws \PhpSpreadsheet\Writer\Exception */ - private function writeSheetFormatPr(\PHPExcel\Shared\XMLWriter $objWriter = null, \PHPExcel\Worksheet $pSheet = null) + private function writeSheetFormatPr(\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpSpreadsheet\Worksheet $pSheet = null) { // sheetFormatPr $objWriter->startElement('sheetFormatPr'); @@ -327,7 +323,7 @@ class Worksheet extends WriterPart // Default row height if ($pSheet->getDefaultRowDimension()->getRowHeight() >= 0) { $objWriter->writeAttribute('customHeight', 'true'); - $objWriter->writeAttribute('defaultRowHeight', \PHPExcel\Shared\StringHelper::formatNumber($pSheet->getDefaultRowDimension()->getRowHeight())); + $objWriter->writeAttribute('defaultRowHeight', \PhpSpreadsheet\Shared\StringHelper::formatNumber($pSheet->getDefaultRowDimension()->getRowHeight())); } else { $objWriter->writeAttribute('defaultRowHeight', '14.4'); } @@ -340,7 +336,7 @@ class Worksheet extends WriterPart // Default column width if ($pSheet->getDefaultColumnDimension()->getWidth() >= 0) { - $objWriter->writeAttribute('defaultColWidth', \PHPExcel\Shared\StringHelper::formatNumber($pSheet->getDefaultColumnDimension()->getWidth())); + $objWriter->writeAttribute('defaultColWidth', \PhpSpreadsheet\Shared\StringHelper::formatNumber($pSheet->getDefaultColumnDimension()->getWidth())); } // Outline level - row @@ -367,11 +363,11 @@ class Worksheet extends WriterPart /** * Write Cols * - * @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer - * @param \PHPExcel\Worksheet $pSheet Worksheet - * @throws \PHPExcel\Writer\Exception + * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpSpreadsheet\Worksheet $pSheet Worksheet + * @throws \PhpSpreadsheet\Writer\Exception */ - private function writeCols(\PHPExcel\Shared\XMLWriter $objWriter = null, \PHPExcel\Worksheet $pSheet = null) + private function writeCols(\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpSpreadsheet\Worksheet $pSheet = null) { // cols if (count($pSheet->getColumnDimensions()) > 0) { @@ -383,15 +379,15 @@ class Worksheet extends WriterPart foreach ($pSheet->getColumnDimensions() as $colDimension) { // col $objWriter->startElement('col'); - $objWriter->writeAttribute('min', \PHPExcel\Cell::columnIndexFromString($colDimension->getColumnIndex())); - $objWriter->writeAttribute('max', \PHPExcel\Cell::columnIndexFromString($colDimension->getColumnIndex())); + $objWriter->writeAttribute('min', \PhpSpreadsheet\Cell::columnIndexFromString($colDimension->getColumnIndex())); + $objWriter->writeAttribute('max', \PhpSpreadsheet\Cell::columnIndexFromString($colDimension->getColumnIndex())); if ($colDimension->getWidth() < 0) { // No width set, apply default of 10 $objWriter->writeAttribute('width', '9.10'); } else { // Width set - $objWriter->writeAttribute('width', \PHPExcel\Shared\StringHelper::formatNumber($colDimension->getWidth())); + $objWriter->writeAttribute('width', \PhpSpreadsheet\Shared\StringHelper::formatNumber($colDimension->getWidth())); } // Column visibility @@ -432,11 +428,11 @@ class Worksheet extends WriterPart /** * Write SheetProtection * - * @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer - * @param \PHPExcel\Worksheet $pSheet Worksheet - * @throws \PHPExcel\Writer\Exception + * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpSpreadsheet\Worksheet $pSheet Worksheet + * @throws \PhpSpreadsheet\Writer\Exception */ - private function writeSheetProtection(\PHPExcel\Shared\XMLWriter $objWriter = null, \PHPExcel\Worksheet $pSheet = null) + private function writeSheetProtection(\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpSpreadsheet\Worksheet $pSheet = null) { // sheetProtection $objWriter->startElement('sheetProtection'); @@ -467,11 +463,11 @@ class Worksheet extends WriterPart /** * Write ConditionalFormatting * - * @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer - * @param \PHPExcel\Worksheet $pSheet Worksheet - * @throws \PHPExcel\Writer\Exception + * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpSpreadsheet\Worksheet $pSheet Worksheet + * @throws \PhpSpreadsheet\Writer\Exception */ - private function writeConditionalFormatting(\PHPExcel\Shared\XMLWriter $objWriter = null, \PHPExcel\Worksheet $pSheet = null) + private function writeConditionalFormatting(\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpSpreadsheet\Worksheet $pSheet = null) { // Conditional id $id = 1; @@ -483,7 +479,7 @@ class Worksheet extends WriterPart // if ($this->getParentWriter()->getStylesConditionalHashTable()->getIndexForHashCode($conditional->getHashCode()) == '') { // continue; // } - if ($conditional->getConditionType() != \PHPExcel\Style\Conditional::CONDITION_NONE) { + if ($conditional->getConditionType() != \PhpSpreadsheet\Style\Conditional::CONDITION_NONE) { // conditionalFormatting $objWriter->startElement('conditionalFormatting'); $objWriter->writeAttribute('sqref', $cellCoordinate); @@ -494,35 +490,35 @@ class Worksheet extends WriterPart $objWriter->writeAttribute('dxfId', $this->getParentWriter()->getStylesConditionalHashTable()->getIndexForHashCode($conditional->getHashCode())); $objWriter->writeAttribute('priority', $id++); - if (($conditional->getConditionType() == \PHPExcel\Style\Conditional::CONDITION_CELLIS || $conditional->getConditionType() == \PHPExcel\Style\Conditional::CONDITION_CONTAINSTEXT) - && $conditional->getOperatorType() != \PHPExcel\Style\Conditional::OPERATOR_NONE) { + if (($conditional->getConditionType() == \PhpSpreadsheet\Style\Conditional::CONDITION_CELLIS || $conditional->getConditionType() == \PhpSpreadsheet\Style\Conditional::CONDITION_CONTAINSTEXT) + && $conditional->getOperatorType() != \PhpSpreadsheet\Style\Conditional::OPERATOR_NONE) { $objWriter->writeAttribute('operator', $conditional->getOperatorType()); } - if ($conditional->getConditionType() == \PHPExcel\Style\Conditional::CONDITION_CONTAINSTEXT + if ($conditional->getConditionType() == \PhpSpreadsheet\Style\Conditional::CONDITION_CONTAINSTEXT && !is_null($conditional->getText())) { $objWriter->writeAttribute('text', $conditional->getText()); } - if ($conditional->getConditionType() == \PHPExcel\Style\Conditional::CONDITION_CONTAINSTEXT - && $conditional->getOperatorType() == \PHPExcel\Style\Conditional::OPERATOR_CONTAINSTEXT + if ($conditional->getConditionType() == \PhpSpreadsheet\Style\Conditional::CONDITION_CONTAINSTEXT + && $conditional->getOperatorType() == \PhpSpreadsheet\Style\Conditional::OPERATOR_CONTAINSTEXT && !is_null($conditional->getText())) { $objWriter->writeElement('formula', 'NOT(ISERROR(SEARCH("' . $conditional->getText() . '",' . $cellCoordinate . ')))'); - } elseif ($conditional->getConditionType() == \PHPExcel\Style\Conditional::CONDITION_CONTAINSTEXT - && $conditional->getOperatorType() == \PHPExcel\Style\Conditional::OPERATOR_BEGINSWITH + } elseif ($conditional->getConditionType() == \PhpSpreadsheet\Style\Conditional::CONDITION_CONTAINSTEXT + && $conditional->getOperatorType() == \PhpSpreadsheet\Style\Conditional::OPERATOR_BEGINSWITH && !is_null($conditional->getText())) { $objWriter->writeElement('formula', 'LEFT(' . $cellCoordinate . ',' . strlen($conditional->getText()) . ')="' . $conditional->getText() . '"'); - } elseif ($conditional->getConditionType() == \PHPExcel\Style\Conditional::CONDITION_CONTAINSTEXT - && $conditional->getOperatorType() == \PHPExcel\Style\Conditional::OPERATOR_ENDSWITH + } elseif ($conditional->getConditionType() == \PhpSpreadsheet\Style\Conditional::CONDITION_CONTAINSTEXT + && $conditional->getOperatorType() == \PhpSpreadsheet\Style\Conditional::OPERATOR_ENDSWITH && !is_null($conditional->getText())) { $objWriter->writeElement('formula', 'RIGHT(' . $cellCoordinate . ',' . strlen($conditional->getText()) . ')="' . $conditional->getText() . '"'); - } elseif ($conditional->getConditionType() == \PHPExcel\Style\Conditional::CONDITION_CONTAINSTEXT - && $conditional->getOperatorType() == \PHPExcel\Style\Conditional::OPERATOR_NOTCONTAINS + } elseif ($conditional->getConditionType() == \PhpSpreadsheet\Style\Conditional::CONDITION_CONTAINSTEXT + && $conditional->getOperatorType() == \PhpSpreadsheet\Style\Conditional::OPERATOR_NOTCONTAINS && !is_null($conditional->getText())) { $objWriter->writeElement('formula', 'ISERROR(SEARCH("' . $conditional->getText() . '",' . $cellCoordinate . '))'); - } elseif ($conditional->getConditionType() == \PHPExcel\Style\Conditional::CONDITION_CELLIS - || $conditional->getConditionType() == \PHPExcel\Style\Conditional::CONDITION_CONTAINSTEXT - || $conditional->getConditionType() == \PHPExcel\Style\Conditional::CONDITION_EXPRESSION) { + } elseif ($conditional->getConditionType() == \PhpSpreadsheet\Style\Conditional::CONDITION_CELLIS + || $conditional->getConditionType() == \PhpSpreadsheet\Style\Conditional::CONDITION_CONTAINSTEXT + || $conditional->getConditionType() == \PhpSpreadsheet\Style\Conditional::CONDITION_EXPRESSION) { foreach ($conditional->getConditions() as $formula) { // Formula $objWriter->writeElement('formula', $formula); @@ -540,11 +536,11 @@ class Worksheet extends WriterPart /** * Write DataValidations * - * @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer - * @param \PHPExcel\Worksheet $pSheet Worksheet - * @throws \PHPExcel\Writer\Exception + * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpSpreadsheet\Worksheet $pSheet Worksheet + * @throws \PhpSpreadsheet\Writer\Exception */ - private function writeDataValidations(\PHPExcel\Shared\XMLWriter $objWriter = null, \PHPExcel\Worksheet $pSheet = null) + private function writeDataValidations(\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpSpreadsheet\Worksheet $pSheet = null) { // Datavalidation collection $dataValidationCollection = $pSheet->getDataValidationCollection(); @@ -606,11 +602,11 @@ class Worksheet extends WriterPart /** * Write Hyperlinks * - * @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer - * @param \PHPExcel\Worksheet $pSheet Worksheet - * @throws \PHPExcel\Writer\Exception + * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpSpreadsheet\Worksheet $pSheet Worksheet + * @throws \PhpSpreadsheet\Writer\Exception */ - private function writeHyperlinks(\PHPExcel\Shared\XMLWriter $objWriter = null, \PHPExcel\Worksheet $pSheet = null) + private function writeHyperlinks(\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpSpreadsheet\Worksheet $pSheet = null) { // Hyperlink collection $hyperlinkCollection = $pSheet->getHyperlinkCollection(); @@ -647,11 +643,11 @@ class Worksheet extends WriterPart /** * Write ProtectedRanges * - * @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer - * @param \PHPExcel\Worksheet $pSheet Worksheet - * @throws \PHPExcel\Writer\Exception + * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpSpreadsheet\Worksheet $pSheet Worksheet + * @throws \PhpSpreadsheet\Writer\Exception */ - private function writeProtectedRanges(\PHPExcel\Shared\XMLWriter $objWriter = null, \PHPExcel\Worksheet $pSheet = null) + private function writeProtectedRanges(\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpSpreadsheet\Worksheet $pSheet = null) { if (count($pSheet->getProtectedCells()) > 0) { // protectedRanges @@ -676,11 +672,11 @@ class Worksheet extends WriterPart /** * Write MergeCells * - * @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer - * @param \PHPExcel\Worksheet $pSheet Worksheet - * @throws \PHPExcel\Writer\Exception + * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpSpreadsheet\Worksheet $pSheet Worksheet + * @throws \PhpSpreadsheet\Writer\Exception */ - private function writeMergeCells(\PHPExcel\Shared\XMLWriter $objWriter = null, \PHPExcel\Worksheet $pSheet = null) + private function writeMergeCells(\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpSpreadsheet\Worksheet $pSheet = null) { if (count($pSheet->getMergeCells()) > 0) { // mergeCells @@ -701,11 +697,11 @@ class Worksheet extends WriterPart /** * Write PrintOptions * - * @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer - * @param \PHPExcel\Worksheet $pSheet Worksheet - * @throws \PHPExcel\Writer\Exception + * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpSpreadsheet\Worksheet $pSheet Worksheet + * @throws \PhpSpreadsheet\Writer\Exception */ - private function writePrintOptions(\PHPExcel\Shared\XMLWriter $objWriter = null, \PHPExcel\Worksheet $pSheet = null) + private function writePrintOptions(\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpSpreadsheet\Worksheet $pSheet = null) { // printOptions $objWriter->startElement('printOptions'); @@ -727,31 +723,31 @@ class Worksheet extends WriterPart /** * Write PageMargins * - * @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer - * @param \PHPExcel\Worksheet $pSheet Worksheet - * @throws \PHPExcel\Writer\Exception + * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpSpreadsheet\Worksheet $pSheet Worksheet + * @throws \PhpSpreadsheet\Writer\Exception */ - private function writePageMargins(\PHPExcel\Shared\XMLWriter $objWriter = null, \PHPExcel\Worksheet $pSheet = null) + private function writePageMargins(\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpSpreadsheet\Worksheet $pSheet = null) { // pageMargins $objWriter->startElement('pageMargins'); - $objWriter->writeAttribute('left', \PHPExcel\Shared\StringHelper::formatNumber($pSheet->getPageMargins()->getLeft())); - $objWriter->writeAttribute('right', \PHPExcel\Shared\StringHelper::formatNumber($pSheet->getPageMargins()->getRight())); - $objWriter->writeAttribute('top', \PHPExcel\Shared\StringHelper::formatNumber($pSheet->getPageMargins()->getTop())); - $objWriter->writeAttribute('bottom', \PHPExcel\Shared\StringHelper::formatNumber($pSheet->getPageMargins()->getBottom())); - $objWriter->writeAttribute('header', \PHPExcel\Shared\StringHelper::formatNumber($pSheet->getPageMargins()->getHeader())); - $objWriter->writeAttribute('footer', \PHPExcel\Shared\StringHelper::formatNumber($pSheet->getPageMargins()->getFooter())); + $objWriter->writeAttribute('left', \PhpSpreadsheet\Shared\StringHelper::formatNumber($pSheet->getPageMargins()->getLeft())); + $objWriter->writeAttribute('right', \PhpSpreadsheet\Shared\StringHelper::formatNumber($pSheet->getPageMargins()->getRight())); + $objWriter->writeAttribute('top', \PhpSpreadsheet\Shared\StringHelper::formatNumber($pSheet->getPageMargins()->getTop())); + $objWriter->writeAttribute('bottom', \PhpSpreadsheet\Shared\StringHelper::formatNumber($pSheet->getPageMargins()->getBottom())); + $objWriter->writeAttribute('header', \PhpSpreadsheet\Shared\StringHelper::formatNumber($pSheet->getPageMargins()->getHeader())); + $objWriter->writeAttribute('footer', \PhpSpreadsheet\Shared\StringHelper::formatNumber($pSheet->getPageMargins()->getFooter())); $objWriter->endElement(); } /** * Write AutoFilter * - * @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer - * @param \PHPExcel\Worksheet $pSheet Worksheet - * @throws \PHPExcel\Writer\Exception + * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpSpreadsheet\Worksheet $pSheet Worksheet + * @throws \PhpSpreadsheet\Writer\Exception */ - private function writeAutoFilter(\PHPExcel\Shared\XMLWriter $objWriter = null, \PHPExcel\Worksheet $pSheet = null) + private function writeAutoFilter(\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpSpreadsheet\Worksheet $pSheet = null) { $autoFilterRange = $pSheet->getAutoFilter()->getRange(); if (!empty($autoFilterRange)) { @@ -759,7 +755,7 @@ class Worksheet extends WriterPart $objWriter->startElement('autoFilter'); // Strip any worksheet reference from the filter coordinates - $range = \PHPExcel\Cell::splitRange($autoFilterRange); + $range = \PhpSpreadsheet\Cell::splitRange($autoFilterRange); $range = $range[0]; // Strip any worksheet ref if (strpos($range[0], '!') !== false) { @@ -778,17 +774,17 @@ class Worksheet extends WriterPart $objWriter->writeAttribute('colId', $pSheet->getAutoFilter()->getColumnOffset($columnID)); $objWriter->startElement($column->getFilterType()); - if ($column->getJoin() == \PHPExcel\Worksheet\AutoFilter\Column::AUTOFILTER_COLUMN_JOIN_AND) { + if ($column->getJoin() == \PhpSpreadsheet\Worksheet\AutoFilter\Column::AUTOFILTER_COLUMN_JOIN_AND) { $objWriter->writeAttribute('and', 1); } foreach ($rules as $rule) { - if (($column->getFilterType() === \PHPExcel\Worksheet\AutoFilter\Column::AUTOFILTER_FILTERTYPE_FILTER) && - ($rule->getOperator() === \PHPExcel\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_EQUAL) && + if (($column->getFilterType() === \PhpSpreadsheet\Worksheet\AutoFilter\Column::AUTOFILTER_FILTERTYPE_FILTER) && + ($rule->getOperator() === \PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_EQUAL) && ($rule->getValue() === '')) { // Filter rule for Blanks $objWriter->writeAttribute('blank', 1); - } elseif ($rule->getRuleType() === \PHPExcel\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMICFILTER) { + } elseif ($rule->getRuleType() === \PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMICFILTER) { // Dynamic Filter Rule $objWriter->writeAttribute('type', $rule->getGrouping()); $val = $column->getAttribute('val'); @@ -799,19 +795,19 @@ class Worksheet extends WriterPart if ($maxVal !== null) { $objWriter->writeAttribute('maxVal', $maxVal); } - } elseif ($rule->getRuleType() === \PHPExcel\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_TOPTENFILTER) { + } elseif ($rule->getRuleType() === \PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_TOPTENFILTER) { // Top 10 Filter Rule $objWriter->writeAttribute('val', $rule->getValue()); - $objWriter->writeAttribute('percent', (($rule->getOperator() === \PHPExcel\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_PERCENT) ? '1' : '0')); - $objWriter->writeAttribute('top', (($rule->getGrouping() === \PHPExcel\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_TOP) ? '1': '0')); + $objWriter->writeAttribute('percent', (($rule->getOperator() === \PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_PERCENT) ? '1' : '0')); + $objWriter->writeAttribute('top', (($rule->getGrouping() === \PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_TOP) ? '1': '0')); } else { // Filter, DateGroupItem or CustomFilter $objWriter->startElement($rule->getRuleType()); - if ($rule->getOperator() !== \PHPExcel\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_EQUAL) { + if ($rule->getOperator() !== \PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_EQUAL) { $objWriter->writeAttribute('operator', $rule->getOperator()); } - if ($rule->getRuleType() === \PHPExcel\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DATEGROUP) { + if ($rule->getRuleType() === \PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DATEGROUP) { // Date Group filters foreach ($rule->getValue() as $key => $value) { if ($value > '') { @@ -840,11 +836,11 @@ class Worksheet extends WriterPart /** * Write PageSetup * - * @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer - * @param \PHPExcel\Worksheet $pSheet Worksheet - * @throws \PHPExcel\Writer\Exception + * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpSpreadsheet\Worksheet $pSheet Worksheet + * @throws \PhpSpreadsheet\Writer\Exception */ - private function writePageSetup(\PHPExcel\Shared\XMLWriter $objWriter = null, \PHPExcel\Worksheet $pSheet = null) + private function writePageSetup(\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpSpreadsheet\Worksheet $pSheet = null) { // pageSetup $objWriter->startElement('pageSetup'); @@ -875,11 +871,11 @@ class Worksheet extends WriterPart /** * Write Header / Footer * - * @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer - * @param \PHPExcel\Worksheet $pSheet Worksheet - * @throws \PHPExcel\Writer\Exception + * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpSpreadsheet\Worksheet $pSheet Worksheet + * @throws \PhpSpreadsheet\Writer\Exception */ - private function writeHeaderFooter(\PHPExcel\Shared\XMLWriter $objWriter = null, \PHPExcel\Worksheet $pSheet = null) + private function writeHeaderFooter(\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpSpreadsheet\Worksheet $pSheet = null) { // headerFooter $objWriter->startElement('headerFooter'); @@ -900,19 +896,19 @@ class Worksheet extends WriterPart /** * Write Breaks * - * @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer - * @param \PHPExcel\Worksheet $pSheet Worksheet - * @throws \PHPExcel\Writer\Exception + * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpSpreadsheet\Worksheet $pSheet Worksheet + * @throws \PhpSpreadsheet\Writer\Exception */ - private function writeBreaks(\PHPExcel\Shared\XMLWriter $objWriter = null, \PHPExcel\Worksheet $pSheet = null) + private function writeBreaks(\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpSpreadsheet\Worksheet $pSheet = null) { // Get row and column breaks $aRowBreaks = array(); $aColumnBreaks = array(); foreach ($pSheet->getBreaks() as $cell => $breakType) { - if ($breakType == \PHPExcel\Worksheet::BREAK_ROW) { + if ($breakType == \PhpSpreadsheet\Worksheet::BREAK_ROW) { $aRowBreaks[] = $cell; - } elseif ($breakType == \PHPExcel\Worksheet::BREAK_COLUMN) { + } elseif ($breakType == \PhpSpreadsheet\Worksheet::BREAK_COLUMN) { $aColumnBreaks[] = $cell; } } @@ -924,7 +920,7 @@ class Worksheet extends WriterPart $objWriter->writeAttribute('manualBreakCount', count($aRowBreaks)); foreach ($aRowBreaks as $cell) { - $coords = \PHPExcel\Cell::coordinateFromString($cell); + $coords = \PhpSpreadsheet\Cell::coordinateFromString($cell); $objWriter->startElement('brk'); $objWriter->writeAttribute('id', $coords[1]); @@ -942,10 +938,10 @@ class Worksheet extends WriterPart $objWriter->writeAttribute('manualBreakCount', count($aColumnBreaks)); foreach ($aColumnBreaks as $cell) { - $coords = \PHPExcel\Cell::coordinateFromString($cell); + $coords = \PhpSpreadsheet\Cell::coordinateFromString($cell); $objWriter->startElement('brk'); - $objWriter->writeAttribute('id', \PHPExcel\Cell::columnIndexFromString($coords[0]) - 1); + $objWriter->writeAttribute('id', \PhpSpreadsheet\Cell::columnIndexFromString($coords[0]) - 1); $objWriter->writeAttribute('man', '1'); $objWriter->endElement(); } @@ -957,12 +953,12 @@ class Worksheet extends WriterPart /** * Write SheetData * - * @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer - * @param \PHPExcel\Worksheet $pSheet Worksheet + * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpSpreadsheet\Worksheet $pSheet Worksheet * @param string[] $pStringTable String table - * @throws \PHPExcel\Writer\Exception + * @throws \PhpSpreadsheet\Writer\Exception */ - private function writeSheetData(\PHPExcel\Shared\XMLWriter $objWriter = null, \PHPExcel\Worksheet $pSheet = null, $pStringTable = null) + private function writeSheetData(\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpSpreadsheet\Worksheet $pSheet = null, $pStringTable = null) { if (is_array($pStringTable)) { // Flipped stringtable, for faster index searching @@ -972,7 +968,7 @@ class Worksheet extends WriterPart $objWriter->startElement('sheetData'); // Get column count - $colCount = \PHPExcel\Cell::columnIndexFromString($pSheet->getHighestColumn()); + $colCount = \PhpSpreadsheet\Cell::columnIndexFromString($pSheet->getHighestColumn()); // Highest row number $highestRow = $pSheet->getHighestRow(); @@ -980,7 +976,7 @@ class Worksheet extends WriterPart // Loop through cells $cellsByRow = array(); foreach ($pSheet->getCellCollection() as $cellID) { - $cellAddress = \PHPExcel\Cell::coordinateFromString($cellID); + $cellAddress = \PhpSpreadsheet\Cell::coordinateFromString($cellID); $cellsByRow[$cellAddress[1]][] = $cellID; } @@ -1001,7 +997,7 @@ class Worksheet extends WriterPart // Row dimensions if ($rowDimension->getRowHeight() >= 0) { $objWriter->writeAttribute('customHeight', '1'); - $objWriter->writeAttribute('ht', \PHPExcel\Shared\StringHelper::formatNumber($rowDimension->getRowHeight())); + $objWriter->writeAttribute('ht', \PhpSpreadsheet\Shared\StringHelper::formatNumber($rowDimension->getRowHeight())); } // Row visibility @@ -1040,21 +1036,21 @@ class Worksheet extends WriterPart $objWriter->endElement(); } else { - throw new \PHPExcel\Writer\Exception("Invalid parameters passed."); + throw new \PhpSpreadsheet\Writer\Exception("Invalid parameters passed."); } } /** * Write Cell * - * @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer - * @param \PHPExcel\Worksheet $pSheet Worksheet - * @param \PHPExcel\Cell $pCellAddress Cell Address + * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpSpreadsheet\Worksheet $pSheet Worksheet + * @param \PhpSpreadsheet\Cell $pCellAddress Cell Address * @param string[] $pStringTable String table * @param string[] $pFlippedStringTable String table (flipped), for faster index searching - * @throws \PHPExcel\Writer\Exception + * @throws \PhpSpreadsheet\Writer\Exception */ - private function writeCell(\PHPExcel\Shared\XMLWriter $objWriter = null, \PHPExcel\Worksheet $pSheet = null, $pCellAddress = null, $pStringTable = null, $pFlippedStringTable = null) + private function writeCell(\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpSpreadsheet\Worksheet $pSheet = null, $pCellAddress = null, $pStringTable = null, $pFlippedStringTable = null) { if (is_array($pStringTable) && is_array($pFlippedStringTable)) { // Cell @@ -1095,9 +1091,9 @@ class Worksheet extends WriterPart // Write data depending on its type switch (strtolower($mappedType)) { case 'inlinestr': // Inline string - if (! $cellValue instanceof \PHPExcel\RichText) { - $objWriter->writeElement('t', \PHPExcel\Shared\StringHelper::controlCharacterPHP2OOXML(htmlspecialchars($cellValue))); - } elseif ($cellValue instanceof \PHPExcel\RichText) { + if (! $cellValue instanceof \PhpSpreadsheet\RichText) { + $objWriter->writeElement('t', \PhpSpreadsheet\Shared\StringHelper::controlCharacterPHP2OOXML(htmlspecialchars($cellValue))); + } elseif ($cellValue instanceof \PhpSpreadsheet\RichText) { $objWriter->startElement('is'); $this->getParentWriter()->getWriterPart('stringtable')->writeRichText($objWriter, $cellValue); $objWriter->endElement(); @@ -1105,11 +1101,11 @@ class Worksheet extends WriterPart break; case 's': // String - if (! $cellValue instanceof \PHPExcel\RichText) { + if (! $cellValue instanceof \PhpSpreadsheet\RichText) { if (isset($pFlippedStringTable[$cellValue])) { $objWriter->writeElement('v', $pFlippedStringTable[$cellValue]); } - } elseif ($cellValue instanceof \PHPExcel\RichText) { + } elseif ($cellValue instanceof \PhpSpreadsheet\RichText) { $objWriter->writeElement('v', $pFlippedStringTable[$cellValue->getHashCode()]); } @@ -1131,7 +1127,7 @@ class Worksheet extends WriterPart if ($this->getParentWriter()->getPreCalculateFormulas()) { // $calculatedValue = $pCell->getCalculatedValue(); if (!is_array($calculatedValue) && substr($calculatedValue, 0, 1) != '#') { - $objWriter->writeElement('v', \PHPExcel\Shared\StringHelper::formatNumber($calculatedValue)); + $objWriter->writeElement('v', \PhpSpreadsheet\Shared\StringHelper::formatNumber($calculatedValue)); } else { $objWriter->writeElement('v', '0'); } @@ -1161,19 +1157,19 @@ class Worksheet extends WriterPart $objWriter->endElement(); } else { - throw new \PHPExcel\Writer\Exception("Invalid parameters passed."); + throw new \PhpSpreadsheet\Writer\Exception("Invalid parameters passed."); } } /** * Write Drawings * - * @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer - * @param \PHPExcel\Worksheet $pSheet Worksheet + * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpSpreadsheet\Worksheet $pSheet Worksheet * @param boolean $includeCharts Flag indicating if we should include drawing details for charts - * @throws \PHPExcel\Writer\Exception + * @throws \PhpSpreadsheet\Writer\Exception */ - private function writeDrawings(\PHPExcel\Shared\XMLWriter $objWriter = null, \PHPExcel\Worksheet $pSheet = null, $includeCharts = false) + private function writeDrawings(\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpSpreadsheet\Worksheet $pSheet = null, $includeCharts = false) { $chartCount = ($includeCharts) ? $pSheet->getChartCollection()->count() : 0; // If sheet contains drawings, add the relationships @@ -1188,11 +1184,11 @@ class Worksheet extends WriterPart /** * Write LegacyDrawing * - * @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer - * @param \PHPExcel\Worksheet $pSheet Worksheet - * @throws \PHPExcel\Writer\Exception + * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpSpreadsheet\Worksheet $pSheet Worksheet + * @throws \PhpSpreadsheet\Writer\Exception */ - private function writeLegacyDrawing(\PHPExcel\Shared\XMLWriter $objWriter = null, \PHPExcel\Worksheet $pSheet = null) + private function writeLegacyDrawing(\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpSpreadsheet\Worksheet $pSheet = null) { // If sheet contains comments, add the relationships if (count($pSheet->getComments()) > 0) { @@ -1205,11 +1201,11 @@ class Worksheet extends WriterPart /** * Write LegacyDrawingHF * - * @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer - * @param \PHPExcel\Worksheet $pSheet Worksheet - * @throws \PHPExcel\Writer\Exception + * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpSpreadsheet\Worksheet $pSheet Worksheet + * @throws \PhpSpreadsheet\Writer\Exception */ - private function writeLegacyDrawingHF(\PHPExcel\Shared\XMLWriter $objWriter = null, \PHPExcel\Worksheet $pSheet = null) + private function writeLegacyDrawingHF(\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpSpreadsheet\Worksheet $pSheet = null) { // If sheet contains images, add the relationships if (count($pSheet->getHeaderFooter()->getImages()) > 0) { diff --git a/src/PhpSpreadsheet/Writer/Excel2007/WriterPart.php b/src/PhpSpreadsheet/Writer/Excel2007/WriterPart.php index 72a38ed5..99a7ab7e 100644 --- a/src/PhpSpreadsheet/Writer/Excel2007/WriterPart.php +++ b/src/PhpSpreadsheet/Writer/Excel2007/WriterPart.php @@ -1,11 +1,11 @@ parentWriter = $pWriter; } @@ -50,25 +49,25 @@ abstract class WriterPart /** * Get parent IWriter object * - * @return \PHPExcel\Writer\IWriter - * @throws \PHPExcel\Writer\Exception + * @return \PhpSpreadsheet\Writer\IWriter + * @throws \PhpSpreadsheet\Writer\Exception */ public function getParentWriter() { if (!is_null($this->parentWriter)) { return $this->parentWriter; } else { - throw new \PHPExcel\Writer\Exception("No parent \\PHPExcel\\Writer\\IWriter assigned."); + throw new \PhpSpreadsheet\Writer\Exception("No parent \\PhpSpreadsheet\\Writer\\IWriter assigned."); } } /** * Set parent IWriter object * - * @param \PHPExcel\Writer\IWriter $pWriter - * @throws \PHPExcel\Writer\Exception + * @param \PhpSpreadsheet\Writer\IWriter $pWriter + * @throws \PhpSpreadsheet\Writer\Exception */ - public function __construct(\PHPExcel\Writer\IWriter $pWriter = null) + public function __construct(\PhpSpreadsheet\Writer\IWriter $pWriter = null) { if (!is_null($pWriter)) { $this->parentWriter = $pWriter; diff --git a/src/PhpSpreadsheet/Writer/Excel5.php b/src/PhpSpreadsheet/Writer/Excel5.php index f7cc9dbf..8a2f23bc 100644 --- a/src/PhpSpreadsheet/Writer/Excel5.php +++ b/src/PhpSpreadsheet/Writer/Excel5.php @@ -1,11 +1,11 @@ phpExcel = $phpExcel; + $this->spreadsheet = $spreadsheet; $this->parser = new Excel5\Parser(); } @@ -108,29 +107,29 @@ class Excel5 extends BaseWriter implements IWriter * Save Spreadsheet to file * * @param string $pFilename - * @throws \PHPExcel\Writer\Exception + * @throws \PhpSpreadsheet\Writer\Exception */ public function save($pFilename = null) { // garbage collect - $this->phpExcel->garbageCollect(); + $this->spreadsheet->garbageCollect(); - $saveDebugLog = \PHPExcel\Calculation::getInstance($this->phpExcel)->getDebugLog()->getWriteDebugLog(); - \PHPExcel\Calculation::getInstance($this->phpExcel)->getDebugLog()->setWriteDebugLog(false); - $saveDateReturnType = \PHPExcel\Calculation\Functions::getReturnDateType(); - \PHPExcel\Calculation\Functions::setReturnDateType(\PHPExcel\Calculation\Functions::RETURNDATE_EXCEL); + $saveDebugLog = \PhpSpreadsheet\Calculation::getInstance($this->spreadsheet)->getDebugLog()->getWriteDebugLog(); + \PhpSpreadsheet\Calculation::getInstance($this->spreadsheet)->getDebugLog()->setWriteDebugLog(false); + $saveDateReturnType = \PhpSpreadsheet\Calculation\Functions::getReturnDateType(); + \PhpSpreadsheet\Calculation\Functions::setReturnDateType(\PhpSpreadsheet\Calculation\Functions::RETURNDATE_EXCEL); // initialize colors array $this->colors = array(); // Initialise workbook writer - $this->writerWorkbook = new Excel5\Workbook($this->phpExcel, $this->strTotal, $this->strUnique, $this->strTable, $this->colors, $this->parser); + $this->writerWorkbook = new Excel5\Workbook($this->spreadsheet, $this->strTotal, $this->strUnique, $this->strTable, $this->colors, $this->parser); // Initialise worksheet writers - $countSheets = $this->phpExcel->getSheetCount(); + $countSheets = $this->spreadsheet->getSheetCount(); for ($i = 0; $i < $countSheets; ++$i) { - $this->writerWorksheets[$i] = new Excel5\Worksheet($this->strTotal, $this->strUnique, $this->strTable, $this->colors, $this->parser, $this->preCalculateFormulas, $this->phpExcel->getSheet($i)); + $this->writerWorksheets[$i] = new Excel5\Worksheet($this->strTotal, $this->strUnique, $this->strTable, $this->colors, $this->parser, $this->preCalculateFormulas, $this->spreadsheet->getSheet($i)); } // build Escher objects. Escher objects for workbooks needs to be build before Escher object for workbook. @@ -139,13 +138,13 @@ class Excel5 extends BaseWriter implements IWriter // add 15 identical cell style Xfs // for now, we use the first cellXf instead of cellStyleXf - $cellXfCollection = $this->phpExcel->getCellXfCollection(); + $cellXfCollection = $this->spreadsheet->getCellXfCollection(); for ($i = 0; $i < 15; ++$i) { $this->writerWorkbook->addXfWriter($cellXfCollection[0], true); } // add all the cell Xfs - foreach ($this->phpExcel->getCellXfCollection() as $style) { + foreach ($this->spreadsheet->getCellXfCollection() as $style) { $this->writerWorkbook->addXfWriter($style, false); } @@ -154,10 +153,10 @@ class Excel5 extends BaseWriter implements IWriter foreach ($this->writerWorksheets[$i]->phpSheet->getCellCollection() as $cellID) { $cell = $this->writerWorksheets[$i]->phpSheet->getCell($cellID); $cVal = $cell->getValue(); - if ($cVal instanceof \PHPExcel\RichText) { + if ($cVal instanceof \PhpSpreadsheet\RichText) { $elements = $cVal->getRichTextElements(); foreach ($elements as $element) { - if ($element instanceof \PHPExcel\RichText\Run) { + if ($element instanceof \PhpSpreadsheet\RichText\Run) { $font = $element->getFont(); $this->writerWorksheets[$i]->fontHashIndex[$font->getHashCode()] = $this->writerWorkbook->addFont($font); } @@ -168,7 +167,7 @@ class Excel5 extends BaseWriter implements IWriter // initialize OLE file $workbookStreamName = 'Workbook'; - $OLE = new \PHPExcel\Shared\OLE\PPS\File(\PHPExcel\Shared\OLE::ascToUcs($workbookStreamName)); + $OLE = new \PhpSpreadsheet\Shared\OLE\PPS\File(\PhpSpreadsheet\Shared\OLE::ascToUcs($workbookStreamName)); // Write the worksheet streams before the global workbook stream, // because the byte sizes of these are needed in the global workbook stream @@ -189,14 +188,14 @@ class Excel5 extends BaseWriter implements IWriter $this->documentSummaryInformation = $this->writeDocumentSummaryInformation(); // initialize OLE Document Summary Information if (isset($this->documentSummaryInformation) && !empty($this->documentSummaryInformation)) { - $OLE_DocumentSummaryInformation = new \PHPExcel\Shared\OLE\PPS\File(\PHPExcel\Shared\OLE::ascToUcs(chr(5) . 'DocumentSummaryInformation')); + $OLE_DocumentSummaryInformation = new \PhpSpreadsheet\Shared\OLE\PPS\File(\PhpSpreadsheet\Shared\OLE::ascToUcs(chr(5) . 'DocumentSummaryInformation')); $OLE_DocumentSummaryInformation->append($this->documentSummaryInformation); } $this->summaryInformation = $this->writeSummaryInformation(); // initialize OLE Summary Information if (isset($this->summaryInformation) && !empty($this->summaryInformation)) { - $OLE_SummaryInformation = new \PHPExcel\Shared\OLE\PPS\File(\PHPExcel\Shared\OLE::ascToUcs(chr(5) . 'SummaryInformation')); + $OLE_SummaryInformation = new \PhpSpreadsheet\Shared\OLE\PPS\File(\PhpSpreadsheet\Shared\OLE::ascToUcs(chr(5) . 'SummaryInformation')); $OLE_SummaryInformation->append($this->summaryInformation); } @@ -211,12 +210,12 @@ class Excel5 extends BaseWriter implements IWriter $arrRootData[] = $OLE_DocumentSummaryInformation; } - $root = new \PHPExcel\Shared\OLE\PPS\Root(time(), time(), $arrRootData); + $root = new \PhpSpreadsheet\Shared\OLE\PPS\Root(time(), time(), $arrRootData); // save the OLE file $res = $root->save($pFilename); - \PHPExcel\Calculation\Functions::setReturnDateType($saveDateReturnType); - \PHPExcel\Calculation::getInstance($this->phpExcel)->getDebugLog()->setWriteDebugLog($saveDebugLog); + \PhpSpreadsheet\Calculation\Functions::setReturnDateType($saveDateReturnType); + \PhpSpreadsheet\Calculation::getInstance($this->spreadsheet)->getDebugLog()->setWriteDebugLog($saveDebugLog); } /** @@ -224,8 +223,8 @@ class Excel5 extends BaseWriter implements IWriter * * @deprecated * @param string $pValue Temporary storage directory - * @throws \PHPExcel\Writer\Exception when directory does not exist - * @return \PHPExcel\Writer\Excel5 + * @throws \PhpSpreadsheet\Writer\Exception when directory does not exist + * @return \PhpSpreadsheet\Writer\Excel5 */ public function setTempDir($pValue = '') { @@ -243,7 +242,7 @@ class Excel5 extends BaseWriter implements IWriter $lastReducedSpId = 0; $lastSpId = 0; - foreach ($this->phpExcel->getAllsheets() as $sheet) { + foreach ($this->spreadsheet->getAllsheets() as $sheet) { // sheet index $sheetIndex = $sheet->getParent()->getIndex($sheet); @@ -256,10 +255,10 @@ class Excel5 extends BaseWriter implements IWriter } // create intermediate Escher object - $escher = new \PHPExcel\Shared\Escher(); + $escher = new \PhpSpreadsheet\Shared\Escher(); // dgContainer - $dgContainer = new \PHPExcel\Shared\Escher\DgContainer(); + $dgContainer = new \PhpSpreadsheet\Shared\Escher\DgContainer(); // set the drawing index (we use sheet index + 1) $dgId = $sheet->getParent()->getIndex($sheet) + 1; @@ -267,11 +266,11 @@ class Excel5 extends BaseWriter implements IWriter $escher->setDgContainer($dgContainer); // spgrContainer - $spgrContainer = new \PHPExcel\Shared\Escher\DgContainer\SpgrContainer(); + $spgrContainer = new \PhpSpreadsheet\Shared\Escher\DgContainer\SpgrContainer(); $dgContainer->setSpgrContainer($spgrContainer); // add one shape which is the group shape - $spContainer = new \PHPExcel\Shared\Escher\DgContainer\SpgrContainer\SpContainer(); + $spContainer = new \PhpSpreadsheet\Shared\Escher\DgContainer\SpgrContainer\SpContainer(); $spContainer->setSpgr(true); $spContainer->setSpType(0); $spContainer->setSpId(($sheet->getParent()->getIndex($sheet) + 1) << 10); @@ -287,7 +286,7 @@ class Excel5 extends BaseWriter implements IWriter ++$countShapes[$sheetIndex]; // add the shape - $spContainer = new \PHPExcel\Shared\Escher\DgContainer\SpgrContainer\SpContainer(); + $spContainer = new \PhpSpreadsheet\Shared\Escher\DgContainer\SpgrContainer\SpContainer(); // set the shape type $spContainer->setSpType(0x004B); @@ -316,7 +315,7 @@ class Excel5 extends BaseWriter implements IWriter $width = $drawing->getWidth(); $height = $drawing->getHeight(); - $twoAnchor = \PHPExcel\Shared\Excel5::oneAnchor2twoAnchor($sheet, $coordinates, $offsetX, $offsetY, $width, $height); + $twoAnchor = \PhpSpreadsheet\Shared\Excel5::oneAnchor2twoAnchor($sheet, $coordinates, $offsetX, $offsetY, $width, $height); $spContainer->setStartCoordinates($twoAnchor['startCoordinates']); $spContainer->setStartOffsetX($twoAnchor['startOffsetX']); @@ -330,7 +329,7 @@ class Excel5 extends BaseWriter implements IWriter // AutoFilters if (!empty($filterRange)) { - $rangeBounds = \PHPExcel\Cell::rangeBoundaries($filterRange); + $rangeBounds = \PhpSpreadsheet\Cell::rangeBoundaries($filterRange); $iNumColStart = $rangeBounds[0][0]; $iNumColEnd = $rangeBounds[1][0]; @@ -339,14 +338,14 @@ class Excel5 extends BaseWriter implements IWriter ++$countShapes[$sheetIndex]; // create an Drawing Object for the dropdown - $oDrawing = new \PHPExcel\Worksheet\BaseDrawing(); + $oDrawing = new \PhpSpreadsheet\Worksheet\BaseDrawing(); // get the coordinates of drawing - $cDrawing = \PHPExcel\Cell::stringFromColumnIndex($iInc - 1) . $rangeBounds[0][1]; + $cDrawing = \PhpSpreadsheet\Cell::stringFromColumnIndex($iInc - 1) . $rangeBounds[0][1]; $oDrawing->setCoordinates($cDrawing); $oDrawing->setWorksheet($sheet); // add the shape - $spContainer = new \PHPExcel\Shared\Escher\DgContainer\SpgrContainer\SpContainer(); + $spContainer = new \PhpSpreadsheet\Shared\Escher\DgContainer\SpgrContainer\SpContainer(); // set the shape type $spContainer->setSpType(0x00C9); // set the shape flag @@ -371,7 +370,7 @@ class Excel5 extends BaseWriter implements IWriter $spContainer->setOPT(0x03BF, 0x000A0000); // Group Shape -> fPrint // set coordinates and offsets, client anchor - $endCoordinates = \PHPExcel\Cell::stringFromColumnIndex($iInc - 1); + $endCoordinates = \PhpSpreadsheet\Cell::stringFromColumnIndex($iInc - 1); $endCoordinates .= $rangeBounds[0][1] + 1; $spContainer->setStartCoordinates($cDrawing); @@ -406,7 +405,7 @@ class Excel5 extends BaseWriter implements IWriter // any drawings in this workbook? $found = false; - foreach ($this->phpExcel->getAllSheets() as $sheet) { + foreach ($this->spreadsheet->getAllSheets() as $sheet) { if (count($sheet->getDrawingCollection()) > 0) { $found = true; break; @@ -419,10 +418,10 @@ class Excel5 extends BaseWriter implements IWriter } // if we reach here, then there are drawings in the workbook - $escher = new \PHPExcel\Shared\Escher(); + $escher = new \PhpSpreadsheet\Shared\Escher(); // dggContainer - $dggContainer = new \PHPExcel\Shared\Escher\DggContainer(); + $dggContainer = new \PhpSpreadsheet\Shared\Escher\DggContainer(); $escher->setDggContainer($dggContainer); // set IDCLs (identifier clusters) @@ -433,7 +432,7 @@ class Excel5 extends BaseWriter implements IWriter $totalCountShapes = 0; $countDrawings = 0; - foreach ($this->phpExcel->getAllsheets() as $sheet) { + foreach ($this->spreadsheet->getAllsheets() as $sheet) { $sheetCountShapes = 0; // count number of shapes (minus group shape), in sheet if (count($sheet->getDrawingCollection()) > 0) { @@ -443,7 +442,7 @@ class Excel5 extends BaseWriter implements IWriter ++$sheetCountShapes; ++$totalCountShapes; - $spId = $sheetCountShapes | ($this->phpExcel->getIndex($sheet) + 1) << 10; + $spId = $sheetCountShapes | ($this->spreadsheet->getIndex($sheet) + 1) << 10; $spIdMax = max($spId, $spIdMax); } } @@ -454,37 +453,37 @@ class Excel5 extends BaseWriter implements IWriter $dggContainer->setCSpSaved($totalCountShapes + $countDrawings); // total number of shapes incl. one group shapes per drawing // bstoreContainer - $bstoreContainer = new \PHPExcel\Shared\Escher\DggContainer\BstoreContainer(); + $bstoreContainer = new \PhpSpreadsheet\Shared\Escher\DggContainer\BstoreContainer(); $dggContainer->setBstoreContainer($bstoreContainer); // the BSE's (all the images) - foreach ($this->phpExcel->getAllsheets() as $sheet) { + foreach ($this->spreadsheet->getAllsheets() as $sheet) { foreach ($sheet->getDrawingCollection() as $drawing) { - if ($drawing instanceof \PHPExcel\Worksheet\Drawing) { + if ($drawing instanceof \PhpSpreadsheet\Worksheet\Drawing) { $filename = $drawing->getPath(); list($imagesx, $imagesy, $imageFormat) = getimagesize($filename); switch ($imageFormat) { case 1: // GIF, not supported by BIFF8, we convert to PNG - $blipType = \PHPExcel\Shared\Escher\DggContainer\BstoreContainer\BSE::BLIPTYPE_PNG; + $blipType = \PhpSpreadsheet\Shared\Escher\DggContainer\BstoreContainer\BSE::BLIPTYPE_PNG; ob_start(); imagepng(imagecreatefromgif($filename)); $blipData = ob_get_contents(); ob_end_clean(); break; case 2: // JPEG - $blipType = \PHPExcel\Shared\Escher\DggContainer\BstoreContainer\BSE::BLIPTYPE_JPEG; + $blipType = \PhpSpreadsheet\Shared\Escher\DggContainer\BstoreContainer\BSE::BLIPTYPE_JPEG; $blipData = file_get_contents($filename); break; case 3: // PNG - $blipType = \PHPExcel\Shared\Escher\DggContainer\BstoreContainer\BSE::BLIPTYPE_PNG; + $blipType = \PhpSpreadsheet\Shared\Escher\DggContainer\BstoreContainer\BSE::BLIPTYPE_PNG; $blipData = file_get_contents($filename); break; case 6: // Windows DIB (BMP), we convert to PNG - $blipType = \PHPExcel\Shared\Escher\DggContainer\BstoreContainer\BSE::BLIPTYPE_PNG; + $blipType = \PhpSpreadsheet\Shared\Escher\DggContainer\BstoreContainer\BSE::BLIPTYPE_PNG; ob_start(); - imagepng(\PHPExcel\Shared\Drawing::imagecreatefrombmp($filename)); + imagepng(\PhpSpreadsheet\Shared\Drawing::imagecreatefrombmp($filename)); $blipData = ob_get_contents(); ob_end_clean(); break; @@ -492,24 +491,24 @@ class Excel5 extends BaseWriter implements IWriter continue 2; } - $blip = new \PHPExcel\Shared\Escher\DggContainer\BstoreContainer\BSE\Blip(); + $blip = new \PhpSpreadsheet\Shared\Escher\DggContainer\BstoreContainer\BSE\Blip(); $blip->setData($blipData); - $BSE = new \PHPExcel\Shared\Escher\DggContainer\BstoreContainer\BSE(); + $BSE = new \PhpSpreadsheet\Shared\Escher\DggContainer\BstoreContainer\BSE(); $BSE->setBlipType($blipType); $BSE->setBlip($blip); $bstoreContainer->addBSE($BSE); - } elseif ($drawing instanceof \PHPExcel\Worksheet\MemoryDrawing) { + } elseif ($drawing instanceof \PhpSpreadsheet\Worksheet\MemoryDrawing) { switch ($drawing->getRenderingFunction()) { - case \PHPExcel\Worksheet\MemoryDrawing::RENDERING_JPEG: - $blipType = \PHPExcel\Shared\Escher\DggContainer\BstoreContainer\BSE::BLIPTYPE_JPEG; + case \PhpSpreadsheet\Worksheet\MemoryDrawing::RENDERING_JPEG: + $blipType = \PhpSpreadsheet\Shared\Escher\DggContainer\BstoreContainer\BSE::BLIPTYPE_JPEG; $renderingFunction = 'imagejpeg'; break; - case \PHPExcel\Worksheet\MemoryDrawing::RENDERING_GIF: - case \PHPExcel\Worksheet\MemoryDrawing::RENDERING_PNG: - case \PHPExcel\Worksheet\MemoryDrawing::RENDERING_DEFAULT: - $blipType = \PHPExcel\Shared\Escher\DggContainer\BstoreContainer\BSE::BLIPTYPE_PNG; + case \PhpSpreadsheet\Worksheet\MemoryDrawing::RENDERING_GIF: + case \PhpSpreadsheet\Worksheet\MemoryDrawing::RENDERING_PNG: + case \PhpSpreadsheet\Worksheet\MemoryDrawing::RENDERING_DEFAULT: + $blipType = \PhpSpreadsheet\Shared\Escher\DggContainer\BstoreContainer\BSE::BLIPTYPE_PNG; $renderingFunction = 'imagepng'; break; } @@ -519,10 +518,10 @@ class Excel5 extends BaseWriter implements IWriter $blipData = ob_get_contents(); ob_end_clean(); - $blip = new \PHPExcel\Shared\Escher\DggContainer\BstoreContainer\BSE\Blip(); + $blip = new \PhpSpreadsheet\Shared\Escher\DggContainer\BstoreContainer\BSE\Blip(); $blip->setData($blipData); - $BSE = new \PHPExcel\Shared\Escher\DggContainer\BstoreContainer\BSE(); + $BSE = new \PhpSpreadsheet\Shared\Escher\DggContainer\BstoreContainer\BSE(); $BSE->setBlipType($blipType); $BSE->setBlip($blip); @@ -573,8 +572,8 @@ class Excel5 extends BaseWriter implements IWriter $dataSection_NumProps++; // GKPIDDSI_CATEGORY : Category - if ($this->phpExcel->getProperties()->getCategory()) { - $dataProp = $this->phpExcel->getProperties()->getCategory(); + if ($this->spreadsheet->getProperties()->getCategory()) { + $dataProp = $this->spreadsheet->getProperties()->getCategory(); $dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x02), 'offset' => array('pack' => 'V'), 'type' => array('pack' => 'V', 'data' => 0x1E), @@ -769,8 +768,8 @@ class Excel5 extends BaseWriter implements IWriter $dataSection_NumProps++; // Title - if ($this->phpExcel->getProperties()->getTitle()) { - $dataProp = $this->phpExcel->getProperties()->getTitle(); + if ($this->spreadsheet->getProperties()->getTitle()) { + $dataProp = $this->spreadsheet->getProperties()->getTitle(); $dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x02), 'offset' => array('pack' => 'V'), 'type' => array('pack' => 'V', 'data' => 0x1E), // null-terminated string prepended by dword string length @@ -778,8 +777,8 @@ class Excel5 extends BaseWriter implements IWriter $dataSection_NumProps++; } // Subject - if ($this->phpExcel->getProperties()->getSubject()) { - $dataProp = $this->phpExcel->getProperties()->getSubject(); + if ($this->spreadsheet->getProperties()->getSubject()) { + $dataProp = $this->spreadsheet->getProperties()->getSubject(); $dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x03), 'offset' => array('pack' => 'V'), 'type' => array('pack' => 'V', 'data' => 0x1E), // null-terminated string prepended by dword string length @@ -787,8 +786,8 @@ class Excel5 extends BaseWriter implements IWriter $dataSection_NumProps++; } // Author (Creator) - if ($this->phpExcel->getProperties()->getCreator()) { - $dataProp = $this->phpExcel->getProperties()->getCreator(); + if ($this->spreadsheet->getProperties()->getCreator()) { + $dataProp = $this->spreadsheet->getProperties()->getCreator(); $dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x04), 'offset' => array('pack' => 'V'), 'type' => array('pack' => 'V', 'data' => 0x1E), // null-terminated string prepended by dword string length @@ -796,8 +795,8 @@ class Excel5 extends BaseWriter implements IWriter $dataSection_NumProps++; } // Keywords - if ($this->phpExcel->getProperties()->getKeywords()) { - $dataProp = $this->phpExcel->getProperties()->getKeywords(); + if ($this->spreadsheet->getProperties()->getKeywords()) { + $dataProp = $this->spreadsheet->getProperties()->getKeywords(); $dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x05), 'offset' => array('pack' => 'V'), 'type' => array('pack' => 'V', 'data' => 0x1E), // null-terminated string prepended by dword string length @@ -805,8 +804,8 @@ class Excel5 extends BaseWriter implements IWriter $dataSection_NumProps++; } // Comments (Description) - if ($this->phpExcel->getProperties()->getDescription()) { - $dataProp = $this->phpExcel->getProperties()->getDescription(); + if ($this->spreadsheet->getProperties()->getDescription()) { + $dataProp = $this->spreadsheet->getProperties()->getDescription(); $dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x06), 'offset' => array('pack' => 'V'), 'type' => array('pack' => 'V', 'data' => 0x1E), // null-terminated string prepended by dword string length @@ -814,8 +813,8 @@ class Excel5 extends BaseWriter implements IWriter $dataSection_NumProps++; } // Last Saved By (LastModifiedBy) - if ($this->phpExcel->getProperties()->getLastModifiedBy()) { - $dataProp = $this->phpExcel->getProperties()->getLastModifiedBy(); + if ($this->spreadsheet->getProperties()->getLastModifiedBy()) { + $dataProp = $this->spreadsheet->getProperties()->getLastModifiedBy(); $dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x08), 'offset' => array('pack' => 'V'), 'type' => array('pack' => 'V', 'data' => 0x1E), // null-terminated string prepended by dword string length @@ -823,21 +822,21 @@ class Excel5 extends BaseWriter implements IWriter $dataSection_NumProps++; } // Created Date/Time - if ($this->phpExcel->getProperties()->getCreated()) { - $dataProp = $this->phpExcel->getProperties()->getCreated(); + if ($this->spreadsheet->getProperties()->getCreated()) { + $dataProp = $this->spreadsheet->getProperties()->getCreated(); $dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x0C), 'offset' => array('pack' => 'V'), 'type' => array('pack' => 'V', 'data' => 0x40), // Filetime (64-bit value representing the number of 100-nanosecond intervals since January 1, 1601) - 'data' => array('data' => \PHPExcel\Shared\OLE::localDateToOLE($dataProp))); + 'data' => array('data' => \PhpSpreadsheet\Shared\OLE::localDateToOLE($dataProp))); $dataSection_NumProps++; } // Modified Date/Time - if ($this->phpExcel->getProperties()->getModified()) { - $dataProp = $this->phpExcel->getProperties()->getModified(); + if ($this->spreadsheet->getProperties()->getModified()) { + $dataProp = $this->spreadsheet->getProperties()->getModified(); $dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x0D), 'offset' => array('pack' => 'V'), 'type' => array('pack' => 'V', 'data' => 0x40), // Filetime (64-bit value representing the number of 100-nanosecond intervals since January 1, 1601) - 'data' => array('data' => \PHPExcel\Shared\OLE::localDateToOLE($dataProp))); + 'data' => array('data' => \PhpSpreadsheet\Shared\OLE::localDateToOLE($dataProp))); $dataSection_NumProps++; } // Security diff --git a/src/PhpSpreadsheet/Writer/Excel5/BIFFwriter.php b/src/PhpSpreadsheet/Writer/Excel5/BIFFwriter.php index 2e131d20..ab919973 100644 --- a/src/PhpSpreadsheet/Writer/Excel5/BIFFwriter.php +++ b/src/PhpSpreadsheet/Writer/Excel5/BIFFwriter.php @@ -1,11 +1,11 @@ data = ''; switch (get_class($this->object)) { - case '\\PHPExcel\\Shared\\Escher': + case '\\PhpSpreadsheet\\Shared\\Escher': if ($dggContainer = $this->object->getDggContainer()) { $writer = new Escher($dggContainer); $this->data = $writer->close(); @@ -85,7 +84,7 @@ class Escher $this->spTypes = $writer->getSpTypes(); } break; - case '\\PHPExcel\\Shared\\Escher\\DggContainer': + case '\\PhpSpreadsheet\\Shared\\Escher\\DggContainer': // this is a container record // initialize @@ -138,7 +137,7 @@ class Escher $this->data = $header . $innerData; break; - case '\\PHPExcel\\Shared\\Escher\\DggContainer\\BstoreContainer': + case '\\PhpSpreadsheet\\Shared\\Escher\\DggContainer\\BstoreContainer': // this is a container record // initialize @@ -165,7 +164,7 @@ class Escher $this->data = $header . $innerData; break; - case '\\PHPExcel\\Shared\\Escher\\DggContainer\\BstoreContainer\\BSE': + case '\\PhpSpreadsheet\\Shared\\Escher\\DggContainer\\BstoreContainer\\BSE': // this is a semi-container record // initialize @@ -214,12 +213,12 @@ class Escher $this->data .= $data; break; - case '\\PHPExcel\\Shared\\Escher\\DggContainer\\BstoreContainer\\BSE\\Blip': + case '\\PhpSpreadsheet\\Shared\\Escher\\DggContainer\\BstoreContainer\\BSE\\Blip': // this is an atom record // write the record switch ($this->object->getParent()->getBlipType()) { - case \PHPExcel\Shared\Escher\DggContainer\BstoreContainer\BSE::BLIPTYPE_JPEG: + case \PhpSpreadsheet\Shared\Escher\DggContainer\BstoreContainer\BSE::BLIPTYPE_JPEG: // initialize $innerData = ''; @@ -246,7 +245,7 @@ class Escher $this->data .= $innerData; break; - case \PHPExcel\Shared\Escher\DggContainer\BstoreContainer\BSE::BLIPTYPE_PNG: + case \PhpSpreadsheet\Shared\Escher\DggContainer\BstoreContainer\BSE::BLIPTYPE_PNG: // initialize $innerData = ''; @@ -274,7 +273,7 @@ class Escher break; } break; - case '\\PHPExcel\\Shared\\Escher\\DgContainer': + case '\\PhpSpreadsheet\\Shared\\Escher\\DgContainer': // this is a container record // initialize @@ -327,7 +326,7 @@ class Escher $this->data = $header . $innerData; break; - case '\\PHPExcel\\Shared\\Escher\\DgContainer\\SpgrContainer': + case '\\PhpSpreadsheet\\Shared\\Escher\\DgContainer\\SpgrContainer': // this is a container record // initialize @@ -366,7 +365,7 @@ class Escher $this->spOffsets = $spOffsets; $this->spTypes = $spTypes; break; - case '\\PHPExcel\\Shared\\Escher\\DgContainer\\SpgrContainer\\SpContainer': + case '\\PhpSpreadsheet\\Shared\\Escher\\DgContainer\\SpgrContainer\\SpContainer': // initialize $data = ''; @@ -430,8 +429,8 @@ class Escher $recType = 0xF010; // start coordinates - list($column, $row) = \PHPExcel\Cell::coordinateFromString($this->object->getStartCoordinates()); - $c1 = \PHPExcel\Cell::columnIndexFromString($column) - 1; + list($column, $row) = \PhpSpreadsheet\Cell::coordinateFromString($this->object->getStartCoordinates()); + $c1 = \PhpSpreadsheet\Cell::columnIndexFromString($column) - 1; $r1 = $row - 1; // start offsetX @@ -441,8 +440,8 @@ class Escher $startOffsetY = $this->object->getStartOffsetY(); // end coordinates - list($column, $row) = \PHPExcel\Cell::coordinateFromString($this->object->getEndCoordinates()); - $c2 = \PHPExcel\Cell::columnIndexFromString($column) - 1; + list($column, $row) = \PhpSpreadsheet\Cell::coordinateFromString($this->object->getEndCoordinates()); + $c2 = \PhpSpreadsheet\Cell::columnIndexFromString($column) - 1; $r2 = $row - 1; // end offsetX diff --git a/src/PhpSpreadsheet/Writer/Excel5/Font.php b/src/PhpSpreadsheet/Writer/Excel5/Font.php index 775fac81..35ced929 100644 --- a/src/PhpSpreadsheet/Writer/Excel5/Font.php +++ b/src/PhpSpreadsheet/Writer/Excel5/Font.php @@ -1,11 +1,11 @@ colorIndex = 0x7FFF; $this->font = $font; @@ -83,7 +82,7 @@ class Font $sss = 0; } $bFamily = 0; // Font family - $bCharSet = \PHPExcel\Shared\Font::getCharsetFromFontName($this->font->getName()); // Character set + $bCharSet = \PhpSpreadsheet\Shared\Font::getCharsetFromFontName($this->font->getName()); // Character set $record = 0x31; // Record identifier $reserved = 0x00; // Reserved @@ -117,7 +116,7 @@ class Font $bCharSet, $reserved ); - $data .= \PHPExcel\Shared\StringHelper::UTF8toBIFF8UnicodeShort($this->font->getName()); + $data .= \PhpSpreadsheet\Shared\StringHelper::UTF8toBIFF8UnicodeShort($this->font->getName()); $length = strlen($data); $header = pack("vv", $record, $length); @@ -145,11 +144,11 @@ class Font * */ private static $mapUnderline = array( - \PHPExcel\Style\Font::UNDERLINE_NONE => 0x00, - \PHPExcel\Style\Font::UNDERLINE_SINGLE => 0x01, - \PHPExcel\Style\Font::UNDERLINE_DOUBLE => 0x02, - \PHPExcel\Style\Font::UNDERLINE_SINGLEACCOUNTING => 0x21, - \PHPExcel\Style\Font::UNDERLINE_DOUBLEACCOUNTING => 0x22, + \PhpSpreadsheet\Style\Font::UNDERLINE_NONE => 0x00, + \PhpSpreadsheet\Style\Font::UNDERLINE_SINGLE => 0x01, + \PhpSpreadsheet\Style\Font::UNDERLINE_DOUBLE => 0x02, + \PhpSpreadsheet\Style\Font::UNDERLINE_SINGLEACCOUNTING => 0x21, + \PhpSpreadsheet\Style\Font::UNDERLINE_DOUBLEACCOUNTING => 0x22, ); /** diff --git a/src/PhpSpreadsheet/Writer/Excel5/Parser.php b/src/PhpSpreadsheet/Writer/Excel5/Parser.php index 0b7c44eb..1abb6203 100644 --- a/src/PhpSpreadsheet/Writer/Excel5/Parser.php +++ b/src/PhpSpreadsheet/Writer/Excel5/Parser.php @@ -1,11 +1,11 @@ 255) { - throw new \PHPExcel\Writer\Exception("String is too long"); + throw new \PhpSpreadsheet\Writer\Exception("String is too long"); } - return pack('C', $this->ptg['ptgStr']) . \PHPExcel\Shared\StringHelper::UTF8toBIFF8UnicodeShort($string); + return pack('C', $this->ptg['ptgStr']) . \PhpSpreadsheet\Shared\StringHelper::UTF8toBIFF8UnicodeShort($string); } /** @@ -627,7 +626,7 @@ class Parser list($cell1, $cell2) = explode(':', $range); } else { // TODO: use real error codes - throw new \PHPExcel\Writer\Exception("Unknown range separator"); + throw new \PhpSpreadsheet\Writer\Exception("Unknown range separator"); } // Convert the cell references @@ -643,7 +642,7 @@ class Parser $ptgArea = pack("C", $this->ptg['ptgAreaA']); } else { // TODO: use real error codes - throw new \PHPExcel\Writer\Exception("Unknown class $class"); + throw new \PhpSpreadsheet\Writer\Exception("Unknown class $class"); } return $ptgArea . $row1 . $row2 . $col1. $col2; } @@ -685,7 +684,7 @@ class Parser // } elseif ($class == 2) { // $ptgArea = pack("C", $this->ptg['ptgArea3dA']); // } else { -// throw new \PHPExcel\Writer\Exception("Unknown class $class"); +// throw new \PhpSpreadsheet\Writer\Exception("Unknown class $class"); // } return $ptgArea . $ext_ref . $row1 . $row2 . $col1. $col2; @@ -715,7 +714,7 @@ class Parser $ptgRef = pack("C", $this->ptg['ptgRefA']); // } else { // // TODO: use real error codes -// throw new \PHPExcel\Writer\Exception("Unknown class $class"); +// throw new \PhpSpreadsheet\Writer\Exception("Unknown class $class"); // } return $ptgRef.$row.$col; } @@ -749,7 +748,7 @@ class Parser // } elseif ($class == 2) { $ptgRef = pack("C", $this->ptg['ptgRef3dA']); // } else { -// throw new \PHPExcel\Writer\Exception("Unknown class $class"); +// throw new \PhpSpreadsheet\Writer\Exception("Unknown class $class"); // } return $ptgRef . $ext_ref. $row . $col; @@ -802,11 +801,11 @@ class Parser $sheet1 = $this->getSheetIndex($sheet_name1); if ($sheet1 == -1) { - throw new \PHPExcel\Writer\Exception("Unknown sheet name $sheet_name1 in formula"); + throw new \PhpSpreadsheet\Writer\Exception("Unknown sheet name $sheet_name1 in formula"); } $sheet2 = $this->getSheetIndex($sheet_name2); if ($sheet2 == -1) { - throw new \PHPExcel\Writer\Exception("Unknown sheet name $sheet_name2 in formula"); + throw new \PhpSpreadsheet\Writer\Exception("Unknown sheet name $sheet_name2 in formula"); } // Reverse max and min sheet numbers if necessary @@ -816,7 +815,7 @@ class Parser } else { // Single sheet name only. $sheet1 = $this->getSheetIndex($ext_ref); if ($sheet1 == -1) { - throw new \PHPExcel\Writer\Exception("Unknown sheet name $ext_ref in formula"); + throw new \PhpSpreadsheet\Writer\Exception("Unknown sheet name $ext_ref in formula"); } $sheet2 = $sheet1; } @@ -848,11 +847,11 @@ class Parser $sheet1 = $this->getSheetIndex($sheet_name1); if ($sheet1 == -1) { - throw new \PHPExcel\Writer\Exception("Unknown sheet name $sheet_name1 in formula"); + throw new \PhpSpreadsheet\Writer\Exception("Unknown sheet name $sheet_name1 in formula"); } $sheet2 = $this->getSheetIndex($sheet_name2); if ($sheet2 == -1) { - throw new \PHPExcel\Writer\Exception("Unknown sheet name $sheet_name2 in formula"); + throw new \PhpSpreadsheet\Writer\Exception("Unknown sheet name $sheet_name2 in formula"); } // Reverse max and min sheet numbers if necessary @@ -862,7 +861,7 @@ class Parser } else { // Single sheet name only. $sheet1 = $this->getSheetIndex($ext_ref); if ($sheet1 == -1) { - throw new \PHPExcel\Writer\Exception("Unknown sheet name $ext_ref in formula"); + throw new \PhpSpreadsheet\Writer\Exception("Unknown sheet name $ext_ref in formula"); } $sheet2 = $sheet1; } @@ -890,7 +889,7 @@ class Parser /** * Look up the index that corresponds to an external sheet name. The hash of * sheet names is updated by the addworksheet() method of the - * \PHPExcel\Writer\Excel5\Workbook class. + * \PhpSpreadsheet\Writer\Excel5\Workbook class. * * @access private * @param string $sheet_name Sheet name @@ -908,10 +907,10 @@ class Parser /** * This method is used to update the array of sheet names. It is * called by the addWorksheet() method of the - * \PHPExcel\Writer\Excel5\Workbook class. + * \PhpSpreadsheet\Writer\Excel5\Workbook class. * * @access public - * @see \PHPExcel\Writer\Excel5\Workbook::addWorksheet() + * @see \PhpSpreadsheet\Writer\Excel5\Workbook::addWorksheet() * @param string $name The name of the worksheet being added * @param integer $index The index of the worksheet being added */ @@ -932,10 +931,10 @@ class Parser $cell = strtoupper($cell); list($row, $col, $row_rel, $col_rel) = $this->cellToRowcol($cell); if ($col >= 256) { - throw new \PHPExcel\Writer\Exception("Column in: $cell greater than 255"); + throw new \PhpSpreadsheet\Writer\Exception("Column in: $cell greater than 255"); } if ($row >= 65536) { - throw new \PHPExcel\Writer\Exception("Row in: $cell greater than 65536 "); + throw new \PhpSpreadsheet\Writer\Exception("Row in: $cell greater than 65536 "); } // Set the high bits to indicate if row or col are relative. @@ -973,7 +972,7 @@ class Parser // FIXME: this changes for BIFF8 if (($row1 >= 65536) or ($row2 >= 65536)) { - throw new \PHPExcel\Writer\Exception("Row in: $range greater than 65536 "); + throw new \PhpSpreadsheet\Writer\Exception("Row in: $range greater than 65536 "); } // Set the high bits to indicate if rows are relative. @@ -1333,7 +1332,7 @@ class Parser $this->advance(); // eat the "(" $result = $this->parenthesizedExpression(); if ($this->currentToken != ")") { - throw new \PHPExcel\Writer\Exception("')' token expected."); + throw new \PhpSpreadsheet\Writer\Exception("')' token expected."); } $this->advance(); // eat the ")" return $result; @@ -1389,7 +1388,7 @@ class Parser $result = $this->func(); return $result; } - throw new \PHPExcel\Writer\Exception("Syntax error: ".$this->currentToken.", lookahead: ".$this->lookAhead.", current char: ".$this->currentCharacter); + throw new \PhpSpreadsheet\Writer\Exception("Syntax error: ".$this->currentToken.", lookahead: ".$this->lookAhead.", current char: ".$this->currentCharacter); } /** @@ -1412,7 +1411,7 @@ class Parser if ($this->currentToken == "," || $this->currentToken == ";") { $this->advance(); // eat the "," or ";" } else { - throw new \PHPExcel\Writer\Exception("Syntax error: comma expected in function $function, arg #{$num_args}"); + throw new \PhpSpreadsheet\Writer\Exception("Syntax error: comma expected in function $function, arg #{$num_args}"); } $result2 = $this->condition(); $result = $this->createTree('arg', $result, $result2); @@ -1423,12 +1422,12 @@ class Parser ++$num_args; } if (!isset($this->functions[$function])) { - throw new \PHPExcel\Writer\Exception("Function $function() doesn't exist"); + throw new \PhpSpreadsheet\Writer\Exception("Function $function() doesn't exist"); } $args = $this->functions[$function][1]; // If fixed number of args eg. TIME($i, $j, $k). Check that the number of args is valid. if (($args >= 0) and ($args != $num_args)) { - throw new \PHPExcel\Writer\Exception("Incorrect number of arguments in function $function() "); + throw new \PhpSpreadsheet\Writer\Exception("Incorrect number of arguments in function $function() "); } $result = $this->createTree($function, $result, $num_args); diff --git a/src/PhpSpreadsheet/Writer/Excel5/Workbook.php b/src/PhpSpreadsheet/Writer/Excel5/Workbook.php index 47b28086..5a3184ef 100644 --- a/src/PhpSpreadsheet/Writer/Excel5/Workbook.php +++ b/src/PhpSpreadsheet/Writer/Excel5/Workbook.php @@ -1,11 +1,11 @@ colors = &$colors; $this->setPaletteXl97(); - $this->phpExcel = $phpExcel; + $this->spreadsheet = $spreadsheet; // set BIFFwriter limit for CONTINUE records // $this->_limit = 8224; $this->codepage = 0x04B0; // Add empty sheets and Build color cache - $countSheets = $phpExcel->getSheetCount(); + $countSheets = $spreadsheet->getSheetCount(); for ($i = 0; $i < $countSheets; ++$i) { - $phpSheet = $phpExcel->getSheet($i); + $phpSheet = $spreadsheet->getSheet($i); $this->parser->setExtSheet($phpSheet->getTitle(), $i); // Register worksheet name with parser @@ -237,7 +236,7 @@ class Workbook extends BIFFwriter /** * Add a new XF writer * - * @param \PHPExcel\Style + * @param \PhpSpreadsheet\Style * @param boolean Is it a style XF? * @return int Index to XF record */ @@ -288,10 +287,10 @@ class Workbook extends BIFFwriter /** * Add a font to added fonts * - * @param \PHPExcel\Style\Font $font + * @param \PhpSpreadsheet\Style\Font $font * @return int Index to FONT record */ - public function addFont(\PHPExcel\Style\Font $font) + public function addFont(\PhpSpreadsheet\Style\Font $font) { $fontHashCode = $font->getHashCode(); if (isset($this->addedFonts[$fontHashCode])) { @@ -300,7 +299,7 @@ class Workbook extends BIFFwriter $countFonts = count($this->fontWriters); $fontIndex = ($countFonts < 4) ? $countFonts : $countFonts + 1; - $fontWriter = new \PHPExcel\Writer\Excel5\Font($font); + $fontWriter = new \PhpSpreadsheet\Writer\Excel5\Font($font); $fontWriter->setColorIndex($this->addColor($font->getColor()->getRGB())); $this->fontWriters[] = $fontWriter; @@ -421,7 +420,7 @@ class Workbook extends BIFFwriter // Calculate the number of selected worksheet tabs and call the finalization // methods for each worksheet - $total_worksheets = $this->phpExcel->getSheetCount(); + $total_worksheets = $this->spreadsheet->getSheetCount(); // Add part 1 of the Workbook globals, what goes before the SHEET records $this->storeBof(0x0005); @@ -455,7 +454,7 @@ class Workbook extends BIFFwriter // Add part 2 of the Workbook globals, the SHEET records $this->calcSheetOffsets(); for ($i = 0; $i < $total_worksheets; ++$i) { - $this->writeBoundSheet($this->phpExcel->getSheet($i), $this->worksheetOffsets[$i]); + $this->writeBoundSheet($this->spreadsheet->getSheet($i), $this->worksheetOffsets[$i]); } // Add part 3 of the Workbook globals @@ -477,9 +476,9 @@ class Workbook extends BIFFwriter $offset = $this->_datasize; // add size of Workbook globals part 2, the length of the SHEET records - $total_worksheets = count($this->phpExcel->getAllSheets()); - foreach ($this->phpExcel->getWorksheetIterator() as $sheet) { - $offset += $boundsheet_length + strlen(\PHPExcel\Shared\StringHelper::UTF8toBIFF8UnicodeShort($sheet->getTitle())); + $total_worksheets = count($this->spreadsheet->getAllSheets()); + foreach ($this->spreadsheet->getWorksheetIterator() as $sheet) { + $offset += $boundsheet_length + strlen(\PhpSpreadsheet\Shared\StringHelper::UTF8toBIFF8UnicodeShort($sheet->getTitle())); } // add the sizes of each of the Sheet substreams, respectively @@ -534,13 +533,13 @@ class Workbook extends BIFFwriter */ private function writeExternals() { - $countSheets = $this->phpExcel->getSheetCount(); + $countSheets = $this->spreadsheet->getSheetCount(); // Create EXTERNCOUNT with number of worksheets $this->writeExternalCount($countSheets); // Create EXTERNSHEET for each worksheet for ($i = 0; $i < $countSheets; ++$i) { - $this->writeExternalSheet($this->phpExcel->getSheet($i)->getTitle()); + $this->writeExternalSheet($this->spreadsheet->getSheet($i)->getTitle()); } } @@ -550,23 +549,23 @@ class Workbook extends BIFFwriter private function writeNames() { // total number of sheets - $total_worksheets = $this->phpExcel->getSheetCount(); + $total_worksheets = $this->spreadsheet->getSheetCount(); // Create the print area NAME records for ($i = 0; $i < $total_worksheets; ++$i) { - $sheetSetup = $this->phpExcel->getSheet($i)->getPageSetup(); + $sheetSetup = $this->spreadsheet->getSheet($i)->getPageSetup(); // Write a Name record if the print area has been defined if ($sheetSetup->isPrintAreaSet()) { // Print area - $printArea = \PHPExcel\Cell::splitRange($sheetSetup->getPrintArea()); + $printArea = \PhpSpreadsheet\Cell::splitRange($sheetSetup->getPrintArea()); $printArea = $printArea[0]; - $printArea[0] = \PHPExcel\Cell::coordinateFromString($printArea[0]); - $printArea[1] = \PHPExcel\Cell::coordinateFromString($printArea[1]); + $printArea[0] = \PhpSpreadsheet\Cell::coordinateFromString($printArea[0]); + $printArea[1] = \PhpSpreadsheet\Cell::coordinateFromString($printArea[1]); $print_rowmin = $printArea[0][1] - 1; $print_rowmax = $printArea[1][1] - 1; - $print_colmin = \PHPExcel\Cell::columnIndexFromString($printArea[0][0]) - 1; - $print_colmax = \PHPExcel\Cell::columnIndexFromString($printArea[1][0]) - 1; + $print_colmin = \PhpSpreadsheet\Cell::columnIndexFromString($printArea[0][0]) - 1; + $print_colmax = \PhpSpreadsheet\Cell::columnIndexFromString($printArea[1][0]) - 1; $this->writeNameShort( $i, // sheet index @@ -581,13 +580,13 @@ class Workbook extends BIFFwriter // Create the print title NAME records for ($i = 0; $i < $total_worksheets; ++$i) { - $sheetSetup = $this->phpExcel->getSheet($i)->getPageSetup(); + $sheetSetup = $this->spreadsheet->getSheet($i)->getPageSetup(); // simultaneous repeatColumns repeatRows if ($sheetSetup->isColumnsToRepeatAtLeftSet() && $sheetSetup->isRowsToRepeatAtTopSet()) { $repeat = $sheetSetup->getColumnsToRepeatAtLeft(); - $colmin = \PHPExcel\Cell::columnIndexFromString($repeat[0]) - 1; - $colmax = \PHPExcel\Cell::columnIndexFromString($repeat[1]) - 1; + $colmin = \PhpSpreadsheet\Cell::columnIndexFromString($repeat[0]) - 1; + $colmax = \PhpSpreadsheet\Cell::columnIndexFromString($repeat[1]) - 1; $repeat = $sheetSetup->getRowsToRepeatAtTop(); $rowmin = $repeat[0] - 1; @@ -607,8 +606,8 @@ class Workbook extends BIFFwriter // Columns to repeat if ($sheetSetup->isColumnsToRepeatAtLeftSet()) { $repeat = $sheetSetup->getColumnsToRepeatAtLeft(); - $colmin = \PHPExcel\Cell::columnIndexFromString($repeat[0]) - 1; - $colmax = \PHPExcel\Cell::columnIndexFromString($repeat[1]) - 1; + $colmin = \PhpSpreadsheet\Cell::columnIndexFromString($repeat[0]) - 1; + $colmax = \PhpSpreadsheet\Cell::columnIndexFromString($repeat[1]) - 1; } else { $colmin = 0; $colmax = 255; @@ -645,19 +644,19 @@ class Workbook extends BIFFwriter $chunk = ''; // Named ranges - if (count($this->phpExcel->getNamedRanges()) > 0) { + if (count($this->spreadsheet->getNamedRanges()) > 0) { // Loop named ranges - $namedRanges = $this->phpExcel->getNamedRanges(); + $namedRanges = $this->spreadsheet->getNamedRanges(); foreach ($namedRanges as $namedRange) { // Create absolute coordinate - $range = \PHPExcel\Cell::splitRange($namedRange->getRange()); + $range = \PhpSpreadsheet\Cell::splitRange($namedRange->getRange()); for ($i = 0; $i < count($range); $i++) { - $range[$i][0] = '\'' . str_replace("'", "''", $namedRange->getWorksheet()->getTitle()) . '\'!' . \PHPExcel\Cell::absoluteCoordinate($range[$i][0]); + $range[$i][0] = '\'' . str_replace("'", "''", $namedRange->getWorksheet()->getTitle()) . '\'!' . \PhpSpreadsheet\Cell::absoluteCoordinate($range[$i][0]); if (isset($range[$i][1])) { - $range[$i][1] = \PHPExcel\Cell::absoluteCoordinate($range[$i][1]); + $range[$i][1] = \PhpSpreadsheet\Cell::absoluteCoordinate($range[$i][1]); } } - $range = \PHPExcel\Cell::buildRange($range); // e.g. Sheet1!$A$1:$B$2 + $range = \PhpSpreadsheet\Cell::buildRange($range); // e.g. Sheet1!$A$1:$B$2 // parse formula try { @@ -671,29 +670,29 @@ class Workbook extends BIFFwriter if ($namedRange->getLocalOnly()) { // local scope - $scope = $this->phpExcel->getIndex($namedRange->getScope()) + 1; + $scope = $this->spreadsheet->getIndex($namedRange->getScope()) + 1; } else { // global scope $scope = 0; } $chunk .= $this->writeData($this->writeDefinedNameBiff8($namedRange->getName(), $formulaData, $scope, false)); - } catch (\PHPExcel\Exception $e) { + } catch (\PhpSpreadsheet\Exception $e) { // do nothing } } } // total number of sheets - $total_worksheets = $this->phpExcel->getSheetCount(); + $total_worksheets = $this->spreadsheet->getSheetCount(); // write the print titles (repeating rows, columns), if any for ($i = 0; $i < $total_worksheets; ++$i) { - $sheetSetup = $this->phpExcel->getSheet($i)->getPageSetup(); + $sheetSetup = $this->spreadsheet->getSheet($i)->getPageSetup(); // simultaneous repeatColumns repeatRows if ($sheetSetup->isColumnsToRepeatAtLeftSet() && $sheetSetup->isRowsToRepeatAtTopSet()) { $repeat = $sheetSetup->getColumnsToRepeatAtLeft(); - $colmin = \PHPExcel\Cell::columnIndexFromString($repeat[0]) - 1; - $colmax = \PHPExcel\Cell::columnIndexFromString($repeat[1]) - 1; + $colmin = \PhpSpreadsheet\Cell::columnIndexFromString($repeat[0]) - 1; + $colmax = \PhpSpreadsheet\Cell::columnIndexFromString($repeat[1]) - 1; $repeat = $sheetSetup->getRowsToRepeatAtTop(); $rowmin = $repeat[0] - 1; @@ -713,8 +712,8 @@ class Workbook extends BIFFwriter // Columns to repeat if ($sheetSetup->isColumnsToRepeatAtLeftSet()) { $repeat = $sheetSetup->getColumnsToRepeatAtLeft(); - $colmin = \PHPExcel\Cell::columnIndexFromString($repeat[0]) - 1; - $colmax = \PHPExcel\Cell::columnIndexFromString($repeat[1]) - 1; + $colmin = \PhpSpreadsheet\Cell::columnIndexFromString($repeat[0]) - 1; + $colmax = \PhpSpreadsheet\Cell::columnIndexFromString($repeat[1]) - 1; } else { $colmin = 0; $colmax = 255; @@ -739,22 +738,22 @@ class Workbook extends BIFFwriter // write the print areas, if any for ($i = 0; $i < $total_worksheets; ++$i) { - $sheetSetup = $this->phpExcel->getSheet($i)->getPageSetup(); + $sheetSetup = $this->spreadsheet->getSheet($i)->getPageSetup(); if ($sheetSetup->isPrintAreaSet()) { // Print area, e.g. A3:J6,H1:X20 - $printArea = \PHPExcel\Cell::splitRange($sheetSetup->getPrintArea()); + $printArea = \PhpSpreadsheet\Cell::splitRange($sheetSetup->getPrintArea()); $countPrintArea = count($printArea); $formulaData = ''; for ($j = 0; $j < $countPrintArea; ++$j) { $printAreaRect = $printArea[$j]; // e.g. A3:J6 - $printAreaRect[0] = \PHPExcel\Cell::coordinateFromString($printAreaRect[0]); - $printAreaRect[1] = \PHPExcel\Cell::coordinateFromString($printAreaRect[1]); + $printAreaRect[0] = \PhpSpreadsheet\Cell::coordinateFromString($printAreaRect[0]); + $printAreaRect[1] = \PhpSpreadsheet\Cell::coordinateFromString($printAreaRect[1]); $print_rowmin = $printAreaRect[0][1] - 1; $print_rowmax = $printAreaRect[1][1] - 1; - $print_colmin = \PHPExcel\Cell::columnIndexFromString($printAreaRect[0][0]) - 1; - $print_colmax = \PHPExcel\Cell::columnIndexFromString($printAreaRect[1][0]) - 1; + $print_colmin = \PhpSpreadsheet\Cell::columnIndexFromString($printAreaRect[0][0]) - 1; + $print_colmax = \PhpSpreadsheet\Cell::columnIndexFromString($printAreaRect[1][0]) - 1; // construct formula data manually because parser does not recognize absolute 3d cell references $formulaData .= pack('Cvvvvv', 0x3B, $i, $print_rowmin, $print_rowmax, $print_colmin, $print_colmax); @@ -771,10 +770,10 @@ class Workbook extends BIFFwriter // write autofilters, if any for ($i = 0; $i < $total_worksheets; ++$i) { - $sheetAutoFilter = $this->phpExcel->getSheet($i)->getAutoFilter(); + $sheetAutoFilter = $this->spreadsheet->getSheet($i)->getAutoFilter(); $autoFilterRange = $sheetAutoFilter->getRange(); if (!empty($autoFilterRange)) { - $rangeBounds = \PHPExcel\Cell::rangeBoundaries($autoFilterRange); + $rangeBounds = \PhpSpreadsheet\Cell::rangeBoundaries($autoFilterRange); //Autofilter built in name $name = pack('C', 0x0D); @@ -803,10 +802,10 @@ class Workbook extends BIFFwriter $options = $isBuiltIn ? 0x20 : 0x00; // length of the name, character count - $nlen = \PHPExcel\Shared\StringHelper::countCharacters($name); + $nlen = \PhpSpreadsheet\Shared\StringHelper::countCharacters($name); // name with stripped length field - $name = substr(\PHPExcel\Shared\StringHelper::UTF8toBIFF8UnicodeLong($name), 2); + $name = substr(\PhpSpreadsheet\Shared\StringHelper::UTF8toBIFF8UnicodeLong($name), 2); // size of the formula (in bytes) $sz = strlen($formulaData); @@ -890,14 +889,14 @@ class Workbook extends BIFFwriter $grbit = 0x0038; // Option flags - // not supported by PHPExcel, so there is only one selected sheet, the active + // not supported by PhpSpreadsheet, so there is only one selected sheet, the active $ctabsel = 1; // Number of workbook tabs selected $wTabRatio = 0x0258; // Tab to scrollbar ratio - // not supported by PHPExcel, set to 0 + // not supported by PhpSpreadsheet, set to 0 $itabFirst = 0; // 1st displayed worksheet - $itabCur = $this->phpExcel->getActiveSheetIndex(); // Active worksheet + $itabCur = $this->spreadsheet->getActiveSheetIndex(); // Active worksheet $header = pack("vv", $record, $length); $data = pack("vvvvvvvvv", $xWn, $yWn, $dxWn, $dyWn, $grbit, $itabCur, $itabFirst, $ctabsel, $wTabRatio); @@ -907,7 +906,7 @@ class Workbook extends BIFFwriter /** * Writes Excel BIFF BOUNDSHEET record. * - * @param \PHPExcel\Worksheet $sheet Worksheet name + * @param \PhpSpreadsheet\Worksheet $sheet Worksheet name * @param integer $offset Location of worksheet BOF */ private function writeBoundSheet($sheet, $offset) @@ -917,13 +916,13 @@ class Workbook extends BIFFwriter // sheet state switch ($sheet->getSheetState()) { - case \PHPExcel\Worksheet::SHEETSTATE_VISIBLE: + case \PhpSpreadsheet\Worksheet::SHEETSTATE_VISIBLE: $ss = 0x00; break; - case \PHPExcel\Worksheet::SHEETSTATE_HIDDEN: + case \PhpSpreadsheet\Worksheet::SHEETSTATE_HIDDEN: $ss = 0x01; break; - case \PHPExcel\Worksheet::SHEETSTATE_VERYHIDDEN: + case \PhpSpreadsheet\Worksheet::SHEETSTATE_VERYHIDDEN: $ss = 0x02; break; default: @@ -937,7 +936,7 @@ class Workbook extends BIFFwriter $grbit = 0x0000; // Visibility and sheet type $data = pack("VCC", $offset, $ss, $st); - $data .= \PHPExcel\Shared\StringHelper::UTF8toBIFF8UnicodeShort($sheetname); + $data .= \PhpSpreadsheet\Shared\StringHelper::UTF8toBIFF8UnicodeShort($sheetname); $length = strlen($data); $header = pack("vv", $record, $length); @@ -953,7 +952,7 @@ class Workbook extends BIFFwriter $length = 0x0004; // Bytes to follow $header = pack("vv", $record, $length); - $data = pack("vv", $this->phpExcel->getSheetCount(), 0x0401); + $data = pack("vv", $this->spreadsheet->getSheetCount(), 0x0401); return $this->writeData($header . $data); } @@ -1004,7 +1003,7 @@ class Workbook extends BIFFwriter { $record = 0x041E; // Record identifier - $numberFormatString = \PHPExcel\Shared\StringHelper::UTF8toBIFF8UnicodeLong($format); + $numberFormatString = \PhpSpreadsheet\Shared\StringHelper::UTF8toBIFF8UnicodeLong($format); $length = 2 + strlen($numberFormatString); // Number of bytes to follow @@ -1021,7 +1020,7 @@ class Workbook extends BIFFwriter $record = 0x0022; // Record identifier $length = 0x0002; // Bytes to follow - $f1904 = (\PHPExcel\Shared\Date::getExcelCalendar() == \PHPExcel\Shared\Date::CALENDAR_MAC_1904) + $f1904 = (\PhpSpreadsheet\Shared\Date::getExcelCalendar() == \PhpSpreadsheet\Shared\Date::CALENDAR_MAC_1904) ? 1 : 0; // Flag for 1904 date system @@ -1409,7 +1408,7 @@ class Workbook extends BIFFwriter { // write the Escher stream if necessary if (isset($this->escher)) { - $writer = new \PHPExcel\Writer\Excel5\Escher($this->escher); + $writer = new \PhpSpreadsheet\Writer\Excel5\Escher($this->escher); $data = $writer->close(); $record = 0x00EB; @@ -1425,7 +1424,7 @@ class Workbook extends BIFFwriter /** * Get Escher object * - * @return \PHPExcel\Shared\Escher + * @return \PhpSpreadsheet\Shared\Escher */ public function getEscher() { @@ -1435,9 +1434,9 @@ class Workbook extends BIFFwriter /** * Set Escher object * - * @param \PHPExcel\Shared\Escher $pValue + * @param \PhpSpreadsheet\Shared\Escher $pValue */ - public function setEscher(\PHPExcel\Shared\Escher $pValue = null) + public function setEscher(\PhpSpreadsheet\Shared\Escher $pValue = null) { $this->escher = $pValue; } diff --git a/src/PhpSpreadsheet/Writer/Excel5/Worksheet.php b/src/PhpSpreadsheet/Writer/Excel5/Worksheet.php index 33d43b66..a55c2292 100644 --- a/src/PhpSpreadsheet/Writer/Excel5/Worksheet.php +++ b/src/PhpSpreadsheet/Writer/Excel5/Worksheet.php @@ -1,11 +1,11 @@ firstRowIndex = ($minR > 65535) ? 65535 : $minR; $this->lastRowIndex = ($maxR > 65535) ? 65535 : $maxR ; - $this->firstColumnIndex = \PHPExcel\Cell::columnIndexFromString($minC); - $this->lastColumnIndex = \PHPExcel\Cell::columnIndexFromString($maxC); + $this->firstColumnIndex = \PhpSpreadsheet\Cell::columnIndexFromString($minC); + $this->lastColumnIndex = \PhpSpreadsheet\Cell::columnIndexFromString($maxC); // if ($this->firstColumnIndex > 255) $this->firstColumnIndex = 255; if ($this->lastColumnIndex > 255) { @@ -266,7 +265,7 @@ class Worksheet extends BIFFwriter * and to the end of the workbook. * * @access public - * @see \PHPExcel\Writer\Excel5\Workbook::storeWorkbook() + * @see \PhpSpreadsheet\Writer\Excel5\Workbook::storeWorkbook() */ public function close() { @@ -291,7 +290,7 @@ class Worksheet extends BIFFwriter // Column dimensions if (($defaultWidth = $phpSheet->getDefaultColumnDimension()->getWidth()) < 0) { - $defaultWidth = \PHPExcel\Shared\Font::getDefaultColumnWidthByFont($phpSheet->getParent()->getDefaultStyle()->getFont()); + $defaultWidth = \PhpSpreadsheet\Shared\Font::getDefaultColumnWidthByFont($phpSheet->getParent()->getDefaultStyle()->getFont()); } $columnDimensions = $phpSheet->getColumnDimensions(); @@ -303,7 +302,7 @@ class Worksheet extends BIFFwriter $width = $defaultWidth; - $columnLetter = \PHPExcel\Cell::stringFromColumnIndex($i); + $columnLetter = \PhpSpreadsheet\Cell::stringFromColumnIndex($i); if (isset($columnDimensions[$columnLetter])) { $columnDimension = $columnDimensions[$columnLetter]; if ($columnDimension->getWidth() >= 0) { @@ -388,7 +387,7 @@ class Worksheet extends BIFFwriter foreach ($phpSheet->getCellCollection() as $cellID) { $cell = $phpSheet->getCell($cellID); $row = $cell->getRow() - 1; - $column = \PHPExcel\Cell::columnIndexFromString($cell->getColumn()) - 1; + $column = \PhpSpreadsheet\Cell::columnIndexFromString($cell->getColumn()) - 1; // Don't break Excel! // if ($row + 1 > 65536 or $column + 1 > 256) { @@ -400,28 +399,28 @@ class Worksheet extends BIFFwriter $xfIndex = $cell->getXfIndex() + 15; // there are 15 cell style Xfs $cVal = $cell->getValue(); - if ($cVal instanceof \PHPExcel\RichText) { + if ($cVal instanceof \PhpSpreadsheet\RichText) { // $this->writeString($row, $column, $cVal->getPlainText(), $xfIndex); $arrcRun = array(); - $str_len = \PHPExcel\Shared\StringHelper::countCharacters($cVal->getPlainText(), 'UTF-8'); + $str_len = \PhpSpreadsheet\Shared\StringHelper::countCharacters($cVal->getPlainText(), 'UTF-8'); $str_pos = 0; $elements = $cVal->getRichTextElements(); foreach ($elements as $element) { // FONT Index - if ($element instanceof \PHPExcel\RichText\Run) { + if ($element instanceof \PhpSpreadsheet\RichText\Run) { $str_fontidx = $this->fontHashIndex[$element->getFont()->getHashCode()]; } else { $str_fontidx = 0; } $arrcRun[] = array('strlen' => $str_pos, 'fontidx' => $str_fontidx); // Position FROM - $str_pos += \PHPExcel\Shared\StringHelper::countCharacters($element->getText(), 'UTF-8'); + $str_pos += \PhpSpreadsheet\Shared\StringHelper::countCharacters($element->getText(), 'UTF-8'); } $this->writeRichTextString($row, $column, $cVal->getPlainText(), $xfIndex, $arrcRun); } else { switch ($cell->getDatatype()) { - case \PHPExcel\Cell\DataType::TYPE_STRING: - case \PHPExcel\Cell\DataType::TYPE_NULL: + case \PhpSpreadsheet\Cell\DataType::TYPE_STRING: + case \PhpSpreadsheet\Cell\DataType::TYPE_NULL: if ($cVal === '' || $cVal === null) { $this->writeBlank($row, $column, $xfIndex); } else { @@ -429,21 +428,21 @@ class Worksheet extends BIFFwriter } break; - case \PHPExcel\Cell\DataType::TYPE_NUMERIC: + case \PhpSpreadsheet\Cell\DataType::TYPE_NUMERIC: $this->writeNumber($row, $column, $cVal, $xfIndex); break; - case \PHPExcel\Cell\DataType::TYPE_FORMULA: + case \PhpSpreadsheet\Cell\DataType::TYPE_FORMULA: $calculatedValue = $this->_preCalculateFormulas ? $cell->getCalculatedValue() : null; $this->writeFormula($row, $column, $cVal, $xfIndex, $calculatedValue); break; - case \PHPExcel\Cell\DataType::TYPE_BOOL: + case \PhpSpreadsheet\Cell\DataType::TYPE_BOOL: $this->writeBoolErr($row, $column, $cVal, 0, $xfIndex); break; - case \PHPExcel\Cell\DataType::TYPE_ERROR: + case \PhpSpreadsheet\Cell\DataType::TYPE_ERROR: $this->writeBoolErr($row, $column, self::mapErrorCode($cVal), 1, $xfIndex); break; } @@ -473,7 +472,7 @@ class Worksheet extends BIFFwriter // Hyperlinks foreach ($phpSheet->getHyperLinkCollection() as $coordinate => $hyperlink) { - list($column, $row) = \PHPExcel\Cell::coordinateFromString($coordinate); + list($column, $row) = \PhpSpreadsheet\Cell::coordinateFromString($coordinate); $url = $hyperlink->getUrl(); @@ -488,7 +487,7 @@ class Worksheet extends BIFFwriter $url = 'external:' . $url; } - $this->writeUrl($row - 1, \PHPExcel\Cell::columnIndexFromString($column) - 1, $url); + $this->writeUrl($row - 1, \PhpSpreadsheet\Cell::columnIndexFromString($column) - 1, $url); } $this->writeDataValidity(); @@ -507,8 +506,8 @@ class Worksheet extends BIFFwriter // Write ConditionalFormattingTable records foreach ($arrConditionalStyles as $cellCoordinate => $conditionalStyles) { foreach ($conditionalStyles as $conditional) { - if ($conditional->getConditionType() == \PHPExcel\Style\Conditional::CONDITION_EXPRESSION - || $conditional->getConditionType() == \PHPExcel\Style\Conditional::CONDITION_CELLIS) { + if ($conditional->getConditionType() == \PhpSpreadsheet\Style\Conditional::CONDITION_EXPRESSION + || $conditional->getConditionType() == \PhpSpreadsheet\Style\Conditional::CONDITION_CELLIS) { if (!in_array($conditional->getHashCode(), $arrConditional)) { $arrConditional[] = $conditional->getHashCode(); // Write CFRULE record @@ -544,10 +543,10 @@ class Worksheet extends BIFFwriter $lastCell = $explodes[1]; } - $firstCellCoordinates = \PHPExcel\Cell::coordinateFromString($firstCell); // e.g. array(0, 1) - $lastCellCoordinates = \PHPExcel\Cell::coordinateFromString($lastCell); // e.g. array(1, 6) + $firstCellCoordinates = \PhpSpreadsheet\Cell::coordinateFromString($firstCell); // e.g. array(0, 1) + $lastCellCoordinates = \PhpSpreadsheet\Cell::coordinateFromString($lastCell); // e.g. array(1, 6) - return pack('vvvv', $firstCellCoordinates[1] - 1, $lastCellCoordinates[1] - 1, \PHPExcel\Cell::columnIndexFromString($firstCellCoordinates[0]) - 1, \PHPExcel\Cell::columnIndexFromString($lastCellCoordinates[0]) - 1); + return pack('vvvv', $firstCellCoordinates[1] - 1, $lastCellCoordinates[1] - 1, \PhpSpreadsheet\Cell::columnIndexFromString($firstCellCoordinates[0]) - 1, \PhpSpreadsheet\Cell::columnIndexFromString($lastCellCoordinates[0]) - 1); } /** @@ -659,7 +658,7 @@ class Worksheet extends BIFFwriter { $record = 0x00FD; // Record identifier $length = 0x000A; // Bytes to follow - $str = \PHPExcel\Shared\StringHelper::UTF8toBIFF8UnicodeShort($str, $arrcRun); + $str = \PhpSpreadsheet\Shared\StringHelper::UTF8toBIFF8UnicodeShort($str, $arrcRun); /* check if string is already present */ if (!isset($this->stringTable[$str])) { @@ -728,7 +727,7 @@ class Worksheet extends BIFFwriter $record = 0x00FD; // Record identifier $length = 0x000A; // Bytes to follow - $str = \PHPExcel\Shared\StringHelper::UTF8toBIFF8UnicodeLong($str); + $str = \PhpSpreadsheet\Shared\StringHelper::UTF8toBIFF8UnicodeLong($str); /* check if string is already present */ if (!isset($this->stringTable[$str])) { @@ -852,7 +851,7 @@ class Worksheet extends BIFFwriter // Numeric value $num = pack('d', $calculatedValue); } elseif (is_string($calculatedValue)) { - if (array_key_exists($calculatedValue, \PHPExcel\Cell\DataType::getErrorCodes())) { + if (array_key_exists($calculatedValue, \PhpSpreadsheet\Cell\DataType::getErrorCodes())) { // Error value $num = pack('CCCvCv', 0x02, 0x00, self::mapErrorCode($calculatedValue), 0x00, 0x00, 0xFFFF); } elseif ($calculatedValue === '') { @@ -903,7 +902,7 @@ class Worksheet extends BIFFwriter $this->writeStringRecord($stringValue); } return 0; - } catch (\PHPExcel\Exception $e) { + } catch (\PhpSpreadsheet\Exception $e) { // do nothing } } @@ -916,7 +915,7 @@ class Worksheet extends BIFFwriter private function writeStringRecord($stringValue) { $record = 0x0207; // Record identifier - $data = \PHPExcel\Shared\StringHelper::UTF8toBIFF8UnicodeLong($stringValue); + $data = \PhpSpreadsheet\Shared\StringHelper::UTF8toBIFF8UnicodeLong($stringValue); $length = strlen($data); $header = pack('vv', $record, $length); @@ -1054,10 +1053,10 @@ class Worksheet extends BIFFwriter $url .= "\0"; // character count - $url_len = \PHPExcel\Shared\StringHelper::countCharacters($url); + $url_len = \PhpSpreadsheet\Shared\StringHelper::countCharacters($url); $url_len = pack('V', $url_len); - $url = \PHPExcel\Shared\StringHelper::convertEncoding($url, 'UTF-16LE', 'UTF-8'); + $url = \PhpSpreadsheet\Shared\StringHelper::convertEncoding($url, 'UTF-16LE', 'UTF-8'); // Calculate the data length $length = 0x24 + strlen($url); @@ -1267,10 +1266,10 @@ class Worksheet extends BIFFwriter $fArabic = $this->phpSheet->getRightToLeft() ? 1 : 0; // 6 $fDspGuts = $this->outlineOn; // 7 $fFrozenNoSplit = 0; // 0 - bit - // no support in PHPExcel for selected sheet, therefore sheet is only selected if it is the active sheet + // no support in PhpSpreadsheet for selected sheet, therefore sheet is only selected if it is the active sheet $fSelected = ($this->phpSheet === $this->phpSheet->getParent()->getActiveSheet()) ? 1 : 0; $fPaged = 1; // 2 - $fPageBreakPreview = $this->phpSheet->getSheetView()->getView() === \PHPExcel\Worksheet\SheetView::SHEETVIEW_PAGE_BREAK_PREVIEW; + $fPageBreakPreview = $this->phpSheet->getSheetView()->getView() === \PhpSpreadsheet\Worksheet\SheetView::SHEETVIEW_PAGE_BREAK_PREVIEW; $grbit = $fDspFmla; $grbit |= $fDspGrid << 1; @@ -1400,7 +1399,7 @@ class Worksheet extends BIFFwriter { // look up the selected cell range $selectedCells = $this->phpSheet->getSelectedCells(); - $selectedCells = \PHPExcel\Cell::splitRange($this->phpSheet->getSelectedCells()); + $selectedCells = \PhpSpreadsheet\Cell::splitRange($this->phpSheet->getSelectedCells()); $selectedCells = $selectedCells[0]; if (count($selectedCells) == 2) { list($first, $last) = $selectedCells; @@ -1409,12 +1408,12 @@ class Worksheet extends BIFFwriter $last = $selectedCells[0]; } - list($colFirst, $rwFirst) = \PHPExcel\Cell::coordinateFromString($first); - $colFirst = \PHPExcel\Cell::columnIndexFromString($colFirst) - 1; // base 0 column index + list($colFirst, $rwFirst) = \PhpSpreadsheet\Cell::coordinateFromString($first); + $colFirst = \PhpSpreadsheet\Cell::columnIndexFromString($colFirst) - 1; // base 0 column index --$rwFirst; // base 0 row index - list($colLast, $rwLast) = \PHPExcel\Cell::coordinateFromString($last); - $colLast = \PHPExcel\Cell::columnIndexFromString($colLast) - 1; // base 0 column index + list($colLast, $rwLast) = \PhpSpreadsheet\Cell::coordinateFromString($last); + $colLast = \PhpSpreadsheet\Cell::columnIndexFromString($colLast) - 1; // base 0 column index --$rwLast; // base 0 row index // make sure we are not out of bounds @@ -1487,12 +1486,12 @@ class Worksheet extends BIFFwriter ++$j; // extract the row and column indexes - $range = \PHPExcel\Cell::splitRange($mergeCell); + $range = \PhpSpreadsheet\Cell::splitRange($mergeCell); list($first, $last) = $range[0]; - list($firstColumn, $firstRow) = \PHPExcel\Cell::coordinateFromString($first); - list($lastColumn, $lastRow) = \PHPExcel\Cell::coordinateFromString($last); + list($firstColumn, $firstRow) = \PhpSpreadsheet\Cell::coordinateFromString($first); + list($lastColumn, $lastRow) = \PhpSpreadsheet\Cell::coordinateFromString($last); - $recordData .= pack('vvvv', $firstRow - 1, $lastRow - 1, \PHPExcel\Cell::columnIndexFromString($firstColumn) - 1, \PHPExcel\Cell::columnIndexFromString($lastColumn) - 1); + $recordData .= pack('vvvv', $firstRow - 1, $lastRow - 1, \PhpSpreadsheet\Cell::columnIndexFromString($firstColumn) - 1, \PhpSpreadsheet\Cell::columnIndexFromString($lastColumn) - 1); // flush record if we have reached limit for number of merged cells, or reached final merged cell if ($j == $maxCountMergeCellsPerRecord or $i == $countMergeCells) { @@ -1617,7 +1616,7 @@ class Worksheet extends BIFFwriter hexdec($password) ); - $recordData .= \PHPExcel\Shared\StringHelper::UTF8toBIFF8UnicodeLong('p' . md5($recordData)); + $recordData .= \PhpSpreadsheet\Shared\StringHelper::UTF8toBIFF8UnicodeLong('p' . md5($recordData)); $length = strlen($recordData); @@ -1690,9 +1689,9 @@ class Worksheet extends BIFFwriter { $panes = array(); if ($freezePane = $this->phpSheet->getFreezePane()) { - list($column, $row) = \PHPExcel\Cell::coordinateFromString($freezePane); + list($column, $row) = \PhpSpreadsheet\Cell::coordinateFromString($freezePane); $panes[0] = $row - 1; - $panes[1] = \PHPExcel\Cell::columnIndexFromString($column) - 1; + $panes[1] = \PhpSpreadsheet\Cell::columnIndexFromString($column) - 1; } else { // thaw panes return; @@ -1791,7 +1790,7 @@ class Worksheet extends BIFFwriter $fLeftToRight = 0x0; // Print over then down // Page orientation - $fLandscape = ($this->phpSheet->getPageSetup()->getOrientation() == \PHPExcel\Worksheet\PageSetup::ORIENTATION_LANDSCAPE) ? + $fLandscape = ($this->phpSheet->getPageSetup()->getOrientation() == \PhpSpreadsheet\Worksheet\PageSetup::ORIENTATION_LANDSCAPE) ? 0x0 : 0x1; $fNoPls = 0x0; // Setup not read from printer @@ -1840,7 +1839,7 @@ class Worksheet extends BIFFwriter } */ - $recordData = \PHPExcel\Shared\StringHelper::UTF8toBIFF8UnicodeLong($this->phpSheet->getHeaderFooter()->getOddHeader()); + $recordData = \PhpSpreadsheet\Shared\StringHelper::UTF8toBIFF8UnicodeLong($this->phpSheet->getHeaderFooter()->getOddHeader()); $length = strlen($recordData); $header = pack("vv", $record, $length); @@ -1864,7 +1863,7 @@ class Worksheet extends BIFFwriter } */ - $recordData = \PHPExcel\Shared\StringHelper::UTF8toBIFF8UnicodeLong($this->phpSheet->getHeaderFooter()->getOddFooter()); + $recordData = \PhpSpreadsheet\Shared\StringHelper::UTF8toBIFF8UnicodeLong($this->phpSheet->getHeaderFooter()->getOddFooter()); $length = strlen($recordData); $header = pack("vv", $record, $length); @@ -2036,7 +2035,7 @@ class Worksheet extends BIFFwriter $record = 0x009D; // Record identifier $length = 0x0002; // Bytes to follow - $rangeBounds = \PHPExcel\Cell::rangeBoundaries($this->phpSheet->getAutoFilter()->getRange()); + $rangeBounds = \PhpSpreadsheet\Cell::rangeBoundaries($this->phpSheet->getAutoFilter()->getRange()); $iNumFilters = 1 + $rangeBounds[1][0] - $rangeBounds[0][0]; $header = pack("vv", $record, $length); @@ -2138,19 +2137,19 @@ class Worksheet extends BIFFwriter foreach ($this->phpSheet->getBreaks() as $cell => $breakType) { // Fetch coordinates - $coordinates = \PHPExcel\Cell::coordinateFromString($cell); + $coordinates = \PhpSpreadsheet\Cell::coordinateFromString($cell); // Decide what to do by the type of break switch ($breakType) { - case \PHPExcel\Worksheet::BREAK_COLUMN: + case \PhpSpreadsheet\Worksheet::BREAK_COLUMN: // Add to list of vertical breaks - $vbreaks[] = \PHPExcel\Cell::columnIndexFromString($coordinates[0]) - 1; + $vbreaks[] = \PhpSpreadsheet\Cell::columnIndexFromString($coordinates[0]) - 1; break; - case \PHPExcel\Worksheet::BREAK_ROW: + case \PhpSpreadsheet\Worksheet::BREAK_ROW: // Add to list of horizontal breaks $hbreaks[] = $coordinates[1]; break; - case \PHPExcel\Worksheet::BREAK_NONE: + case \PhpSpreadsheet\Worksheet::BREAK_NONE: default: // Nothing to do break; @@ -2391,10 +2390,10 @@ class Worksheet extends BIFFwriter $row_end = $row_start; // Row containing bottom right corner of object // Zero the specified offset if greater than the cell dimensions - if ($x1 >= \PHPExcel\Shared\Excel5::sizeCol($this->phpSheet, \PHPExcel\Cell::stringFromColumnIndex($col_start))) { + if ($x1 >= \PhpSpreadsheet\Shared\Excel5::sizeCol($this->phpSheet, \PhpSpreadsheet\Cell::stringFromColumnIndex($col_start))) { $x1 = 0; } - if ($y1 >= \PHPExcel\Shared\Excel5::sizeRow($this->phpSheet, $row_start + 1)) { + if ($y1 >= \PhpSpreadsheet\Shared\Excel5::sizeRow($this->phpSheet, $row_start + 1)) { $y1 = 0; } @@ -2402,38 +2401,38 @@ class Worksheet extends BIFFwriter $height = $height + $y1 -1; // Subtract the underlying cell widths to find the end cell of the image - while ($width >= \PHPExcel\Shared\Excel5::sizeCol($this->phpSheet, \PHPExcel\Cell::stringFromColumnIndex($col_end))) { - $width -= \PHPExcel\Shared\Excel5::sizeCol($this->phpSheet, \PHPExcel\Cell::stringFromColumnIndex($col_end)); + while ($width >= \PhpSpreadsheet\Shared\Excel5::sizeCol($this->phpSheet, \PhpSpreadsheet\Cell::stringFromColumnIndex($col_end))) { + $width -= \PhpSpreadsheet\Shared\Excel5::sizeCol($this->phpSheet, \PhpSpreadsheet\Cell::stringFromColumnIndex($col_end)); ++$col_end; } // Subtract the underlying cell heights to find the end cell of the image - while ($height >= \PHPExcel\Shared\Excel5::sizeRow($this->phpSheet, $row_end + 1)) { - $height -= \PHPExcel\Shared\Excel5::sizeRow($this->phpSheet, $row_end + 1); + while ($height >= \PhpSpreadsheet\Shared\Excel5::sizeRow($this->phpSheet, $row_end + 1)) { + $height -= \PhpSpreadsheet\Shared\Excel5::sizeRow($this->phpSheet, $row_end + 1); ++$row_end; } // Bitmap isn't allowed to start or finish in a hidden cell, i.e. a cell // with zero eight or width. // - if (\PHPExcel\Shared\Excel5::sizeCol($this->phpSheet, \PHPExcel\Cell::stringFromColumnIndex($col_start)) == 0) { + if (\PhpSpreadsheet\Shared\Excel5::sizeCol($this->phpSheet, \PhpSpreadsheet\Cell::stringFromColumnIndex($col_start)) == 0) { return; } - if (\PHPExcel\Shared\Excel5::sizeCol($this->phpSheet, \PHPExcel\Cell::stringFromColumnIndex($col_end)) == 0) { + if (\PhpSpreadsheet\Shared\Excel5::sizeCol($this->phpSheet, \PhpSpreadsheet\Cell::stringFromColumnIndex($col_end)) == 0) { return; } - if (\PHPExcel\Shared\Excel5::sizeRow($this->phpSheet, $row_start + 1) == 0) { + if (\PhpSpreadsheet\Shared\Excel5::sizeRow($this->phpSheet, $row_start + 1) == 0) { return; } - if (\PHPExcel\Shared\Excel5::sizeRow($this->phpSheet, $row_end + 1) == 0) { + if (\PhpSpreadsheet\Shared\Excel5::sizeRow($this->phpSheet, $row_end + 1) == 0) { return; } // Convert the pixel values to the percentage value expected by Excel - $x1 = $x1 / \PHPExcel\Shared\Excel5::sizeCol($this->phpSheet, \PHPExcel\Cell::stringFromColumnIndex($col_start)) * 1024; - $y1 = $y1 / \PHPExcel\Shared\Excel5::sizeRow($this->phpSheet, $row_start + 1) * 256; - $x2 = $width / \PHPExcel\Shared\Excel5::sizeCol($this->phpSheet, \PHPExcel\Cell::stringFromColumnIndex($col_end)) * 1024; // Distance to right side of object - $y2 = $height / \PHPExcel\Shared\Excel5::sizeRow($this->phpSheet, $row_end + 1) * 256; // Distance to bottom of object + $x1 = $x1 / \PhpSpreadsheet\Shared\Excel5::sizeCol($this->phpSheet, \PhpSpreadsheet\Cell::stringFromColumnIndex($col_start)) * 1024; + $y1 = $y1 / \PhpSpreadsheet\Shared\Excel5::sizeRow($this->phpSheet, $row_start + 1) * 256; + $x2 = $width / \PhpSpreadsheet\Shared\Excel5::sizeCol($this->phpSheet, \PhpSpreadsheet\Cell::stringFromColumnIndex($col_end)) * 1024; // Distance to right side of object + $y2 = $height / \PhpSpreadsheet\Shared\Excel5::sizeRow($this->phpSheet, $row_end + 1) * 256; // Distance to bottom of object $this->writeObjPicture($col_start, $x1, $row_start, $y1, $col_end, $x2, $row_end, $y2); } @@ -2560,7 +2559,7 @@ class Worksheet extends BIFFwriter // Open file. $bmp_fd = @fopen($bitmap, "rb"); if (!$bmp_fd) { - throw new \PHPExcel\Writer\Exception("Couldn't import $bitmap"); + throw new \PhpSpreadsheet\Writer\Exception("Couldn't import $bitmap"); } // Slurp the file into a string. @@ -2568,13 +2567,13 @@ class Worksheet extends BIFFwriter // Check that the file is big enough to be a bitmap. if (strlen($data) <= 0x36) { - throw new \PHPExcel\Writer\Exception("$bitmap doesn't contain enough data.\n"); + throw new \PhpSpreadsheet\Writer\Exception("$bitmap doesn't contain enough data.\n"); } // The first 2 bytes are used to identify the bitmap. $identity = unpack("A2ident", $data); if ($identity['ident'] != "BM") { - throw new \PHPExcel\Writer\Exception("$bitmap doesn't appear to be a valid bitmap image.\n"); + throw new \PhpSpreadsheet\Writer\Exception("$bitmap doesn't appear to be a valid bitmap image.\n"); } // Remove bitmap data: ID. @@ -2598,20 +2597,20 @@ class Worksheet extends BIFFwriter $height = $width_and_height[2]; $data = substr($data, 8); if ($width > 0xFFFF) { - throw new \PHPExcel\Writer\Exception("$bitmap: largest image width supported is 65k.\n"); + throw new \PhpSpreadsheet\Writer\Exception("$bitmap: largest image width supported is 65k.\n"); } if ($height > 0xFFFF) { - throw new \PHPExcel\Writer\Exception("$bitmap: largest image height supported is 65k.\n"); + throw new \PhpSpreadsheet\Writer\Exception("$bitmap: largest image height supported is 65k.\n"); } // Read and remove the bitmap planes and bpp data. Verify them. $planes_and_bitcount = unpack("v2", substr($data, 0, 4)); $data = substr($data, 4); if ($planes_and_bitcount[2] != 24) { // Bitcount - throw new \PHPExcel\Writer\Exception("$bitmap isn't a 24bit true color bitmap.\n"); + throw new \PhpSpreadsheet\Writer\Exception("$bitmap isn't a 24bit true color bitmap.\n"); } if ($planes_and_bitcount[1] != 1) { - throw new \PHPExcel\Writer\Exception("$bitmap: only 1 plane supported in bitmap image.\n"); + throw new \PhpSpreadsheet\Writer\Exception("$bitmap: only 1 plane supported in bitmap image.\n"); } // Read and remove the bitmap compression. Verify compression. @@ -2620,7 +2619,7 @@ class Worksheet extends BIFFwriter //$compression = 0; if ($compression['comp'] != 0) { - throw new \PHPExcel\Writer\Exception("$bitmap: compression not supported in bitmap image.\n"); + throw new \PhpSpreadsheet\Writer\Exception("$bitmap: compression not supported in bitmap image.\n"); } // Remove bitmap data: data size, hres, vres, colours, imp. colours. @@ -2655,7 +2654,7 @@ class Worksheet extends BIFFwriter /** * Get Escher object * - * @return \PHPExcel\Shared\Escher + * @return \PhpSpreadsheet\Shared\Escher */ public function getEscher() { @@ -2665,9 +2664,9 @@ class Worksheet extends BIFFwriter /** * Set Escher object * - * @param \PHPExcel\Shared\Escher $pValue + * @param \PhpSpreadsheet\Shared\Escher $pValue */ - public function setEscher(\PHPExcel\Shared\Escher $pValue = null) + public function setEscher(\PhpSpreadsheet\Shared\Escher $pValue = null) { $this->escher = $pValue; } @@ -2679,7 +2678,7 @@ class Worksheet extends BIFFwriter { // write the Escher stream if necessary if (isset($this->escher)) { - $writer = new \PHPExcel\Writer\Excel5\Escher($this->escher); + $writer = new \PhpSpreadsheet\Writer\Excel5\Escher($this->escher); $data = $writer->close(); $spOffsets = $writer->getSpOffsets(); $spTypes = $writer->getSpTypes(); @@ -2793,28 +2792,28 @@ class Worksheet extends BIFFwriter // data type $type = $dataValidation->getType(); switch ($type) { - case \PHPExcel\Cell\DataValidation::TYPE_NONE: + case \PhpSpreadsheet\Cell\DataValidation::TYPE_NONE: $type = 0x00; break; - case \PHPExcel\Cell\DataValidation::TYPE_WHOLE: + case \PhpSpreadsheet\Cell\DataValidation::TYPE_WHOLE: $type = 0x01; break; - case \PHPExcel\Cell\DataValidation::TYPE_DECIMAL: + case \PhpSpreadsheet\Cell\DataValidation::TYPE_DECIMAL: $type = 0x02; break; - case \PHPExcel\Cell\DataValidation::TYPE_LIST: + case \PhpSpreadsheet\Cell\DataValidation::TYPE_LIST: $type = 0x03; break; - case \PHPExcel\Cell\DataValidation::TYPE_DATE: + case \PhpSpreadsheet\Cell\DataValidation::TYPE_DATE: $type = 0x04; break; - case \PHPExcel\Cell\DataValidation::TYPE_TIME: + case \PhpSpreadsheet\Cell\DataValidation::TYPE_TIME: $type = 0x05; break; - case \PHPExcel\Cell\DataValidation::TYPE_TEXTLENGTH: + case \PhpSpreadsheet\Cell\DataValidation::TYPE_TEXTLENGTH: $type = 0x06; break; - case \PHPExcel\Cell\DataValidation::TYPE_CUSTOM: + case \PhpSpreadsheet\Cell\DataValidation::TYPE_CUSTOM: $type = 0x07; break; } @@ -2823,13 +2822,13 @@ class Worksheet extends BIFFwriter // error style $errorStyle = $dataValidation->getType(); switch ($errorStyle) { - case \PHPExcel\Cell\DataValidation::STYLE_STOP: + case \PhpSpreadsheet\Cell\DataValidation::STYLE_STOP: $errorStyle = 0x00; break; - case \PHPExcel\Cell\DataValidation::STYLE_WARNING: + case \PhpSpreadsheet\Cell\DataValidation::STYLE_WARNING: $errorStyle = 0x01; break; - case \PHPExcel\Cell\DataValidation::STYLE_INFORMATION: + case \PhpSpreadsheet\Cell\DataValidation::STYLE_INFORMATION: $errorStyle = 0x02; break; } @@ -2855,28 +2854,28 @@ class Worksheet extends BIFFwriter // condition operator $operator = $dataValidation->getOperator(); switch ($operator) { - case \PHPExcel\Cell\DataValidation::OPERATOR_BETWEEN: + case \PhpSpreadsheet\Cell\DataValidation::OPERATOR_BETWEEN: $operator = 0x00; break; - case \PHPExcel\Cell\DataValidation::OPERATOR_NOTBETWEEN: + case \PhpSpreadsheet\Cell\DataValidation::OPERATOR_NOTBETWEEN: $operator = 0x01; break; - case \PHPExcel\Cell\DataValidation::OPERATOR_EQUAL: + case \PhpSpreadsheet\Cell\DataValidation::OPERATOR_EQUAL: $operator = 0x02; break; - case \PHPExcel\Cell\DataValidation::OPERATOR_NOTEQUAL: + case \PhpSpreadsheet\Cell\DataValidation::OPERATOR_NOTEQUAL: $operator = 0x03; break; - case \PHPExcel\Cell\DataValidation::OPERATOR_GREATERTHAN: + case \PhpSpreadsheet\Cell\DataValidation::OPERATOR_GREATERTHAN: $operator = 0x04; break; - case \PHPExcel\Cell\DataValidation::OPERATOR_LESSTHAN: + case \PhpSpreadsheet\Cell\DataValidation::OPERATOR_LESSTHAN: $operator = 0x05; break; - case \PHPExcel\Cell\DataValidation::OPERATOR_GREATERTHANOREQUAL: + case \PhpSpreadsheet\Cell\DataValidation::OPERATOR_GREATERTHANOREQUAL: $operator = 0x06; break; - case \PHPExcel\Cell\DataValidation::OPERATOR_LESSTHANOREQUAL: + case \PhpSpreadsheet\Cell\DataValidation::OPERATOR_LESSTHANOREQUAL: $operator = 0x07; break; } @@ -2887,22 +2886,22 @@ class Worksheet extends BIFFwriter // prompt title $promptTitle = $dataValidation->getPromptTitle() !== '' ? $dataValidation->getPromptTitle() : chr(0); - $data .= \PHPExcel\Shared\StringHelper::UTF8toBIFF8UnicodeLong($promptTitle); + $data .= \PhpSpreadsheet\Shared\StringHelper::UTF8toBIFF8UnicodeLong($promptTitle); // error title $errorTitle = $dataValidation->getErrorTitle() !== '' ? $dataValidation->getErrorTitle() : chr(0); - $data .= \PHPExcel\Shared\StringHelper::UTF8toBIFF8UnicodeLong($errorTitle); + $data .= \PhpSpreadsheet\Shared\StringHelper::UTF8toBIFF8UnicodeLong($errorTitle); // prompt text $prompt = $dataValidation->getPrompt() !== '' ? $dataValidation->getPrompt() : chr(0); - $data .= \PHPExcel\Shared\StringHelper::UTF8toBIFF8UnicodeLong($prompt); + $data .= \PhpSpreadsheet\Shared\StringHelper::UTF8toBIFF8UnicodeLong($prompt); // error text $error = $dataValidation->getError() !== '' ? $dataValidation->getError() : chr(0); - $data .= \PHPExcel\Shared\StringHelper::UTF8toBIFF8UnicodeLong($error); + $data .= \PhpSpreadsheet\Shared\StringHelper::UTF8toBIFF8UnicodeLong($error); // formula 1 try { @@ -2913,7 +2912,7 @@ class Worksheet extends BIFFwriter $this->parser->parse($formula1); $formula1 = $this->parser->toReversePolish(); $sz1 = strlen($formula1); - } catch (\PHPExcel\Exception $e) { + } catch (\PhpSpreadsheet\Exception $e) { $sz1 = 0; $formula1 = ''; } @@ -2924,12 +2923,12 @@ class Worksheet extends BIFFwriter try { $formula2 = $dataValidation->getFormula2(); if ($formula2 === '') { - throw new \PHPExcel\Writer\Exception('No formula2'); + throw new \PhpSpreadsheet\Writer\Exception('No formula2'); } $this->parser->parse($formula2); $formula2 = $this->parser->toReversePolish(); $sz2 = strlen($formula2); - } catch (\PHPExcel\Exception $e) { + } catch (\PhpSpreadsheet\Exception $e) { $sz2 = 0; $formula2 = ''; } @@ -2990,7 +2989,7 @@ class Worksheet extends BIFFwriter $wScalvePLV = $this->phpSheet->getSheetView()->getZoomScale(); // 2 // The options flags that comprise $grbit - if ($this->phpSheet->getSheetView()->getView() == \PHPExcel\Worksheet\SheetView::SHEETVIEW_PAGE_LAYOUT) { + if ($this->phpSheet->getSheetView()->getView() == \PhpSpreadsheet\Worksheet\SheetView::SHEETVIEW_PAGE_LAYOUT) { $fPageLayoutView = 1; } else { $fPageLayoutView = 0; @@ -3009,43 +3008,43 @@ class Worksheet extends BIFFwriter /** * Write CFRule Record - * @param \PHPExcel\Style\Conditional $conditional + * @param \PhpSpreadsheet\Style\Conditional $conditional */ - private function writeCFRule(\PHPExcel\Style\Conditional $conditional) + private function writeCFRule(\PhpSpreadsheet\Style\Conditional $conditional) { $record = 0x01B1; // Record identifier // $type : Type of the CF // $operatorType : Comparison operator - if ($conditional->getConditionType() == \PHPExcel\Style\Conditional::CONDITION_EXPRESSION) { + if ($conditional->getConditionType() == \PhpSpreadsheet\Style\Conditional::CONDITION_EXPRESSION) { $type = 0x02; $operatorType = 0x00; - } elseif ($conditional->getConditionType() == \PHPExcel\Style\Conditional::CONDITION_CELLIS) { + } elseif ($conditional->getConditionType() == \PhpSpreadsheet\Style\Conditional::CONDITION_CELLIS) { $type = 0x01; switch ($conditional->getOperatorType()) { - case \PHPExcel\Style\Conditional::OPERATOR_NONE: + case \PhpSpreadsheet\Style\Conditional::OPERATOR_NONE: $operatorType = 0x00; break; - case \PHPExcel\Style\Conditional::OPERATOR_EQUAL: + case \PhpSpreadsheet\Style\Conditional::OPERATOR_EQUAL: $operatorType = 0x03; break; - case \PHPExcel\Style\Conditional::OPERATOR_GREATERTHAN: + case \PhpSpreadsheet\Style\Conditional::OPERATOR_GREATERTHAN: $operatorType = 0x05; break; - case \PHPExcel\Style\Conditional::OPERATOR_GREATERTHANOREQUAL: + case \PhpSpreadsheet\Style\Conditional::OPERATOR_GREATERTHANOREQUAL: $operatorType = 0x07; break; - case \PHPExcel\Style\Conditional::OPERATOR_LESSTHAN: + case \PhpSpreadsheet\Style\Conditional::OPERATOR_LESSTHAN: $operatorType = 0x06; break; - case \PHPExcel\Style\Conditional::OPERATOR_LESSTHANOREQUAL: + case \PhpSpreadsheet\Style\Conditional::OPERATOR_LESSTHANOREQUAL: $operatorType = 0x08; break; - case \PHPExcel\Style\Conditional::OPERATOR_NOTEQUAL: + case \PhpSpreadsheet\Style\Conditional::OPERATOR_NOTEQUAL: $operatorType = 0x04; break; - case \PHPExcel\Style\Conditional::OPERATOR_BETWEEN: + case \PhpSpreadsheet\Style\Conditional::OPERATOR_BETWEEN: $operatorType = 0x01; break; // not OPERATOR_NOTBETWEEN 0x02 @@ -3061,7 +3060,7 @@ class Worksheet extends BIFFwriter $szValue2 = 0x0000; $operand1 = pack('Cv', 0x1E, $arrConditions[0]); $operand2 = null; - } elseif ($numConditions == 2 && ($conditional->getOperatorType() == \PHPExcel\Style\Conditional::OPERATOR_BETWEEN)) { + } elseif ($numConditions == 2 && ($conditional->getOperatorType() == \PhpSpreadsheet\Style\Conditional::OPERATOR_BETWEEN)) { $szValue1 = ($arrConditions[0] <= 65535 ? 3 : 0x0000); $szValue2 = ($arrConditions[1] <= 65535 ? 3 : 0x0000); $operand1 = pack('Cv', 0x1E, $arrConditions[0]); @@ -3095,14 +3094,14 @@ class Worksheet extends BIFFwriter $bFormatProt = 0; } // Border - $bBorderLeft = ($conditional->getStyle()->getBorders()->getLeft()->getColor()->getARGB() == \PHPExcel\Style\Color::COLOR_BLACK - && $conditional->getStyle()->getBorders()->getLeft()->getBorderStyle() == \PHPExcel\Style\Border::BORDER_NONE ? 1 : 0); - $bBorderRight = ($conditional->getStyle()->getBorders()->getRight()->getColor()->getARGB() == \PHPExcel\Style\Color::COLOR_BLACK - && $conditional->getStyle()->getBorders()->getRight()->getBorderStyle() == \PHPExcel\Style\Border::BORDER_NONE ? 1 : 0); - $bBorderTop = ($conditional->getStyle()->getBorders()->getTop()->getColor()->getARGB() == \PHPExcel\Style\Color::COLOR_BLACK - && $conditional->getStyle()->getBorders()->getTop()->getBorderStyle() == \PHPExcel\Style\Border::BORDER_NONE ? 1 : 0); - $bBorderBottom = ($conditional->getStyle()->getBorders()->getBottom()->getColor()->getARGB() == \PHPExcel\Style\Color::COLOR_BLACK - && $conditional->getStyle()->getBorders()->getBottom()->getBorderStyle() == \PHPExcel\Style\Border::BORDER_NONE ? 1 : 0); + $bBorderLeft = ($conditional->getStyle()->getBorders()->getLeft()->getColor()->getARGB() == \PhpSpreadsheet\Style\Color::COLOR_BLACK + && $conditional->getStyle()->getBorders()->getLeft()->getBorderStyle() == \PhpSpreadsheet\Style\Border::BORDER_NONE ? 1 : 0); + $bBorderRight = ($conditional->getStyle()->getBorders()->getRight()->getColor()->getARGB() == \PhpSpreadsheet\Style\Color::COLOR_BLACK + && $conditional->getStyle()->getBorders()->getRight()->getBorderStyle() == \PhpSpreadsheet\Style\Border::BORDER_NONE ? 1 : 0); + $bBorderTop = ($conditional->getStyle()->getBorders()->getTop()->getColor()->getARGB() == \PhpSpreadsheet\Style\Color::COLOR_BLACK + && $conditional->getStyle()->getBorders()->getTop()->getBorderStyle() == \PhpSpreadsheet\Style\Border::BORDER_NONE ? 1 : 0); + $bBorderBottom = ($conditional->getStyle()->getBorders()->getBottom()->getColor()->getARGB() == \PhpSpreadsheet\Style\Color::COLOR_BLACK + && $conditional->getStyle()->getBorders()->getBottom()->getBorderStyle() == \PhpSpreadsheet\Style\Border::BORDER_NONE ? 1 : 0); if ($bBorderLeft == 0 || $bBorderRight == 0 || $bBorderTop == 0 || $bBorderBottom == 0) { $bFormatBorder = 1; } else { @@ -3178,7 +3177,7 @@ class Worksheet extends BIFFwriter $dataBlockFont = pack('VVVVVVVV', 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000); $dataBlockFont .= pack('VVVVVVVV', 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000); } else { - $dataBlockFont = \PHPExcel\Shared\StringHelper::UTF8toBIFF8UnicodeLong($conditional->getStyle()->getFont()->getName()); + $dataBlockFont = \PhpSpreadsheet\Shared\StringHelper::UTF8toBIFF8UnicodeLong($conditional->getStyle()->getFont()->getName()); } // Font Size if ($conditional->getStyle()->getFont()->getSize() == null) { @@ -3207,23 +3206,23 @@ class Worksheet extends BIFFwriter } // Underline type switch ($conditional->getStyle()->getFont()->getUnderline()) { - case \PHPExcel\Style\Font::UNDERLINE_NONE: + case \PhpSpreadsheet\Style\Font::UNDERLINE_NONE: $dataBlockFont .= pack('C', 0x00); $fontUnderline = 0; break; - case \PHPExcel\Style\Font::UNDERLINE_DOUBLE: + case \PhpSpreadsheet\Style\Font::UNDERLINE_DOUBLE: $dataBlockFont .= pack('C', 0x02); $fontUnderline = 0; break; - case \PHPExcel\Style\Font::UNDERLINE_DOUBLEACCOUNTING: + case \PhpSpreadsheet\Style\Font::UNDERLINE_DOUBLEACCOUNTING: $dataBlockFont .= pack('C', 0x22); $fontUnderline = 0; break; - case \PHPExcel\Style\Font::UNDERLINE_SINGLE: + case \PhpSpreadsheet\Style\Font::UNDERLINE_SINGLE: $dataBlockFont .= pack('C', 0x01); $fontUnderline = 0; break; - case \PHPExcel\Style\Font::UNDERLINE_SINGLEACCOUNTING: + case \PhpSpreadsheet\Style\Font::UNDERLINE_SINGLEACCOUNTING: $dataBlockFont .= pack('C', 0x21); $fontUnderline = 0; break; @@ -3437,22 +3436,22 @@ class Worksheet extends BIFFwriter $blockAlign = 0; // Alignment and text break switch ($conditional->getStyle()->getAlignment()->getHorizontal()) { - case \PHPExcel\Style\Alignment::HORIZONTAL_GENERAL: + case \PhpSpreadsheet\Style\Alignment::HORIZONTAL_GENERAL: $blockAlign = 0; break; - case \PHPExcel\Style\Alignment::HORIZONTAL_LEFT: + case \PhpSpreadsheet\Style\Alignment::HORIZONTAL_LEFT: $blockAlign = 1; break; - case \PHPExcel\Style\Alignment::HORIZONTAL_RIGHT: + case \PhpSpreadsheet\Style\Alignment::HORIZONTAL_RIGHT: $blockAlign = 3; break; - case \PHPExcel\Style\Alignment::HORIZONTAL_CENTER: + case \PhpSpreadsheet\Style\Alignment::HORIZONTAL_CENTER: $blockAlign = 2; break; - case \PHPExcel\Style\Alignment::HORIZONTAL_CENTER_CONTINUOUS: + case \PhpSpreadsheet\Style\Alignment::HORIZONTAL_CENTER_CONTINUOUS: $blockAlign = 6; break; - case \PHPExcel\Style\Alignment::HORIZONTAL_JUSTIFY: + case \PhpSpreadsheet\Style\Alignment::HORIZONTAL_JUSTIFY: $blockAlign = 5; break; } @@ -3462,16 +3461,16 @@ class Worksheet extends BIFFwriter $blockAlign |= 0 << 3; } switch ($conditional->getStyle()->getAlignment()->getVertical()) { - case \PHPExcel\Style\Alignment::VERTICAL_BOTTOM: + case \PhpSpreadsheet\Style\Alignment::VERTICAL_BOTTOM: $blockAlign = 2 << 4; break; - case \PHPExcel\Style\Alignment::VERTICAL_TOP: + case \PhpSpreadsheet\Style\Alignment::VERTICAL_TOP: $blockAlign = 0 << 4; break; - case \PHPExcel\Style\Alignment::VERTICAL_CENTER: + case \PhpSpreadsheet\Style\Alignment::VERTICAL_CENTER: $blockAlign = 1 << 4; break; - case \PHPExcel\Style\Alignment::VERTICAL_JUSTIFY: + case \PhpSpreadsheet\Style\Alignment::VERTICAL_JUSTIFY: $blockAlign = 3 << 4; break; } @@ -3497,178 +3496,178 @@ class Worksheet extends BIFFwriter if ($bFormatBorder == 1) { $blockLineStyle = 0; switch ($conditional->getStyle()->getBorders()->getLeft()->getBorderStyle()) { - case \PHPExcel\Style\Border::BORDER_NONE: + case \PhpSpreadsheet\Style\Border::BORDER_NONE: $blockLineStyle |= 0x00; break; - case \PHPExcel\Style\Border::BORDER_THIN: + case \PhpSpreadsheet\Style\Border::BORDER_THIN: $blockLineStyle |= 0x01; break; - case \PHPExcel\Style\Border::BORDER_MEDIUM: + case \PhpSpreadsheet\Style\Border::BORDER_MEDIUM: $blockLineStyle |= 0x02; break; - case \PHPExcel\Style\Border::BORDER_DASHED: + case \PhpSpreadsheet\Style\Border::BORDER_DASHED: $blockLineStyle |= 0x03; break; - case \PHPExcel\Style\Border::BORDER_DOTTED: + case \PhpSpreadsheet\Style\Border::BORDER_DOTTED: $blockLineStyle |= 0x04; break; - case \PHPExcel\Style\Border::BORDER_THICK: + case \PhpSpreadsheet\Style\Border::BORDER_THICK: $blockLineStyle |= 0x05; break; - case \PHPExcel\Style\Border::BORDER_DOUBLE: + case \PhpSpreadsheet\Style\Border::BORDER_DOUBLE: $blockLineStyle |= 0x06; break; - case \PHPExcel\Style\Border::BORDER_HAIR: + case \PhpSpreadsheet\Style\Border::BORDER_HAIR: $blockLineStyle |= 0x07; break; - case \PHPExcel\Style\Border::BORDER_MEDIUMDASHED: + case \PhpSpreadsheet\Style\Border::BORDER_MEDIUMDASHED: $blockLineStyle |= 0x08; break; - case \PHPExcel\Style\Border::BORDER_DASHDOT: + case \PhpSpreadsheet\Style\Border::BORDER_DASHDOT: $blockLineStyle |= 0x09; break; - case \PHPExcel\Style\Border::BORDER_MEDIUMDASHDOT: + case \PhpSpreadsheet\Style\Border::BORDER_MEDIUMDASHDOT: $blockLineStyle |= 0x0A; break; - case \PHPExcel\Style\Border::BORDER_DASHDOTDOT: + case \PhpSpreadsheet\Style\Border::BORDER_DASHDOTDOT: $blockLineStyle |= 0x0B; break; - case \PHPExcel\Style\Border::BORDER_MEDIUMDASHDOTDOT: + case \PhpSpreadsheet\Style\Border::BORDER_MEDIUMDASHDOTDOT: $blockLineStyle |= 0x0C; break; - case \PHPExcel\Style\Border::BORDER_SLANTDASHDOT: + case \PhpSpreadsheet\Style\Border::BORDER_SLANTDASHDOT: $blockLineStyle |= 0x0D; break; } switch ($conditional->getStyle()->getBorders()->getRight()->getBorderStyle()) { - case \PHPExcel\Style\Border::BORDER_NONE: + case \PhpSpreadsheet\Style\Border::BORDER_NONE: $blockLineStyle |= 0x00 << 4; break; - case \PHPExcel\Style\Border::BORDER_THIN: + case \PhpSpreadsheet\Style\Border::BORDER_THIN: $blockLineStyle |= 0x01 << 4; break; - case \PHPExcel\Style\Border::BORDER_MEDIUM: + case \PhpSpreadsheet\Style\Border::BORDER_MEDIUM: $blockLineStyle |= 0x02 << 4; break; - case \PHPExcel\Style\Border::BORDER_DASHED: + case \PhpSpreadsheet\Style\Border::BORDER_DASHED: $blockLineStyle |= 0x03 << 4; break; - case \PHPExcel\Style\Border::BORDER_DOTTED: + case \PhpSpreadsheet\Style\Border::BORDER_DOTTED: $blockLineStyle |= 0x04 << 4; break; - case \PHPExcel\Style\Border::BORDER_THICK: + case \PhpSpreadsheet\Style\Border::BORDER_THICK: $blockLineStyle |= 0x05 << 4; break; - case \PHPExcel\Style\Border::BORDER_DOUBLE: + case \PhpSpreadsheet\Style\Border::BORDER_DOUBLE: $blockLineStyle |= 0x06 << 4; break; - case \PHPExcel\Style\Border::BORDER_HAIR: + case \PhpSpreadsheet\Style\Border::BORDER_HAIR: $blockLineStyle |= 0x07 << 4; break; - case \PHPExcel\Style\Border::BORDER_MEDIUMDASHED: + case \PhpSpreadsheet\Style\Border::BORDER_MEDIUMDASHED: $blockLineStyle |= 0x08 << 4; break; - case \PHPExcel\Style\Border::BORDER_DASHDOT: + case \PhpSpreadsheet\Style\Border::BORDER_DASHDOT: $blockLineStyle |= 0x09 << 4; break; - case \PHPExcel\Style\Border::BORDER_MEDIUMDASHDOT: + case \PhpSpreadsheet\Style\Border::BORDER_MEDIUMDASHDOT: $blockLineStyle |= 0x0A << 4; break; - case \PHPExcel\Style\Border::BORDER_DASHDOTDOT: + case \PhpSpreadsheet\Style\Border::BORDER_DASHDOTDOT: $blockLineStyle |= 0x0B << 4; break; - case \PHPExcel\Style\Border::BORDER_MEDIUMDASHDOTDOT: + case \PhpSpreadsheet\Style\Border::BORDER_MEDIUMDASHDOTDOT: $blockLineStyle |= 0x0C << 4; break; - case \PHPExcel\Style\Border::BORDER_SLANTDASHDOT: + case \PhpSpreadsheet\Style\Border::BORDER_SLANTDASHDOT: $blockLineStyle |= 0x0D << 4; break; } switch ($conditional->getStyle()->getBorders()->getTop()->getBorderStyle()) { - case \PHPExcel\Style\Border::BORDER_NONE: + case \PhpSpreadsheet\Style\Border::BORDER_NONE: $blockLineStyle |= 0x00 << 8; break; - case \PHPExcel\Style\Border::BORDER_THIN: + case \PhpSpreadsheet\Style\Border::BORDER_THIN: $blockLineStyle |= 0x01 << 8; break; - case \PHPExcel\Style\Border::BORDER_MEDIUM: + case \PhpSpreadsheet\Style\Border::BORDER_MEDIUM: $blockLineStyle |= 0x02 << 8; break; - case \PHPExcel\Style\Border::BORDER_DASHED: + case \PhpSpreadsheet\Style\Border::BORDER_DASHED: $blockLineStyle |= 0x03 << 8; break; - case \PHPExcel\Style\Border::BORDER_DOTTED: + case \PhpSpreadsheet\Style\Border::BORDER_DOTTED: $blockLineStyle |= 0x04 << 8; break; - case \PHPExcel\Style\Border::BORDER_THICK: + case \PhpSpreadsheet\Style\Border::BORDER_THICK: $blockLineStyle |= 0x05 << 8; break; - case \PHPExcel\Style\Border::BORDER_DOUBLE: + case \PhpSpreadsheet\Style\Border::BORDER_DOUBLE: $blockLineStyle |= 0x06 << 8; break; - case \PHPExcel\Style\Border::BORDER_HAIR: + case \PhpSpreadsheet\Style\Border::BORDER_HAIR: $blockLineStyle |= 0x07 << 8; break; - case \PHPExcel\Style\Border::BORDER_MEDIUMDASHED: + case \PhpSpreadsheet\Style\Border::BORDER_MEDIUMDASHED: $blockLineStyle |= 0x08 << 8; break; - case \PHPExcel\Style\Border::BORDER_DASHDOT: + case \PhpSpreadsheet\Style\Border::BORDER_DASHDOT: $blockLineStyle |= 0x09 << 8; break; - case \PHPExcel\Style\Border::BORDER_MEDIUMDASHDOT: + case \PhpSpreadsheet\Style\Border::BORDER_MEDIUMDASHDOT: $blockLineStyle |= 0x0A << 8; break; - case \PHPExcel\Style\Border::BORDER_DASHDOTDOT: + case \PhpSpreadsheet\Style\Border::BORDER_DASHDOTDOT: $blockLineStyle |= 0x0B << 8; break; - case \PHPExcel\Style\Border::BORDER_MEDIUMDASHDOTDOT: + case \PhpSpreadsheet\Style\Border::BORDER_MEDIUMDASHDOTDOT: $blockLineStyle |= 0x0C << 8; break; - case \PHPExcel\Style\Border::BORDER_SLANTDASHDOT: + case \PhpSpreadsheet\Style\Border::BORDER_SLANTDASHDOT: $blockLineStyle |= 0x0D << 8; break; } switch ($conditional->getStyle()->getBorders()->getBottom()->getBorderStyle()) { - case \PHPExcel\Style\Border::BORDER_NONE: + case \PhpSpreadsheet\Style\Border::BORDER_NONE: $blockLineStyle |= 0x00 << 12; break; - case \PHPExcel\Style\Border::BORDER_THIN: + case \PhpSpreadsheet\Style\Border::BORDER_THIN: $blockLineStyle |= 0x01 << 12; break; - case \PHPExcel\Style\Border::BORDER_MEDIUM: + case \PhpSpreadsheet\Style\Border::BORDER_MEDIUM: $blockLineStyle |= 0x02 << 12; break; - case \PHPExcel\Style\Border::BORDER_DASHED: + case \PhpSpreadsheet\Style\Border::BORDER_DASHED: $blockLineStyle |= 0x03 << 12; break; - case \PHPExcel\Style\Border::BORDER_DOTTED: + case \PhpSpreadsheet\Style\Border::BORDER_DOTTED: $blockLineStyle |= 0x04 << 12; break; - case \PHPExcel\Style\Border::BORDER_THICK: + case \PhpSpreadsheet\Style\Border::BORDER_THICK: $blockLineStyle |= 0x05 << 12; break; - case \PHPExcel\Style\Border::BORDER_DOUBLE: + case \PhpSpreadsheet\Style\Border::BORDER_DOUBLE: $blockLineStyle |= 0x06 << 12; break; - case \PHPExcel\Style\Border::BORDER_HAIR: + case \PhpSpreadsheet\Style\Border::BORDER_HAIR: $blockLineStyle |= 0x07 << 12; break; - case \PHPExcel\Style\Border::BORDER_MEDIUMDASHED: + case \PhpSpreadsheet\Style\Border::BORDER_MEDIUMDASHED: $blockLineStyle |= 0x08 << 12; break; - case \PHPExcel\Style\Border::BORDER_DASHDOT: + case \PhpSpreadsheet\Style\Border::BORDER_DASHDOT: $blockLineStyle |= 0x09 << 12; break; - case \PHPExcel\Style\Border::BORDER_MEDIUMDASHDOT: + case \PhpSpreadsheet\Style\Border::BORDER_MEDIUMDASHDOT: $blockLineStyle |= 0x0A << 12; break; - case \PHPExcel\Style\Border::BORDER_DASHDOTDOT: + case \PhpSpreadsheet\Style\Border::BORDER_DASHDOTDOT: $blockLineStyle |= 0x0B << 12; break; - case \PHPExcel\Style\Border::BORDER_MEDIUMDASHDOTDOT: + case \PhpSpreadsheet\Style\Border::BORDER_MEDIUMDASHDOTDOT: $blockLineStyle |= 0x0C << 12; break; - case \PHPExcel\Style\Border::BORDER_SLANTDASHDOT: + case \PhpSpreadsheet\Style\Border::BORDER_SLANTDASHDOT: $blockLineStyle |= 0x0D << 12; break; } @@ -3681,46 +3680,46 @@ class Worksheet extends BIFFwriter //@todo writeCFRule() => $blockColor => Index Color for bottom line //@todo writeCFRule() => $blockColor => Index Color for diagonal line switch ($conditional->getStyle()->getBorders()->getDiagonal()->getBorderStyle()) { - case \PHPExcel\Style\Border::BORDER_NONE: + case \PhpSpreadsheet\Style\Border::BORDER_NONE: $blockColor |= 0x00 << 21; break; - case \PHPExcel\Style\Border::BORDER_THIN: + case \PhpSpreadsheet\Style\Border::BORDER_THIN: $blockColor |= 0x01 << 21; break; - case \PHPExcel\Style\Border::BORDER_MEDIUM: + case \PhpSpreadsheet\Style\Border::BORDER_MEDIUM: $blockColor |= 0x02 << 21; break; - case \PHPExcel\Style\Border::BORDER_DASHED: + case \PhpSpreadsheet\Style\Border::BORDER_DASHED: $blockColor |= 0x03 << 21; break; - case \PHPExcel\Style\Border::BORDER_DOTTED: + case \PhpSpreadsheet\Style\Border::BORDER_DOTTED: $blockColor |= 0x04 << 21; break; - case \PHPExcel\Style\Border::BORDER_THICK: + case \PhpSpreadsheet\Style\Border::BORDER_THICK: $blockColor |= 0x05 << 21; break; - case \PHPExcel\Style\Border::BORDER_DOUBLE: + case \PhpSpreadsheet\Style\Border::BORDER_DOUBLE: $blockColor |= 0x06 << 21; break; - case \PHPExcel\Style\Border::BORDER_HAIR: + case \PhpSpreadsheet\Style\Border::BORDER_HAIR: $blockColor |= 0x07 << 21; break; - case \PHPExcel\Style\Border::BORDER_MEDIUMDASHED: + case \PhpSpreadsheet\Style\Border::BORDER_MEDIUMDASHED: $blockColor |= 0x08 << 21; break; - case \PHPExcel\Style\Border::BORDER_DASHDOT: + case \PhpSpreadsheet\Style\Border::BORDER_DASHDOT: $blockColor |= 0x09 << 21; break; - case \PHPExcel\Style\Border::BORDER_MEDIUMDASHDOT: + case \PhpSpreadsheet\Style\Border::BORDER_MEDIUMDASHDOT: $blockColor |= 0x0A << 21; break; - case \PHPExcel\Style\Border::BORDER_DASHDOTDOT: + case \PhpSpreadsheet\Style\Border::BORDER_DASHDOTDOT: $blockColor |= 0x0B << 21; break; - case \PHPExcel\Style\Border::BORDER_MEDIUMDASHDOTDOT: + case \PhpSpreadsheet\Style\Border::BORDER_MEDIUMDASHDOTDOT: $blockColor |= 0x0C << 21; break; - case \PHPExcel\Style\Border::BORDER_SLANTDASHDOT: + case \PhpSpreadsheet\Style\Border::BORDER_SLANTDASHDOT: $blockColor |= 0x0D << 21; break; } @@ -3730,67 +3729,67 @@ class Worksheet extends BIFFwriter // Fill Patern Style $blockFillPatternStyle = 0; switch ($conditional->getStyle()->getFill()->getFillType()) { - case \PHPExcel\Style\Fill::FILL_NONE: + case \PhpSpreadsheet\Style\Fill::FILL_NONE: $blockFillPatternStyle = 0x00; break; - case \PHPExcel\Style\Fill::FILL_SOLID: + case \PhpSpreadsheet\Style\Fill::FILL_SOLID: $blockFillPatternStyle = 0x01; break; - case \PHPExcel\Style\Fill::FILL_PATTERN_MEDIUMGRAY: + case \PhpSpreadsheet\Style\Fill::FILL_PATTERN_MEDIUMGRAY: $blockFillPatternStyle = 0x02; break; - case \PHPExcel\Style\Fill::FILL_PATTERN_DARKGRAY: + case \PhpSpreadsheet\Style\Fill::FILL_PATTERN_DARKGRAY: $blockFillPatternStyle = 0x03; break; - case \PHPExcel\Style\Fill::FILL_PATTERN_LIGHTGRAY: + case \PhpSpreadsheet\Style\Fill::FILL_PATTERN_LIGHTGRAY: $blockFillPatternStyle = 0x04; break; - case \PHPExcel\Style\Fill::FILL_PATTERN_DARKHORIZONTAL: + case \PhpSpreadsheet\Style\Fill::FILL_PATTERN_DARKHORIZONTAL: $blockFillPatternStyle = 0x05; break; - case \PHPExcel\Style\Fill::FILL_PATTERN_DARKVERTICAL: + case \PhpSpreadsheet\Style\Fill::FILL_PATTERN_DARKVERTICAL: $blockFillPatternStyle = 0x06; break; - case \PHPExcel\Style\Fill::FILL_PATTERN_DARKDOWN: + case \PhpSpreadsheet\Style\Fill::FILL_PATTERN_DARKDOWN: $blockFillPatternStyle = 0x07; break; - case \PHPExcel\Style\Fill::FILL_PATTERN_DARKUP: + case \PhpSpreadsheet\Style\Fill::FILL_PATTERN_DARKUP: $blockFillPatternStyle = 0x08; break; - case \PHPExcel\Style\Fill::FILL_PATTERN_DARKGRID: + case \PhpSpreadsheet\Style\Fill::FILL_PATTERN_DARKGRID: $blockFillPatternStyle = 0x09; break; - case \PHPExcel\Style\Fill::FILL_PATTERN_DARKTRELLIS: + case \PhpSpreadsheet\Style\Fill::FILL_PATTERN_DARKTRELLIS: $blockFillPatternStyle = 0x0A; break; - case \PHPExcel\Style\Fill::FILL_PATTERN_LIGHTHORIZONTAL: + case \PhpSpreadsheet\Style\Fill::FILL_PATTERN_LIGHTHORIZONTAL: $blockFillPatternStyle = 0x0B; break; - case \PHPExcel\Style\Fill::FILL_PATTERN_LIGHTVERTICAL: + case \PhpSpreadsheet\Style\Fill::FILL_PATTERN_LIGHTVERTICAL: $blockFillPatternStyle = 0x0C; break; - case \PHPExcel\Style\Fill::FILL_PATTERN_LIGHTDOWN: + case \PhpSpreadsheet\Style\Fill::FILL_PATTERN_LIGHTDOWN: $blockFillPatternStyle = 0x0D; break; - case \PHPExcel\Style\Fill::FILL_PATTERN_LIGHTUP: + case \PhpSpreadsheet\Style\Fill::FILL_PATTERN_LIGHTUP: $blockFillPatternStyle = 0x0E; break; - case \PHPExcel\Style\Fill::FILL_PATTERN_LIGHTGRID: + case \PhpSpreadsheet\Style\Fill::FILL_PATTERN_LIGHTGRID: $blockFillPatternStyle = 0x0F; break; - case \PHPExcel\Style\Fill::FILL_PATTERN_LIGHTTRELLIS: + case \PhpSpreadsheet\Style\Fill::FILL_PATTERN_LIGHTTRELLIS: $blockFillPatternStyle = 0x10; break; - case \PHPExcel\Style\Fill::FILL_PATTERN_GRAY125: + case \PhpSpreadsheet\Style\Fill::FILL_PATTERN_GRAY125: $blockFillPatternStyle = 0x11; break; - case \PHPExcel\Style\Fill::FILL_PATTERN_GRAY0625: + case \PhpSpreadsheet\Style\Fill::FILL_PATTERN_GRAY0625: $blockFillPatternStyle = 0x12; break; - case \PHPExcel\Style\Fill::FILL_GRADIENT_LINEAR: + case \PhpSpreadsheet\Style\Fill::FILL_GRADIENT_LINEAR: $blockFillPatternStyle = 0x00; break; // does not exist in BIFF8 - case \PHPExcel\Style\Fill::FILL_GRADIENT_PATH: + case \PhpSpreadsheet\Style\Fill::FILL_GRADIENT_PATH: $blockFillPatternStyle = 0x00; break; // does not exist in BIFF8 default: @@ -4150,10 +4149,10 @@ class Worksheet extends BIFFwriter } if ($bFormatProt == 1) { $dataBlockProtection = 0; - if ($conditional->getStyle()->getProtection()->getLocked() == \PHPExcel\Style\Protection::PROTECTION_PROTECTED) { + if ($conditional->getStyle()->getProtection()->getLocked() == \PhpSpreadsheet\Style\Protection::PROTECTION_PROTECTED) { $dataBlockProtection = 1; } - if ($conditional->getStyle()->getProtection()->getHidden() == \PHPExcel\Style\Protection::PROTECTION_PROTECTED) { + if ($conditional->getStyle()->getProtection()->getHidden() == \PhpSpreadsheet\Style\Protection::PROTECTION_PROTECTED) { $dataBlockProtection = 1 << 1; } } @@ -4199,15 +4198,15 @@ class Worksheet extends BIFFwriter $arrConditional = array(); foreach ($this->phpSheet->getConditionalStylesCollection() as $cellCoordinate => $conditionalStyles) { foreach ($conditionalStyles as $conditional) { - if ($conditional->getConditionType() == \PHPExcel\Style\Conditional::CONDITION_EXPRESSION - || $conditional->getConditionType() == \PHPExcel\Style\Conditional::CONDITION_CELLIS) { + if ($conditional->getConditionType() == \PhpSpreadsheet\Style\Conditional::CONDITION_EXPRESSION + || $conditional->getConditionType() == \PhpSpreadsheet\Style\Conditional::CONDITION_CELLIS) { if (!in_array($conditional->getHashCode(), $arrConditional)) { $arrConditional[] = $conditional->getHashCode(); } // Cells - $arrCoord = \PHPExcel\Cell::coordinateFromString($cellCoordinate); + $arrCoord = \PhpSpreadsheet\Cell::coordinateFromString($cellCoordinate); if (!is_numeric($arrCoord[0])) { - $arrCoord[0] = \PHPExcel\Cell::columnIndexFromString($arrCoord[0]); + $arrCoord[0] = \PhpSpreadsheet\Cell::columnIndexFromString($arrCoord[0]); } if (is_null($numColumnMin) || ($numColumnMin > $arrCoord[0])) { $numColumnMin = $arrCoord[0]; diff --git a/src/PhpSpreadsheet/Writer/Excel5/Xf.php b/src/PhpSpreadsheet/Writer/Excel5/Xf.php index 1deb4ff2..033446a4 100644 --- a/src/PhpSpreadsheet/Writer/Excel5/Xf.php +++ b/src/PhpSpreadsheet/Writer/Excel5/Xf.php @@ -1,11 +1,11 @@ isStyleXf = false; $this->fontIndex = 0; @@ -229,10 +228,10 @@ class Xf $border1 |= $this->rightBorderColor << 23; $diagonalDirection = $this->_style->getBorders()->getDiagonalDirection(); - $diag_tl_to_rb = $diagonalDirection == \PHPExcel\Style\Borders::DIAGONAL_BOTH - || $diagonalDirection == \PHPExcel\Style\Borders::DIAGONAL_DOWN; - $diag_tr_to_lb = $diagonalDirection == \PHPExcel\Style\Borders::DIAGONAL_BOTH - || $diagonalDirection == \PHPExcel\Style\Borders::DIAGONAL_UP; + $diag_tl_to_rb = $diagonalDirection == \PhpSpreadsheet\Style\Borders::DIAGONAL_BOTH + || $diagonalDirection == \PhpSpreadsheet\Style\Borders::DIAGONAL_DOWN; + $diag_tr_to_lb = $diagonalDirection == \PhpSpreadsheet\Style\Borders::DIAGONAL_BOTH + || $diagonalDirection == \PhpSpreadsheet\Style\Borders::DIAGONAL_UP; $border1 |= $diag_tl_to_rb << 30; $border1 |= $diag_tr_to_lb << 31; @@ -371,20 +370,20 @@ class Xf * */ private static $mapBorderStyles = array( - \PHPExcel\Style\Border::BORDER_NONE => 0x00, - \PHPExcel\Style\Border::BORDER_THIN => 0x01, - \PHPExcel\Style\Border::BORDER_MEDIUM => 0x02, - \PHPExcel\Style\Border::BORDER_DASHED => 0x03, - \PHPExcel\Style\Border::BORDER_DOTTED => 0x04, - \PHPExcel\Style\Border::BORDER_THICK => 0x05, - \PHPExcel\Style\Border::BORDER_DOUBLE => 0x06, - \PHPExcel\Style\Border::BORDER_HAIR => 0x07, - \PHPExcel\Style\Border::BORDER_MEDIUMDASHED => 0x08, - \PHPExcel\Style\Border::BORDER_DASHDOT => 0x09, - \PHPExcel\Style\Border::BORDER_MEDIUMDASHDOT => 0x0A, - \PHPExcel\Style\Border::BORDER_DASHDOTDOT => 0x0B, - \PHPExcel\Style\Border::BORDER_MEDIUMDASHDOTDOT => 0x0C, - \PHPExcel\Style\Border::BORDER_SLANTDASHDOT => 0x0D, + \PhpSpreadsheet\Style\Border::BORDER_NONE => 0x00, + \PhpSpreadsheet\Style\Border::BORDER_THIN => 0x01, + \PhpSpreadsheet\Style\Border::BORDER_MEDIUM => 0x02, + \PhpSpreadsheet\Style\Border::BORDER_DASHED => 0x03, + \PhpSpreadsheet\Style\Border::BORDER_DOTTED => 0x04, + \PhpSpreadsheet\Style\Border::BORDER_THICK => 0x05, + \PhpSpreadsheet\Style\Border::BORDER_DOUBLE => 0x06, + \PhpSpreadsheet\Style\Border::BORDER_HAIR => 0x07, + \PhpSpreadsheet\Style\Border::BORDER_MEDIUMDASHED => 0x08, + \PhpSpreadsheet\Style\Border::BORDER_DASHDOT => 0x09, + \PhpSpreadsheet\Style\Border::BORDER_MEDIUMDASHDOT => 0x0A, + \PhpSpreadsheet\Style\Border::BORDER_DASHDOTDOT => 0x0B, + \PhpSpreadsheet\Style\Border::BORDER_MEDIUMDASHDOTDOT => 0x0C, + \PhpSpreadsheet\Style\Border::BORDER_SLANTDASHDOT => 0x0D, ); /** @@ -407,27 +406,27 @@ class Xf * */ private static $mapFillTypes = array( - \PHPExcel\Style\Fill::FILL_NONE => 0x00, - \PHPExcel\Style\Fill::FILL_SOLID => 0x01, - \PHPExcel\Style\Fill::FILL_PATTERN_MEDIUMGRAY => 0x02, - \PHPExcel\Style\Fill::FILL_PATTERN_DARKGRAY => 0x03, - \PHPExcel\Style\Fill::FILL_PATTERN_LIGHTGRAY => 0x04, - \PHPExcel\Style\Fill::FILL_PATTERN_DARKHORIZONTAL => 0x05, - \PHPExcel\Style\Fill::FILL_PATTERN_DARKVERTICAL => 0x06, - \PHPExcel\Style\Fill::FILL_PATTERN_DARKDOWN => 0x07, - \PHPExcel\Style\Fill::FILL_PATTERN_DARKUP => 0x08, - \PHPExcel\Style\Fill::FILL_PATTERN_DARKGRID => 0x09, - \PHPExcel\Style\Fill::FILL_PATTERN_DARKTRELLIS => 0x0A, - \PHPExcel\Style\Fill::FILL_PATTERN_LIGHTHORIZONTAL => 0x0B, - \PHPExcel\Style\Fill::FILL_PATTERN_LIGHTVERTICAL => 0x0C, - \PHPExcel\Style\Fill::FILL_PATTERN_LIGHTDOWN => 0x0D, - \PHPExcel\Style\Fill::FILL_PATTERN_LIGHTUP => 0x0E, - \PHPExcel\Style\Fill::FILL_PATTERN_LIGHTGRID => 0x0F, - \PHPExcel\Style\Fill::FILL_PATTERN_LIGHTTRELLIS => 0x10, - \PHPExcel\Style\Fill::FILL_PATTERN_GRAY125 => 0x11, - \PHPExcel\Style\Fill::FILL_PATTERN_GRAY0625 => 0x12, - \PHPExcel\Style\Fill::FILL_GRADIENT_LINEAR => 0x00, // does not exist in BIFF8 - \PHPExcel\Style\Fill::FILL_GRADIENT_PATH => 0x00, // does not exist in BIFF8 + \PhpSpreadsheet\Style\Fill::FILL_NONE => 0x00, + \PhpSpreadsheet\Style\Fill::FILL_SOLID => 0x01, + \PhpSpreadsheet\Style\Fill::FILL_PATTERN_MEDIUMGRAY => 0x02, + \PhpSpreadsheet\Style\Fill::FILL_PATTERN_DARKGRAY => 0x03, + \PhpSpreadsheet\Style\Fill::FILL_PATTERN_LIGHTGRAY => 0x04, + \PhpSpreadsheet\Style\Fill::FILL_PATTERN_DARKHORIZONTAL => 0x05, + \PhpSpreadsheet\Style\Fill::FILL_PATTERN_DARKVERTICAL => 0x06, + \PhpSpreadsheet\Style\Fill::FILL_PATTERN_DARKDOWN => 0x07, + \PhpSpreadsheet\Style\Fill::FILL_PATTERN_DARKUP => 0x08, + \PhpSpreadsheet\Style\Fill::FILL_PATTERN_DARKGRID => 0x09, + \PhpSpreadsheet\Style\Fill::FILL_PATTERN_DARKTRELLIS => 0x0A, + \PhpSpreadsheet\Style\Fill::FILL_PATTERN_LIGHTHORIZONTAL => 0x0B, + \PhpSpreadsheet\Style\Fill::FILL_PATTERN_LIGHTVERTICAL => 0x0C, + \PhpSpreadsheet\Style\Fill::FILL_PATTERN_LIGHTDOWN => 0x0D, + \PhpSpreadsheet\Style\Fill::FILL_PATTERN_LIGHTUP => 0x0E, + \PhpSpreadsheet\Style\Fill::FILL_PATTERN_LIGHTGRID => 0x0F, + \PhpSpreadsheet\Style\Fill::FILL_PATTERN_LIGHTTRELLIS => 0x10, + \PhpSpreadsheet\Style\Fill::FILL_PATTERN_GRAY125 => 0x11, + \PhpSpreadsheet\Style\Fill::FILL_PATTERN_GRAY0625 => 0x12, + \PhpSpreadsheet\Style\Fill::FILL_GRADIENT_LINEAR => 0x00, // does not exist in BIFF8 + \PhpSpreadsheet\Style\Fill::FILL_GRADIENT_PATH => 0x00, // does not exist in BIFF8 ); /** @@ -450,13 +449,13 @@ class Xf * */ private static $mapHAlignments = array( - \PHPExcel\Style\Alignment::HORIZONTAL_GENERAL => 0, - \PHPExcel\Style\Alignment::HORIZONTAL_LEFT => 1, - \PHPExcel\Style\Alignment::HORIZONTAL_CENTER => 2, - \PHPExcel\Style\Alignment::HORIZONTAL_RIGHT => 3, - \PHPExcel\Style\Alignment::HORIZONTAL_FILL => 4, - \PHPExcel\Style\Alignment::HORIZONTAL_JUSTIFY => 5, - \PHPExcel\Style\Alignment::HORIZONTAL_CENTER_CONTINUOUS => 6, + \PhpSpreadsheet\Style\Alignment::HORIZONTAL_GENERAL => 0, + \PhpSpreadsheet\Style\Alignment::HORIZONTAL_LEFT => 1, + \PhpSpreadsheet\Style\Alignment::HORIZONTAL_CENTER => 2, + \PhpSpreadsheet\Style\Alignment::HORIZONTAL_RIGHT => 3, + \PhpSpreadsheet\Style\Alignment::HORIZONTAL_FILL => 4, + \PhpSpreadsheet\Style\Alignment::HORIZONTAL_JUSTIFY => 5, + \PhpSpreadsheet\Style\Alignment::HORIZONTAL_CENTER_CONTINUOUS => 6, ); /** @@ -479,10 +478,10 @@ class Xf * */ private static $mapVAlignments = array( - \PHPExcel\Style\Alignment::VERTICAL_TOP => 0, - \PHPExcel\Style\Alignment::VERTICAL_CENTER => 1, - \PHPExcel\Style\Alignment::VERTICAL_BOTTOM => 2, - \PHPExcel\Style\Alignment::VERTICAL_JUSTIFY => 3, + \PhpSpreadsheet\Style\Alignment::VERTICAL_TOP => 0, + \PhpSpreadsheet\Style\Alignment::VERTICAL_CENTER => 1, + \PhpSpreadsheet\Style\Alignment::VERTICAL_BOTTOM => 2, + \PhpSpreadsheet\Style\Alignment::VERTICAL_JUSTIFY => 3, ); /** @@ -525,11 +524,11 @@ class Xf private static function mapLocked($locked) { switch ($locked) { - case \PHPExcel\Style\Protection::PROTECTION_INHERIT: + case \PhpSpreadsheet\Style\Protection::PROTECTION_INHERIT: return 1; - case \PHPExcel\Style\Protection::PROTECTION_PROTECTED: + case \PhpSpreadsheet\Style\Protection::PROTECTION_PROTECTED: return 1; - case \PHPExcel\Style\Protection::PROTECTION_UNPROTECTED: + case \PhpSpreadsheet\Style\Protection::PROTECTION_UNPROTECTED: return 0; default: return 1; @@ -545,11 +544,11 @@ class Xf private static function mapHidden($hidden) { switch ($hidden) { - case \PHPExcel\Style\Protection::PROTECTION_INHERIT: + case \PhpSpreadsheet\Style\Protection::PROTECTION_INHERIT: return 0; - case \PHPExcel\Style\Protection::PROTECTION_PROTECTED: + case \PhpSpreadsheet\Style\Protection::PROTECTION_PROTECTED: return 1; - case \PHPExcel\Style\Protection::PROTECTION_UNPROTECTED: + case \PhpSpreadsheet\Style\Protection::PROTECTION_UNPROTECTED: return 0; default: return 0; diff --git a/src/PhpSpreadsheet/Writer/Exception.php b/src/PhpSpreadsheet/Writer/Exception.php index e5b0d4ad..42cec6f4 100644 --- a/src/PhpSpreadsheet/Writer/Exception.php +++ b/src/PhpSpreadsheet/Writer/Exception.php @@ -1,11 +1,11 @@ phpExcel = $phpExcel; - $this->defaultFont = $this->phpExcel->getDefaultStyle()->getFont(); + $this->spreadsheet = $spreadsheet; + $this->defaultFont = $this->spreadsheet->getDefaultStyle()->getFont(); } /** - * Save PHPExcel to file + * Save Spreadsheet to file * * @param string $pFilename - * @throws \PHPExcel\Writer\Exception + * @throws \Spreadsheet\Writer\Exception */ public function save($pFilename = null) { // garbage collect - $this->phpExcel->garbageCollect(); + $this->spreadsheet->garbageCollect(); - $saveDebugLog = Calculation::getInstance($this->phpExcel)->getDebugLog()->getWriteDebugLog(); - Calculation::getInstance($this->phpExcel)->getDebugLog()->setWriteDebugLog(false); + $saveDebugLog = Calculation::getInstance($this->spreadsheet)->getDebugLog()->getWriteDebugLog(); + Calculation::getInstance($this->spreadsheet)->getDebugLog()->setWriteDebugLog(false); $saveArrayReturnType = Calculation::getArrayReturnType(); Calculation::setArrayReturnType(Calculation::RETURN_ARRAY_AS_VALUE); @@ -165,7 +164,7 @@ class HTML extends BaseWriter implements IWriter // Open file $fileHandle = fopen($pFilename, 'wb+'); if ($fileHandle === false) { - throw new \PHPExcel\Writer\Exception("Could not open file $pFilename for writing."); + throw new \Spreadsheet\Writer\Exception("Could not open file $pFilename for writing."); } // Write headers @@ -186,7 +185,7 @@ class HTML extends BaseWriter implements IWriter fclose($fileHandle); Calculation::setArrayReturnType($saveArrayReturnType); - Calculation::getInstance($this->phpExcel)->getDebugLog()->setWriteDebugLog($saveDebugLog); + Calculation::getInstance($this->spreadsheet)->getDebugLog()->setWriteDebugLog($saveDebugLog); } /** @@ -198,12 +197,12 @@ class HTML extends BaseWriter implements IWriter private function mapVAlign($vAlign) { switch ($vAlign) { - case \PHPExcel\Style\Alignment::VERTICAL_BOTTOM: + case \Spreadsheet\Style\Alignment::VERTICAL_BOTTOM: return 'bottom'; - case \PHPExcel\Style\Alignment::VERTICAL_TOP: + case \Spreadsheet\Style\Alignment::VERTICAL_TOP: return 'top'; - case \PHPExcel\Style\Alignment::VERTICAL_CENTER: - case \PHPExcel\Style\Alignment::VERTICAL_JUSTIFY: + case \Spreadsheet\Style\Alignment::VERTICAL_CENTER: + case \Spreadsheet\Style\Alignment::VERTICAL_JUSTIFY: return 'middle'; default: return 'baseline'; @@ -219,16 +218,16 @@ class HTML extends BaseWriter implements IWriter private function mapHAlign($hAlign) { switch ($hAlign) { - case \PHPExcel\Style\Alignment::HORIZONTAL_GENERAL: + case \Spreadsheet\Style\Alignment::HORIZONTAL_GENERAL: return false; - case \PHPExcel\Style\Alignment::HORIZONTAL_LEFT: + case \Spreadsheet\Style\Alignment::HORIZONTAL_LEFT: return 'left'; - case \PHPExcel\Style\Alignment::HORIZONTAL_RIGHT: + case \Spreadsheet\Style\Alignment::HORIZONTAL_RIGHT: return 'right'; - case \PHPExcel\Style\Alignment::HORIZONTAL_CENTER: - case \PHPExcel\Style\Alignment::HORIZONTAL_CENTER_CONTINUOUS: + case \Spreadsheet\Style\Alignment::HORIZONTAL_CENTER: + case \Spreadsheet\Style\Alignment::HORIZONTAL_CENTER_CONTINUOUS: return 'center'; - case \PHPExcel\Style\Alignment::HORIZONTAL_JUSTIFY: + case \Spreadsheet\Style\Alignment::HORIZONTAL_JUSTIFY: return 'justify'; default: return false; @@ -244,33 +243,33 @@ class HTML extends BaseWriter implements IWriter private function mapBorderStyle($borderStyle) { switch ($borderStyle) { - case \PHPExcel\Style\Border::BORDER_NONE: + case \Spreadsheet\Style\Border::BORDER_NONE: return 'none'; - case \PHPExcel\Style\Border::BORDER_DASHDOT: + case \Spreadsheet\Style\Border::BORDER_DASHDOT: return '1px dashed'; - case \PHPExcel\Style\Border::BORDER_DASHDOTDOT: + case \Spreadsheet\Style\Border::BORDER_DASHDOTDOT: return '1px dotted'; - case \PHPExcel\Style\Border::BORDER_DASHED: + case \Spreadsheet\Style\Border::BORDER_DASHED: return '1px dashed'; - case \PHPExcel\Style\Border::BORDER_DOTTED: + case \Spreadsheet\Style\Border::BORDER_DOTTED: return '1px dotted'; - case \PHPExcel\Style\Border::BORDER_DOUBLE: + case \Spreadsheet\Style\Border::BORDER_DOUBLE: return '3px double'; - case \PHPExcel\Style\Border::BORDER_HAIR: + case \Spreadsheet\Style\Border::BORDER_HAIR: return '1px solid'; - case \PHPExcel\Style\Border::BORDER_MEDIUM: + case \Spreadsheet\Style\Border::BORDER_MEDIUM: return '2px solid'; - case \PHPExcel\Style\Border::BORDER_MEDIUMDASHDOT: + case \Spreadsheet\Style\Border::BORDER_MEDIUMDASHDOT: return '2px dashed'; - case \PHPExcel\Style\Border::BORDER_MEDIUMDASHDOTDOT: + case \Spreadsheet\Style\Border::BORDER_MEDIUMDASHDOTDOT: return '2px dotted'; - case \PHPExcel\Style\Border::BORDER_MEDIUMDASHED: + case \Spreadsheet\Style\Border::BORDER_MEDIUMDASHED: return '2px dashed'; - case \PHPExcel\Style\Border::BORDER_SLANTDASHDOT: + case \Spreadsheet\Style\Border::BORDER_SLANTDASHDOT: return '2px dashed'; - case \PHPExcel\Style\Border::BORDER_THICK: + case \Spreadsheet\Style\Border::BORDER_THICK: return '3px solid'; - case \PHPExcel\Style\Border::BORDER_THIN: + case \Spreadsheet\Style\Border::BORDER_THIN: return '1px solid'; default: // map others to thin @@ -336,19 +335,19 @@ class HTML extends BaseWriter implements IWriter * * @param boolean $pIncludeStyles Include styles? * @return string - * @throws \PHPExcel\Writer\Exception + * @throws \Spreadsheet\Writer\Exception */ public function generateHTMLHeader($pIncludeStyles = false) { - // PHPExcel object known? - if (is_null($this->phpExcel)) { - throw new \PHPExcel\Writer\Exception('Internal PHPExcel object not set to an instance of an object.'); + // Spreadsheet object known? + if (is_null($this->spreadsheet)) { + throw new \Spreadsheet\Writer\Exception('Internal Spreadsheet object not set to an instance of an object.'); } // Construct HTML - $properties = $this->phpExcel->getProperties(); + $properties = $this->spreadsheet->getProperties(); $html = '' . PHP_EOL; - $html .= '' . PHP_EOL; + $html .= '' . PHP_EOL; $html .= '' . PHP_EOL; $html .= ' ' . PHP_EOL; $html .= ' ' . PHP_EOL; @@ -395,13 +394,13 @@ class HTML extends BaseWriter implements IWriter * Generate sheet data * * @return string - * @throws \PHPExcel\Writer\Exception + * @throws \Spreadsheet\Writer\Exception */ public function generateSheetData() { - // PHPExcel object known? - if (is_null($this->phpExcel)) { - throw new \PHPExcel\Writer\Exception('Internal PHPExcel object not set to an instance of an object.'); + // Spreadsheet object known? + if (is_null($this->spreadsheet)) { + throw new \Spreadsheet\Writer\Exception('Internal Spreadsheet object not set to an instance of an object.'); } // Ensure that Spans have been calculated? @@ -412,9 +411,9 @@ class HTML extends BaseWriter implements IWriter // Fetch sheets $sheets = array(); if (is_null($this->sheetIndex)) { - $sheets = $this->phpExcel->getAllSheets(); + $sheets = $this->spreadsheet->getAllSheets(); } else { - $sheets[] = $this->phpExcel->getSheet($this->sheetIndex); + $sheets[] = $this->spreadsheet->getSheet($this->sheetIndex); } // Construct HTML @@ -428,10 +427,10 @@ class HTML extends BaseWriter implements IWriter // Get worksheet dimension $dimension = explode(':', $sheet->calculateWorksheetDimension()); - $dimension[0] = \PHPExcel\Cell::coordinateFromString($dimension[0]); - $dimension[0][0] = \PHPExcel\Cell::columnIndexFromString($dimension[0][0]) - 1; - $dimension[1] = \PHPExcel\Cell::coordinateFromString($dimension[1]); - $dimension[1][0] = \PHPExcel\Cell::columnIndexFromString($dimension[1][0]) - 1; + $dimension[0] = \Spreadsheet\Cell::coordinateFromString($dimension[0]); + $dimension[0][0] = \Spreadsheet\Cell::columnIndexFromString($dimension[0][0]) - 1; + $dimension[1] = \Spreadsheet\Cell::coordinateFromString($dimension[1]); + $dimension[1][0] = \Spreadsheet\Cell::columnIndexFromString($dimension[1][0]) - 1; // row min,max $rowMin = $dimension[0][1]; @@ -475,7 +474,7 @@ class HTML extends BaseWriter implements IWriter while ($column++ < $dimension[1][0]) { // Cell exists? if ($sheet->cellExistsByColumnAndRow($column, $row)) { - $rowData[$column] = \PHPExcel\Cell::stringFromColumnIndex($column) . $row; + $rowData[$column] = \Spreadsheet\Cell::stringFromColumnIndex($column) . $row; } else { $rowData[$column] = ''; } @@ -498,7 +497,7 @@ class HTML extends BaseWriter implements IWriter // Writing PDF? if ($this->isPdf) { - if (is_null($this->sheetIndex) && $sheetId + 1 < $this->phpExcel->getSheetCount()) { + if (is_null($this->sheetIndex) && $sheetId + 1 < $this->spreadsheet->getSheetCount()) { $html .= '
'; } } @@ -514,21 +513,21 @@ class HTML extends BaseWriter implements IWriter * Generate sheet tabs * * @return string - * @throws \PHPExcel\Writer\Exception + * @throws \Spreadsheet\Writer\Exception */ public function generateNavigation() { - // PHPExcel object known? - if (is_null($this->phpExcel)) { - throw new \PHPExcel\Writer\Exception('Internal PHPExcel object not set to an instance of an object.'); + // Spreadsheet object known? + if (is_null($this->spreadsheet)) { + throw new \Spreadsheet\Writer\Exception('Internal Spreadsheet object not set to an instance of an object.'); } // Fetch sheets $sheets = array(); if (is_null($this->sheetIndex)) { - $sheets = $this->phpExcel->getAllSheets(); + $sheets = $this->spreadsheet->getAllSheets(); } else { - $sheets[] = $this->phpExcel->getSheet($this->sheetIndex); + $sheets[] = $this->spreadsheet->getSheet($this->sheetIndex); } // Construct HTML @@ -552,19 +551,19 @@ class HTML extends BaseWriter implements IWriter return $html; } - private function extendRowsForChartsAndImages(\PHPExcel\Worksheet $pSheet, $row) + private function extendRowsForChartsAndImages(\Spreadsheet\Worksheet $pSheet, $row) { $rowMax = $row; $colMax = 'A'; if ($this->includeCharts) { foreach ($pSheet->getChartCollection() as $chart) { - if ($chart instanceof PHPExcel_Chart) { + if ($chart instanceof Spreadsheet_Chart) { $chartCoordinates = $chart->getTopLeftPosition(); - $chartTL = \PHPExcel\Cell::coordinateFromString($chartCoordinates['cell']); - $chartCol = \PHPExcel\Cell::columnIndexFromString($chartTL[0]); + $chartTL = \Spreadsheet\Cell::coordinateFromString($chartCoordinates['cell']); + $chartCol = \Spreadsheet\Cell::columnIndexFromString($chartTL[0]); if ($chartTL[1] > $rowMax) { $rowMax = $chartTL[1]; - if ($chartCol > \PHPExcel\Cell::columnIndexFromString($colMax)) { + if ($chartCol > \Spreadsheet\Cell::columnIndexFromString($colMax)) { $colMax = $chartTL[0]; } } @@ -573,12 +572,12 @@ class HTML extends BaseWriter implements IWriter } foreach ($pSheet->getDrawingCollection() as $drawing) { - if ($drawing instanceof \PHPExcel\Worksheet\Drawing) { - $imageTL = \PHPExcel\Cell::coordinateFromString($drawing->getCoordinates()); - $imageCol = \PHPExcel\Cell::columnIndexFromString($imageTL[0]); + if ($drawing instanceof \Spreadsheet\Worksheet\Drawing) { + $imageTL = \Spreadsheet\Cell::coordinateFromString($drawing->getCoordinates()); + $imageCol = \Spreadsheet\Cell::columnIndexFromString($imageTL[0]); if ($imageTL[1] > $rowMax) { $rowMax = $imageTL[1]; - if ($imageCol > \PHPExcel\Cell::columnIndexFromString($colMax)) { + if ($imageCol > \Spreadsheet\Cell::columnIndexFromString($colMax)) { $colMax = $imageTL[0]; } } @@ -606,19 +605,19 @@ class HTML extends BaseWriter implements IWriter /** * Generate image tag in cell * - * @param \PHPExcel\Worksheet $pSheet \PHPExcel\Worksheet + * @param \Spreadsheet\Worksheet $pSheet \Spreadsheet\Worksheet * @param string $coordinates Cell coordinates * @return string - * @throws \PHPExcel\Writer\Exception + * @throws \Spreadsheet\Writer\Exception */ - private function writeImageInCell(\PHPExcel\Worksheet $pSheet, $coordinates) + private function writeImageInCell(\Spreadsheet\Worksheet $pSheet, $coordinates) { // Construct HTML $html = ''; // Write images foreach ($pSheet->getDrawingCollection() as $drawing) { - if ($drawing instanceof \PHPExcel\Worksheet\Drawing) { + if ($drawing instanceof \Spreadsheet\Worksheet\Drawing) { if ($drawing->getCoordinates() == $coordinates) { $filename = $drawing->getPath(); @@ -662,7 +661,7 @@ class HTML extends BaseWriter implements IWriter $imageData . '" border="0" />'; $html .= '
'; } - } elseif ($drawing instanceof \PHPExcel\Worksheet\MemoryDrawing) { + } elseif ($drawing instanceof \Spreadsheet\Worksheet\MemoryDrawing) { if ($drawing->getCoordinates() != $coordinates) { continue; } @@ -687,22 +686,22 @@ class HTML extends BaseWriter implements IWriter /** * Generate chart tag in cell * - * @param \PHPExcel\Worksheet $pSheet \PHPExcel\Worksheet + * @param \Spreadsheet\Worksheet $pSheet \Spreadsheet\Worksheet * @param string $coordinates Cell coordinates * @return string - * @throws \PHPExcel\Writer\Exception + * @throws \Spreadsheet\Writer\Exception */ - private function writeChartInCell(\PHPExcel\Worksheet $pSheet, $coordinates) + private function writeChartInCell(\Spreadsheet\Worksheet $pSheet, $coordinates) { // Construct HTML $html = ''; // Write charts foreach ($pSheet->getChartCollection() as $chart) { - if ($chart instanceof PHPExcel_Chart) { + if ($chart instanceof Spreadsheet_Chart) { $chartCoordinates = $chart->getTopLeftPosition(); if ($chartCoordinates['cell'] == $coordinates) { - $chartFileName = \PHPExcel\Shared\File::sysGetTempDir().'/'.uniqid().'.png'; + $chartFileName = \Spreadsheet\Shared\File::sysGetTempDir().'/'.uniqid().'.png'; if (!$chart->render($chartFileName)) { return; } @@ -736,13 +735,13 @@ class HTML extends BaseWriter implements IWriter * * @param boolean $generateSurroundingHTML Generate surrounding HTML tags? (<style> and </style>) * @return string - * @throws \PHPExcel\Writer\Exception + * @throws \Spreadsheet\Writer\Exception */ public function generateStyles($generateSurroundingHTML = true) { - // PHPExcel object known? - if (is_null($this->phpExcel)) { - throw new \PHPExcel\Writer\Exception('Internal PHPExcel object not set to an instance of an object.'); + // Spreadsheet object known? + if (is_null($this->spreadsheet)) { + throw new \Spreadsheet\Writer\Exception('Internal Spreadsheet object not set to an instance of an object.'); } // Build CSS @@ -778,13 +777,13 @@ class HTML extends BaseWriter implements IWriter * * @param boolean $generateSurroundingHTML Generate surrounding HTML style? (html { }) * @return array - * @throws \PHPExcel\Writer\Exception + * @throws \Spreadsheet\Writer\Exception */ public function buildCSS($generateSurroundingHTML = true) { - // PHPExcel object known? - if (is_null($this->phpExcel)) { - throw new \PHPExcel\Writer\Exception('Internal PHPExcel object not set to an instance of an object.'); + // Spreadsheet object known? + if (is_null($this->spreadsheet)) { + throw new \Spreadsheet\Writer\Exception('Internal Spreadsheet object not set to an instance of an object.'); } // Cached? @@ -838,7 +837,7 @@ class HTML extends BaseWriter implements IWriter $css['.s']['text-align'] = 'left'; // STRING // Calculate cell style hashes - foreach ($this->phpExcel->getCellXfCollection() as $index => $style) { + foreach ($this->spreadsheet->getCellXfCollection() as $index => $style) { $css['td.style' . $index] = $this->createCSSStyle($style); $css['th.style' . $index] = $this->createCSSStyle($style); } @@ -846,9 +845,9 @@ class HTML extends BaseWriter implements IWriter // Fetch sheets $sheets = array(); if (is_null($this->sheetIndex)) { - $sheets = $this->phpExcel->getAllSheets(); + $sheets = $this->spreadsheet->getAllSheets(); } else { - $sheets[] = $this->phpExcel->getSheet($this->sheetIndex); + $sheets[] = $this->spreadsheet->getSheet($this->sheetIndex); } // Build styles per sheet @@ -861,7 +860,7 @@ class HTML extends BaseWriter implements IWriter $sheet->calculateColumnWidths(); // col elements, initialize - $highestColumnIndex = \PHPExcel\Cell::columnIndexFromString($sheet->getHighestColumn()) - 1; + $highestColumnIndex = \Spreadsheet\Cell::columnIndexFromString($sheet->getHighestColumn()) - 1; $column = -1; while ($column++ < $highestColumnIndex) { $this->columnWidths[$sheetIndex][$column] = 42; // approximation @@ -870,9 +869,9 @@ class HTML extends BaseWriter implements IWriter // col elements, loop through columnDimensions and set width foreach ($sheet->getColumnDimensions() as $columnDimension) { - if (($width = \PHPExcel\Shared\Drawing::cellDimensionToPixels($columnDimension->getWidth(), $this->defaultFont)) >= 0) { - $width = \PHPExcel\Shared\Drawing::pixelsToPoints($width); - $column = \PHPExcel\Cell::columnIndexFromString($columnDimension->getColumnIndex()) - 1; + if (($width = \Spreadsheet\Shared\Drawing::cellDimensionToPixels($columnDimension->getWidth(), $this->defaultFont)) >= 0) { + $width = \Spreadsheet\Shared\Drawing::pixelsToPoints($width); + $column = \Spreadsheet\Cell::columnIndexFromString($columnDimension->getColumnIndex()) - 1; $this->columnWidths[$sheetIndex][$column] = $width; $css['table.sheet' . $sheetIndex . ' col.col' . $column]['width'] = $width . 'pt'; @@ -890,7 +889,7 @@ class HTML extends BaseWriter implements IWriter $css['table.sheet' . $sheetIndex . ' tr'] = array(); if ($rowDimension->getRowHeight() == -1) { - $pt_height = Font::getDefaultRowHeightByFont($this->phpExcel->getDefaultStyle()->getFont()); + $pt_height = Font::getDefaultRowHeightByFont($this->spreadsheet->getDefaultStyle()->getFont()); } else { $pt_height = $rowDimension->getRowHeight(); } @@ -908,7 +907,7 @@ class HTML extends BaseWriter implements IWriter $css['table.sheet' . $sheetIndex . ' tr.row' . $row] = array(); if ($rowDimension->getRowHeight() == -1) { - $pt_height = Font::getDefaultRowHeightByFont($this->phpExcel->getDefaultStyle()->getFont()); + $pt_height = Font::getDefaultRowHeightByFont($this->spreadsheet->getDefaultStyle()->getFont()); } else { $pt_height = $rowDimension->getRowHeight(); } @@ -932,10 +931,10 @@ class HTML extends BaseWriter implements IWriter /** * Create CSS style * - * @param \PHPExcel\Style $pStyle PHPExcel_Style + * @param \Spreadsheet\Style $pStyle Spreadsheet_Style * @return array */ - private function createCSSStyle(\PHPExcel\Style $pStyle) + private function createCSSStyle(\Spreadsheet\Style $pStyle) { // Construct CSS $css = ''; @@ -953,12 +952,12 @@ class HTML extends BaseWriter implements IWriter } /** - * Create CSS style (\PHPExcel\Style\Alignment) + * Create CSS style (\Spreadsheet\Style\Alignment) * - * @param \PHPExcel\Style\Alignment $pStyle \PHPExcel\Style\Alignment + * @param \Spreadsheet\Style\Alignment $pStyle \Spreadsheet\Style\Alignment * @return array */ - private function createCSSStyleAlignment(\PHPExcel\Style\Alignment $pStyle) + private function createCSSStyleAlignment(\Spreadsheet\Style\Alignment $pStyle) { // Construct CSS $css = array(); @@ -976,12 +975,12 @@ class HTML extends BaseWriter implements IWriter } /** - * Create CSS style (\PHPExcel\Style\Font) + * Create CSS style (\Spreadsheet\Style\Font) * - * @param \PHPExcel\Style\Font $pStyle \PHPExcel\Style\Font + * @param \Spreadsheet\Style\Font $pStyle \Spreadsheet\Style\Font * @return array */ - private function createCSSStyleFont(\PHPExcel\Style\Font $pStyle) + private function createCSSStyleFont(\Spreadsheet\Style\Font $pStyle) { // Construct CSS $css = array(); @@ -990,9 +989,9 @@ class HTML extends BaseWriter implements IWriter if ($pStyle->getBold()) { $css['font-weight'] = 'bold'; } - if ($pStyle->getUnderline() != \PHPExcel\Style\Font::UNDERLINE_NONE && $pStyle->getStrikethrough()) { + if ($pStyle->getUnderline() != \Spreadsheet\Style\Font::UNDERLINE_NONE && $pStyle->getStrikethrough()) { $css['text-decoration'] = 'underline line-through'; - } elseif ($pStyle->getUnderline() != \PHPExcel\Style\Font::UNDERLINE_NONE) { + } elseif ($pStyle->getUnderline() != \Spreadsheet\Style\Font::UNDERLINE_NONE) { $css['text-decoration'] = 'underline'; } elseif ($pStyle->getStrikethrough()) { $css['text-decoration'] = 'line-through'; @@ -1009,12 +1008,12 @@ class HTML extends BaseWriter implements IWriter } /** - * Create CSS style (\PHPExcel\Style\Borders) + * Create CSS style (\Spreadsheet\Style\Borders) * - * @param \PHPExcel\Style\Borders $pStyle \PHPExcel\Style\Borders + * @param \Spreadsheet\Style\Borders $pStyle \Spreadsheet\Style\Borders * @return array */ - private function createCSSStyleBorders(\PHPExcel\Style\Borders $pStyle) + private function createCSSStyleBorders(\Spreadsheet\Style\Borders $pStyle) { // Construct CSS $css = array(); @@ -1029,12 +1028,12 @@ class HTML extends BaseWriter implements IWriter } /** - * Create CSS style (\PHPExcel\Style\Border) + * Create CSS style (\Spreadsheet\Style\Border) * - * @param \PHPExcel\Style\Border $pStyle \PHPExcel\Style\Border + * @param \Spreadsheet\Style\Border $pStyle \Spreadsheet\Style\Border * @return string */ - private function createCSSStyleBorder(\PHPExcel\Style\Border $pStyle) + private function createCSSStyleBorder(\Spreadsheet\Style\Border $pStyle) { // Create CSS // $css = $this->mapBorderStyle($pStyle->getBorderStyle()) . ' #' . $pStyle->getColor()->getRGB(); @@ -1046,18 +1045,18 @@ class HTML extends BaseWriter implements IWriter } /** - * Create CSS style (\PHPExcel\Style\Fill) + * Create CSS style (\Spreadsheet\Style\Fill) * - * @param \PHPExcel\Style\Fill $pStyle \PHPExcel\Style\Fill + * @param \Spreadsheet\Style\Fill $pStyle \Spreadsheet\Style\Fill * @return array */ - private function createCSSStyleFill(\PHPExcel\Style\Fill $pStyle) + private function createCSSStyleFill(\Spreadsheet\Style\Fill $pStyle) { // Construct HTML $css = array(); // Create CSS - $value = $pStyle->getFillType() == \PHPExcel\Style\Fill::FILL_NONE ? + $value = $pStyle->getFillType() == \Spreadsheet\Style\Fill::FILL_NONE ? 'white' : '#' . $pStyle->getStartColor()->getRGB(); $css['background-color'] = $value; @@ -1080,9 +1079,9 @@ class HTML extends BaseWriter implements IWriter /** * Generate table header * - * @param \PHPExcel\Worksheet $pSheet The worksheet for the table we are writing + * @param \Spreadsheet\Worksheet $pSheet The worksheet for the table we are writing * @return string - * @throws \PHPExcel\Writer\Exception + * @throws \Spreadsheet\Writer\Exception */ private function generateTableHeader($pSheet) { @@ -1107,7 +1106,7 @@ class HTML extends BaseWriter implements IWriter } // Write elements - $highestColumnIndex = \PHPExcel\Cell::columnIndexFromString($pSheet->getHighestColumn()) - 1; + $highestColumnIndex = \Spreadsheet\Cell::columnIndexFromString($pSheet->getHighestColumn()) - 1; $i = -1; while ($i++ < $highestColumnIndex) { if (!$this->isPdf) { @@ -1127,7 +1126,7 @@ class HTML extends BaseWriter implements IWriter /** * Generate table footer * - * @throws \PHPExcel\Writer\Exception + * @throws \Spreadsheet\Writer\Exception */ private function generateTableFooter() { @@ -1139,13 +1138,13 @@ class HTML extends BaseWriter implements IWriter /** * Generate row * - * @param \PHPExcel\Worksheet $pSheet \PHPExcel\Worksheet + * @param \Spreadsheet\Worksheet $pSheet \Spreadsheet\Worksheet * @param array $pValues Array containing cells in a row * @param int $pRow Row number (0-based) * @return string - * @throws \PHPExcel\Writer\Exception + * @throws \Spreadsheet\Writer\Exception */ - private function generateRow(\PHPExcel\Worksheet $pSheet, $pValues = null, $pRow = 0, $cellType = 'td') + private function generateRow(\Spreadsheet\Worksheet $pSheet, $pValues = null, $pRow = 0, $cellType = 'td') { if (is_array($pValues)) { // Construct HTML @@ -1185,7 +1184,7 @@ class HTML extends BaseWriter implements IWriter $colNum = 0; foreach ($pValues as $cellAddress) { $cell = ($cellAddress > '') ? $pSheet->getCell($cellAddress) : ''; - $coordinate = \PHPExcel\Cell::stringFromColumnIndex($colNum) . ($pRow + 1); + $coordinate = \Spreadsheet\Cell::stringFromColumnIndex($colNum) . ($pRow + 1); if (!$this->useInlineCss) { $cssClass = ''; $cssClass = 'column' . $colNum; @@ -1207,19 +1206,19 @@ class HTML extends BaseWriter implements IWriter // initialize $cellData = ' '; - // \PHPExcel\Cell - if ($cell instanceof \PHPExcel\Cell) { + // \Spreadsheet\Cell + if ($cell instanceof \Spreadsheet\Cell) { $cellData = ''; if (is_null($cell->getParent())) { $cell->attach($pSheet); } // Value - if ($cell->getValue() instanceof \PHPExcel\RichText) { + if ($cell->getValue() instanceof \Spreadsheet\RichText) { // Loop through rich text elements $elements = $cell->getValue()->getRichTextElements(); foreach ($elements as $element) { // Rich text start? - if ($element instanceof \PHPExcel\RichText\Run) { + if ($element instanceof \Spreadsheet\RichText\Run) { $cellData .= ''; if ($element->getFont()->getSuperScript()) { @@ -1233,7 +1232,7 @@ class HTML extends BaseWriter implements IWriter $cellText = $element->getText(); $cellData .= htmlspecialchars($cellText); - if ($element instanceof \PHPExcel\RichText\Run) { + if ($element instanceof \Spreadsheet\RichText\Run) { if ($element->getFont()->getSuperScript()) { $cellData .= ''; } elseif ($element->getFont()->getSubScript()) { @@ -1245,13 +1244,13 @@ class HTML extends BaseWriter implements IWriter } } else { if ($this->preCalculateFormulas) { - $cellData = \PHPExcel\Style\NumberFormat::toFormattedString( + $cellData = \Spreadsheet\Style\NumberFormat::toFormattedString( $cell->getCalculatedValue(), $pSheet->getParent()->getCellXfByIndex($cell->getXfIndex())->getNumberFormat()->getFormatCode(), array($this, 'formatColor') ); } else { - $cellData = \PHPExcel\Style\NumberFormat::toFormattedString( + $cellData = \Spreadsheet\Style\NumberFormat::toFormattedString( $cell->getValue(), $pSheet->getParent()->getCellXfByIndex($cell->getXfIndex())->getNumberFormat()->getFormatCode(), array($this, 'formatColor') @@ -1289,7 +1288,7 @@ class HTML extends BaseWriter implements IWriter // General horizontal alignment: Actual horizontal alignment depends on dataType $sharedStyle = $pSheet->getParent()->getCellXfByIndex($cell->getXfIndex()); - if ($sharedStyle->getAlignment()->getHorizontal() == \PHPExcel\Style\Alignment::HORIZONTAL_GENERAL + if ($sharedStyle->getAlignment()->getHorizontal() == \Spreadsheet\Style\Alignment::HORIZONTAL_GENERAL && isset($this->cssStyles['.' . $cell->getDataType()]['text-align'])) { $cssClass['text-align'] = $this->cssStyles['.' . $cell->getDataType()]['text-align']; } @@ -1315,7 +1314,7 @@ class HTML extends BaseWriter implements IWriter // Also apply style from last cell in merge to fix borders - // relies on !important for non-none border declarations in createCSSStyleBorder - $endCellCoord = \PHPExcel\Cell::stringFromColumnIndex($colNum + $colSpan - 1) . ($pRow + $rowSpan); + $endCellCoord = \Spreadsheet\Cell::stringFromColumnIndex($colNum + $colSpan - 1) . ($pRow + $rowSpan); if (!$this->useInlineCss) { $cssClass .= ' style' . $pSheet->getCell($endCellCoord)->getXfIndex(); } @@ -1328,7 +1327,7 @@ class HTML extends BaseWriter implements IWriter if (!$this->useInlineCss) { $html .= ' class="' . $cssClass . '"'; } else { - //** Necessary redundant code for the sake of PHPExcel_Writer_PDF ** + //** Necessary redundant code for the sake of Spreadsheet_Writer_PDF ** // We must explicitly write the width of the element because TCPDF // does not recognize e.g. $width = 0; @@ -1384,7 +1383,7 @@ class HTML extends BaseWriter implements IWriter // Return return $html; } else { - throw new \PHPExcel\Writer\Exception("Invalid parameters passed."); + throw new \Spreadsheet\Writer\Exception("Invalid parameters passed."); } } @@ -1419,7 +1418,7 @@ class HTML extends BaseWriter implements IWriter * Set images root * * @param string $pValue - * @return PHPExcel_Writer_HTML + * @return Spreadsheet_Writer_HTML */ public function setImagesRoot($pValue = '.') { @@ -1441,7 +1440,7 @@ class HTML extends BaseWriter implements IWriter * Set embed images * * @param boolean $pValue - * @return PHPExcel_Writer_HTML + * @return Spreadsheet_Writer_HTML */ public function setEmbedImages($pValue = '.') { @@ -1463,7 +1462,7 @@ class HTML extends BaseWriter implements IWriter * Set use inline CSS? * * @param boolean $pValue - * @return PHPExcel_Writer_HTML + * @return Spreadsheet_Writer_HTML */ public function setUseInlineCss($pValue = false) { @@ -1511,24 +1510,24 @@ class HTML extends BaseWriter implements IWriter // In HTML only the upper-left cell should be written and it should have // appropriate rowspan / colspan attribute $sheetIndexes = $this->sheetIndex !== null ? - array($this->sheetIndex) : range(0, $this->phpExcel->getSheetCount() - 1); + array($this->sheetIndex) : range(0, $this->spreadsheet->getSheetCount() - 1); foreach ($sheetIndexes as $sheetIndex) { - $sheet = $this->phpExcel->getSheet($sheetIndex); + $sheet = $this->spreadsheet->getSheet($sheetIndex); $candidateSpannedRow = array(); // loop through all Excel merged cells foreach ($sheet->getMergeCells() as $cells) { - list($cells,) = \PHPExcel\Cell::splitRange($cells); + list($cells,) = \Spreadsheet\Cell::splitRange($cells); $first = $cells[0]; $last = $cells[1]; - list($fc, $fr) = \PHPExcel\Cell::coordinateFromString($first); - $fc = \PHPExcel\Cell::columnIndexFromString($fc) - 1; + list($fc, $fr) = \Spreadsheet\Cell::coordinateFromString($first); + $fc = \Spreadsheet\Cell::columnIndexFromString($fc) - 1; - list($lc, $lr) = \PHPExcel\Cell::coordinateFromString($last); - $lc = \PHPExcel\Cell::columnIndexFromString($lc) - 1; + list($lc, $lr) = \Spreadsheet\Cell::coordinateFromString($last); + $lc = \Spreadsheet\Cell::columnIndexFromString($lc) - 1; // loop through the individual cells in the individual merge $r = $fr - 1; @@ -1558,7 +1557,7 @@ class HTML extends BaseWriter implements IWriter // Identify which rows should be omitted in HTML. These are the rows where all the cells // participate in a merge and the where base cells are somewhere above. - $countColumns = \PHPExcel\Cell::columnIndexFromString($sheet->getHighestColumn()); + $countColumns = \Spreadsheet\Cell::columnIndexFromString($sheet->getHighestColumn()); foreach ($candidateSpannedRow as $rowIndex) { if (isset($this->isSpannedCell[$sheetIndex][$rowIndex])) { if (count($this->isSpannedCell[$sheetIndex][$rowIndex]) == $countColumns) { @@ -1592,7 +1591,7 @@ class HTML extends BaseWriter implements IWriter $this->spansAreCalculated = true; } - private function setMargins(\PHPExcel\Worksheet $pSheet) + private function setMargins(\Spreadsheet\Worksheet $pSheet) { $htmlPage = '@page { '; $htmlBody = 'body { '; diff --git a/src/PhpSpreadsheet/Writer/IWriter.php b/src/PhpSpreadsheet/Writer/IWriter.php index 6034a450..57bc0820 100644 --- a/src/PhpSpreadsheet/Writer/IWriter.php +++ b/src/PhpSpreadsheet/Writer/IWriter.php @@ -1,11 +1,9 @@ setPHPExcel($pPHPExcel); + $this->setPhpSpreadsheet($spreadsheet); $writerPartsArray = array( - 'content' => 'PHPExcel_Writer_OpenDocument_Content', - 'meta' => 'PHPExcel_Writer_OpenDocument_Meta', - 'meta_inf' => 'PHPExcel_Writer_OpenDocument_MetaInf', - 'mimetype' => 'PHPExcel_Writer_OpenDocument_Mimetype', - 'settings' => 'PHPExcel_Writer_OpenDocument_Settings', - 'styles' => 'PHPExcel_Writer_OpenDocument_Styles', - 'thumbnails' => 'PHPExcel_Writer_OpenDocument_Thumbnails' + 'content' => \PhpSpreadsheet\Writer\OpenDocument\Content::class, + 'meta' => \PhpSpreadsheet\Writer\OpenDocument\Meta::class, + 'meta_inf' => \PhpSpreadsheet\Writer\OpenDocument\MetaInf::class, + 'mimetype' => \PhpSpreadsheet\Writer\OpenDocument\Mimetype::class, + 'settings' => \PhpSpreadsheet\Writer\OpenDocument\Settings::class, + 'styles' => \PhpSpreadsheet\Writer\OpenDocument\Styles::class, + 'thumbnails' => \PhpSpreadsheet\Writer\OpenDocument\Thumbnails::class, ); foreach ($writerPartsArray as $writer => $class) { @@ -71,7 +68,7 @@ class OpenDocument extends BaseWriter implements IWriter * Get writer part * * @param string $pPartName Writer part name - * @return \PHPExcel\Writer\Excel2007\WriterPart + * @return \PhpSpreadsheet\Writer\Excel2007\WriterPart */ public function getWriterPart($pPartName = '') { @@ -83,15 +80,15 @@ class OpenDocument extends BaseWriter implements IWriter } /** - * Save PHPExcel to file + * Save PhpSpreadsheet to file * * @param string $pFilename - * @throws \PHPExcel\Writer\Exception + * @throws \PhpSpreadsheet\Writer\Exception */ public function save($pFilename = null) { if (!$this->spreadSheet) { - throw new \PHPExcel\Writer\Exception('PHPExcel object unassigned.'); + throw new \PhpSpreadsheet\Writer\Exception('PhpSpreadsheet object unassigned.'); } // garbage collect @@ -100,7 +97,7 @@ class OpenDocument extends BaseWriter implements IWriter // If $pFilename is php://output or php://stdout, make it a temporary file... $originalFilename = $pFilename; if (strtolower($pFilename) == 'php://output' || strtolower($pFilename) == 'php://stdout') { - $pFilename = @tempnam(\PHPExcel\Shared\File::sysGetTempDir(), 'phpxltmp'); + $pFilename = @tempnam(\PhpSpreadsheet\Shared\File::sysGetTempDir(), 'phpxltmp'); if ($pFilename == '') { $pFilename = $originalFilename; } @@ -118,13 +115,13 @@ class OpenDocument extends BaseWriter implements IWriter // Close file if ($objZip->close() === false) { - throw new \PHPExcel\Writer\Exception("Could not close zip file $pFilename."); + throw new \PhpSpreadsheet\Writer\Exception("Could not close zip file $pFilename."); } // If a temporary file was used, copy it to the correct file stream if ($originalFilename != $pFilename) { if (copy($pFilename, $originalFilename) === false) { - throw new \PHPExcel\Writer\Exception("Could not copy temporary zip file $pFilename to $originalFilename."); + throw new \PhpSpreadsheet\Writer\Exception("Could not copy temporary zip file $pFilename to $originalFilename."); } @unlink($pFilename); } @@ -134,13 +131,13 @@ class OpenDocument extends BaseWriter implements IWriter * Create zip object * * @param string $pFilename - * @throws \PHPExcel\Writer\Exception + * @throws \PhpSpreadsheet\Writer\Exception * @return ZipArchive */ private function createZip($pFilename) { // Create new ZIP file and open it for writing - $zipClass = \PHPExcel\Settings::getZipClass(); + $zipClass = \PhpSpreadsheet\Settings::getZipClass(); $objZip = new $zipClass(); // Retrieve OVERWRITE and CREATE constants from the instantiated zip class @@ -155,7 +152,7 @@ class OpenDocument extends BaseWriter implements IWriter // Try opening the ZIP file if ($objZip->open($pFilename, $zipOverWrite) !== true) { if ($objZip->open($pFilename, $zipCreate) !== true) { - throw new \PHPExcel\Writer\Exception("Could not open $pFilename for writing."); + throw new \PhpSpreadsheet\Writer\Exception("Could not open $pFilename for writing."); } } @@ -163,30 +160,30 @@ class OpenDocument extends BaseWriter implements IWriter } /** - * Get PHPExcel object + * Get PhpSpreadsheet object * - * @return PHPExcel - * @throws \PHPExcel\Writer\Exception + * @return PhpSpreadsheet + * @throws \PhpSpreadsheet\Writer\Exception */ - public function getPHPExcel() + public function getPhpSpreadsheet() { if ($this->spreadSheet !== null) { return $this->spreadSheet; } else { - throw new \PHPExcel\Writer\Exception('No PHPExcel assigned.'); + throw new \PhpSpreadsheet\Writer\Exception('No PhpSpreadsheet assigned.'); } } /** - * Set PHPExcel object + * Set PhpSpreadsheet object * - * @param PHPExcel $pPHPExcel PHPExcel object - * @throws \PHPExcel\Writer\Exception - * @return PHPExcel_Writer_Excel2007 + * @param \PhpSpreadsheet\Spreadsheet $spreadsheet PhpSpreadsheet object + * @throws \PhpSpreadsheet\Writer\Exception + * @return Excel2007 */ - public function setPHPExcel(\PHPExcel\SpreadSheet $pPHPExcel = null) + public function setPhpSpreadsheet(\PhpSpreadsheet\SpreadSheet $spreadsheet = null) { - $this->spreadSheet = $pPHPExcel; + $this->spreadSheet = $spreadsheet; return $this; } } diff --git a/src/PhpSpreadsheet/Writer/OpenDocument/Cell/Comment.php b/src/PhpSpreadsheet/Writer/OpenDocument/Cell/Comment.php index 86737b9d..1901b7b5 100644 --- a/src/PhpSpreadsheet/Writer/OpenDocument/Cell/Comment.php +++ b/src/PhpSpreadsheet/Writer/OpenDocument/Cell/Comment.php @@ -1,11 +1,11 @@ */ class Comment { - public static function write(PHPExcel_Shared_XMLWriter $objWriter, PHPExcel_Cell $cell) + public static function write(\PhpSpreadsheet\Shared\XMLWriter $objWriter, \PhpSpreadsheet\Cell $cell) { $comments = $cell->getWorksheet()->getComments(); if (!isset($comments[$cell->getCoordinate()])) { @@ -57,7 +53,7 @@ class Comment //$objWriter->writeAttribute('draw:caption-point-x', $comment->getMarginLeft()); //$objWriter->writeAttribute('draw:caption-point-y', $comment->getMarginTop()); $objWriter->writeElement('dc:creator', $comment->getAuthor()); - // TODO: Not realized in PHPExcel_Comment yet. + // TODO: Not realized in \PhpSpreadsheet\Comment yet. //$objWriter->writeElement('dc:date', $comment->getDate()); $objWriter->writeElement('text:p', $comment->getText()->getPlainText()); //$objWriter->writeAttribute('draw:text-style-name', 'P1'); diff --git a/src/PhpSpreadsheet/Writer/OpenDocument/Content.php b/src/PhpSpreadsheet/Writer/OpenDocument/Content.php index 341930f7..f2312409 100644 --- a/src/PhpSpreadsheet/Writer/OpenDocument/Content.php +++ b/src/PhpSpreadsheet/Writer/OpenDocument/Content.php @@ -1,11 +1,11 @@ */ class Content extends WriterPart @@ -45,21 +41,21 @@ class Content extends WriterPart /** * Write content.xml to XML format * - * @param PHPExcel $pPHPExcel + * @param \PhpSpreadsheet\Spreadsheet $spreadsheet * @return string XML Output - * @throws \PHPExcel\Writer\Exception + * @throws \PhpSpreadsheet\Writer\Exception */ - public function write(\PHPExcel\SpreadSheet $pPHPExcel = null) + public function write(\PhpSpreadsheet\SpreadSheet $spreadsheet = null) { - if (!$pPHPExcel) { - $pPHPExcel = $this->getParentWriter()->getPHPExcel(); /* @var $pPHPExcel PHPExcel */ + if (!$spreadsheet) { + $spreadsheet = $this->getParentWriter()->getPhpSpreadsheet(); /* @var $spreadsheet PhpSpreadsheet */ } $objWriter = null; if ($this->getParentWriter()->getUseDiskCaching()) { - $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); + $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); } else { - $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY); + $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_MEMORY); } // XML header @@ -120,22 +116,22 @@ class Content extends WriterPart /** * Write sheets * - * @param PHPExcel_Shared_XMLWriter $objWriter + * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter */ - private function writeSheets(PHPExcel_Shared_XMLWriter $objWriter) + private function writeSheets(\PhpSpreadsheet\Shared\XMLWriter $objWriter) { - $pPHPExcel = $this->getParentWriter()->getPHPExcel(); /* @var $pPHPExcel PHPExcel */ + $spreadsheet = $this->getParentWriter()->getPhpSpreadsheet(); /* @var $spreadsheet PhpSpreadsheet */ - $sheet_count = $pPHPExcel->getSheetCount(); + $sheet_count = $spreadsheet->getSheetCount(); for ($i = 0; $i < $sheet_count; $i++) { //$this->getWriterPart('Worksheet')->writeWorksheet()); $objWriter->startElement('table:table'); - $objWriter->writeAttribute('table:name', $pPHPExcel->getSheet($i)->getTitle()); + $objWriter->writeAttribute('table:name', $spreadsheet->getSheet($i)->getTitle()); $objWriter->writeElement('office:forms'); $objWriter->startElement('table:table-column'); $objWriter->writeAttribute('table:number-columns-repeated', self::NUMBER_COLS_REPEATED_MAX); $objWriter->endElement(); - $this->writeRows($objWriter, $pPHPExcel->getSheet($i)); + $this->writeRows($objWriter, $spreadsheet->getSheet($i)); $objWriter->endElement(); } } @@ -143,10 +139,10 @@ class Content extends WriterPart /** * Write rows of the specified sheet * - * @param PHPExcel_Shared_XMLWriter $objWriter - * @param \PHPExcel\Worksheet $sheet + * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter + * @param \PhpSpreadsheet\Worksheet $sheet */ - private function writeRows(PHPExcel_Shared_XMLWriter $objWriter, \PHPExcel\Worksheet $sheet) + private function writeRows(\PhpSpreadsheet\Shared\XMLWriter $objWriter, \PhpSpreadsheet\Worksheet $sheet) { $number_rows_repeated = self::NUMBER_ROWS_REPEATED_MAX; $span_row = 0; @@ -179,34 +175,34 @@ class Content extends WriterPart /** * Write cells of the specified row * - * @param PHPExcel_Shared_XMLWriter $objWriter - * @param \PHPExcel\Worksheet\Row $row - * @throws \PHPExcel\Writer\Exception + * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter + * @param \PhpSpreadsheet\Worksheet\Row $row + * @throws \PhpSpreadsheet\Writer\Exception */ - private function writeCells(PHPExcel_Shared_XMLWriter $objWriter, \PHPExcel\Worksheet\Row $row) + private function writeCells(\PhpSpreadsheet\Shared\XMLWriter $objWriter, \PhpSpreadsheet\Worksheet\Row $row) { $number_cols_repeated = self::NUMBER_COLS_REPEATED_MAX; $prev_column = -1; $cells = $row->getCellIterator(); while ($cells->valid()) { $cell = $cells->current(); - $column = PHPExcel_Cell::columnIndexFromString($cell->getColumn()) - 1; + $column = \PhpSpreadsheet\Cell::columnIndexFromString($cell->getColumn()) - 1; $this->writeCellSpan($objWriter, $column, $prev_column); $objWriter->startElement('table:table-cell'); switch ($cell->getDataType()) { - case \PHPExcel\Cell\DataType::TYPE_BOOL: + case \PhpSpreadsheet\Cell\DataType::TYPE_BOOL: $objWriter->writeAttribute('office:value-type', 'boolean'); $objWriter->writeAttribute('office:value', $cell->getValue()); $objWriter->writeElement('text:p', $cell->getValue()); break; - case \PHPExcel\Cell\DataType::TYPE_ERROR: - throw new \PHPExcel\Writer\Exception('Writing of error not implemented yet.'); + case \PhpSpreadsheet\Cell\DataType::TYPE_ERROR: + throw new \PhpSpreadsheet\Writer\Exception('Writing of error not implemented yet.'); break; - case \PHPExcel\Cell\DataType::TYPE_FORMULA: + case \PhpSpreadsheet\Cell\DataType::TYPE_FORMULA: try { $formula_value = $cell->getCalculatedValue(); } catch (Exception $e) { @@ -222,22 +218,22 @@ class Content extends WriterPart $objWriter->writeElement('text:p', $formula_value); break; - case \PHPExcel\Cell\DataType::TYPE_INLINE: - throw new \PHPExcel\Writer\Exception('Writing of inline not implemented yet.'); + case \PhpSpreadsheet\Cell\DataType::TYPE_INLINE: + throw new \PhpSpreadsheet\Writer\Exception('Writing of inline not implemented yet.'); break; - case \PHPExcel\Cell\DataType::TYPE_NUMERIC: + case \PhpSpreadsheet\Cell\DataType::TYPE_NUMERIC: $objWriter->writeAttribute('office:value-type', 'float'); $objWriter->writeAttribute('office:value', $cell->getValue()); $objWriter->writeElement('text:p', $cell->getValue()); break; - case \PHPExcel\Cell\DataType::TYPE_STRING: + case \PhpSpreadsheet\Cell\DataType::TYPE_STRING: $objWriter->writeAttribute('office:value-type', 'string'); $objWriter->writeElement('text:p', $cell->getValue()); break; } - PHPExcel_Writer_OpenDocument_Cell_Comment::write($objWriter, $cell); + Cell\Comment::write($objWriter, $cell); $objWriter->endElement(); $prev_column = $column; $cells->next(); @@ -257,11 +253,11 @@ class Content extends WriterPart /** * Write span * - * @param PHPExcel_Shared_XMLWriter $objWriter + * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter * @param integer $curColumn * @param integer $prevColumn */ - private function writeCellSpan(PHPExcel_Shared_XMLWriter $objWriter, $curColumn, $prevColumn) + private function writeCellSpan(\PhpSpreadsheet\Shared\XMLWriter $objWriter, $curColumn, $prevColumn) { $diff = $curColumn - $prevColumn - 1; if (1 === $diff) { diff --git a/src/PhpSpreadsheet/Writer/OpenDocument/Meta.php b/src/PhpSpreadsheet/Writer/OpenDocument/Meta.php index d2069b6b..1edd0032 100644 --- a/src/PhpSpreadsheet/Writer/OpenDocument/Meta.php +++ b/src/PhpSpreadsheet/Writer/OpenDocument/Meta.php @@ -1,11 +1,9 @@ getParentWriter()->getPHPExcel(); + if (!$spreadsheet) { + $spreadsheet = $this->getParentWriter()->getPhpSpreadsheet(); } $objWriter = null; if ($this->getParentWriter()->getUseDiskCaching()) { - $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); + $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); } else { - $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY); + $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_MEMORY); } // XML header @@ -65,14 +62,14 @@ class Meta extends WriterPart $objWriter->startElement('office:meta'); - $objWriter->writeElement('meta:initial-creator', $pPHPExcel->getProperties()->getCreator()); - $objWriter->writeElement('dc:creator', $pPHPExcel->getProperties()->getCreator()); - $objWriter->writeElement('meta:creation-date', date(DATE_W3C, $pPHPExcel->getProperties()->getCreated())); - $objWriter->writeElement('dc:date', date(DATE_W3C, $pPHPExcel->getProperties()->getCreated())); - $objWriter->writeElement('dc:title', $pPHPExcel->getProperties()->getTitle()); - $objWriter->writeElement('dc:description', $pPHPExcel->getProperties()->getDescription()); - $objWriter->writeElement('dc:subject', $pPHPExcel->getProperties()->getSubject()); - $keywords = explode(' ', $pPHPExcel->getProperties()->getKeywords()); + $objWriter->writeElement('meta:initial-creator', $spreadsheet->getProperties()->getCreator()); + $objWriter->writeElement('dc:creator', $spreadsheet->getProperties()->getCreator()); + $objWriter->writeElement('meta:creation-date', date(DATE_W3C, $spreadsheet->getProperties()->getCreated())); + $objWriter->writeElement('dc:date', date(DATE_W3C, $spreadsheet->getProperties()->getCreated())); + $objWriter->writeElement('dc:title', $spreadsheet->getProperties()->getTitle()); + $objWriter->writeElement('dc:description', $spreadsheet->getProperties()->getDescription()); + $objWriter->writeElement('dc:subject', $spreadsheet->getProperties()->getSubject()); + $keywords = explode(' ', $spreadsheet->getProperties()->getKeywords()); foreach ($keywords as $keyword) { $objWriter->writeElement('meta:keyword', $keyword); } @@ -80,12 +77,12 @@ class Meta extends WriterPart // $objWriter->startElement('meta:user-defined'); $objWriter->writeAttribute('meta:name', 'Company'); - $objWriter->writeRaw($pPHPExcel->getProperties()->getCompany()); + $objWriter->writeRaw($spreadsheet->getProperties()->getCompany()); $objWriter->endElement(); $objWriter->startElement('meta:user-defined'); $objWriter->writeAttribute('meta:name', 'category'); - $objWriter->writeRaw($pPHPExcel->getProperties()->getCategory()); + $objWriter->writeRaw($spreadsheet->getProperties()->getCategory()); $objWriter->endElement(); $objWriter->endElement(); diff --git a/src/PhpSpreadsheet/Writer/OpenDocument/MetaInf.php b/src/PhpSpreadsheet/Writer/OpenDocument/MetaInf.php index c6d6e3d3..791dfcee 100644 --- a/src/PhpSpreadsheet/Writer/OpenDocument/MetaInf.php +++ b/src/PhpSpreadsheet/Writer/OpenDocument/MetaInf.php @@ -1,11 +1,9 @@ getParentWriter()->getPHPExcel(); + if (!$spreadsheet) { + $spreadsheet = $this->getParentWriter()->getPhpSpreadsheet(); } $objWriter = null; if ($this->getParentWriter()->getUseDiskCaching()) { - $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); + $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); } else { - $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY); + $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_MEMORY); } // XML header diff --git a/src/PhpSpreadsheet/Writer/OpenDocument/Mimetype.php b/src/PhpSpreadsheet/Writer/OpenDocument/Mimetype.php index 496e93e7..7e6a713b 100644 --- a/src/PhpSpreadsheet/Writer/OpenDocument/Mimetype.php +++ b/src/PhpSpreadsheet/Writer/OpenDocument/Mimetype.php @@ -1,12 +1,8 @@ getParentWriter()->getPHPExcel(); + if (!$spreadsheet) { + $spreadsheet = $this->getParentWriter()->getPhpSpreadsheet(); } $objWriter = null; if ($this->getParentWriter()->getUseDiskCaching()) { - $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); + $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); } else { - $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY); + $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_MEMORY); } // XML header diff --git a/src/PhpSpreadsheet/Writer/OpenDocument/Styles.php b/src/PhpSpreadsheet/Writer/OpenDocument/Styles.php index 14eee25b..345ff3da 100644 --- a/src/PhpSpreadsheet/Writer/OpenDocument/Styles.php +++ b/src/PhpSpreadsheet/Writer/OpenDocument/Styles.php @@ -1,11 +1,9 @@ getParentWriter()->getPHPExcel(); + if (!$spreadsheet) { + $spreadsheet = $this->getParentWriter()->getPhpSpreadsheet(); } $objWriter = null; if ($this->getParentWriter()->getUseDiskCaching()) { - $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); + $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); } else { - $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY); + $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_MEMORY); } // XML header diff --git a/src/PhpSpreadsheet/Writer/OpenDocument/Thumbnails.php b/src/PhpSpreadsheet/Writer/OpenDocument/Thumbnails.php index 58ca83bd..bc423afd 100644 --- a/src/PhpSpreadsheet/Writer/OpenDocument/Thumbnails.php +++ b/src/PhpSpreadsheet/Writer/OpenDocument/Thumbnails.php @@ -1,11 +1,9 @@ renderer = new $rendererName($phpExcel); + $this->renderer = new $rendererName($spreadsheet); } diff --git a/src/PhpSpreadsheet/Writer/PDF/Core.php b/src/PhpSpreadsheet/Writer/PDF/Core.php index 9902c0d9..32f47672 100644 --- a/src/PhpSpreadsheet/Writer/PDF/Core.php +++ b/src/PhpSpreadsheet/Writer/PDF/Core.php @@ -1,11 +1,9 @@ 'LETTER', // (8.5 in. by 11 in.) - \PHPExcel\Worksheet\PageSetup::PAPERSIZE_LETTER_SMALL + \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_LETTER_SMALL => 'LETTER', // (8.5 in. by 11 in.) - \PHPExcel\Worksheet\PageSetup::PAPERSIZE_TABLOID + \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_TABLOID => array(792.00, 1224.00), // (11 in. by 17 in.) - \PHPExcel\Worksheet\PageSetup::PAPERSIZE_LEDGER + \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_LEDGER => array(1224.00, 792.00), // (17 in. by 11 in.) - \PHPExcel\Worksheet\PageSetup::PAPERSIZE_LEGAL + \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_LEGAL => 'LEGAL', // (8.5 in. by 14 in.) - \PHPExcel\Worksheet\PageSetup::PAPERSIZE_STATEMENT + \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_STATEMENT => array(396.00, 612.00), // (5.5 in. by 8.5 in.) - \PHPExcel\Worksheet\PageSetup::PAPERSIZE_EXECUTIVE + \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_EXECUTIVE => 'EXECUTIVE', // (7.25 in. by 10.5 in.) - \PHPExcel\Worksheet\PageSetup::PAPERSIZE_A3 + \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_A3 => 'A3', // (297 mm by 420 mm) - \PHPExcel\Worksheet\PageSetup::PAPERSIZE_A4 + \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_A4 => 'A4', // (210 mm by 297 mm) - \PHPExcel\Worksheet\PageSetup::PAPERSIZE_A4_SMALL + \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_A4_SMALL => 'A4', // (210 mm by 297 mm) - \PHPExcel\Worksheet\PageSetup::PAPERSIZE_A5 + \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_A5 => 'A5', // (148 mm by 210 mm) - \PHPExcel\Worksheet\PageSetup::PAPERSIZE_B4 + \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_B4 => 'B4', // (250 mm by 353 mm) - \PHPExcel\Worksheet\PageSetup::PAPERSIZE_B5 + \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_B5 => 'B5', // (176 mm by 250 mm) - \PHPExcel\Worksheet\PageSetup::PAPERSIZE_FOLIO + \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_FOLIO => 'FOLIO', // (8.5 in. by 13 in.) - \PHPExcel\Worksheet\PageSetup::PAPERSIZE_QUARTO + \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_QUARTO => array(609.45, 779.53), // (215 mm by 275 mm) - \PHPExcel\Worksheet\PageSetup::PAPERSIZE_STANDARD_1 + \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_STANDARD_1 => array(720.00, 1008.00), // (10 in. by 14 in.) - \PHPExcel\Worksheet\PageSetup::PAPERSIZE_STANDARD_2 + \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_STANDARD_2 => array(792.00, 1224.00), // (11 in. by 17 in.) - \PHPExcel\Worksheet\PageSetup::PAPERSIZE_NOTE + \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_NOTE => 'LETTER', // (8.5 in. by 11 in.) - \PHPExcel\Worksheet\PageSetup::PAPERSIZE_NO9_ENVELOPE + \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_NO9_ENVELOPE => array(279.00, 639.00), // (3.875 in. by 8.875 in.) - \PHPExcel\Worksheet\PageSetup::PAPERSIZE_NO10_ENVELOPE + \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_NO10_ENVELOPE => array(297.00, 684.00), // (4.125 in. by 9.5 in.) - \PHPExcel\Worksheet\PageSetup::PAPERSIZE_NO11_ENVELOPE + \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_NO11_ENVELOPE => array(324.00, 747.00), // (4.5 in. by 10.375 in.) - \PHPExcel\Worksheet\PageSetup::PAPERSIZE_NO12_ENVELOPE + \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_NO12_ENVELOPE => array(342.00, 792.00), // (4.75 in. by 11 in.) - \PHPExcel\Worksheet\PageSetup::PAPERSIZE_NO14_ENVELOPE + \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_NO14_ENVELOPE => array(360.00, 828.00), // (5 in. by 11.5 in.) - \PHPExcel\Worksheet\PageSetup::PAPERSIZE_C + \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_C => array(1224.00, 1584.00), // (17 in. by 22 in.) - \PHPExcel\Worksheet\PageSetup::PAPERSIZE_D + \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_D => array(1584.00, 2448.00), // (22 in. by 34 in.) - \PHPExcel\Worksheet\PageSetup::PAPERSIZE_E + \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_E => array(2448.00, 3168.00), // (34 in. by 44 in.) - \PHPExcel\Worksheet\PageSetup::PAPERSIZE_DL_ENVELOPE + \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_DL_ENVELOPE => array(311.81, 623.62), // (110 mm by 220 mm) - \PHPExcel\Worksheet\PageSetup::PAPERSIZE_C5_ENVELOPE + \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_C5_ENVELOPE => 'C5', // (162 mm by 229 mm) - \PHPExcel\Worksheet\PageSetup::PAPERSIZE_C3_ENVELOPE + \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_C3_ENVELOPE => 'C3', // (324 mm by 458 mm) - \PHPExcel\Worksheet\PageSetup::PAPERSIZE_C4_ENVELOPE + \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_C4_ENVELOPE => 'C4', // (229 mm by 324 mm) - \PHPExcel\Worksheet\PageSetup::PAPERSIZE_C6_ENVELOPE + \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_C6_ENVELOPE => 'C6', // (114 mm by 162 mm) - \PHPExcel\Worksheet\PageSetup::PAPERSIZE_C65_ENVELOPE + \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_C65_ENVELOPE => array(323.15, 649.13), // (114 mm by 229 mm) - \PHPExcel\Worksheet\PageSetup::PAPERSIZE_B4_ENVELOPE + \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_B4_ENVELOPE => 'B4', // (250 mm by 353 mm) - \PHPExcel\Worksheet\PageSetup::PAPERSIZE_B5_ENVELOPE + \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_B5_ENVELOPE => 'B5', // (176 mm by 250 mm) - \PHPExcel\Worksheet\PageSetup::PAPERSIZE_B6_ENVELOPE + \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_B6_ENVELOPE => array(498.90, 354.33), // (176 mm by 125 mm) - \PHPExcel\Worksheet\PageSetup::PAPERSIZE_ITALY_ENVELOPE + \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_ITALY_ENVELOPE => array(311.81, 651.97), // (110 mm by 230 mm) - \PHPExcel\Worksheet\PageSetup::PAPERSIZE_MONARCH_ENVELOPE + \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_MONARCH_ENVELOPE => array(279.00, 540.00), // (3.875 in. by 7.5 in.) - \PHPExcel\Worksheet\PageSetup::PAPERSIZE_6_3_4_ENVELOPE + \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_6_3_4_ENVELOPE => array(261.00, 468.00), // (3.625 in. by 6.5 in.) - \PHPExcel\Worksheet\PageSetup::PAPERSIZE_US_STANDARD_FANFOLD + \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_US_STANDARD_FANFOLD => array(1071.00, 792.00), // (14.875 in. by 11 in.) - \PHPExcel\Worksheet\PageSetup::PAPERSIZE_GERMAN_STANDARD_FANFOLD + \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_GERMAN_STANDARD_FANFOLD => array(612.00, 864.00), // (8.5 in. by 12 in.) - \PHPExcel\Worksheet\PageSetup::PAPERSIZE_GERMAN_LEGAL_FANFOLD + \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_GERMAN_LEGAL_FANFOLD => 'FOLIO', // (8.5 in. by 13 in.) - \PHPExcel\Worksheet\PageSetup::PAPERSIZE_ISO_B4 + \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_ISO_B4 => 'B4', // (250 mm by 353 mm) - \PHPExcel\Worksheet\PageSetup::PAPERSIZE_JAPANESE_DOUBLE_POSTCARD + \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_JAPANESE_DOUBLE_POSTCARD => array(566.93, 419.53), // (200 mm by 148 mm) - \PHPExcel\Worksheet\PageSetup::PAPERSIZE_STANDARD_PAPER_1 + \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_STANDARD_PAPER_1 => array(648.00, 792.00), // (9 in. by 11 in.) - \PHPExcel\Worksheet\PageSetup::PAPERSIZE_STANDARD_PAPER_2 + \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_STANDARD_PAPER_2 => array(720.00, 792.00), // (10 in. by 11 in.) - \PHPExcel\Worksheet\PageSetup::PAPERSIZE_STANDARD_PAPER_3 + \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_STANDARD_PAPER_3 => array(1080.00, 792.00), // (15 in. by 11 in.) - \PHPExcel\Worksheet\PageSetup::PAPERSIZE_INVITE_ENVELOPE + \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_INVITE_ENVELOPE => array(623.62, 623.62), // (220 mm by 220 mm) - \PHPExcel\Worksheet\PageSetup::PAPERSIZE_LETTER_EXTRA_PAPER + \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_LETTER_EXTRA_PAPER => array(667.80, 864.00), // (9.275 in. by 12 in.) - \PHPExcel\Worksheet\PageSetup::PAPERSIZE_LEGAL_EXTRA_PAPER + \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_LEGAL_EXTRA_PAPER => array(667.80, 1080.00), // (9.275 in. by 15 in.) - \PHPExcel\Worksheet\PageSetup::PAPERSIZE_TABLOID_EXTRA_PAPER + \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_TABLOID_EXTRA_PAPER => array(841.68, 1296.00), // (11.69 in. by 18 in.) - \PHPExcel\Worksheet\PageSetup::PAPERSIZE_A4_EXTRA_PAPER + \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_A4_EXTRA_PAPER => array(668.98, 912.76), // (236 mm by 322 mm) - \PHPExcel\Worksheet\PageSetup::PAPERSIZE_LETTER_TRANSVERSE_PAPER + \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_LETTER_TRANSVERSE_PAPER => array(595.80, 792.00), // (8.275 in. by 11 in.) - \PHPExcel\Worksheet\PageSetup::PAPERSIZE_A4_TRANSVERSE_PAPER + \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_A4_TRANSVERSE_PAPER => 'A4', // (210 mm by 297 mm) - \PHPExcel\Worksheet\PageSetup::PAPERSIZE_LETTER_EXTRA_TRANSVERSE_PAPER + \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_LETTER_EXTRA_TRANSVERSE_PAPER => array(667.80, 864.00), // (9.275 in. by 12 in.) - \PHPExcel\Worksheet\PageSetup::PAPERSIZE_SUPERA_SUPERA_A4_PAPER + \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_SUPERA_SUPERA_A4_PAPER => array(643.46, 1009.13), // (227 mm by 356 mm) - \PHPExcel\Worksheet\PageSetup::PAPERSIZE_SUPERB_SUPERB_A3_PAPER + \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_SUPERB_SUPERB_A3_PAPER => array(864.57, 1380.47), // (305 mm by 487 mm) - \PHPExcel\Worksheet\PageSetup::PAPERSIZE_LETTER_PLUS_PAPER + \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_LETTER_PLUS_PAPER => array(612.00, 913.68), // (8.5 in. by 12.69 in.) - \PHPExcel\Worksheet\PageSetup::PAPERSIZE_A4_PLUS_PAPER + \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_A4_PLUS_PAPER => array(595.28, 935.43), // (210 mm by 330 mm) - \PHPExcel\Worksheet\PageSetup::PAPERSIZE_A5_TRANSVERSE_PAPER + \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_A5_TRANSVERSE_PAPER => 'A5', // (148 mm by 210 mm) - \PHPExcel\Worksheet\PageSetup::PAPERSIZE_JIS_B5_TRANSVERSE_PAPER + \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_JIS_B5_TRANSVERSE_PAPER => array(515.91, 728.50), // (182 mm by 257 mm) - \PHPExcel\Worksheet\PageSetup::PAPERSIZE_A3_EXTRA_PAPER + \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_A3_EXTRA_PAPER => array(912.76, 1261.42), // (322 mm by 445 mm) - \PHPExcel\Worksheet\PageSetup::PAPERSIZE_A5_EXTRA_PAPER + \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_A5_EXTRA_PAPER => array(493.23, 666.14), // (174 mm by 235 mm) - \PHPExcel\Worksheet\PageSetup::PAPERSIZE_ISO_B5_EXTRA_PAPER + \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_ISO_B5_EXTRA_PAPER => array(569.76, 782.36), // (201 mm by 276 mm) - \PHPExcel\Worksheet\PageSetup::PAPERSIZE_A2_PAPER + \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_A2_PAPER => 'A2', // (420 mm by 594 mm) - \PHPExcel\Worksheet\PageSetup::PAPERSIZE_A3_TRANSVERSE_PAPER + \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_A3_TRANSVERSE_PAPER => 'A3', // (297 mm by 420 mm) - \PHPExcel\Worksheet\PageSetup::PAPERSIZE_A3_EXTRA_TRANSVERSE_PAPER + \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_A3_EXTRA_TRANSVERSE_PAPER => array(912.76, 1261.42) // (322 mm by 445 mm) ); /** * Create a new PDF Writer instance * - * @param \PHPExcel\Spreadsheet $phpExcel Spreadsheet object + * @param \PhpSpreadsheet\Spreadsheet $spreadsheet Spreadsheet object */ - public function __construct(\PHPExcel\Spreadsheet $phpExcel) + public function __construct(\PhpSpreadsheet\Spreadsheet $spreadsheet) { - parent::__construct($phpExcel); + parent::__construct($spreadsheet); $this->setUseInlineCss(true); - $this->tempDir = \PHPExcel\Shared\File::sysGetTempDir(); + $this->tempDir = \PhpSpreadsheet\Shared\File::sysGetTempDir(); } /** @@ -256,9 +253,9 @@ abstract class Core extends \PHPExcel\Writer\HTML * Set Paper Size * * @param string $pValue Paper size - * @return PHPExcel_Writer_PDF + * @return self */ - public function setPaperSize($pValue = \PHPExcel\Worksheet\PageSetup::PAPERSIZE_LETTER) + public function setPaperSize($pValue = \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_LETTER) { $this->paperSize = $pValue; return $this; @@ -278,9 +275,9 @@ abstract class Core extends \PHPExcel\Writer\HTML * Set Orientation * * @param string $pValue Page orientation - * @return PHPExcel_Writer_PDF + * @return self */ - public function setOrientation($pValue = \PHPExcel\Worksheet\PageSetup::ORIENTATION_DEFAULT) + public function setOrientation($pValue = \PhpSpreadsheet\Worksheet\PageSetup::ORIENTATION_DEFAULT) { $this->orientation = $pValue; return $this; @@ -300,15 +297,15 @@ abstract class Core extends \PHPExcel\Writer\HTML * Set temporary storage directory * * @param string $pValue Temporary storage directory - * @throws \PHPExcel\Writer\Exception when directory does not exist - * @return PHPExcel_Writer_PDF + * @throws \PhpSpreadsheet\Writer\Exception when directory does not exist + * @return self */ public function setTempDir($pValue = '') { if (is_dir($pValue)) { $this->tempDir = $pValue; } else { - throw new \PHPExcel\Writer\Exception("Directory does not exist: $pValue"); + throw new \PhpSpreadsheet\Writer\Exception("Directory does not exist: $pValue"); } return $this; } @@ -317,20 +314,20 @@ abstract class Core extends \PHPExcel\Writer\HTML * Save Spreadsheet to PDF file, pre-save * * @param string $pFilename Name of the file to save as - * @throws \PHPExcel\Writer\Exception + * @throws \PhpSpreadsheet\Writer\Exception */ protected function prepareForSave($pFilename = null) { // garbage collect - $this->phpExcel->garbageCollect(); + $this->spreadsheet->garbageCollect(); - $this->saveArrayReturnType = PHPExcel_Calculation::getArrayReturnType(); - PHPExcel_Calculation::setArrayReturnType(PHPExcel_Calculation::RETURN_ARRAY_AS_VALUE); + $this->saveArrayReturnType = \PhpSpreadsheet\Calculation::getArrayReturnType(); + \PhpSpreadsheet\Calculation::setArrayReturnType(\PhpSpreadsheet\Calculation::RETURN_ARRAY_AS_VALUE); // Open file $fileHandle = fopen($pFilename, 'w'); if ($fileHandle === false) { - throw new \PHPExcel\Writer\Exception("Could not open file $pFilename for writing."); + throw new \PhpSpreadsheet\Writer\Exception("Could not open file $pFilename for writing."); } // Set PDF @@ -342,16 +339,16 @@ abstract class Core extends \PHPExcel\Writer\HTML } /** - * Save PHPExcel to PDF file, post-save + * Save PhpSpreadsheet to PDF file, post-save * * @param resource $fileHandle - * @throws \PHPExcel\Writer\Exception + * @throws \PhpSpreadsheet\Writer\Exception */ protected function restoreStateAfterSave($fileHandle) { // Close file fclose($fileHandle); - PHPExcel_Calculation::setArrayReturnType($this->saveArrayReturnType); + \PhpSpreadsheet\Calculation::setArrayReturnType($this->saveArrayReturnType); } } diff --git a/src/PhpSpreadsheet/Writer/PDF/DomPDF.php b/src/PhpSpreadsheet/Writer/PDF/DomPDF.php index 8bc85803..2b651cc3 100644 --- a/src/PhpSpreadsheet/Writer/PDF/DomPDF.php +++ b/src/PhpSpreadsheet/Writer/PDF/DomPDF.php @@ -1,19 +1,17 @@ getSheetIndex())) { - $orientation = ($this->phpExcel->getSheet(0)->getPageSetup()->getOrientation() - == \PHPExcel\Worksheet\PageSetup::ORIENTATION_LANDSCAPE) ? 'L' : 'P'; - $printPaperSize = $this->phpExcel->getSheet(0)->getPageSetup()->getPaperSize(); - $printMargins = $this->phpExcel->getSheet(0)->getPageMargins(); + $orientation = ($this->phpSpreadsheet->getSheet(0)->getPageSetup()->getOrientation() + == \PhpSpreadsheet\Worksheet\PageSetup::ORIENTATION_LANDSCAPE) ? 'L' : 'P'; + $printPaperSize = $this->phpSpreadsheet->getSheet(0)->getPageSetup()->getPaperSize(); + $printMargins = $this->phpSpreadsheet->getSheet(0)->getPageMargins(); } else { - $orientation = ($this->phpExcel->getSheet($this->getSheetIndex())->getPageSetup()->getOrientation() - == \PHPExcel\Worksheet\PageSetup::ORIENTATION_LANDSCAPE) ? 'L' : 'P'; - $printPaperSize = $this->phpExcel->getSheet($this->getSheetIndex())->getPageSetup()->getPaperSize(); - $printMargins = $this->phpExcel->getSheet($this->getSheetIndex())->getPageMargins(); + $orientation = ($this->phpSpreadsheet->getSheet($this->getSheetIndex())->getPageSetup()->getOrientation() + == \PhpSpreadsheet\Worksheet\PageSetup::ORIENTATION_LANDSCAPE) ? 'L' : 'P'; + $printPaperSize = $this->phpSpreadsheet->getSheet($this->getSheetIndex())->getPageSetup()->getPaperSize(); + $printMargins = $this->phpSpreadsheet->getSheet($this->getSheetIndex())->getPageMargins(); } $orientation = ($orientation == 'L') ? 'landscape' : 'portrait'; // Override Page Orientation if (!is_null($this->getOrientation())) { - $orientation = ($this->getOrientation() == \PHPExcel\Worksheet\PageSetup::ORIENTATION_DEFAULT) - ? \PHPExcel\Worksheet\PageSetup::ORIENTATION_PORTRAIT + $orientation = ($this->getOrientation() == \PhpSpreadsheet\Worksheet\PageSetup::ORIENTATION_DEFAULT) + ? \PhpSpreadsheet\Worksheet\PageSetup::ORIENTATION_PORTRAIT : $this->getOrientation(); } // Override Paper Size diff --git a/src/PhpSpreadsheet/Writer/PDF/MPDF.php b/src/PhpSpreadsheet/Writer/PDF/MPDF.php index 185ac334..6bd976f4 100644 --- a/src/PhpSpreadsheet/Writer/PDF/MPDF.php +++ b/src/PhpSpreadsheet/Writer/PDF/MPDF.php @@ -1,19 +1,17 @@ getSheetIndex())) { - $orientation = ($this->phpExcel->getSheet(0)->getPageSetup()->getOrientation() - == \PHPExcel\Worksheet\PageSetup::ORIENTATION_LANDSCAPE) ? 'L' : 'P'; - $printPaperSize = $this->phpExcel->getSheet(0)->getPageSetup()->getPaperSize(); - $printMargins = $this->phpExcel->getSheet(0)->getPageMargins(); + $orientation = ($this->phpSpreadsheet->getSheet(0)->getPageSetup()->getOrientation() + == \PhpSpreadsheet\Worksheet\PageSetup::ORIENTATION_LANDSCAPE) ? 'L' : 'P'; + $printPaperSize = $this->phpSpreadsheet->getSheet(0)->getPageSetup()->getPaperSize(); + $printMargins = $this->phpSpreadsheet->getSheet(0)->getPageMargins(); } else { - $orientation = ($this->phpExcel->getSheet($this->getSheetIndex())->getPageSetup()->getOrientation() - == \PHPExcel\Worksheet\PageSetup::ORIENTATION_LANDSCAPE) ? 'L' : 'P'; - $printPaperSize = $this->phpExcel->getSheet($this->getSheetIndex())->getPageSetup()->getPaperSize(); - $printMargins = $this->phpExcel->getSheet($this->getSheetIndex())->getPageMargins(); + $orientation = ($this->phpSpreadsheet->getSheet($this->getSheetIndex())->getPageSetup()->getOrientation() + == \PhpSpreadsheet\Worksheet\PageSetup::ORIENTATION_LANDSCAPE) ? 'L' : 'P'; + $printPaperSize = $this->phpSpreadsheet->getSheet($this->getSheetIndex())->getPageSetup()->getPaperSize(); + $printMargins = $this->phpSpreadsheet->getSheet($this->getSheetIndex())->getPageMargins(); } $this->setOrientation($orientation); // Override Page Orientation if (!is_null($this->getOrientation())) { - $orientation = ($this->getOrientation() == \PHPExcel\Worksheet\PageSetup::ORIENTATION_DEFAULT) - ? \PHPExcel\Worksheet\PageSetup::ORIENTATION_PORTRAIT + $orientation = ($this->getOrientation() == \PhpSpreadsheet\Worksheet\PageSetup::ORIENTATION_DEFAULT) + ? \PhpSpreadsheet\Worksheet\PageSetup::ORIENTATION_PORTRAIT : $this->getOrientation(); } $orientation = strtoupper($orientation); @@ -100,11 +97,11 @@ class MPDF extends Core implements \PHPExcel\Writer\IWriter $pdf->AddPage($orientation); // Document info - $pdf->SetTitle($this->phpExcel->getProperties()->getTitle()); - $pdf->SetAuthor($this->phpExcel->getProperties()->getCreator()); - $pdf->SetSubject($this->phpExcel->getProperties()->getSubject()); - $pdf->SetKeywords($this->phpExcel->getProperties()->getKeywords()); - $pdf->SetCreator($this->phpExcel->getProperties()->getCreator()); + $pdf->SetTitle($this->phpSpreadsheet->getProperties()->getTitle()); + $pdf->SetAuthor($this->phpSpreadsheet->getProperties()->getCreator()); + $pdf->SetSubject($this->phpSpreadsheet->getProperties()->getSubject()); + $pdf->SetKeywords($this->phpSpreadsheet->getProperties()->getKeywords()); + $pdf->SetCreator($this->phpSpreadsheet->getProperties()->getCreator()); $pdf->WriteHTML( $this->generateHTMLHeader(false) . diff --git a/src/PhpSpreadsheet/Writer/PDF/TcPDF.php b/src/PhpSpreadsheet/Writer/PDF/TcPDF.php index b96dec88..5aead92e 100644 --- a/src/PhpSpreadsheet/Writer/PDF/TcPDF.php +++ b/src/PhpSpreadsheet/Writer/PDF/TcPDF.php @@ -1,20 +1,18 @@ getSheetIndex())) { - $orientation = ($this->phpExcel->getSheet(0)->getPageSetup()->getOrientation() - == \PHPExcel\Worksheet\PageSetup::ORIENTATION_LANDSCAPE) ? 'L' : 'P'; - $printPaperSize = $this->phpExcel->getSheet(0)->getPageSetup()->getPaperSize(); - $printMargins = $this->phpExcel->getSheet(0)->getPageMargins(); + $orientation = ($this->phpSpreadsheet->getSheet(0)->getPageSetup()->getOrientation() + == \PhpSpreadsheet\Worksheet\PageSetup::ORIENTATION_LANDSCAPE) ? 'L' : 'P'; + $printPaperSize = $this->phpSpreadsheet->getSheet(0)->getPageSetup()->getPaperSize(); + $printMargins = $this->phpSpreadsheet->getSheet(0)->getPageMargins(); } else { - $orientation = ($this->phpExcel->getSheet($this->getSheetIndex())->getPageSetup()->getOrientation() - == \PHPExcel\Worksheet\PageSetup::ORIENTATION_LANDSCAPE) ? 'L' : 'P'; - $printPaperSize = $this->phpExcel->getSheet($this->getSheetIndex())->getPageSetup()->getPaperSize(); - $printMargins = $this->phpExcel->getSheet($this->getSheetIndex())->getPageMargins(); + $orientation = ($this->phpSpreadsheet->getSheet($this->getSheetIndex())->getPageSetup()->getOrientation() + == \PhpSpreadsheet\Worksheet\PageSetup::ORIENTATION_LANDSCAPE) ? 'L' : 'P'; + $printPaperSize = $this->phpSpreadsheet->getSheet($this->getSheetIndex())->getPageSetup()->getPaperSize(); + $printMargins = $this->phpSpreadsheet->getSheet($this->getSheetIndex())->getPageMargins(); } // Override Page Orientation if (!is_null($this->getOrientation())) { - $orientation = ($this->getOrientation() == \PHPExcel\Worksheet\PageSetup::ORIENTATION_LANDSCAPE) + $orientation = ($this->getOrientation() == \PhpSpreadsheet\Worksheet\PageSetup::ORIENTATION_LANDSCAPE) ? 'L' : 'P'; } @@ -111,11 +108,11 @@ class TcPDF extends Core implements \PHPExcel\Writer\IWriter ); // Document info - $pdf->SetTitle($this->phpExcel->getProperties()->getTitle()); - $pdf->SetAuthor($this->phpExcel->getProperties()->getCreator()); - $pdf->SetSubject($this->phpExcel->getProperties()->getSubject()); - $pdf->SetKeywords($this->phpExcel->getProperties()->getKeywords()); - $pdf->SetCreator($this->phpExcel->getProperties()->getCreator()); + $pdf->SetTitle($this->phpSpreadsheet->getProperties()->getTitle()); + $pdf->SetAuthor($this->phpSpreadsheet->getProperties()->getCreator()); + $pdf->SetSubject($this->phpSpreadsheet->getProperties()->getSubject()); + $pdf->SetKeywords($this->phpSpreadsheet->getProperties()->getKeywords()); + $pdf->SetCreator($this->phpSpreadsheet->getProperties()->getCreator()); // Write to file fwrite($fileHandle, $pdf->output($pFilename, 'S')); diff --git a/src/PhpSpreadsheet/locale/bg/config b/src/PhpSpreadsheet/locale/bg/config index 4aeae6b5..65288508 100644 --- a/src/PhpSpreadsheet/locale/bg/config +++ b/src/PhpSpreadsheet/locale/bg/config @@ -1,8 +1,8 @@ ## -## PHPExcel +## PhpSpreadsheet ## -## Copyright (c) 2006 - 2013 PHPExcel +## Copyright (c) 2006 - 2013 PhpSpreadsheet ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -18,9 +18,8 @@ ## License along with this library; if not, write to the Free Software ## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ## -## @category PHPExcel -## @package PHPExcel_Settings -## @copyright Copyright (c) 2006 - 2013 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet) +## @category PhpSpreadsheet +## @copyright Copyright (c) 2006 - 2013 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet) ## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL ## @version ##VERSION##, ##DATE## ## diff --git a/src/PhpSpreadsheet/locale/cs/config b/src/PhpSpreadsheet/locale/cs/config index 74b8673a..cd5066a3 100644 --- a/src/PhpSpreadsheet/locale/cs/config +++ b/src/PhpSpreadsheet/locale/cs/config @@ -1,7 +1,8 @@ ## -## PHPExcel -## -## Copyright (c) 2006 - 2013 PHPExcel +## PhpSpreadsheet +## + +## Copyright (c) 2006 - 2013 PhpSpreadsheet ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -17,9 +18,8 @@ ## License along with this library; if not, write to the Free Software ## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ## -## @category PHPExcel -## @package PHPExcel_Settings -## @copyright Copyright (c) 2006 - 2013 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet) +## @category PhpSpreadsheet +## @copyright Copyright (c) 2006 - 2013 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet) ## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL ## @version ##VERSION##, ##DATE## ## diff --git a/src/PhpSpreadsheet/locale/cs/functions b/src/PhpSpreadsheet/locale/cs/functions index 8a88b29b..8b2334f5 100644 --- a/src/PhpSpreadsheet/locale/cs/functions +++ b/src/PhpSpreadsheet/locale/cs/functions @@ -1,7 +1,8 @@ ## -## PHPExcel -## -## Copyright (c) 2006 - 2013 PHPExcel +## PhpSpreadsheet +## + +## Copyright (c) 2006 - 2013 PhpSpreadsheet ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -17,9 +18,8 @@ ## License along with this library; if not, write to the Free Software ## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ## -## @category PHPExcel -## @package PHPExcel_Calculation -## @copyright Copyright (c) 2006 - 2013 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet) +## @category PhpSpreadsheet +## @copyright Copyright (c) 2006 - 2013 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet) ## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL ## @version ##VERSION##, ##DATE## ## diff --git a/src/PhpSpreadsheet/locale/da/config b/src/PhpSpreadsheet/locale/da/config index 0dbb1d46..e638e110 100644 --- a/src/PhpSpreadsheet/locale/da/config +++ b/src/PhpSpreadsheet/locale/da/config @@ -1,7 +1,8 @@ ## -## PHPExcel -## -## Copyright (c) 2006 - 2013 PHPExcel +## PhpSpreadsheet +## + +## Copyright (c) 2006 - 2013 PhpSpreadsheet ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -17,9 +18,8 @@ ## License along with this library; if not, write to the Free Software ## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ## -## @category PHPExcel -## @package PHPExcel_Settings -## @copyright Copyright (c) 2006 - 2013 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet) +## @category PhpSpreadsheet +## @copyright Copyright (c) 2006 - 2013 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet) ## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL ## @version ##VERSION##, ##DATE## ## @@ -32,12 +32,13 @@ ArgumentSeparator = ; ## ## (For future use) ## -currencySymbol = kr +currencySymbol = kr ## -## Excel Error Codes (For future use) +## Excel Error Codes (For future use) + ## NULL = #NUL! DIV0 = #DIVISION/0! diff --git a/src/PhpSpreadsheet/locale/da/functions b/src/PhpSpreadsheet/locale/da/functions index 5e1ecda9..49d8aad3 100644 --- a/src/PhpSpreadsheet/locale/da/functions +++ b/src/PhpSpreadsheet/locale/da/functions @@ -1,7 +1,8 @@ ## -## PHPExcel -## -## Copyright (c) 2006 - 2013 PHPExcel +## PhpSpreadsheet +## + +## Copyright (c) 2006 - 2013 PhpSpreadsheet ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -17,9 +18,8 @@ ## License along with this library; if not, write to the Free Software ## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ## -## @category PHPExcel -## @package PHPExcel_Calculation -## @copyright Copyright (c) 2006 - 2013 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet) +## @category PhpSpreadsheet +## @copyright Copyright (c) 2006 - 2013 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet) ## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL ## @version ##VERSION##, ##DATE## ## diff --git a/src/PhpSpreadsheet/locale/de/config b/src/PhpSpreadsheet/locale/de/config index ab5e74de..f7fe2fd7 100644 --- a/src/PhpSpreadsheet/locale/de/config +++ b/src/PhpSpreadsheet/locale/de/config @@ -1,7 +1,8 @@ ## -## PHPExcel -## -## Copyright (c) 2006 - 2013 PHPExcel +## PhpSpreadsheet +## + +## Copyright (c) 2006 - 2013 PhpSpreadsheet ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -17,9 +18,8 @@ ## License along with this library; if not, write to the Free Software ## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ## -## @category PHPExcel -## @package PHPExcel_Settings -## @copyright Copyright (c) 2006 - 2013 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet) +## @category PhpSpreadsheet +## @copyright Copyright (c) 2006 - 2013 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet) ## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL ## @version ##VERSION##, ##DATE## ## @@ -36,7 +36,8 @@ currencySymbol = € ## -## Excel Error Codes (For future use) +## Excel Error Codes (For future use) + ## NULL = #NULL! DIV0 = #DIV/0! diff --git a/src/PhpSpreadsheet/locale/de/functions b/src/PhpSpreadsheet/locale/de/functions index 6d810c39..8446313f 100644 --- a/src/PhpSpreadsheet/locale/de/functions +++ b/src/PhpSpreadsheet/locale/de/functions @@ -1,7 +1,8 @@ ## -## PHPExcel -## -## Copyright (c) 2006 - 2013 PHPExcel +## PhpSpreadsheet +## + +## Copyright (c) 2006 - 2013 PhpSpreadsheet ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -17,9 +18,8 @@ ## License along with this library; if not, write to the Free Software ## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ## -## @category PHPExcel -## @package PHPExcel_Calculation -## @copyright Copyright (c) 2006 - 2013 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet) +## @category PhpSpreadsheet +## @copyright Copyright (c) 2006 - 2013 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet) ## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL ## @version ##VERSION##, ##DATE## ## diff --git a/src/PhpSpreadsheet/locale/en/uk/config b/src/PhpSpreadsheet/locale/en/uk/config index ff27e456..04d59cc9 100644 --- a/src/PhpSpreadsheet/locale/en/uk/config +++ b/src/PhpSpreadsheet/locale/en/uk/config @@ -1,7 +1,8 @@ ## -## PHPExcel -## -## Copyright (c) 2006 - 2013 PHPExcel +## PhpSpreadsheet +## + +## Copyright (c) 2006 - 2013 PhpSpreadsheet ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -17,9 +18,8 @@ ## License along with this library; if not, write to the Free Software ## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ## -## @category PHPExcel -## @package PHPExcel_Settings -## @copyright Copyright (c) 2006 - 2013 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet) +## @category PhpSpreadsheet +## @copyright Copyright (c) 2006 - 2013 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet) ## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL ## @version ##VERSION##, ##DATE## ## diff --git a/src/PhpSpreadsheet/locale/es/config b/src/PhpSpreadsheet/locale/es/config index 9de8773a..c68e9a77 100644 --- a/src/PhpSpreadsheet/locale/es/config +++ b/src/PhpSpreadsheet/locale/es/config @@ -1,7 +1,8 @@ ## -## PHPExcel -## -## Copyright (c) 2006 - 2013 PHPExcel +## PhpSpreadsheet +## + +## Copyright (c) 2006 - 2013 PhpSpreadsheet ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -17,9 +18,8 @@ ## License along with this library; if not, write to the Free Software ## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ## -## @category PHPExcel -## @package PHPExcel_Settings -## @copyright Copyright (c) 2006 - 2013 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet) +## @category PhpSpreadsheet +## @copyright Copyright (c) 2006 - 2013 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet) ## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL ## @version ##VERSION##, ##DATE## ## @@ -36,7 +36,8 @@ currencySymbol = $ ## I'm surprised that the Excel Documentation suggests $ rath ## -## Excel Error Codes (For future use) +## Excel Error Codes (For future use) + ## NULL = #¡NULO! DIV0 = #¡DIV/0! diff --git a/src/PhpSpreadsheet/locale/es/functions b/src/PhpSpreadsheet/locale/es/functions index 2c4e07a9..9bc71f9a 100644 --- a/src/PhpSpreadsheet/locale/es/functions +++ b/src/PhpSpreadsheet/locale/es/functions @@ -1,7 +1,8 @@ ## -## PHPExcel -## -## Copyright (c) 2006 - 2013 PHPExcel +## PhpSpreadsheet +## + +## Copyright (c) 2006 - 2013 PhpSpreadsheet ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -17,9 +18,8 @@ ## License along with this library; if not, write to the Free Software ## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ## -## @category PHPExcel -## @package PHPExcel_Calculation -## @copyright Copyright (c) 2006 - 2013 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet) +## @category PhpSpreadsheet +## @copyright Copyright (c) 2006 - 2013 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet) ## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL ## @version ##VERSION##, ##DATE## ## diff --git a/src/PhpSpreadsheet/locale/fi/config b/src/PhpSpreadsheet/locale/fi/config index e7fb9cae..bf57d552 100644 --- a/src/PhpSpreadsheet/locale/fi/config +++ b/src/PhpSpreadsheet/locale/fi/config @@ -1,7 +1,8 @@ ## -## PHPExcel -## -## Copyright (c) 2006 - 2013 PHPExcel +## PhpSpreadsheet +## + +## Copyright (c) 2006 - 2013 PhpSpreadsheet ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -17,9 +18,8 @@ ## License along with this library; if not, write to the Free Software ## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ## -## @category PHPExcel -## @package PHPExcel_Settings -## @copyright Copyright (c) 2006 - 2013 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet) +## @category PhpSpreadsheet +## @copyright Copyright (c) 2006 - 2013 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet) ## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL ## @version ##VERSION##, ##DATE## ## @@ -36,7 +36,8 @@ currencySymbol = $ # Symbol not known, should it be a € (Euro)? ## -## Excel Error Codes (For future use) +## Excel Error Codes (For future use) + ## NULL = #TYHJÄ! DIV0 = #JAKO/0! diff --git a/src/PhpSpreadsheet/locale/fi/functions b/src/PhpSpreadsheet/locale/fi/functions index d39130fe..00dd7b9f 100644 --- a/src/PhpSpreadsheet/locale/fi/functions +++ b/src/PhpSpreadsheet/locale/fi/functions @@ -1,7 +1,8 @@ ## -## PHPExcel -## -## Copyright (c) 2006 - 2013 PHPExcel +## PhpSpreadsheet +## + +## Copyright (c) 2006 - 2013 PhpSpreadsheet ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -17,9 +18,8 @@ ## License along with this library; if not, write to the Free Software ## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ## -## @category PHPExcel -## @package PHPExcel_Calculation -## @copyright Copyright (c) 2006 - 2013 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet) +## @category PhpSpreadsheet +## @copyright Copyright (c) 2006 - 2013 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet) ## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL ## @version ##VERSION##, ##DATE## ## @@ -133,7 +133,7 @@ OCT2HEX = OKTHEKSA ## Muuntaa oktaaliluvun heksadesimaaliluvuksi. ## -## Financial functions Rahoitusfunktiot +## Financial functions Rahoitusfunktiot ## ACCRINT = KERTYNYT.KORKO ## Laskee arvopaperille kertyneen koron, kun korko kertyy säännöllisin väliajoin. ACCRINTM = KERTYNYT.KORKO.LOPUSSA ## Laskee arvopaperille kertyneen koron, kun korko maksetaan eräpäivänä. diff --git a/src/PhpSpreadsheet/locale/fr/config b/src/PhpSpreadsheet/locale/fr/config index 2150f73d..b0e0fa03 100644 --- a/src/PhpSpreadsheet/locale/fr/config +++ b/src/PhpSpreadsheet/locale/fr/config @@ -1,7 +1,8 @@ ## -## PHPExcel -## -## Copyright (c) 2006 - 2013 PHPExcel +## PhpSpreadsheet +## + +## Copyright (c) 2006 - 2013 PhpSpreadsheet ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -17,9 +18,8 @@ ## License along with this library; if not, write to the Free Software ## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ## -## @category PHPExcel -## @package PHPExcel_Settings -## @copyright Copyright (c) 2006 - 2013 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet) +## @category PhpSpreadsheet +## @copyright Copyright (c) 2006 - 2013 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet) ## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL ## @version ##VERSION##, ##DATE## ## @@ -36,7 +36,8 @@ currencySymbol = € ## -## Excel Error Codes (For future use) +## Excel Error Codes (For future use) + ## NULL = #NUL! DIV0 = #DIV/0! diff --git a/src/PhpSpreadsheet/locale/fr/functions b/src/PhpSpreadsheet/locale/fr/functions index 333734cc..f631e7c4 100644 --- a/src/PhpSpreadsheet/locale/fr/functions +++ b/src/PhpSpreadsheet/locale/fr/functions @@ -1,7 +1,8 @@ ## -## PHPExcel -## -## Copyright (c) 2006 - 2013 PHPExcel +## PhpSpreadsheet +## + +## Copyright (c) 2006 - 2013 PhpSpreadsheet ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -17,9 +18,8 @@ ## License along with this library; if not, write to the Free Software ## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ## -## @category PHPExcel -## @package PHPExcel_Calculation -## @copyright Copyright (c) 2006 - 2013 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet) +## @category PhpSpreadsheet +## @copyright Copyright (c) 2006 - 2013 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet) ## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL ## @version ##VERSION##, ##DATE## ## diff --git a/src/PhpSpreadsheet/locale/hu/config b/src/PhpSpreadsheet/locale/hu/config index 6d3a1bdf..f93af423 100644 --- a/src/PhpSpreadsheet/locale/hu/config +++ b/src/PhpSpreadsheet/locale/hu/config @@ -1,7 +1,8 @@ ## -## PHPExcel -## -## Copyright (c) 2006 - 2013 PHPExcel +## PhpSpreadsheet +## + +## Copyright (c) 2006 - 2013 PhpSpreadsheet ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -17,9 +18,8 @@ ## License along with this library; if not, write to the Free Software ## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ## -## @category PHPExcel -## @package PHPExcel_Settings -## @copyright Copyright (c) 2006 - 2013 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet) +## @category PhpSpreadsheet +## @copyright Copyright (c) 2006 - 2013 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet) ## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL ## @version ##VERSION##, ##DATE## ## diff --git a/src/PhpSpreadsheet/locale/hu/functions b/src/PhpSpreadsheet/locale/hu/functions index f117c2bf..e57176a5 100644 --- a/src/PhpSpreadsheet/locale/hu/functions +++ b/src/PhpSpreadsheet/locale/hu/functions @@ -1,7 +1,8 @@ ## -## PHPExcel -## -## Copyright (c) 2006 - 2013 PHPExcel +## PhpSpreadsheet +## + +## Copyright (c) 2006 - 2013 PhpSpreadsheet ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -17,9 +18,8 @@ ## License along with this library; if not, write to the Free Software ## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ## -## @category PHPExcel -## @package PHPExcel_Calculation -## @copyright Copyright (c) 2006 - 2013 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet) +## @category PhpSpreadsheet +## @copyright Copyright (c) 2006 - 2013 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet) ## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL ## @version ##VERSION##, ##DATE## ## @@ -35,7 +35,7 @@ GETPIVOTDATA = KIMUTATÁSADATOT.VESZ ## A kimutatásokban tárolt adatok vissz ## -## Cube functions Kockafüggvények +## Cube functions Kockafüggvények ## CUBEKPIMEMBER = KOCKA.FŐTELJMUT ## Egy fő teljesítménymutató (KPI) nevét, tulajdonságát és mértékegységét adja eredményül, a nevet és a tulajdonságot megjeleníti a cellában. A KPI-k számszerűsíthető mérési lehetőséget jelentenek – ilyen mutató például a havi bruttó nyereség vagy az egy alkalmazottra jutó negyedéves forgalom –, egy szervezet teljesítményének nyomonkövetésére használhatók. CUBEMEMBER = KOCKA.TAG ## Kockahierachia tagját vagy rekordját adja eredményül. Ellenőrizhető vele, hogy szerepel-e a kockában az adott tag vagy rekord. diff --git a/src/PhpSpreadsheet/locale/it/config b/src/PhpSpreadsheet/locale/it/config index cc85a187..89e5612a 100644 --- a/src/PhpSpreadsheet/locale/it/config +++ b/src/PhpSpreadsheet/locale/it/config @@ -1,7 +1,8 @@ ## -## PHPExcel -## -## Copyright (c) 2006 - 2013 PHPExcel +## PhpSpreadsheet +## + +## Copyright (c) 2006 - 2013 PhpSpreadsheet ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -17,9 +18,8 @@ ## License along with this library; if not, write to the Free Software ## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ## -## @category PHPExcel -## @package PHPExcel_Settings -## @copyright Copyright (c) 2006 - 2013 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet) +## @category PhpSpreadsheet +## @copyright Copyright (c) 2006 - 2013 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet) ## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL ## @version ##VERSION##, ##DATE## ## @@ -36,7 +36,8 @@ currencySymbol = € ## -## Excel Error Codes (For future use) +## Excel Error Codes (For future use) + ## NULL = #NULLO! DIV0 = #DIV/0! diff --git a/src/PhpSpreadsheet/locale/it/functions b/src/PhpSpreadsheet/locale/it/functions index 818cb5fd..7ed76d9a 100644 --- a/src/PhpSpreadsheet/locale/it/functions +++ b/src/PhpSpreadsheet/locale/it/functions @@ -1,7 +1,8 @@ ## -## PHPExcel -## -## Copyright (c) 2006 - 2013 PHPExcel +## PhpSpreadsheet +## + +## Copyright (c) 2006 - 2013 PhpSpreadsheet ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -17,9 +18,8 @@ ## License along with this library; if not, write to the Free Software ## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ## -## @category PHPExcel -## @package PHPExcel_Calculation -## @copyright Copyright (c) 2006 - 2013 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet) +## @category PhpSpreadsheet +## @copyright Copyright (c) 2006 - 2013 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet) ## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL ## @version ##VERSION##, ##DATE## ## diff --git a/src/PhpSpreadsheet/locale/nl/config b/src/PhpSpreadsheet/locale/nl/config index 28286252..0fc12250 100644 --- a/src/PhpSpreadsheet/locale/nl/config +++ b/src/PhpSpreadsheet/locale/nl/config @@ -1,7 +1,8 @@ ## -## PHPExcel -## -## Copyright (c) 2006 - 2013 PHPExcel +## PhpSpreadsheet +## + +## Copyright (c) 2006 - 2013 PhpSpreadsheet ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -17,9 +18,8 @@ ## License along with this library; if not, write to the Free Software ## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ## -## @category PHPExcel -## @package PHPExcel_Settings -## @copyright Copyright (c) 2006 - 2013 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet) +## @category PhpSpreadsheet +## @copyright Copyright (c) 2006 - 2013 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet) ## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL ## @version ##VERSION##, ##DATE## ## @@ -36,7 +36,8 @@ currencySymbol = € ## -## Excel Error Codes (For future use) +## Excel Error Codes (For future use) + ## NULL = #LEEG! DIV0 = #DEEL/0! diff --git a/src/PhpSpreadsheet/locale/nl/functions b/src/PhpSpreadsheet/locale/nl/functions index e559c6bc..03425ba4 100644 --- a/src/PhpSpreadsheet/locale/nl/functions +++ b/src/PhpSpreadsheet/locale/nl/functions @@ -1,7 +1,8 @@ ## -## PHPExcel -## -## Copyright (c) 2006 - 2013 PHPExcel +## PhpSpreadsheet +## + +## Copyright (c) 2006 - 2013 PhpSpreadsheet ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -17,9 +18,8 @@ ## License along with this library; if not, write to the Free Software ## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ## -## @category PHPExcel -## @package PHPExcel_Calculation -## @copyright Copyright (c) 2006 - 2013 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet) +## @category PhpSpreadsheet +## @copyright Copyright (c) 2006 - 2013 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet) ## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL ## @version ##VERSION##, ##DATE## ## diff --git a/src/PhpSpreadsheet/locale/no/config b/src/PhpSpreadsheet/locale/no/config index 98b13946..29f3365e 100644 --- a/src/PhpSpreadsheet/locale/no/config +++ b/src/PhpSpreadsheet/locale/no/config @@ -1,7 +1,8 @@ ## -## PHPExcel -## -## Copyright (c) 2006 - 2013 PHPExcel +## PhpSpreadsheet +## + +## Copyright (c) 2006 - 2013 PhpSpreadsheet ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -17,9 +18,8 @@ ## License along with this library; if not, write to the Free Software ## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ## -## @category PHPExcel -## @package PHPExcel_Settings -## @copyright Copyright (c) 2006 - 2013 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet) +## @category PhpSpreadsheet +## @copyright Copyright (c) 2006 - 2013 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet) ## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL ## @version ##VERSION##, ##DATE## ## @@ -36,7 +36,8 @@ currencySymbol = kr ## -## Excel Error Codes (For future use) +## Excel Error Codes (For future use) + ## NULL = #NULL! DIV0 = #DIV/0! diff --git a/src/PhpSpreadsheet/locale/no/functions b/src/PhpSpreadsheet/locale/no/functions index 8be61c1c..c4f59895 100644 --- a/src/PhpSpreadsheet/locale/no/functions +++ b/src/PhpSpreadsheet/locale/no/functions @@ -1,7 +1,8 @@ ## -## PHPExcel -## -## Copyright (c) 2006 - 2013 PHPExcel +## PhpSpreadsheet +## + +## Copyright (c) 2006 - 2013 PhpSpreadsheet ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -17,9 +18,8 @@ ## License along with this library; if not, write to the Free Software ## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ## -## @category PHPExcel -## @package PHPExcel_Calculation -## @copyright Copyright (c) 2006 - 2013 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet) +## @category PhpSpreadsheet +## @copyright Copyright (c) 2006 - 2013 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet) ## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL ## @version ##VERSION##, ##DATE## ## diff --git a/src/PhpSpreadsheet/locale/pl/config b/src/PhpSpreadsheet/locale/pl/config index 883b5cc2..a1194a72 100644 --- a/src/PhpSpreadsheet/locale/pl/config +++ b/src/PhpSpreadsheet/locale/pl/config @@ -1,7 +1,8 @@ ## -## PHPExcel -## -## Copyright (c) 2006 - 2013 PHPExcel +## PhpSpreadsheet +## + +## Copyright (c) 2006 - 2013 PhpSpreadsheet ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -17,9 +18,8 @@ ## License along with this library; if not, write to the Free Software ## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ## -## @category PHPExcel -## @package PHPExcel_Settings -## @copyright Copyright (c) 2006 - 2013 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet) +## @category PhpSpreadsheet +## @copyright Copyright (c) 2006 - 2013 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet) ## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL ## @version ##VERSION##, ##DATE## ## @@ -36,7 +36,8 @@ currencySymbol = zł ## -## Excel Error Codes (For future use) +## Excel Error Codes (For future use) + ## NULL = #ZERO! DIV0 = #DZIEL/0! diff --git a/src/PhpSpreadsheet/locale/pl/functions b/src/PhpSpreadsheet/locale/pl/functions index eb999079..9fff33cc 100644 --- a/src/PhpSpreadsheet/locale/pl/functions +++ b/src/PhpSpreadsheet/locale/pl/functions @@ -1,7 +1,8 @@ ## -## PHPExcel -## -## Copyright (c) 2006 - 2013 PHPExcel +## PhpSpreadsheet +## + +## Copyright (c) 2006 - 2013 PhpSpreadsheet ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -17,9 +18,8 @@ ## License along with this library; if not, write to the Free Software ## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ## -## @category PHPExcel -## @package PHPExcel_Calculation -## @copyright Copyright (c) 2006 - 2013 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet) +## @category PhpSpreadsheet +## @copyright Copyright (c) 2006 - 2013 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet) ## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL ## @version ##VERSION##, ##DATE## ## diff --git a/src/PhpSpreadsheet/locale/pt/br/config b/src/PhpSpreadsheet/locale/pt/br/config index 7fff2e79..0fb989fc 100644 --- a/src/PhpSpreadsheet/locale/pt/br/config +++ b/src/PhpSpreadsheet/locale/pt/br/config @@ -1,7 +1,8 @@ ## -## PHPExcel -## -## Copyright (c) 2006 - 2013 PHPExcel +## PhpSpreadsheet +## + +## Copyright (c) 2006 - 2013 PhpSpreadsheet ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -17,9 +18,8 @@ ## License along with this library; if not, write to the Free Software ## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ## -## @category PHPExcel -## @package PHPExcel_Settings -## @copyright Copyright (c) 2006 - 2013 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet) +## @category PhpSpreadsheet +## @copyright Copyright (c) 2006 - 2013 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet) ## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL ## @version ##VERSION##, ##DATE## ## @@ -36,7 +36,8 @@ currencySymbol = R$ ## -## Excel Error Codes (For future use) +## Excel Error Codes (For future use) + ## NULL = #NULO! DIV0 = #DIV/0! diff --git a/src/PhpSpreadsheet/locale/pt/config b/src/PhpSpreadsheet/locale/pt/config index 6f60ff4b..b6acd436 100644 --- a/src/PhpSpreadsheet/locale/pt/config +++ b/src/PhpSpreadsheet/locale/pt/config @@ -1,7 +1,8 @@ ## -## PHPExcel -## -## Copyright (c) 2006 - 2013 PHPExcel +## PhpSpreadsheet +## + +## Copyright (c) 2006 - 2013 PhpSpreadsheet ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -17,9 +18,8 @@ ## License along with this library; if not, write to the Free Software ## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ## -## @category PHPExcel -## @package PHPExcel_Settings -## @copyright Copyright (c) 2006 - 2013 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet) +## @category PhpSpreadsheet +## @copyright Copyright (c) 2006 - 2013 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet) ## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL ## @version ##VERSION##, ##DATE## ## @@ -36,7 +36,8 @@ currencySymbol = € ## -## Excel Error Codes (For future use) +## Excel Error Codes (For future use) + ## NULL = #NULO! DIV0 = #DIV/0! diff --git a/src/PhpSpreadsheet/locale/ru/config b/src/PhpSpreadsheet/locale/ru/config index 6292c687..68ee0005 100644 --- a/src/PhpSpreadsheet/locale/ru/config +++ b/src/PhpSpreadsheet/locale/ru/config @@ -1,7 +1,8 @@ ## -## PHPExcel -## -## Copyright (c) 2006 - 2013 PHPExcel +## PhpSpreadsheet +## + +## Copyright (c) 2006 - 2013 PhpSpreadsheet ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -17,9 +18,8 @@ ## License along with this library; if not, write to the Free Software ## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ## -## @category PHPExcel -## @package PHPExcel_Settings -## @copyright Copyright (c) 2006 - 2013 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet) +## @category PhpSpreadsheet +## @copyright Copyright (c) 2006 - 2013 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet) ## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL ## @version ##VERSION##, ##DATE## ## @@ -36,7 +36,8 @@ currencySymbol = р ## -## Excel Error Codes (For future use) +## Excel Error Codes (For future use) + ## NULL = #ПУСТО! DIV0 = #ДЕЛ/0! diff --git a/src/PhpSpreadsheet/locale/ru/functions b/src/PhpSpreadsheet/locale/ru/functions index 680af03d..7cc8dd37 100644 --- a/src/PhpSpreadsheet/locale/ru/functions +++ b/src/PhpSpreadsheet/locale/ru/functions @@ -1,7 +1,8 @@ ## -## PHPExcel -## -## Copyright (c) 2006 - 2013 PHPExcel +## PhpSpreadsheet +## + +## Copyright (c) 2006 - 2013 PhpSpreadsheet ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -17,9 +18,8 @@ ## License along with this library; if not, write to the Free Software ## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ## -## @category PHPExcel -## @package PHPExcel_Calculation -## @copyright Copyright (c) 2006 - 2013 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet) +## @category PhpSpreadsheet +## @copyright Copyright (c) 2006 - 2013 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet) ## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL ## @version ##VERSION##, ##DATE## ## @@ -300,7 +300,7 @@ SQRTPI = КОРЕНЬПИ ## Возвращает квадратный ко SUBTOTAL = ПРОМЕЖУТОЧНЫЕ.ИТОГИ ## Возвращает промежуточный итог в списке или базе данных. SUM = СУММ ## Суммирует аргументы. SUMIF = СУММЕСЛИ ## Суммирует ячейки, удовлетворяющие заданному условию. -SUMIFS = СУММЕСЛИМН ## Суммирует диапазон ячеек, удовлетворяющих нескольким условиям. +SUMIFS = СУММЕСЛИМН ## Суммирует диапазон ячеек, удовлетворяющих нескольким условиям. SUMPRODUCT = СУММПРОИЗВ ## Возвращает сумму произведений соответствующих элементов массивов. SUMSQ = СУММКВ ## Возвращает сумму квадратов аргументов. SUMX2MY2 = СУММРАЗНКВ ## Возвращает сумму разностей квадратов соответствующих значений в двух массивах. @@ -318,7 +318,7 @@ AVEDEV = СРОТКЛ ## Возвращает среднее арифмет AVERAGE = СРЗНАЧ ## Возвращает среднее арифметическое аргументов. AVERAGEA = СРЗНАЧА ## Возвращает среднее арифметическое аргументов, включая числа, текст и логические значения. AVERAGEIF = СРЗНАЧЕСЛИ ## Возвращает среднее значение (среднее арифметическое) всех ячеек в диапазоне, которые удовлетворяют данному условию. -AVERAGEIFS = СРЗНАЧЕСЛИМН ## Возвращает среднее значение (среднее арифметическое) всех ячеек, которые удовлетворяют нескольким условиям. +AVERAGEIFS = СРЗНАЧЕСЛИМН ## Возвращает среднее значение (среднее арифметическое) всех ячеек, которые удовлетворяют нескольким условиям. BETADIST = БЕТАРАСП ## Возвращает интегральную функцию бета-распределения. BETAINV = БЕТАОБР ## Возвращает обратную интегральную функцию указанного бета-распределения. BINOMDIST = БИНОМРАСП ## Возвращает отдельное значение биномиального распределения. diff --git a/src/PhpSpreadsheet/locale/sv/config b/src/PhpSpreadsheet/locale/sv/config index 3ab92fe8..a346da07 100644 --- a/src/PhpSpreadsheet/locale/sv/config +++ b/src/PhpSpreadsheet/locale/sv/config @@ -1,7 +1,8 @@ ## -## PHPExcel -## -## Copyright (c) 2006 - 2013 PHPExcel +## PhpSpreadsheet +## + +## Copyright (c) 2006 - 2013 PhpSpreadsheet ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -17,9 +18,8 @@ ## License along with this library; if not, write to the Free Software ## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ## -## @category PHPExcel -## @package PHPExcel_Settings -## @copyright Copyright (c) 2006 - 2013 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet) +## @category PhpSpreadsheet +## @copyright Copyright (c) 2006 - 2013 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet) ## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL ## @version ##VERSION##, ##DATE## ## @@ -36,7 +36,8 @@ currencySymbol = kr ## -## Excel Error Codes (For future use) +## Excel Error Codes (For future use) + ## NULL = #Skärning! DIV0 = #Division/0! diff --git a/src/PhpSpreadsheet/locale/tr/config b/src/PhpSpreadsheet/locale/tr/config index 5afc33ed..56905072 100644 --- a/src/PhpSpreadsheet/locale/tr/config +++ b/src/PhpSpreadsheet/locale/tr/config @@ -1,7 +1,8 @@ ## -## PHPExcel -## -## Copyright (c) 2006 - 2013 PHPExcel +## PhpSpreadsheet +## + +## Copyright (c) 2006 - 2013 PhpSpreadsheet ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -17,9 +18,8 @@ ## License along with this library; if not, write to the Free Software ## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ## -## @category PHPExcel -## @package PHPExcel_Settings -## @copyright Copyright (c) 2006 - 2013 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet) +## @category PhpSpreadsheet +## @copyright Copyright (c) 2006 - 2013 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet) ## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL ## @version ##VERSION##, ##DATE## ## @@ -36,7 +36,8 @@ currencySymbol = YTL ## -## Excel Error Codes (For future use) +## Excel Error Codes (For future use) + ## NULL = #BOŞ! DIV0 = #SAYI/0! diff --git a/src/PhpSpreadsheet/locale/tr/functions b/src/PhpSpreadsheet/locale/tr/functions index 22c978fc..d0c3dd62 100644 --- a/src/PhpSpreadsheet/locale/tr/functions +++ b/src/PhpSpreadsheet/locale/tr/functions @@ -1,7 +1,8 @@ ## -## PHPExcel -## -## Copyright (c) 2006 - 2013 PHPExcel +## PhpSpreadsheet +## + +## Copyright (c) 2006 - 2013 PhpSpreadsheet ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public @@ -17,9 +18,8 @@ ## License along with this library; if not, write to the Free Software ## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ## -## @category PHPExcel -## @package PHPExcel_Calculation -## @copyright Copyright (c) 2006 - 2013 PHPExcel (https://github.com/PHPOffice/PhpSpreadsheet) +## @category PhpSpreadsheet +## @copyright Copyright (c) 2006 - 2013 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet) ## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL ## @version ##VERSION##, ##DATE## ## diff --git a/tests/PhpSpreadsheet/Calculation/DateTimeTest.php b/tests/PhpSpreadsheet/Calculation/DateTimeTest.php index 476cade4..0372c7ad 100644 --- a/tests/PhpSpreadsheet/Calculation/DateTimeTest.php +++ b/tests/PhpSpreadsheet/Calculation/DateTimeTest.php @@ -2,13 +2,12 @@ namespace PhpSpreadsheet\Tests\Calculation; -use PHPExcel\Shared\Date; -use PHPExcel\Calculation\Functions; -use PHPExcel\Calculation\DateTime; +use PhpSpreadsheet\Shared\Date; +use PhpSpreadsheet\Calculation\Functions; +use PhpSpreadsheet\Calculation\DateTime; /** * Class DateTimeTest - * @package PHPExcel\Calculation */ class DateTimeTest extends \PHPUnit_Framework_TestCase { diff --git a/tests/PhpSpreadsheet/Calculation/EngineeringTest.php b/tests/PhpSpreadsheet/Calculation/EngineeringTest.php index a8a58bb2..1bbce265 100644 --- a/tests/PhpSpreadsheet/Calculation/EngineeringTest.php +++ b/tests/PhpSpreadsheet/Calculation/EngineeringTest.php @@ -2,8 +2,8 @@ namespace PhpSpreadsheet\Tests\Calculation; -use PHPExcel\Calculation\Engineering; -use PHPExcel\Calculation\Functions; +use PhpSpreadsheet\Calculation\Engineering; +use PhpSpreadsheet\Calculation\Functions; class EngineeringTest extends \PHPUnit_Framework_TestCase { diff --git a/tests/PhpSpreadsheet/Calculation/FinancialTest.php b/tests/PhpSpreadsheet/Calculation/FinancialTest.php index c879f84a..28006a54 100644 --- a/tests/PhpSpreadsheet/Calculation/FinancialTest.php +++ b/tests/PhpSpreadsheet/Calculation/FinancialTest.php @@ -2,8 +2,8 @@ namespace PhpSpreadsheet\Tests\Calculation; -use PHPExcel\Calculation\Financial; -use PHPExcel\Calculation\Functions; +use PhpSpreadsheet\Calculation\Financial; +use PhpSpreadsheet\Calculation\Functions; class FinancialTest extends \PHPUnit_Framework_TestCase { diff --git a/tests/PhpSpreadsheet/Calculation/FunctionsTest.php b/tests/PhpSpreadsheet/Calculation/FunctionsTest.php index 87206562..3303c183 100644 --- a/tests/PhpSpreadsheet/Calculation/FunctionsTest.php +++ b/tests/PhpSpreadsheet/Calculation/FunctionsTest.php @@ -2,7 +2,7 @@ namespace PhpSpreadsheet\Tests\Calculation; -use PHPExcel\Calculation\Functions; +use PhpSpreadsheet\Calculation\Functions; class FunctionsTest extends \PHPUnit_Framework_TestCase { diff --git a/tests/PhpSpreadsheet/Calculation/LogicalTest.php b/tests/PhpSpreadsheet/Calculation/LogicalTest.php index 7cd35e93..5cad07ac 100644 --- a/tests/PhpSpreadsheet/Calculation/LogicalTest.php +++ b/tests/PhpSpreadsheet/Calculation/LogicalTest.php @@ -2,8 +2,8 @@ namespace PhpSpreadsheet\Tests\Calculation; -use PHPExcel\Calculation\Functions; -use PHPExcel\Calculation\Logical; +use PhpSpreadsheet\Calculation\Functions; +use PhpSpreadsheet\Calculation\Logical; class LogicalTest extends \PHPUnit_Framework_TestCase { diff --git a/tests/PhpSpreadsheet/Calculation/LookupRefTest.php b/tests/PhpSpreadsheet/Calculation/LookupRefTest.php index 93f087d4..29fbaea4 100644 --- a/tests/PhpSpreadsheet/Calculation/LookupRefTest.php +++ b/tests/PhpSpreadsheet/Calculation/LookupRefTest.php @@ -2,12 +2,11 @@ namespace PhpSpreadsheet\Tests\Calculation; -use PHPExcel\Calculation\Functions; -use PHPExcel\Calculation\LookupRef; +use PhpSpreadsheet\Calculation\Functions; +use PhpSpreadsheet\Calculation\LookupRef; /** * Class LookupRefTest - * @package PHPExcel\Calculation */ class LookupRefTest extends \PHPUnit_Framework_TestCase { diff --git a/tests/PhpSpreadsheet/Calculation/MathTrigTest.php b/tests/PhpSpreadsheet/Calculation/MathTrigTest.php index c1a701fe..0cfb1f4d 100644 --- a/tests/PhpSpreadsheet/Calculation/MathTrigTest.php +++ b/tests/PhpSpreadsheet/Calculation/MathTrigTest.php @@ -2,9 +2,9 @@ namespace PhpSpreadsheet\Tests\Calculation; -use PHPExcel\Calculation; -use PHPExcel\Calculation\Functions; -use PHPExcel\Calculation\MathTrig; +use PhpSpreadsheet\Calculation; +use PhpSpreadsheet\Calculation\Functions; +use PhpSpreadsheet\Calculation\MathTrig; class MathTrigTest extends \PHPUnit_Framework_TestCase { diff --git a/tests/PhpSpreadsheet/Calculation/TextDataTest.php b/tests/PhpSpreadsheet/Calculation/TextDataTest.php index 4052c7d1..98251999 100644 --- a/tests/PhpSpreadsheet/Calculation/TextDataTest.php +++ b/tests/PhpSpreadsheet/Calculation/TextDataTest.php @@ -2,9 +2,9 @@ namespace PhpSpreadsheet\Tests\Calculation; -use PHPExcel\Shared\StringHelper; -use PHPExcel\Calculation\Functions; -use PHPExcel\Calculation\TextData; +use PhpSpreadsheet\Shared\StringHelper; +use PhpSpreadsheet\Calculation\Functions; +use PhpSpreadsheet\Calculation\TextData; class TextDataTest extends \PHPUnit_Framework_TestCase { diff --git a/tests/PhpSpreadsheet/CalculationTest.php b/tests/PhpSpreadsheet/CalculationTest.php index b25498bb..aaa66bfd 100644 --- a/tests/PhpSpreadsheet/CalculationTest.php +++ b/tests/PhpSpreadsheet/CalculationTest.php @@ -2,8 +2,8 @@ namespace PhpSpreadsheet\Tests; -use PHPExcel\Calculation; -use PHPExcel\Calculation\Functions; +use PhpSpreadsheet\Calculation; +use PhpSpreadsheet\Calculation\Functions; class CalculationTest extends \PHPUnit_Framework_TestCase { diff --git a/tests/PhpSpreadsheet/Cell/AdvancedValueBinderTest.php b/tests/PhpSpreadsheet/Cell/AdvancedValueBinderTest.php index 3cfa3aa7..86e4e8f3 100644 --- a/tests/PhpSpreadsheet/Cell/AdvancedValueBinderTest.php +++ b/tests/PhpSpreadsheet/Cell/AdvancedValueBinderTest.php @@ -2,22 +2,22 @@ namespace PhpSpreadsheet\Tests\Cell; -use PHPExcel\Worksheet; -use PHPExcel\Style\NumberFormat; -use PHPExcel\Shared\StringHelper; -use PHPExcel\Cell; -use PHPExcel\Cell\AdvancedValueBinder; -use PHPExcel\Cell\DataType; -use PHPExcel\CachedObjectStorage\Memory; +use PhpSpreadsheet\Worksheet; +use PhpSpreadsheet\Style\NumberFormat; +use PhpSpreadsheet\Shared\StringHelper; +use PhpSpreadsheet\Cell; +use PhpSpreadsheet\Cell\AdvancedValueBinder; +use PhpSpreadsheet\Cell\DataType; +use PhpSpreadsheet\CachedObjectStorage\Memory; class AdvancedValueBinderTest extends \PHPUnit_Framework_TestCase { public function setUp() { - if (!defined('PHPEXCEL_ROOT')) { - define('PHPEXCEL_ROOT', APPLICATION_PATH . '/'); + if (!defined('PHPSPREADSHEET_ROOT')) { + define('PHPSPREADSHEET_ROOT', APPLICATION_PATH . '/'); } - require_once(PHPEXCEL_ROOT . '/Bootstrap.php'); + require_once(PHPSPREADSHEET_ROOT . '/Bootstrap.php'); } public function provider() diff --git a/tests/PhpSpreadsheet/Cell/DataTypeTest.php b/tests/PhpSpreadsheet/Cell/DataTypeTest.php index 88f8f785..98c342b5 100644 --- a/tests/PhpSpreadsheet/Cell/DataTypeTest.php +++ b/tests/PhpSpreadsheet/Cell/DataTypeTest.php @@ -2,17 +2,17 @@ namespace PhpSpreadsheet\Tests\Cell; -use PHPExcel\Cell\DataType; +use PhpSpreadsheet\Cell\DataType; class DataTypeTest extends \PHPUnit_Framework_TestCase { public function setUp() { - if (!defined('PHPEXCEL_ROOT')) { - define('PHPEXCEL_ROOT', APPLICATION_PATH . '/'); + if (!defined('PHPSPREADSHEET_ROOT')) { + define('PHPSPREADSHEET_ROOT', APPLICATION_PATH . '/'); } - require_once(PHPEXCEL_ROOT . '/Bootstrap.php'); + require_once(PHPSPREADSHEET_ROOT . '/Bootstrap.php'); } public function testGetErrorCodes() diff --git a/tests/PhpSpreadsheet/Cell/DefaultValueBinderTest.php b/tests/PhpSpreadsheet/Cell/DefaultValueBinderTest.php index a9806b44..54595e96 100644 --- a/tests/PhpSpreadsheet/Cell/DefaultValueBinderTest.php +++ b/tests/PhpSpreadsheet/Cell/DefaultValueBinderTest.php @@ -2,10 +2,10 @@ namespace PhpSpreadsheet\Tests\Cell; -use PHPExcel\Cell\DefaultValueBinder; -use PHPExcel\Cell; -use PHPExcel\RichText; -use PHPExcel\Cell\DataType; +use PhpSpreadsheet\Cell\DefaultValueBinder; +use PhpSpreadsheet\Cell; +use PhpSpreadsheet\RichText; +use PhpSpreadsheet\Cell\DataType; class DefaultValueBinderTest extends \PHPUnit_Framework_TestCase { @@ -13,10 +13,10 @@ class DefaultValueBinderTest extends \PHPUnit_Framework_TestCase public function setUp() { - if (!defined('PHPEXCEL_ROOT')) { - define('PHPEXCEL_ROOT', APPLICATION_PATH . '/'); + if (!defined('PHPSPREADSHEET_ROOT')) { + define('PHPSPREADSHEET_ROOT', APPLICATION_PATH . '/'); } - require_once(PHPEXCEL_ROOT . '/Bootstrap.php'); + require_once(PHPSPREADSHEET_ROOT . '/Bootstrap.php'); } protected function createCellStub() diff --git a/tests/PhpSpreadsheet/Cell/HyperlinkTest.php b/tests/PhpSpreadsheet/Cell/HyperlinkTest.php index 8acdcfae..9c812a57 100644 --- a/tests/PhpSpreadsheet/Cell/HyperlinkTest.php +++ b/tests/PhpSpreadsheet/Cell/HyperlinkTest.php @@ -2,17 +2,17 @@ namespace PhpSpreadsheet\Tests\Cell; -use PHPExcel\Cell\Hyperlink; +use PhpSpreadsheet\Cell\Hyperlink; class HyperlinkTest extends \PHPUnit_Framework_TestCase { public function setUp() { - if (!defined('PHPEXCEL_ROOT')) { - define('PHPEXCEL_ROOT', APPLICATION_PATH . '/'); + if (!defined('PHPSPREADSHEET_ROOT')) { + define('PHPSPREADSHEET_ROOT', APPLICATION_PATH . '/'); } - require_once(PHPEXCEL_ROOT . '/Bootstrap.php'); + require_once(PHPSPREADSHEET_ROOT . '/Bootstrap.php'); } public function testGetUrl() @@ -28,7 +28,7 @@ class HyperlinkTest extends \PHPUnit_Framework_TestCase public function testSetUrl() { $initialUrlValue = 'http://www.phpexcel.net'; - $newUrlValue = 'http://github.com/PHPOffice/PHPExcel'; + $newUrlValue = 'http://github.com/PHPOffice/PhpSpreadsheet'; $testInstance = new Hyperlink($initialUrlValue); $result = $testInstance->setUrl($newUrlValue); @@ -40,7 +40,7 @@ class HyperlinkTest extends \PHPUnit_Framework_TestCase public function testGetTooltip() { - $tooltipValue = 'PHPExcel Web Site'; + $tooltipValue = 'PhpSpreadsheet Web Site'; $testInstance = new Hyperlink(null, $tooltipValue); @@ -50,8 +50,8 @@ class HyperlinkTest extends \PHPUnit_Framework_TestCase public function testSetTooltip() { - $initialTooltipValue = 'PHPExcel Web Site'; - $newTooltipValue = 'PHPExcel Repository on Github'; + $initialTooltipValue = 'PhpSpreadsheet Web Site'; + $newTooltipValue = 'PhpSpreadsheet Repository on Github'; $testInstance = new Hyperlink(null, $initialTooltipValue); $result = $testInstance->setTooltip($newTooltipValue); @@ -78,8 +78,8 @@ class HyperlinkTest extends \PHPUnit_Framework_TestCase public function testGetHashCode() { $urlValue = 'http://www.phpexcel.net'; - $tooltipValue = 'PHPExcel Web Site'; - $initialExpectedHash = '176f1ec64e84084db814481bd710b6b3'; + $tooltipValue = 'PhpSpreadsheet Web Site'; + $initialExpectedHash = '4c923947ffe2695a2e1750b7e1c6724e'; $testInstance = new Hyperlink($urlValue, $tooltipValue); diff --git a/tests/PhpSpreadsheet/CellTest.php b/tests/PhpSpreadsheet/CellTest.php index fbcd4886..a8083715 100644 --- a/tests/PhpSpreadsheet/CellTest.php +++ b/tests/PhpSpreadsheet/CellTest.php @@ -2,8 +2,8 @@ namespace PhpSpreadsheet\Tests; -use PHPExcel\Cell; -use PHPExcel\Exception; +use PhpSpreadsheet\Cell; +use PhpSpreadsheet\Exception; class CellTest extends \PHPUnit_Framework_TestCase { diff --git a/tests/PhpSpreadsheet/Chart/DataSeriesValuesTest.php b/tests/PhpSpreadsheet/Chart/DataSeriesValuesTest.php index 43291558..b0fbdde1 100644 --- a/tests/PhpSpreadsheet/Chart/DataSeriesValuesTest.php +++ b/tests/PhpSpreadsheet/Chart/DataSeriesValuesTest.php @@ -2,8 +2,8 @@ namespace PhpSpreadsheet\Tests\Chart; -use PHPExcel\Chart\DataSeriesValues; -use PHPExcel\Exception; +use PhpSpreadsheet\Chart\DataSeriesValues; +use PhpSpreadsheet\Exception; class DataSeriesValuesTest extends \PHPUnit_Framework_TestCase { diff --git a/tests/PhpSpreadsheet/Chart/LayoutTest.php b/tests/PhpSpreadsheet/Chart/LayoutTest.php index 23074beb..1659021f 100644 --- a/tests/PhpSpreadsheet/Chart/LayoutTest.php +++ b/tests/PhpSpreadsheet/Chart/LayoutTest.php @@ -2,7 +2,7 @@ namespace PhpSpreadsheet\Tests\Chart; -use PHPExcel\Chart\Layout; +use PhpSpreadsheet\Chart\Layout; class LayoutTest extends \PHPUnit_Framework_TestCase { diff --git a/tests/PhpSpreadsheet/Chart/LegendTest.php b/tests/PhpSpreadsheet/Chart/LegendTest.php index b7ab9a48..d4f64c05 100644 --- a/tests/PhpSpreadsheet/Chart/LegendTest.php +++ b/tests/PhpSpreadsheet/Chart/LegendTest.php @@ -2,7 +2,7 @@ namespace PhpSpreadsheet\Tests\Chart; -use PHPExcel\Chart\Legend; +use PhpSpreadsheet\Chart\Legend; class LegendTest extends \PHPUnit_Framework_TestCase { diff --git a/tests/PhpSpreadsheet/Custom/Complex.php b/tests/PhpSpreadsheet/Custom/Complex.php index 3b520813..63f9f391 100644 --- a/tests/PhpSpreadsheet/Custom/Complex.php +++ b/tests/PhpSpreadsheet/Custom/Complex.php @@ -2,7 +2,7 @@ namespace PhpSpreadsheet\Tests\Custom; -use PHPExcel\Exception; +use PhpSpreadsheet\Exception; class Complex { diff --git a/tests/PhpSpreadsheet/Reader/XEEValidatorTest.php b/tests/PhpSpreadsheet/Reader/XEEValidatorTest.php index 19d65360..6965d0cc 100644 --- a/tests/PhpSpreadsheet/Reader/XEEValidatorTest.php +++ b/tests/PhpSpreadsheet/Reader/XEEValidatorTest.php @@ -2,13 +2,13 @@ namespace PhpSpreadsheet\Tests\Reader; -use PHPExcel\Reader\BaseReader; +use PhpSpreadsheet\Reader\BaseReader; class XEEValidatorTest extends \PHPUnit_Framework_TestCase { /** * @dataProvider providerInvalidXML - * @expectedException \PHPExcel\Reader\Exception + * @expectedException \PhpSpreadsheet\Reader\Exception */ public function testInvalidXML($filename) { diff --git a/tests/PhpSpreadsheet/ReferenceHelperTest.php b/tests/PhpSpreadsheet/ReferenceHelperTest.php index da2a3541..d3586d10 100644 --- a/tests/PhpSpreadsheet/ReferenceHelperTest.php +++ b/tests/PhpSpreadsheet/ReferenceHelperTest.php @@ -2,7 +2,7 @@ namespace PhpSpreadsheet\Tests; -use PHPExcel\ReferenceHelper; +use PhpSpreadsheet\ReferenceHelper; class ReferenceHelperTest extends \PHPUnit_Framework_TestCase { diff --git a/tests/PhpSpreadsheet/SettingsTest.php b/tests/PhpSpreadsheet/SettingsTest.php index 9518cbc6..552ad7dd 100644 --- a/tests/PhpSpreadsheet/SettingsTest.php +++ b/tests/PhpSpreadsheet/SettingsTest.php @@ -13,7 +13,7 @@ class SettingsTest extends \PHPUnit_Framework_TestCase */ public function testGetXMLSettings() { - $result = call_user_func(array('PHPExcel\\Settings','getLibXmlLoaderOptions')); + $result = call_user_func(array(\PhpSpreadsheet\Settings::class,'getLibXmlLoaderOptions')); $this->assertTrue((bool) ((LIBXML_DTDLOAD | LIBXML_DTDATTR) & $result)); } @@ -21,8 +21,8 @@ class SettingsTest extends \PHPUnit_Framework_TestCase */ public function testSetXMLSettings() { - call_user_func_array(array('PHPExcel\\Settings','setLibXmlLoaderOptions'), [LIBXML_DTDLOAD | LIBXML_DTDATTR | LIBXML_DTDVALID]); - $result = call_user_func(array('PHPExcel\\Settings','getLibXmlLoaderOptions')); + call_user_func_array(array(\PhpSpreadsheet\Settings::class,'setLibXmlLoaderOptions'), [LIBXML_DTDLOAD | LIBXML_DTDATTR | LIBXML_DTDVALID]); + $result = call_user_func(array(\PhpSpreadsheet\Settings::class,'getLibXmlLoaderOptions')); $this->assertTrue((bool) ((LIBXML_DTDLOAD | LIBXML_DTDATTR | LIBXML_DTDVALID) & $result)); } } diff --git a/tests/PhpSpreadsheet/Shared/CodePageTest.php b/tests/PhpSpreadsheet/Shared/CodePageTest.php index 18833ff4..4e26c33a 100644 --- a/tests/PhpSpreadsheet/Shared/CodePageTest.php +++ b/tests/PhpSpreadsheet/Shared/CodePageTest.php @@ -2,8 +2,8 @@ namespace PhpSpreadsheet\Tests\Shared; -use PHPExcel\Shared\CodePage; -use PHPExcel\Exception; +use PhpSpreadsheet\Shared\CodePage; +use PhpSpreadsheet\Exception; class CodePageTest extends \PHPUnit_Framework_TestCase { diff --git a/tests/PhpSpreadsheet/Shared/DateTest.php b/tests/PhpSpreadsheet/Shared/DateTest.php index 66ef4be9..b903c0b5 100644 --- a/tests/PhpSpreadsheet/Shared/DateTest.php +++ b/tests/PhpSpreadsheet/Shared/DateTest.php @@ -2,7 +2,7 @@ namespace PhpSpreadsheet\Tests\Shared; -use PHPExcel\Shared\Date; +use PhpSpreadsheet\Shared\Date; class DateTest extends \PHPUnit_Framework_TestCase { diff --git a/tests/PhpSpreadsheet/Shared/FileTest.php b/tests/PhpSpreadsheet/Shared/FileTest.php index 89a36596..7d6b86c2 100644 --- a/tests/PhpSpreadsheet/Shared/FileTest.php +++ b/tests/PhpSpreadsheet/Shared/FileTest.php @@ -2,7 +2,7 @@ namespace PhpSpreadsheet\Tests\Shared; -use PHPExcel\Shared\File; +use PhpSpreadsheet\Shared\File; class FileTest extends \PHPUnit_Framework_TestCase { diff --git a/tests/PhpSpreadsheet/Shared/FontTest.php b/tests/PhpSpreadsheet/Shared/FontTest.php index 76d61a01..c9c711c6 100644 --- a/tests/PhpSpreadsheet/Shared/FontTest.php +++ b/tests/PhpSpreadsheet/Shared/FontTest.php @@ -2,7 +2,7 @@ namespace PhpSpreadsheet\Tests\Shared; -use PHPExcel\Shared\Font; +use PhpSpreadsheet\Shared\Font; class FontTest extends \PHPUnit_Framework_TestCase { diff --git a/tests/PhpSpreadsheet/Shared/PasswordHasherTest.php b/tests/PhpSpreadsheet/Shared/PasswordHasherTest.php index 3be3759d..41addd76 100644 --- a/tests/PhpSpreadsheet/Shared/PasswordHasherTest.php +++ b/tests/PhpSpreadsheet/Shared/PasswordHasherTest.php @@ -2,7 +2,7 @@ namespace PhpSpreadsheet\Tests\Shared; -use PHPExcel\Shared\PasswordHasher; +use PhpSpreadsheet\Shared\PasswordHasher; class PasswordHasherTest extends \PHPUnit_Framework_TestCase { diff --git a/tests/PhpSpreadsheet/Shared/StringTest.php b/tests/PhpSpreadsheet/Shared/StringTest.php index 19885efb..957c078d 100644 --- a/tests/PhpSpreadsheet/Shared/StringTest.php +++ b/tests/PhpSpreadsheet/Shared/StringTest.php @@ -2,7 +2,7 @@ namespace PhpSpreadsheet\Tests\Shared; -use PHPExcel\Shared\StringHelper; +use PhpSpreadsheet\Shared\StringHelper; class StringTest extends \PHPUnit_Framework_TestCase { diff --git a/tests/PhpSpreadsheet/Shared/TimeZoneTest.php b/tests/PhpSpreadsheet/Shared/TimeZoneTest.php index 65f74986..5c7a99e1 100644 --- a/tests/PhpSpreadsheet/Shared/TimeZoneTest.php +++ b/tests/PhpSpreadsheet/Shared/TimeZoneTest.php @@ -2,7 +2,7 @@ namespace PhpSpreadsheet\Tests\Shared; -use PHPExcel\Shared\TimeZone; +use PhpSpreadsheet\Shared\TimeZone; class TimeZoneTest extends \PHPUnit_Framework_TestCase { diff --git a/tests/PhpSpreadsheet/Style/ColorTest.php b/tests/PhpSpreadsheet/Style/ColorTest.php index 58b2404c..928d5234 100644 --- a/tests/PhpSpreadsheet/Style/ColorTest.php +++ b/tests/PhpSpreadsheet/Style/ColorTest.php @@ -2,7 +2,7 @@ namespace PhpSpreadsheet\Tests\Style; -use PHPExcel\Style\Color; +use PhpSpreadsheet\Style\Color; class ColorTest extends \PHPUnit_Framework_TestCase { diff --git a/tests/PhpSpreadsheet/Style/NumberFormatDateTest.php b/tests/PhpSpreadsheet/Style/NumberFormatDateTest.php index 1b79d654..9833f7df 100644 --- a/tests/PhpSpreadsheet/Style/NumberFormatDateTest.php +++ b/tests/PhpSpreadsheet/Style/NumberFormatDateTest.php @@ -2,8 +2,8 @@ namespace PhpSpreadsheet\Tests\Style; -use PHPExcel\Shared\StringHelper; -use PHPExcel\Style\NumberFormat; +use PhpSpreadsheet\Shared\StringHelper; +use PhpSpreadsheet\Style\NumberFormat; class NumberFormatDateTest extends \PHPUnit_Framework_TestCase { diff --git a/tests/PhpSpreadsheet/Style/NumberFormatTest.php b/tests/PhpSpreadsheet/Style/NumberFormatTest.php index f0360d81..1949667c 100644 --- a/tests/PhpSpreadsheet/Style/NumberFormatTest.php +++ b/tests/PhpSpreadsheet/Style/NumberFormatTest.php @@ -2,8 +2,8 @@ namespace PhpSpreadsheet\Tests\Style; -use PHPExcel\Shared\StringHelper; -use PHPExcel\Style\NumberFormat; +use PhpSpreadsheet\Shared\StringHelper; +use PhpSpreadsheet\Style\NumberFormat; class NumberFormatTest extends \PHPUnit_Framework_TestCase { diff --git a/tests/PhpSpreadsheet/Worksheet/AutoFilter/Column/RuleTest.php b/tests/PhpSpreadsheet/Worksheet/AutoFilter/Column/RuleTest.php index 5de3876f..2b269d94 100644 --- a/tests/PhpSpreadsheet/Worksheet/AutoFilter/Column/RuleTest.php +++ b/tests/PhpSpreadsheet/Worksheet/AutoFilter/Column/RuleTest.php @@ -2,7 +2,7 @@ namespace PhpSpreadsheet\Tests\Worksheet\AutoFilter\Column; -use PHPExcel\Worksheet\AutoFilter\Column; +use PhpSpreadsheet\Worksheet\AutoFilter\Column; class RuleTest extends \PHPUnit_Framework_TestCase { diff --git a/tests/PhpSpreadsheet/Worksheet/AutoFilter/ColumnTest.php b/tests/PhpSpreadsheet/Worksheet/AutoFilter/ColumnTest.php index 61776bf5..44ffa637 100644 --- a/tests/PhpSpreadsheet/Worksheet/AutoFilter/ColumnTest.php +++ b/tests/PhpSpreadsheet/Worksheet/AutoFilter/ColumnTest.php @@ -2,7 +2,7 @@ namespace PhpSpreadsheet\Tests\Worksheet\AutoFilter; -use PHPExcel\Worksheet\AutoFilter; +use PhpSpreadsheet\Worksheet\AutoFilter; class AutofilterColumnTest extends \PHPUnit_Framework_TestCase { @@ -75,7 +75,7 @@ class AutofilterColumnTest extends \PHPUnit_Framework_TestCase } /** - * @expectedException \PHPExcel\Exception + * @expectedException \PhpSpreadsheet\Exception */ public function testSetInvalidFilterTypeThrowsException() { @@ -100,7 +100,7 @@ class AutofilterColumnTest extends \PHPUnit_Framework_TestCase } /** - * @expectedException \PHPExcel\Exception + * @expectedException \PhpSpreadsheet\Exception */ public function testSetInvalidJoinThrowsException() { diff --git a/tests/PhpSpreadsheet/Worksheet/AutoFilterTest.php b/tests/PhpSpreadsheet/Worksheet/AutoFilterTest.php index 8e66e37b..a96b3fb8 100644 --- a/tests/PhpSpreadsheet/Worksheet/AutoFilterTest.php +++ b/tests/PhpSpreadsheet/Worksheet/AutoFilterTest.php @@ -2,10 +2,10 @@ namespace PhpSpreadsheet\Tests\Worksheet; -use PHPExcel\Worksheet\AutoFilter; -use PHPExcel\Worksheet\AutoFilter\Column; -use PHPExcel\Worksheet; -use PHPExcel\CachedObjectStorage\Memory; +use PhpSpreadsheet\Worksheet\AutoFilter; +use PhpSpreadsheet\Worksheet\AutoFilter\Column; +use PhpSpreadsheet\Worksheet; +use PhpSpreadsheet\CachedObjectStorage\Memory; class AutoFilterTest extends \PHPUnit_Framework_TestCase { @@ -98,7 +98,7 @@ class AutoFilterTest extends \PHPUnit_Framework_TestCase } /** - * @expectedException \PHPExcel\Exception + * @expectedException \PhpSpreadsheet\Exception */ public function testSetRangeInvalidRange() { @@ -132,7 +132,7 @@ class AutoFilterTest extends \PHPUnit_Framework_TestCase } /** - * @expectedException \PHPExcel\Exception + * @expectedException \PhpSpreadsheet\Exception */ public function testGetInvalidColumnOffset() { @@ -150,7 +150,7 @@ class AutoFilterTest extends \PHPUnit_Framework_TestCase $this->assertInstanceOf(AutoFilter::class, $result); $result = $this->testAutoFilterObject->getColumns(); - // Result should be an array of \PHPExcel\Worksheet\AutoFilter\Column + // Result should be an array of \PhpSpreadsheet\Worksheet\AutoFilter\Column // objects for each column we set indexed by the column ID $this->assertInternalType('array', $result); $this->assertEquals(1, count($result)); @@ -159,7 +159,7 @@ class AutoFilterTest extends \PHPUnit_Framework_TestCase } /** - * @expectedException \PHPExcel\Exception + * @expectedException \PhpSpreadsheet\Exception */ public function testSetInvalidColumnWithString() { @@ -178,7 +178,7 @@ class AutoFilterTest extends \PHPUnit_Framework_TestCase $this->assertInstanceOf(AutoFilter::class, $result); $result = $this->testAutoFilterObject->getColumns(); - // Result should be an array of \PHPExcel\Worksheet\AutoFilter\Column + // Result should be an array of \PhpSpreadsheet\Worksheet\AutoFilter\Column // objects for each column we set indexed by the column ID $this->assertInternalType('array', $result); $this->assertEquals(1, count($result)); @@ -187,7 +187,7 @@ class AutoFilterTest extends \PHPUnit_Framework_TestCase } /** - * @expectedException \PHPExcel\Exception + * @expectedException \PhpSpreadsheet\Exception */ public function testSetInvalidColumnWithObject() { @@ -198,7 +198,7 @@ class AutoFilterTest extends \PHPUnit_Framework_TestCase } /** - * @expectedException \PHPExcel\Exception + * @expectedException \PhpSpreadsheet\Exception */ public function testSetColumnWithInvalidDataType() { @@ -217,7 +217,7 @@ class AutoFilterTest extends \PHPUnit_Framework_TestCase } $result = $this->testAutoFilterObject->getColumns(); - // Result should be an array of \PHPExcel\Worksheet\AutoFilter\Column + // Result should be an array of \PhpSpreadsheet\Worksheet\AutoFilter\Column // objects for each column we set indexed by the column ID $this->assertInternalType('array', $result); $this->assertEquals(count($columnIndexes), count($result)); @@ -236,7 +236,7 @@ class AutoFilterTest extends \PHPUnit_Framework_TestCase } // If we request a specific column by its column ID, we should - // get a \PHPExcel\Worksheet\AutoFilter\Column object returned + // get a \PhpSpreadsheet\Worksheet\AutoFilter\Column object returned foreach ($columnIndexes as $columnIndex) { $result = $this->testAutoFilterObject->getColumn($columnIndex); $this->assertInstanceOf(Column::class, $result); @@ -252,7 +252,7 @@ class AutoFilterTest extends \PHPUnit_Framework_TestCase ]; // If we request a specific column by its offset, we should - // get a \PHPExcel\Worksheet\AutoFilter\Column object returned + // get a \PhpSpreadsheet\Worksheet\AutoFilter\Column object returned foreach ($columnIndexes as $columnIndex => $columnID) { $result = $this->testAutoFilterObject->getColumnByOffset($columnIndex); $this->assertInstanceOf(Column::class, $result); @@ -263,13 +263,13 @@ class AutoFilterTest extends \PHPUnit_Framework_TestCase public function testGetColumnIfNotSet() { // If we request a specific column by its column ID, we should - // get a \PHPExcel\Worksheet\AutoFilter\Column object returned + // get a \PhpSpreadsheet\Worksheet\AutoFilter\Column object returned $result = $this->testAutoFilterObject->getColumn('K'); $this->assertInstanceOf(Column::class, $result); } /** - * @expectedException \PHPExcel\Exception + * @expectedException \PhpSpreadsheet\Exception */ public function testGetColumnWithoutRangeSet() { diff --git a/tests/PhpSpreadsheet/Worksheet/CellCollectionTest.php b/tests/PhpSpreadsheet/Worksheet/CellCollectionTest.php index 92690c19..552755b4 100644 --- a/tests/PhpSpreadsheet/Worksheet/CellCollectionTest.php +++ b/tests/PhpSpreadsheet/Worksheet/CellCollectionTest.php @@ -2,8 +2,8 @@ namespace PhpSpreadsheet\Tests\Worksheet; -use PHPExcel\CachedObjectStorageFactory; -use PHPExcel\Spreadsheet; +use PhpSpreadsheet\CachedObjectStorageFactory; +use PhpSpreadsheet\Spreadsheet; class CellCollectionTest extends \PHPUnit_Framework_TestCase { diff --git a/tests/PhpSpreadsheet/Worksheet/ColumnCellIteratorTest.php b/tests/PhpSpreadsheet/Worksheet/ColumnCellIteratorTest.php index b840bd7f..8484f71a 100644 --- a/tests/PhpSpreadsheet/Worksheet/ColumnCellIteratorTest.php +++ b/tests/PhpSpreadsheet/Worksheet/ColumnCellIteratorTest.php @@ -2,9 +2,9 @@ namespace PhpSpreadsheet\Tests\Worksheet; -use PHPExcel\Worksheet\ColumnCellIterator; -use PHPExcel\Cell; -use PHPExcel\Worksheet; +use PhpSpreadsheet\Worksheet\ColumnCellIterator; +use PhpSpreadsheet\Cell; +use PhpSpreadsheet\Worksheet; class ColumnCellIteratorTest extends \PHPUnit_Framework_TestCase { @@ -68,7 +68,7 @@ class ColumnCellIteratorTest extends \PHPUnit_Framework_TestCase } /** - * @expectedException \PHPExcel\Exception + * @expectedException \PhpSpreadsheet\Exception */ public function testSeekOutOfRange() { @@ -77,7 +77,7 @@ class ColumnCellIteratorTest extends \PHPUnit_Framework_TestCase } /** - * @expectedException \PHPExcel\Exception + * @expectedException \PhpSpreadsheet\Exception */ public function testPrevOutOfRange() { diff --git a/tests/PhpSpreadsheet/Worksheet/ColumnIteratorTest.php b/tests/PhpSpreadsheet/Worksheet/ColumnIteratorTest.php index 8ebc26e1..1fb77381 100644 --- a/tests/PhpSpreadsheet/Worksheet/ColumnIteratorTest.php +++ b/tests/PhpSpreadsheet/Worksheet/ColumnIteratorTest.php @@ -2,9 +2,9 @@ namespace PhpSpreadsheet\Tests\Worksheet; -use PHPExcel\Worksheet; -use PHPExcel\Worksheet\ColumnIterator; -use PHPExcel\Worksheet\Column; +use PhpSpreadsheet\Worksheet; +use PhpSpreadsheet\Worksheet\ColumnIterator; +use PhpSpreadsheet\Worksheet\Column; class ColumnIteratorTest extends \PHPUnit_Framework_TestCase { @@ -70,7 +70,7 @@ class ColumnIteratorTest extends \PHPUnit_Framework_TestCase } /** - * @expectedException \PHPExcel\Exception + * @expectedException \PhpSpreadsheet\Exception */ public function testSeekOutOfRange() { @@ -79,7 +79,7 @@ class ColumnIteratorTest extends \PHPUnit_Framework_TestCase } /** - * @expectedException \PHPExcel\Exception + * @expectedException \PhpSpreadsheet\Exception */ public function testPrevOutOfRange() { diff --git a/tests/PhpSpreadsheet/Worksheet/RowCellIteratorTest.php b/tests/PhpSpreadsheet/Worksheet/RowCellIteratorTest.php index 9e09476b..c199fc10 100644 --- a/tests/PhpSpreadsheet/Worksheet/RowCellIteratorTest.php +++ b/tests/PhpSpreadsheet/Worksheet/RowCellIteratorTest.php @@ -2,9 +2,9 @@ namespace PhpSpreadsheet\Tests\Worksheet; -use PHPExcel\Worksheet; -use PHPExcel\Cell; -use PHPExcel\Worksheet\RowCellIterator; +use PhpSpreadsheet\Worksheet; +use PhpSpreadsheet\Cell; +use PhpSpreadsheet\Worksheet\RowCellIterator; class RowCellIteratorTest extends \PHPUnit_Framework_TestCase { @@ -70,7 +70,7 @@ class RowCellIteratorTest extends \PHPUnit_Framework_TestCase } /** - * @expectedException \PHPExcel\Exception + * @expectedException \PhpSpreadsheet\Exception */ public function testSeekOutOfRange() { @@ -79,7 +79,7 @@ class RowCellIteratorTest extends \PHPUnit_Framework_TestCase } /** - * @expectedException \PHPExcel\Exception + * @expectedException \PhpSpreadsheet\Exception */ public function testPrevOutOfRange() { diff --git a/tests/PhpSpreadsheet/Worksheet/RowIteratorTest.php b/tests/PhpSpreadsheet/Worksheet/RowIteratorTest.php index dcb81391..ceb9a414 100644 --- a/tests/PhpSpreadsheet/Worksheet/RowIteratorTest.php +++ b/tests/PhpSpreadsheet/Worksheet/RowIteratorTest.php @@ -2,9 +2,9 @@ namespace PhpSpreadsheet\Tests\Worksheet; -use PHPExcel\Worksheet\RowIterator; -use PHPExcel\Worksheet; -use PHPExcel\Worksheet\Row; +use PhpSpreadsheet\Worksheet\RowIterator; +use PhpSpreadsheet\Worksheet; +use PhpSpreadsheet\Worksheet\Row; class RowIteratorTest extends \PHPUnit_Framework_TestCase { @@ -68,7 +68,7 @@ class RowIteratorTest extends \PHPUnit_Framework_TestCase } /** - * @expectedException \PHPExcel\Exception + * @expectedException \PhpSpreadsheet\Exception */ public function testSeekOutOfRange() { @@ -77,7 +77,7 @@ class RowIteratorTest extends \PHPUnit_Framework_TestCase } /** - * @expectedException \PHPExcel\Exception + * @expectedException \PhpSpreadsheet\Exception */ public function testPrevOutOfRange() { diff --git a/tests/PhpSpreadsheet/Worksheet/WorksheetColumnTest.php b/tests/PhpSpreadsheet/Worksheet/WorksheetColumnTest.php index 85810272..0da62fae 100644 --- a/tests/PhpSpreadsheet/Worksheet/WorksheetColumnTest.php +++ b/tests/PhpSpreadsheet/Worksheet/WorksheetColumnTest.php @@ -2,9 +2,9 @@ namespace PhpSpreadsheet\Tests\Worksheet; -use PHPExcel\Worksheet; -use PHPExcel\Worksheet\Column; -use PHPExcel\Worksheet\ColumnCellIterator; +use PhpSpreadsheet\Worksheet; +use PhpSpreadsheet\Worksheet\Column; +use PhpSpreadsheet\Worksheet\ColumnCellIterator; class WorksheetColumnTest extends \PHPUnit_Framework_TestCase { diff --git a/tests/PhpSpreadsheet/Worksheet/WorksheetRowTest.php b/tests/PhpSpreadsheet/Worksheet/WorksheetRowTest.php index 1bd90830..48c07d24 100644 --- a/tests/PhpSpreadsheet/Worksheet/WorksheetRowTest.php +++ b/tests/PhpSpreadsheet/Worksheet/WorksheetRowTest.php @@ -2,9 +2,9 @@ namespace PhpSpreadsheet\Tests\Worksheet; -use PHPExcel\Worksheet; -use PHPExcel\Worksheet\Row; -use PHPExcel\Worksheet\RowCellIterator; +use PhpSpreadsheet\Worksheet; +use PhpSpreadsheet\Worksheet\Row; +use PhpSpreadsheet\Worksheet\RowCellIterator; class WorksheetRowTest extends \PHPUnit_Framework_TestCase { diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 885f592a..31f081cd 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -1,10 +1,7 @@