diff --git a/composer.json b/composer.json index f5ec8def..2a0ddb27 100644 --- a/composer.json +++ b/composer.json @@ -45,12 +45,12 @@ }, "autoload": { "psr-4": { - "PhpSpreadsheet\\": "src/PhpSpreadsheet" + "PhpOffice\\PhpSpreadsheet\\": "src/PhpSpreadsheet" } }, "autoload-dev": { "psr-4": { - "PhpSpreadsheetTests\\": "tests/PhpSpreadsheetTests" + "PhpOffice\\PhpSpreadsheetTests\\": "tests/PhpSpreadsheetTests" } } } diff --git a/samples/01_Simple.php b/samples/01_Simple.php index 10377d70..d21de72e 100644 --- a/samples/01_Simple.php +++ b/samples/01_Simple.php @@ -4,7 +4,7 @@ require __DIR__ . '/Header.php'; // Create new Spreadsheet object $helper->log('Create new Spreadsheet object'); -$spreadsheet = new \PhpSpreadsheet\Spreadsheet(); +$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet(); // Set document properties $helper->log('Set document properties'); diff --git a/samples/01_Simple_PCLZip.php b/samples/01_Simple_PCLZip.php index 915a1413..f6796b39 100644 --- a/samples/01_Simple_PCLZip.php +++ b/samples/01_Simple_PCLZip.php @@ -4,7 +4,7 @@ require __DIR__ . '/Header.php'; // Create new Spreadsheet object $helper->log('Create new Spreadsheet object'); -$spreadsheet = new \PhpSpreadsheet\Spreadsheet(); +$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet(); // Set document properties $helper->log('Set document properties'); @@ -44,7 +44,7 @@ $spreadsheet->setActiveSheetIndex(0); $helper->log('Write to Excel2007 format'); // Use PCLZip rather than ZipArchive to create the Excel2007 OfficeOpenXML file -PhpSpreadsheet\Settings::setZipClass(PhpSpreadsheet\Settings::PCLZIP); +\PhpOffice\PhpSpreadsheet\Settings::setZipClass(\PhpOffice\PhpSpreadsheet\Settings::PCLZIP); // Save $helper->write($spreadsheet, __FILE__, ['Excel2007' => 'xlsx']); diff --git a/samples/01_Simple_download_ods.php b/samples/01_Simple_download_ods.php index 705e69e4..ebbd28da 100644 --- a/samples/01_Simple_download_ods.php +++ b/samples/01_Simple_download_ods.php @@ -2,7 +2,7 @@ require_once __DIR__ . '/../src/Bootstrap.php'; -$helper = new \PhpSpreadsheet\Helper\Sample(); +$helper = new \PhpOffice\PhpSpreadsheet\Helper\Sample(); if ($helper->isCli()) { echo 'This example should only be run from a Web Browser' . PHP_EOL; @@ -10,7 +10,7 @@ if ($helper->isCli()) { } // Create new Spreadsheet object -$spreadsheet = new \PhpSpreadsheet\Spreadsheet(); +$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet(); // Set document properties $spreadsheet->getProperties()->setCreator('Maarten Balliauw') @@ -52,6 +52,6 @@ header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); // always modifie header('Cache-Control: cache, must-revalidate'); // HTTP/1.1 header('Pragma: public'); // HTTP/1.0 -$writer = \PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'OpenDocument'); +$writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'OpenDocument'); $writer->save('php://output'); exit; diff --git a/samples/01_Simple_download_pdf.php b/samples/01_Simple_download_pdf.php index ee9b522d..1a9bc6d0 100644 --- a/samples/01_Simple_download_pdf.php +++ b/samples/01_Simple_download_pdf.php @@ -2,7 +2,7 @@ require_once __DIR__ . '/../src/Bootstrap.php'; -$helper = new \PhpSpreadsheet\Helper\Sample(); +$helper = new \PhpOffice\PhpSpreadsheet\Helper\Sample(); if ($helper->isCli()) { echo 'This example should only be run from a Web Browser' . PHP_EOL; @@ -11,16 +11,16 @@ if ($helper->isCli()) { // Change these values to select the Rendering library that you wish to use // and its directory location on your server -//$rendererName = PhpSpreadsheet\Settings::PDF_RENDERER_TCPDF; -$rendererName = PhpSpreadsheet\Settings::PDF_RENDERER_MPDF; -//$rendererName = PhpSpreadsheet\Settings::PDF_RENDERER_DOMPDF; +//$rendererName = \PhpOffice\PhpSpreadsheet\Settings::PDF_RENDERER_TCPDF; +$rendererName = \PhpOffice\PhpSpreadsheet\Settings::PDF_RENDERER_MPDF; +//$rendererName = \PhpOffice\PhpSpreadsheet\Settings::PDF_RENDERER_DOMPDF; //$rendererLibrary = 'tcPDF5.9'; $rendererLibrary = 'mPDF5.4'; //$rendererLibrary = 'domPDF0.6.0beta3'; $rendererLibraryPath = __DIR__ . '/../../../libraries/PDF/' . $rendererLibrary; // Create new Spreadsheet object -$spreadsheet = new \PhpSpreadsheet\Spreadsheet(); +$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet(); // Set document properties $spreadsheet->getProperties()->setCreator('Maarten Balliauw') @@ -50,7 +50,7 @@ $spreadsheet->getActiveSheet()->setShowGridLines(false); // Set active sheet index to the first sheet, so Excel opens this as the first sheet $spreadsheet->setActiveSheetIndex(0); -if (!PhpSpreadsheet\Settings::setPdfRenderer($rendererName, $rendererLibraryPath)) { +if (!\PhpOffice\PhpSpreadsheet\Settings::setPdfRenderer($rendererName, $rendererLibraryPath)) { $helper->log('NOTICE: Please set the $rendererName and $rendererLibraryPath values at the top of this script as appropriate for your directory structure'); return; @@ -61,6 +61,6 @@ header('Content-Type: application/pdf'); header('Content-Disposition: attachment;filename="01simple.pdf"'); header('Cache-Control: max-age=0'); -$writer = \PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'PDF'); +$writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'PDF'); $writer->save('php://output'); exit; diff --git a/samples/01_Simple_download_xls.php b/samples/01_Simple_download_xls.php index 94807e38..3b9c41d2 100644 --- a/samples/01_Simple_download_xls.php +++ b/samples/01_Simple_download_xls.php @@ -2,7 +2,7 @@ require_once __DIR__ . '/../src/Bootstrap.php'; -$helper = new \PhpSpreadsheet\Helper\Sample(); +$helper = new \PhpOffice\PhpSpreadsheet\Helper\Sample(); if ($helper->isCli()) { echo 'This example should only be run from a Web Browser' . PHP_EOL; @@ -10,7 +10,7 @@ if ($helper->isCli()) { } // Create new Spreadsheet object -$spreadsheet = new \PhpSpreadsheet\Spreadsheet(); +$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet(); // Set document properties $spreadsheet->getProperties()->setCreator('Maarten Balliauw') @@ -52,6 +52,6 @@ header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); // always modifie header('Cache-Control: cache, must-revalidate'); // HTTP/1.1 header('Pragma: public'); // HTTP/1.0 -$writer = \PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Excel5'); +$writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Excel5'); $writer->save('php://output'); exit; diff --git a/samples/01_Simple_download_xlsx.php b/samples/01_Simple_download_xlsx.php index 2afbfe22..185ec096 100644 --- a/samples/01_Simple_download_xlsx.php +++ b/samples/01_Simple_download_xlsx.php @@ -2,14 +2,14 @@ require_once __DIR__ . '/../src/Bootstrap.php'; -$helper = new \PhpSpreadsheet\Helper\Sample(); +$helper = new \PhpOffice\PhpSpreadsheet\Helper\Sample(); if ($helper->isCli()) { echo 'This example should only be run from a Web Browser' . PHP_EOL; return; } // Create new Spreadsheet object -$spreadsheet = new \PhpSpreadsheet\Spreadsheet(); +$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet(); // Set document properties $spreadsheet->getProperties()->setCreator('Maarten Balliauw') @@ -51,6 +51,6 @@ header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); // always modifie header('Cache-Control: cache, must-revalidate'); // HTTP/1.1 header('Pragma: public'); // HTTP/1.0 -$writer = \PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Excel2007'); +$writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Excel2007'); $writer->save('php://output'); exit; diff --git a/samples/02_Types.php b/samples/02_Types.php index 4e3c3fbf..5fef248d 100644 --- a/samples/02_Types.php +++ b/samples/02_Types.php @@ -4,7 +4,7 @@ require __DIR__ . '/Header.php'; // Create new Spreadsheet object $helper->log('Create new Spreadsheet object'); -$spreadsheet = new \PhpSpreadsheet\Spreadsheet(); +$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet(); // Set document properties $helper->log('Set document properties'); @@ -70,41 +70,41 @@ $dateTimeNow = time(); $spreadsheet->getActiveSheet() ->setCellValue('A9', 'Date/Time') ->setCellValue('B9', 'Date') - ->setCellValue('C9', \PhpSpreadsheet\Shared\Date::PHPToExcel($dateTimeNow)); + ->setCellValue('C9', \PhpOffice\PhpSpreadsheet\Shared\Date::PHPToExcel($dateTimeNow)); $spreadsheet->getActiveSheet() ->getStyle('C9') ->getNumberFormat() - ->setFormatCode(\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_YYYYMMDD2); + ->setFormatCode(\PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_YYYYMMDD2); $spreadsheet->getActiveSheet() ->setCellValue('A10', 'Date/Time') ->setCellValue('B10', 'Time') - ->setCellValue('C10', \PhpSpreadsheet\Shared\Date::PHPToExcel($dateTimeNow)); + ->setCellValue('C10', \PhpOffice\PhpSpreadsheet\Shared\Date::PHPToExcel($dateTimeNow)); $spreadsheet->getActiveSheet() ->getStyle('C10') ->getNumberFormat() - ->setFormatCode(\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_TIME4); + ->setFormatCode(\PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_TIME4); $spreadsheet->getActiveSheet() ->setCellValue('A11', 'Date/Time') ->setCellValue('B11', 'Date and Time') - ->setCellValue('C11', \PhpSpreadsheet\Shared\Date::PHPToExcel($dateTimeNow)); + ->setCellValue('C11', \PhpOffice\PhpSpreadsheet\Shared\Date::PHPToExcel($dateTimeNow)); $spreadsheet->getActiveSheet() ->getStyle('C11') ->getNumberFormat() - ->setFormatCode(\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_DATETIME); + ->setFormatCode(\PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_DATETIME); $spreadsheet->getActiveSheet() ->setCellValue('A12', 'NULL') ->setCellValue('C12', null); -$richText = new \PhpSpreadsheet\RichText(); +$richText = new \PhpOffice\PhpSpreadsheet\RichText(); $richText->createText('你好 '); $payable = $richText->createTextRun('你 好 吗?'); $payable->getFont()->setBold(true); $payable->getFont()->setItalic(true); -$payable->getFont()->setColor(new \PhpSpreadsheet\Style\Color(\PhpSpreadsheet\Style\Color::COLOR_DARKGREEN)); +$payable->getFont()->setColor(new \PhpOffice\PhpSpreadsheet\Style\Color(\PhpOffice\PhpSpreadsheet\Style\Color::COLOR_DARKGREEN)); $richText->createText(', unless specified otherwise on the invoice.'); @@ -112,11 +112,11 @@ $spreadsheet->getActiveSheet() ->setCellValue('A13', 'Rich Text') ->setCellValue('C13', $richText); -$richText2 = new \PhpSpreadsheet\RichText(); +$richText2 = new \PhpOffice\PhpSpreadsheet\RichText(); $richText2->createText("black text\n"); $red = $richText2->createTextRun('red text'); -$red->getFont()->setColor(new \PhpSpreadsheet\Style\Color(\PhpSpreadsheet\Style\Color::COLOR_RED)); +$red->getFont()->setColor(new \PhpOffice\PhpSpreadsheet\Style\Color(\PhpOffice\PhpSpreadsheet\Style\Color::COLOR_RED)); $spreadsheet->getActiveSheet() ->getCell('C14') diff --git a/samples/03_Formulas.php b/samples/03_Formulas.php index dfe313f3..3f0e9c8d 100644 --- a/samples/03_Formulas.php +++ b/samples/03_Formulas.php @@ -4,7 +4,7 @@ require __DIR__ . '/Header.php'; // Create new Spreadsheet object $helper->log('Create new Spreadsheet object'); -$spreadsheet = new \PhpSpreadsheet\Spreadsheet(); +$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet(); // Set document properties $helper->log('Set document properties'); diff --git a/samples/04_Printing.php b/samples/04_Printing.php index 1f4b0425..b6cd9f9c 100644 --- a/samples/04_Printing.php +++ b/samples/04_Printing.php @@ -4,7 +4,7 @@ require __DIR__ . '/Header.php'; // Create new Spreadsheet object $helper->log('Create new Spreadsheet object'); -$spreadsheet = new \PhpSpreadsheet\Spreadsheet(); +$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet(); // Set document properties $helper->log('Set document properties'); @@ -34,22 +34,22 @@ $spreadsheet->getActiveSheet() // Add a drawing to the header $helper->log('Add a drawing to the header'); -$drawing = new \PhpSpreadsheet\Worksheet\HeaderFooterDrawing(); +$drawing = new \PhpOffice\PhpSpreadsheet\Worksheet\HeaderFooterDrawing(); $drawing->setName('PhpSpreadsheet logo'); $drawing->setPath(__DIR__ . '/images/PhpSpreadsheet_logo.gif'); $drawing->setHeight(36); $spreadsheet->getActiveSheet() ->getHeaderFooter() - ->addImage($drawing, \PhpSpreadsheet\Worksheet\HeaderFooter::IMAGE_HEADER_LEFT); + ->addImage($drawing, \PhpOffice\PhpSpreadsheet\Worksheet\HeaderFooter::IMAGE_HEADER_LEFT); // Set page orientation and size $helper->log('Set page orientation and size'); $spreadsheet->getActiveSheet() ->getPageSetup() - ->setOrientation(\PhpSpreadsheet\Worksheet\PageSetup::ORIENTATION_LANDSCAPE); + ->setOrientation(\PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::ORIENTATION_LANDSCAPE); $spreadsheet->getActiveSheet() ->getPageSetup() - ->setPaperSize(\PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_A4); + ->setPaperSize(\PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_A4); // Rename worksheet $helper->log('Rename worksheet'); diff --git a/samples/06_Largescale_with_cellcaching.php b/samples/06_Largescale_with_cellcaching.php index 6b25378c..30e8b9bd 100644 --- a/samples/06_Largescale_with_cellcaching.php +++ b/samples/06_Largescale_with_cellcaching.php @@ -2,8 +2,8 @@ require __DIR__ . '/Header.php'; -$cacheMethod = \PhpSpreadsheet\CachedObjectStorageFactory::CACHE_IN_MEMORY_GZIP; -if (\PhpSpreadsheet\Settings::setCacheStorageMethod($cacheMethod)) { +$cacheMethod = \PhpOffice\PhpSpreadsheet\CachedObjectStorageFactory::CACHE_IN_MEMORY_GZIP; +if (\PhpOffice\PhpSpreadsheet\Settings::setCacheStorageMethod($cacheMethod)) { $helper->log('Enable Cell Caching using ' . $cacheMethod . ' method'); } else { $helper->log('ERROR: Unable to set Cell Caching using ' . $cacheMethod . ' method, reverting to memory'); diff --git a/samples/06_Largescale_with_cellcaching_sqlite.php b/samples/06_Largescale_with_cellcaching_sqlite.php index 16083016..c80505cf 100644 --- a/samples/06_Largescale_with_cellcaching_sqlite.php +++ b/samples/06_Largescale_with_cellcaching_sqlite.php @@ -2,8 +2,8 @@ require __DIR__ . '/Header.php'; -$cacheMethod = \PhpSpreadsheet\CachedObjectStorageFactory::CACHE_TO_SQLITE; -if (\PhpSpreadsheet\Settings::setCacheStorageMethod($cacheMethod)) { +$cacheMethod = \PhpOffice\PhpSpreadsheet\CachedObjectStorageFactory::CACHE_TO_SQLITE; +if (\PhpOffice\PhpSpreadsheet\Settings::setCacheStorageMethod($cacheMethod)) { $helper->log('Enable Cell Caching using ' . $cacheMethod . ' method'); } else { $helper->log('ERROR: Unable to set Cell Caching using ' . $cacheMethod . ' method, reverting to memory'); diff --git a/samples/06_Largescale_with_cellcaching_sqlite3.php b/samples/06_Largescale_with_cellcaching_sqlite3.php index 7ea31645..3d781004 100644 --- a/samples/06_Largescale_with_cellcaching_sqlite3.php +++ b/samples/06_Largescale_with_cellcaching_sqlite3.php @@ -2,8 +2,8 @@ require __DIR__ . '/Header.php'; -$cacheMethod = \PhpSpreadsheet\CachedObjectStorageFactory::CACHE_TO_SQLITE3; -if (\PhpSpreadsheet\Settings::setCacheStorageMethod($cacheMethod)) { +$cacheMethod = \PhpOffice\PhpSpreadsheet\CachedObjectStorageFactory::CACHE_TO_SQLITE3; +if (\PhpOffice\PhpSpreadsheet\Settings::setCacheStorageMethod($cacheMethod)) { $helper->log('Enable Cell Caching using ' . $cacheMethod . ' method'); } else { $helper->log('ERROR: Unable to set Cell Caching using ' . $cacheMethod . ' method, reverting to memory'); diff --git a/samples/07_Reader.php b/samples/07_Reader.php index 587ccfd2..1faa2d6c 100644 --- a/samples/07_Reader.php +++ b/samples/07_Reader.php @@ -5,11 +5,11 @@ require __DIR__ . '/Header.php'; // Create temporary file that will be read $sampleSpreadsheet = require __DIR__ . '/templates/sampleSpreadsheet.php'; $filename = $helper->getTemporaryFilename(); -$writer = new \PhpSpreadsheet\Writer\Excel2007($sampleSpreadsheet); +$writer = new \PhpOffice\PhpSpreadsheet\Writer\Excel2007($sampleSpreadsheet); $writer->save($filename); $callStartTime = microtime(true); -$spreadsheet = \PhpSpreadsheet\IOFactory::load($filename); +$spreadsheet = \PhpOffice\PhpSpreadsheet\IOFactory::load($filename); $helper->logRead('Excel2007', $filename, $callStartTime); // Save diff --git a/samples/07_Reader_PCLZip.php b/samples/07_Reader_PCLZip.php index 5a57c947..7fc40ecb 100644 --- a/samples/07_Reader_PCLZip.php +++ b/samples/07_Reader_PCLZip.php @@ -5,14 +5,14 @@ require __DIR__ . '/Header.php'; // Create temporary file that will be read $sampleSpreadsheet = require __DIR__ . '/templates/sampleSpreadsheet.php'; $filename = $helper->getTemporaryFilename(); -$writer = new \PhpSpreadsheet\Writer\Excel2007($sampleSpreadsheet); +$writer = new \PhpOffice\PhpSpreadsheet\Writer\Excel2007($sampleSpreadsheet); $writer->save($filename); // Use PCLZip rather than ZipArchive to read the Excel2007 OfficeOpenXML file -\PhpSpreadsheet\Settings::setZipClass(\PhpSpreadsheet\Settings::PCLZIP); +\PhpSpreadsheet\Settings::setZipClass(\PhpOffice\PhpSpreadsheet\Settings::PCLZIP); $callStartTime = microtime(true); -$spreadsheet = \PhpSpreadsheet\IOFactory::load($filename); +$spreadsheet = \PhpOffice\PhpSpreadsheet\IOFactory::load($filename); $helper->logRead('Excel2007', $filename, $callStartTime); $callEndTime = microtime(true); diff --git a/samples/08_Conditional_formatting.php b/samples/08_Conditional_formatting.php index eced9c29..86019305 100644 --- a/samples/08_Conditional_formatting.php +++ b/samples/08_Conditional_formatting.php @@ -4,7 +4,7 @@ require __DIR__ . '/Header.php'; // Create new Spreadsheet object $helper->log('Create new Spreadsheet object'); -$spreadsheet = new \PhpSpreadsheet\Spreadsheet(); +$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet(); // Set document properties $helper->log('Set document properties'); @@ -47,30 +47,30 @@ $spreadsheet->getActiveSheet()->getColumnDimension('B')->setWidth(12); // Add conditional formatting $helper->log('Add conditional formatting'); -$conditional1 = new \PhpSpreadsheet\Style\Conditional(); -$conditional1->setConditionType(\PhpSpreadsheet\Style\Conditional::CONDITION_CELLIS) - ->setOperatorType(\PhpSpreadsheet\Style\Conditional::OPERATOR_BETWEEN) +$conditional1 = new \PhpOffice\PhpSpreadsheet\Style\Conditional(); +$conditional1->setConditionType(\PhpOffice\PhpSpreadsheet\Style\Conditional::CONDITION_CELLIS) + ->setOperatorType(\PhpOffice\PhpSpreadsheet\Style\Conditional::OPERATOR_BETWEEN) ->addCondition('200') ->addCondition('400'); -$conditional1->getStyle()->getFont()->getColor()->setARGB(\PhpSpreadsheet\Style\Color::COLOR_YELLOW); +$conditional1->getStyle()->getFont()->getColor()->setARGB(\PhpOffice\PhpSpreadsheet\Style\Color::COLOR_YELLOW); $conditional1->getStyle()->getFont()->setBold(true); -$conditional1->getStyle()->getNumberFormat()->setFormatCode(\PhpSpreadsheet\Style\NumberFormat::FORMAT_CURRENCY_EUR_SIMPLE); +$conditional1->getStyle()->getNumberFormat()->setFormatCode(\PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_CURRENCY_EUR_SIMPLE); -$conditional2 = new \PhpSpreadsheet\Style\Conditional(); -$conditional2->setConditionType(\PhpSpreadsheet\Style\Conditional::CONDITION_CELLIS) - ->setOperatorType(\PhpSpreadsheet\Style\Conditional::OPERATOR_LESSTHAN) +$conditional2 = new \PhpOffice\PhpSpreadsheet\Style\Conditional(); +$conditional2->setConditionType(\PhpOffice\PhpSpreadsheet\Style\Conditional::CONDITION_CELLIS) + ->setOperatorType(\PhpOffice\PhpSpreadsheet\Style\Conditional::OPERATOR_LESSTHAN) ->addCondition('0'); -$conditional2->getStyle()->getFont()->getColor()->setARGB(\PhpSpreadsheet\Style\Color::COLOR_RED); +$conditional2->getStyle()->getFont()->getColor()->setARGB(\PhpOffice\PhpSpreadsheet\Style\Color::COLOR_RED); $conditional2->getStyle()->getFont()->setItalic(true); -$conditional2->getStyle()->getNumberFormat()->setFormatCode(\PhpSpreadsheet\Style\NumberFormat::FORMAT_CURRENCY_EUR_SIMPLE); +$conditional2->getStyle()->getNumberFormat()->setFormatCode(\PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_CURRENCY_EUR_SIMPLE); -$conditional3 = new \PhpSpreadsheet\Style\Conditional(); -$conditional3->setConditionType(\PhpSpreadsheet\Style\Conditional::CONDITION_CELLIS) - ->setOperatorType(\PhpSpreadsheet\Style\Conditional::OPERATOR_GREATERTHANOREQUAL) +$conditional3 = new \PhpOffice\PhpSpreadsheet\Style\Conditional(); +$conditional3->setConditionType(\PhpOffice\PhpSpreadsheet\Style\Conditional::CONDITION_CELLIS) + ->setOperatorType(\PhpOffice\PhpSpreadsheet\Style\Conditional::OPERATOR_GREATERTHANOREQUAL) ->addCondition('0'); -$conditional3->getStyle()->getFont()->getColor()->setARGB(\PhpSpreadsheet\Style\Color::COLOR_GREEN); +$conditional3->getStyle()->getFont()->getColor()->setARGB(\PhpOffice\PhpSpreadsheet\Style\Color::COLOR_GREEN); $conditional3->getStyle()->getFont()->setItalic(true); -$conditional3->getStyle()->getNumberFormat()->setFormatCode(\PhpSpreadsheet\Style\NumberFormat::FORMAT_CURRENCY_EUR_SIMPLE); +$conditional3->getStyle()->getNumberFormat()->setFormatCode(\PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_CURRENCY_EUR_SIMPLE); $conditionalStyles = $spreadsheet->getActiveSheet()->getStyle('B2')->getConditionalStyles(); array_push($conditionalStyles, $conditional1); @@ -98,8 +98,8 @@ $spreadsheet->getActiveSheet()->getHeaderFooter()->setOddFooter('&L&B' . $spread // Set page orientation and size $helper->log('Set page orientation and size'); -$spreadsheet->getActiveSheet()->getPageSetup()->setOrientation(\PhpSpreadsheet\Worksheet\PageSetup::ORIENTATION_PORTRAIT); -$spreadsheet->getActiveSheet()->getPageSetup()->setPaperSize(\PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_A4); +$spreadsheet->getActiveSheet()->getPageSetup()->setOrientation(\PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::ORIENTATION_PORTRAIT); +$spreadsheet->getActiveSheet()->getPageSetup()->setPaperSize(\PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_A4); // Rename worksheet $helper->log('Rename worksheet'); diff --git a/samples/08_Conditional_formatting_2.php b/samples/08_Conditional_formatting_2.php index 958792e5..87bd2851 100644 --- a/samples/08_Conditional_formatting_2.php +++ b/samples/08_Conditional_formatting_2.php @@ -4,7 +4,7 @@ require __DIR__ . '/Header.php'; // Create new Spreadsheet object $helper->log('Create new Spreadsheet object'); -$spreadsheet = new \PhpSpreadsheet\Spreadsheet(); +$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet(); // Set document properties $helper->log('Set document properties'); @@ -32,22 +32,22 @@ $spreadsheet->getActiveSheet() $spreadsheet->getActiveSheet()->getStyle('A1:A8') ->getNumberFormat() ->setFormatCode( - \PhpSpreadsheet\Style\NumberFormat::FORMAT_PERCENTAGE_00 + \PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_PERCENTAGE_00 ); // Add conditional formatting $helper->log('Add conditional formatting'); -$conditional1 = new \PhpSpreadsheet\Style\Conditional(); -$conditional1->setConditionType(\PhpSpreadsheet\Style\Conditional::CONDITION_CELLIS) - ->setOperatorType(\PhpSpreadsheet\Style\Conditional::OPERATOR_LESSTHAN) +$conditional1 = new \PhpOffice\PhpSpreadsheet\Style\Conditional(); +$conditional1->setConditionType(\PhpOffice\PhpSpreadsheet\Style\Conditional::CONDITION_CELLIS) + ->setOperatorType(\PhpOffice\PhpSpreadsheet\Style\Conditional::OPERATOR_LESSTHAN) ->addCondition('0'); -$conditional1->getStyle()->getFont()->getColor()->setARGB(\PhpSpreadsheet\Style\Color::COLOR_RED); +$conditional1->getStyle()->getFont()->getColor()->setARGB(\PhpOffice\PhpSpreadsheet\Style\Color::COLOR_RED); -$conditional3 = new \PhpSpreadsheet\Style\Conditional(); -$conditional3->setConditionType(\PhpSpreadsheet\Style\Conditional::CONDITION_CELLIS) - ->setOperatorType(\PhpSpreadsheet\Style\Conditional::OPERATOR_GREATERTHANOREQUAL) +$conditional3 = new \PhpOffice\PhpSpreadsheet\Style\Conditional(); +$conditional3->setConditionType(\PhpOffice\PhpSpreadsheet\Style\Conditional::CONDITION_CELLIS) + ->setOperatorType(\PhpOffice\PhpSpreadsheet\Style\Conditional::OPERATOR_GREATERTHANOREQUAL) ->addCondition('1'); -$conditional3->getStyle()->getFont()->getColor()->setARGB(\PhpSpreadsheet\Style\Color::COLOR_GREEN); +$conditional3->getStyle()->getFont()->getColor()->setARGB(\PhpOffice\PhpSpreadsheet\Style\Color::COLOR_GREEN); $conditionalStyles = $spreadsheet->getActiveSheet()->getStyle('A1')->getConditionalStyles(); array_push($conditionalStyles, $conditional1); diff --git a/samples/09_Pagebreaks.php b/samples/09_Pagebreaks.php index 5fa385af..9b91d2f0 100644 --- a/samples/09_Pagebreaks.php +++ b/samples/09_Pagebreaks.php @@ -4,7 +4,7 @@ require __DIR__ . '/Header.php'; // Create new Spreadsheet object $helper->log('Create new Spreadsheet object'); -$spreadsheet = new \PhpSpreadsheet\Spreadsheet(); +$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet(); // Set document properties $helper->log('Set document properties'); @@ -36,7 +36,7 @@ for ($i = 2; $i <= 50; ++$i) { // Add page breaks every 10 rows if ($i % 10 == 0) { // Add a page break - $spreadsheet->getActiveSheet()->setBreak('A' . $i, \PhpSpreadsheet\Worksheet::BREAK_ROW); + $spreadsheet->getActiveSheet()->setBreak('A' . $i, \PhpOffice\PhpSpreadsheet\Worksheet::BREAK_ROW); } } diff --git a/samples/10_Autofilter.php b/samples/10_Autofilter.php index 9ef59f72..45955a8c 100644 --- a/samples/10_Autofilter.php +++ b/samples/10_Autofilter.php @@ -4,7 +4,7 @@ require __DIR__ . '/Header.php'; // Create new Spreadsheet object $helper->log('Create new Spreadsheet object'); -$spreadsheet = new \PhpSpreadsheet\Spreadsheet(); +$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet(); // Set document properties $helper->log('Set document properties'); diff --git a/samples/10_Autofilter_selection_1.php b/samples/10_Autofilter_selection_1.php index 746b7847..6f74f483 100644 --- a/samples/10_Autofilter_selection_1.php +++ b/samples/10_Autofilter_selection_1.php @@ -4,7 +4,7 @@ require __DIR__ . '/Header.php'; // Create new Spreadsheet object $helper->log('Create new Spreadsheet object'); -$spreadsheet = new \PhpSpreadsheet\Spreadsheet(); +$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet(); // Set document properties $helper->log('Set document properties'); @@ -48,7 +48,7 @@ foreach ($years as $year) { foreach ($countries as $country) { $endDays = date('t', mktime(0, 0, 0, $period, 1, $year)); for ($i = 1; $i <= $endDays; ++$i) { - $eDate = \PhpSpreadsheet\Shared\Date::formattedPHPToExcel( + $eDate = \PhpOffice\PhpSpreadsheet\Shared\Date::formattedPHPToExcel( $year, $period, $i @@ -86,8 +86,8 @@ $spreadsheet->getActiveSheet()->getStyle('A1:F1')->getFont()->setBold(true); $spreadsheet->getActiveSheet()->getStyle('A1:F1')->getAlignment()->setWrapText(true); $spreadsheet->getActiveSheet()->getColumnDimension('C')->setWidth(12.5); $spreadsheet->getActiveSheet()->getColumnDimension('D')->setWidth(10.5); -$spreadsheet->getActiveSheet()->getStyle('D2:D' . $row)->getNumberFormat()->setFormatCode(\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_YYYYMMDD2); -$spreadsheet->getActiveSheet()->getStyle('E2:F' . $row)->getNumberFormat()->setFormatCode(\PhpSpreadsheet\Style\NumberFormat::FORMAT_CURRENCY_USD_SIMPLE); +$spreadsheet->getActiveSheet()->getStyle('D2:D' . $row)->getNumberFormat()->setFormatCode(\PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_YYYYMMDD2); +$spreadsheet->getActiveSheet()->getStyle('E2:F' . $row)->getNumberFormat()->setFormatCode(\PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_CURRENCY_USD_SIMPLE); $spreadsheet->getActiveSheet()->getColumnDimension('F')->setWidth(14); $spreadsheet->getActiveSheet()->freezePane('A2'); @@ -104,45 +104,45 @@ $helper->log('Set active filters'); // Filter the Country column on a filter value of countries beginning with the letter U (or Japan) // We use * as a wildcard, so specify as U* and using a wildcard requires customFilter $autoFilter->getColumn('C') - ->setFilterType(\PhpSpreadsheet\Worksheet\AutoFilter\Column::AUTOFILTER_FILTERTYPE_CUSTOMFILTER) + ->setFilterType(\PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column::AUTOFILTER_FILTERTYPE_CUSTOMFILTER) ->createRule() ->setRule( - \PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_EQUAL, + \PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_EQUAL, 'u*' ) - ->setRuleType(\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_CUSTOMFILTER); + ->setRuleType(\PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_CUSTOMFILTER); $autoFilter->getColumn('C') ->createRule() ->setRule( - \PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_EQUAL, + \PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_EQUAL, 'japan' ) - ->setRuleType(\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_CUSTOMFILTER); + ->setRuleType(\PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_CUSTOMFILTER); // Filter the Date column on a filter value of the first day of every period of the current year // We us a dateGroup ruletype for this, although it is still a standard filter foreach ($periods as $period) { $endDate = date('t', mktime(0, 0, 0, $period, 1, $currentYear)); $autoFilter->getColumn('D') - ->setFilterType(\PhpSpreadsheet\Worksheet\AutoFilter\Column::AUTOFILTER_FILTERTYPE_FILTER) + ->setFilterType(\PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column::AUTOFILTER_FILTERTYPE_FILTER) ->createRule() ->setRule( - \PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_EQUAL, + \PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_EQUAL, [ 'year' => $currentYear, 'month' => $period, 'day' => $endDate, ] ) - ->setRuleType(\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DATEGROUP); + ->setRuleType(\PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DATEGROUP); } // Display only sales values that are blank // Standard filter, operator equals, and value of NULL $autoFilter->getColumn('E') - ->setFilterType(\PhpSpreadsheet\Worksheet\AutoFilter\Column::AUTOFILTER_FILTERTYPE_FILTER) + ->setFilterType(\PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column::AUTOFILTER_FILTERTYPE_FILTER) ->createRule() ->setRule( - \PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_EQUAL, + \PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_EQUAL, '' ); diff --git a/samples/10_Autofilter_selection_2.php b/samples/10_Autofilter_selection_2.php index 9b0400de..1802d0ea 100644 --- a/samples/10_Autofilter_selection_2.php +++ b/samples/10_Autofilter_selection_2.php @@ -4,7 +4,7 @@ require __DIR__ . '/Header.php'; // Create new Spreadsheet object $helper->log('Create new Spreadsheet object'); -$spreadsheet = new \PhpSpreadsheet\Spreadsheet(); +$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet(); // Set document properties $helper->log('Set document properties'); @@ -48,7 +48,7 @@ foreach ($years as $year) { foreach ($countries as $country) { $endDays = date('t', mktime(0, 0, 0, $period, 1, $year)); for ($i = 1; $i <= $endDays; ++$i) { - $eDate = \PhpSpreadsheet\Shared\Date::formattedPHPToExcel( + $eDate = \PhpOffice\PhpSpreadsheet\Shared\Date::formattedPHPToExcel( $year, $period, $i @@ -86,8 +86,8 @@ $spreadsheet->getActiveSheet()->getStyle('A1:F1')->getFont()->setBold(true); $spreadsheet->getActiveSheet()->getStyle('A1:F1')->getAlignment()->setWrapText(true); $spreadsheet->getActiveSheet()->getColumnDimension('C')->setWidth(12.5); $spreadsheet->getActiveSheet()->getColumnDimension('D')->setWidth(10.5); -$spreadsheet->getActiveSheet()->getStyle('D2:D' . $row)->getNumberFormat()->setFormatCode(\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_YYYYMMDD2); -$spreadsheet->getActiveSheet()->getStyle('E2:F' . $row)->getNumberFormat()->setFormatCode(\PhpSpreadsheet\Style\NumberFormat::FORMAT_CURRENCY_USD_SIMPLE); +$spreadsheet->getActiveSheet()->getStyle('D2:D' . $row)->getNumberFormat()->setFormatCode(\PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_YYYYMMDD2); +$spreadsheet->getActiveSheet()->getStyle('E2:F' . $row)->getNumberFormat()->setFormatCode(\PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_CURRENCY_USD_SIMPLE); $spreadsheet->getActiveSheet()->getColumnDimension('F')->setWidth(14); $spreadsheet->getActiveSheet()->freezePane('A2'); @@ -104,39 +104,39 @@ $helper->log('Set active filters'); // Filter the Country column on a filter value of Germany // As it's just a simple value filter, we can use FILTERTYPE_FILTER $autoFilter->getColumn('C') - ->setFilterType(\PhpSpreadsheet\Worksheet\AutoFilter\Column::AUTOFILTER_FILTERTYPE_FILTER) + ->setFilterType(\PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column::AUTOFILTER_FILTERTYPE_FILTER) ->createRule() ->setRule( - \PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_EQUAL, + \PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_EQUAL, 'Germany' ); // Filter the Date column on a filter value of the year to date $autoFilter->getColumn('D') - ->setFilterType(\PhpSpreadsheet\Worksheet\AutoFilter\Column::AUTOFILTER_FILTERTYPE_DYNAMICFILTER) + ->setFilterType(\PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column::AUTOFILTER_FILTERTYPE_DYNAMICFILTER) ->createRule() ->setRule( - \PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_EQUAL, + \PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_EQUAL, null, - \PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_YEARTODATE + \PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_YEARTODATE ) - ->setRuleType(\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMICFILTER); + ->setRuleType(\PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMICFILTER); // Display only sales values that are between 400 and 600 $autoFilter->getColumn('E') - ->setFilterType(\PhpSpreadsheet\Worksheet\AutoFilter\Column::AUTOFILTER_FILTERTYPE_CUSTOMFILTER) + ->setFilterType(\PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column::AUTOFILTER_FILTERTYPE_CUSTOMFILTER) ->createRule() ->setRule( - \PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_GREATERTHANOREQUAL, + \PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_GREATERTHANOREQUAL, 400 ) - ->setRuleType(\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_CUSTOMFILTER); + ->setRuleType(\PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_CUSTOMFILTER); $autoFilter->getColumn('E') - ->setJoin(\PhpSpreadsheet\Worksheet\AutoFilter\Column::AUTOFILTER_COLUMN_JOIN_AND) + ->setJoin(\PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column::AUTOFILTER_COLUMN_JOIN_AND) ->createRule() ->setRule( - \PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_LESSTHANOREQUAL, + \PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_LESSTHANOREQUAL, 600 ) - ->setRuleType(\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_CUSTOMFILTER); + ->setRuleType(\PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_CUSTOMFILTER); // Save $helper->write($spreadsheet, __FILE__); diff --git a/samples/10_Autofilter_selection_display.php b/samples/10_Autofilter_selection_display.php index 22d88461..0f431e66 100644 --- a/samples/10_Autofilter_selection_display.php +++ b/samples/10_Autofilter_selection_display.php @@ -4,7 +4,7 @@ require __DIR__ . '/Header.php'; // Create new Spreadsheet object $helper->log('Create new Spreadsheet object'); -$spreadsheet = new \PhpSpreadsheet\Spreadsheet(); +$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet(); // Set document properties $helper->log('Set document properties'); @@ -48,7 +48,7 @@ foreach ($years as $year) { foreach ($countries as $country) { $endDays = date('t', mktime(0, 0, 0, $period, 1, $year)); for ($i = 1; $i <= $endDays; ++$i) { - $eDate = \PhpSpreadsheet\Shared\Date::formattedPHPToExcel( + $eDate = \PhpOffice\PhpSpreadsheet\Shared\Date::formattedPHPToExcel( $year, $period, $i @@ -86,8 +86,8 @@ $spreadsheet->getActiveSheet()->getStyle('A1:F1')->getFont()->setBold(true); $spreadsheet->getActiveSheet()->getStyle('A1:F1')->getAlignment()->setWrapText(true); $spreadsheet->getActiveSheet()->getColumnDimension('C')->setWidth(12.5); $spreadsheet->getActiveSheet()->getColumnDimension('D')->setWidth(10.5); -$spreadsheet->getActiveSheet()->getStyle('D2:D' . $row)->getNumberFormat()->setFormatCode(\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_YYYYMMDD2); -$spreadsheet->getActiveSheet()->getStyle('E2:F' . $row)->getNumberFormat()->setFormatCode(\PhpSpreadsheet\Style\NumberFormat::FORMAT_CURRENCY_USD_SIMPLE); +$spreadsheet->getActiveSheet()->getStyle('D2:D' . $row)->getNumberFormat()->setFormatCode(\PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_YYYYMMDD2); +$spreadsheet->getActiveSheet()->getStyle('E2:F' . $row)->getNumberFormat()->setFormatCode(\PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_CURRENCY_USD_SIMPLE); $spreadsheet->getActiveSheet()->getColumnDimension('F')->setWidth(14); $spreadsheet->getActiveSheet()->freezePane('A2'); @@ -104,45 +104,45 @@ $helper->log('Set active filters'); // Filter the Country column on a filter value of countries beginning with the letter U (or Japan) // We use * as a wildcard, so specify as U* and using a wildcard requires customFilter $autoFilter->getColumn('C') - ->setFilterType(\PhpSpreadsheet\Worksheet\AutoFilter\Column::AUTOFILTER_FILTERTYPE_CUSTOMFILTER) + ->setFilterType(\PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column::AUTOFILTER_FILTERTYPE_CUSTOMFILTER) ->createRule() ->setRule( - \PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_EQUAL, + \PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_EQUAL, 'u*' ) - ->setRuleType(\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_CUSTOMFILTER); + ->setRuleType(\PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_CUSTOMFILTER); $autoFilter->getColumn('C') ->createRule() ->setRule( - \PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_EQUAL, + \PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_EQUAL, 'japan' ) - ->setRuleType(\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_CUSTOMFILTER); + ->setRuleType(\PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_CUSTOMFILTER); // Filter the Date column on a filter value of the first day of every period of the current year // We us a dateGroup ruletype for this, although it is still a standard filter foreach ($periods as $period) { $endDate = date('t', mktime(0, 0, 0, $period, 1, $currentYear)); $autoFilter->getColumn('D') - ->setFilterType(\PhpSpreadsheet\Worksheet\AutoFilter\Column::AUTOFILTER_FILTERTYPE_FILTER) + ->setFilterType(\PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column::AUTOFILTER_FILTERTYPE_FILTER) ->createRule() ->setRule( - \PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_EQUAL, + \PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_EQUAL, [ 'year' => $currentYear, 'month' => $period, 'day' => $endDate, ] ) - ->setRuleType(\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DATEGROUP); + ->setRuleType(\PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DATEGROUP); } // Display only sales values that are blank // Standard filter, operator equals, and value of NULL $autoFilter->getColumn('E') - ->setFilterType(\PhpSpreadsheet\Worksheet\AutoFilter\Column::AUTOFILTER_FILTERTYPE_FILTER) + ->setFilterType(\PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column::AUTOFILTER_FILTERTYPE_FILTER) ->createRule() ->setRule( - \PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_EQUAL, + \PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_EQUAL, '' ); diff --git a/samples/11_Documentsecurity.php b/samples/11_Documentsecurity.php index 1479620c..2224808a 100644 --- a/samples/11_Documentsecurity.php +++ b/samples/11_Documentsecurity.php @@ -4,7 +4,7 @@ require __DIR__ . '/Header.php'; // Create new Spreadsheet object $helper->log('Create new Spreadsheet object'); -$spreadsheet = new \PhpSpreadsheet\Spreadsheet(); +$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet(); // Set document properties $helper->log('Set document properties'); diff --git a/samples/12_CellProtection.php b/samples/12_CellProtection.php index c3eec91a..4ef97b01 100644 --- a/samples/12_CellProtection.php +++ b/samples/12_CellProtection.php @@ -4,7 +4,7 @@ require __DIR__ . '/Header.php'; // Create new Spreadsheet object $helper->log('Create new Spreadsheet object'); -$spreadsheet = new \PhpSpreadsheet\Spreadsheet(); +$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet(); // Set document properties $helper->log('Set document properties'); @@ -37,7 +37,7 @@ $spreadsheet->getActiveSheet()->getProtection()->setSheet(true); $spreadsheet->getActiveSheet() ->getStyle('A2:B2') ->getProtection()->setLocked( - \PhpSpreadsheet\Style\Protection::PROTECTION_UNPROTECTED + \PhpOffice\PhpSpreadsheet\Style\Protection::PROTECTION_UNPROTECTED ); // Save diff --git a/samples/13_Calculation.php b/samples/13_Calculation.php index cea7ae77..d87f5104 100644 --- a/samples/13_Calculation.php +++ b/samples/13_Calculation.php @@ -6,12 +6,12 @@ require __DIR__ . '/Header.php'; // List functions $helper->log('List implemented functions'); -$calc = \PhpSpreadsheet\Calculation::getInstance(); +$calc = \PhpOffice\PhpSpreadsheet\Calculation::getInstance(); print_r($calc->listFunctionNames()); // Create new Spreadsheet object $helper->log('Create new Spreadsheet object'); -$spreadsheet = new \PhpSpreadsheet\Spreadsheet(); +$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet(); // Add some data, we will use some formulas here $helper->log('Add some data and formulas'); diff --git a/samples/13_CalculationCyclicFormulae.php b/samples/13_CalculationCyclicFormulae.php index 8b8719e8..ea1be404 100644 --- a/samples/13_CalculationCyclicFormulae.php +++ b/samples/13_CalculationCyclicFormulae.php @@ -4,7 +4,7 @@ require __DIR__ . '/Header.php'; // Create new Spreadsheet object $helper->log('Create new Spreadsheet object'); -$spreadsheet = new \PhpSpreadsheet\Spreadsheet(); +$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet(); // Add some data, we will use some formulas here $helper->log('Add some data and formulas'); @@ -13,7 +13,7 @@ $spreadsheet->getActiveSheet()->setCellValue('A1', '=B1') ->setCellValue('B1', '=A1+1') ->setCellValue('B2', '=A2'); -\PhpSpreadsheet\Calculation::getInstance($spreadsheet)->cyclicFormulaCount = 100; +\PhpOffice\PhpSpreadsheet\Calculation::getInstance($spreadsheet)->cyclicFormulaCount = 100; // Calculated data $helper->log('Calculated data'); diff --git a/samples/14_Excel5.php b/samples/14_Excel5.php index 61dfea71..8b0aec15 100644 --- a/samples/14_Excel5.php +++ b/samples/14_Excel5.php @@ -4,7 +4,7 @@ require __DIR__ . '/Header.php'; $spreadsheet = require __DIR__ . '/templates/sampleSpreadsheet.php'; $filename = $helper->getFilename(__FILE__, 'xls'); -$writer = \PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Excel5'); +$writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Excel5'); $callStartTime = microtime(true); $writer->save($filename); diff --git a/samples/15_Datavalidation.php b/samples/15_Datavalidation.php index 5ceb1fc4..bd7299d6 100644 --- a/samples/15_Datavalidation.php +++ b/samples/15_Datavalidation.php @@ -4,7 +4,7 @@ require __DIR__ . '/Header.php'; // Create new Spreadsheet object $helper->log('Create new Spreadsheet object'); -$spreadsheet = new \PhpSpreadsheet\Spreadsheet(); +$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet(); // Set document properties $helper->log('Set document properties'); @@ -35,8 +35,8 @@ $spreadsheet->getActiveSheet()->setCellValue('A1', 'Cell B3 and B5 contain data // Set data validation $helper->log('Set data validation'); $validation = $spreadsheet->getActiveSheet()->getCell('B3')->getDataValidation(); -$validation->setType(\PhpSpreadsheet\Cell\DataValidation::TYPE_WHOLE); -$validation->setErrorStyle(\PhpSpreadsheet\Cell\DataValidation::STYLE_STOP); +$validation->setType(\PhpOffice\PhpSpreadsheet\Cell\DataValidation::TYPE_WHOLE); +$validation->setErrorStyle(\PhpOffice\PhpSpreadsheet\Cell\DataValidation::STYLE_STOP); $validation->setAllowBlank(true); $validation->setShowInputMessage(true); $validation->setShowErrorMessage(true); @@ -48,8 +48,8 @@ $validation->setFormula1(10); $validation->setFormula2(20); $validation = $spreadsheet->getActiveSheet()->getCell('B5')->getDataValidation(); -$validation->setType(\PhpSpreadsheet\Cell\DataValidation::TYPE_LIST); -$validation->setErrorStyle(\PhpSpreadsheet\Cell\DataValidation::STYLE_INFORMATION); +$validation->setType(\PhpOffice\PhpSpreadsheet\Cell\DataValidation::TYPE_LIST); +$validation->setErrorStyle(\PhpOffice\PhpSpreadsheet\Cell\DataValidation::STYLE_INFORMATION); $validation->setAllowBlank(false); $validation->setShowInputMessage(true); $validation->setShowErrorMessage(true); @@ -61,8 +61,8 @@ $validation->setPrompt('Please pick a value from the drop-down list.'); $validation->setFormula1('"Item A,Item B,Item C"'); // Make sure to put the list items between " and " if your list is simply a comma-separated list of values !!! $validation = $spreadsheet->getActiveSheet()->getCell('B7')->getDataValidation(); -$validation->setType(\PhpSpreadsheet\Cell\DataValidation::TYPE_LIST); -$validation->setErrorStyle(\PhpSpreadsheet\Cell\DataValidation::STYLE_INFORMATION); +$validation->setType(\PhpOffice\PhpSpreadsheet\Cell\DataValidation::TYPE_LIST); +$validation->setErrorStyle(\PhpOffice\PhpSpreadsheet\Cell\DataValidation::STYLE_INFORMATION); $validation->setAllowBlank(false); $validation->setShowInputMessage(true); $validation->setShowErrorMessage(true); diff --git a/samples/16_Csv.php b/samples/16_Csv.php index ed0fd7b3..1c8eec96 100644 --- a/samples/16_Csv.php +++ b/samples/16_Csv.php @@ -4,7 +4,7 @@ require __DIR__ . '/Header.php'; $spreadsheet = require __DIR__ . '/templates/sampleSpreadsheet.php'; $helper->log('Write to CSV format'); -$writer = \PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'CSV')->setDelimiter(',') +$writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'CSV')->setDelimiter(',') ->setEnclosure('"') ->setSheetIndex(0); @@ -15,7 +15,7 @@ $helper->logWrite($writer, $filename, $callStartTime); $helper->log('Read from CSV format'); -$reader = \PhpSpreadsheet\IOFactory::createReader('CSV')->setDelimiter(',') +$reader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader('CSV')->setDelimiter(',') ->setEnclosure('"') ->setSheetIndex(0); @@ -28,7 +28,7 @@ $helper->write($spreadsheetFromCSV, __FILE__, ['Excel2007' => 'xlsx']); // Write CSV $filenameCSV = $helper->getFilename(__FILE__, 'csv'); -$writerCSV = \PhpSpreadsheet\IOFactory::createWriter($spreadsheetFromCSV, 'CSV'); +$writerCSV = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheetFromCSV, 'CSV'); $writerCSV->setExcelCompatibility(true); $callStartTime = microtime(true); diff --git a/samples/17_Html.php b/samples/17_Html.php index c7d33a00..eb3b748b 100644 --- a/samples/17_Html.php +++ b/samples/17_Html.php @@ -4,7 +4,7 @@ require __DIR__ . '/Header.php'; $spreadsheet = require __DIR__ . '/templates/sampleSpreadsheet.php'; $filename = $helper->getFilename(__FILE__, 'html'); -$writer = \PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'HTML'); +$writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'HTML'); $callStartTime = microtime(true); $writer->save($filename); diff --git a/samples/18_Extendedcalculation.php b/samples/18_Extendedcalculation.php index 7f51a14f..a12c5c60 100644 --- a/samples/18_Extendedcalculation.php +++ b/samples/18_Extendedcalculation.php @@ -1,16 +1,16 @@ log('List implemented functions'); -$calc = \PhpSpreadsheet\Calculation::getInstance(); +$calc = \PhpOffice\PhpSpreadsheet\Calculation::getInstance(); print_r($calc->listFunctionNames()); // Create new Spreadsheet object $helper->log('Create new Spreadsheet object'); -$spreadsheet = new \PhpSpreadsheet\Spreadsheet(); +$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet(); // Add some data, we will use some formulas here $helper->log('Add some data'); diff --git a/samples/19_Namedrange.php b/samples/19_Namedrange.php index add02535..ea39a335 100644 --- a/samples/19_Namedrange.php +++ b/samples/19_Namedrange.php @@ -4,7 +4,7 @@ require __DIR__ . '/Header.php'; // Create new Spreadsheet object $helper->log('Create new Spreadsheet object'); -$spreadsheet = new \PhpSpreadsheet\Spreadsheet(); +$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet(); // Set document properties $helper->log('Set document properties'); @@ -28,8 +28,8 @@ $spreadsheet->getActiveSheet()->setCellValue('A1', 'Firstname:') // Define named ranges $helper->log('Define named ranges'); -$spreadsheet->addNamedRange(new \PhpSpreadsheet\NamedRange('PersonName', $spreadsheet->getActiveSheet(), 'B1')); -$spreadsheet->addNamedRange(new \PhpSpreadsheet\NamedRange('PersonLN', $spreadsheet->getActiveSheet(), 'B2')); +$spreadsheet->addNamedRange(new \PhpOffice\PhpSpreadsheet\NamedRange('PersonName', $spreadsheet->getActiveSheet(), 'B1')); +$spreadsheet->addNamedRange(new \PhpOffice\PhpSpreadsheet\NamedRange('PersonLN', $spreadsheet->getActiveSheet(), 'B2')); // Rename named ranges $helper->log('Rename named ranges'); diff --git a/samples/20_Read_Excel2003XML.php b/samples/20_Read_Excel2003XML.php index 88b5f3f7..37169359 100644 --- a/samples/20_Read_Excel2003XML.php +++ b/samples/20_Read_Excel2003XML.php @@ -4,7 +4,7 @@ require __DIR__ . '/Header.php'; $filename = __DIR__ . '/templates/Excel2003XMLTest.xml'; $callStartTime = microtime(true); -$spreadsheet = \PhpSpreadsheet\IOFactory::load($filename); +$spreadsheet = \PhpOffice\PhpSpreadsheet\IOFactory::load($filename); $helper->logRead('Excel2003XML', $filename, $callStartTime); // Save diff --git a/samples/20_Read_Excel5.php b/samples/20_Read_Excel5.php index 0247e428..6592def3 100644 --- a/samples/20_Read_Excel5.php +++ b/samples/20_Read_Excel5.php @@ -6,14 +6,14 @@ $spreadsheet = require __DIR__ . '/templates/sampleSpreadsheet.php'; // Write temporary file $filename = $helper->getTemporaryFilename('xls'); -$writer = \PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Excel5'); +$writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Excel5'); $callStartTime = microtime(true); $writer->save($filename); $helper->logWrite($writer, $filename, $callStartTime); // Read Excel5 file $callStartTime = microtime(true); -$spreadsheet = \PhpSpreadsheet\IOFactory::load($filename); +$spreadsheet = \PhpOffice\PhpSpreadsheet\IOFactory::load($filename); $helper->logRead('Excel5', $filename, $callStartTime); // Save diff --git a/samples/20_Read_Gnumeric.php b/samples/20_Read_Gnumeric.php index 76606b07..d390dc14 100644 --- a/samples/20_Read_Gnumeric.php +++ b/samples/20_Read_Gnumeric.php @@ -4,7 +4,7 @@ require __DIR__ . '/Header.php'; $filename = __DIR__ . '/templates/GnumericTest.gnumeric'; $callStartTime = microtime(true); -$spreadsheet = \PhpSpreadsheet\IOFactory::load($filename); +$spreadsheet = \PhpOffice\PhpSpreadsheet\IOFactory::load($filename); $helper->logRead('Gnumeric', $filename, $callStartTime); // Save diff --git a/samples/20_Read_OOCalc.php b/samples/20_Read_OOCalc.php index 77f744bd..9dedb1ca 100644 --- a/samples/20_Read_OOCalc.php +++ b/samples/20_Read_OOCalc.php @@ -4,7 +4,7 @@ require __DIR__ . '/Header.php'; $filename = __DIR__ . '/templates/OOCalcTest.ods'; $callStartTime = microtime(true); -$spreadsheet = \PhpSpreadsheet\IOFactory::load($filename); +$spreadsheet = \PhpOffice\PhpSpreadsheet\IOFactory::load($filename); $helper->logRead('OOCalc', $filename, $callStartTime); // Save diff --git a/samples/20_Read_OOCalc_with_PCLZip.php b/samples/20_Read_OOCalc_with_PCLZip.php index ce64d2b2..9c42e872 100644 --- a/samples/20_Read_OOCalc_with_PCLZip.php +++ b/samples/20_Read_OOCalc_with_PCLZip.php @@ -3,11 +3,11 @@ require __DIR__ . '/Header.php'; // Use PCLZip rather than ZipArchive to read the Excel2007 OfficeOpenXML file -PhpSpreadsheet\Settings::setZipClass(PhpSpreadsheet\Settings::PCLZIP); +\PhpOffice\PhpSpreadsheet\Settings::setZipClass(\PhpOffice\PhpSpreadsheet\Settings::PCLZIP); $filename = __DIR__ . '/templates/OOCalcTest.ods'; $callStartTime = microtime(true); -$spreadsheet = \PhpSpreadsheet\IOFactory::load($filename); +$spreadsheet = \PhpOffice\PhpSpreadsheet\IOFactory::load($filename); $helper->logRead('OOCalc', $filename, $callStartTime); // Save diff --git a/samples/20_Read_Sylk.php b/samples/20_Read_Sylk.php index c87285ce..0ffa618f 100644 --- a/samples/20_Read_Sylk.php +++ b/samples/20_Read_Sylk.php @@ -4,7 +4,7 @@ require __DIR__ . '/Header.php'; $filename = __DIR__ . '/templates/SylkTest.slk'; $callStartTime = microtime(true); -$spreadsheet = \PhpSpreadsheet\IOFactory::load($filename); +$spreadsheet = \PhpOffice\PhpSpreadsheet\IOFactory::load($filename); $helper->logRead('SYLK', $filename, $callStartTime); // Save diff --git a/samples/21_Pdf.php b/samples/21_Pdf.php index 0a54383b..6fad9f33 100644 --- a/samples/21_Pdf.php +++ b/samples/21_Pdf.php @@ -5,9 +5,9 @@ $spreadsheet = require __DIR__ . '/templates/sampleSpreadsheet.php'; // Change these values to select the Rendering library that you wish to use // and its directory location on your server -//$rendererName = \PhpSpreadsheet\Settings::PDF_RENDERER_TCPDF; -//$rendererName = \PhpSpreadsheet\Settings::PDF_RENDERER_MPDF; -$rendererName = \PhpSpreadsheet\Settings::PDF_RENDERER_DOMPDF; +//$rendererName = \PhpOffice\PhpSpreadsheet\Settings::PDF_RENDERER_TCPDF; +//$rendererName = \PhpOffice\PhpSpreadsheet\Settings::PDF_RENDERER_MPDF; +$rendererName = \PhpOffice\PhpSpreadsheet\Settings::PDF_RENDERER_DOMPDF; //$rendererLibrary = 'tcPDF5.9'; //$rendererLibrary = 'mPDF5.4'; $rendererLibrary = 'domPDF0.6.0beta3'; @@ -17,11 +17,11 @@ $helper->log('Hide grid lines'); $spreadsheet->getActiveSheet()->setShowGridLines(false); $helper->log('Set orientation to landscape'); -$spreadsheet->getActiveSheet()->getPageSetup()->setOrientation(\PhpSpreadsheet\Worksheet\PageSetup::ORIENTATION_LANDSCAPE); +$spreadsheet->getActiveSheet()->getPageSetup()->setOrientation(\PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::ORIENTATION_LANDSCAPE); $helper->log("Write to PDF format using {$rendererName}"); -if (!\PhpSpreadsheet\Settings::setPdfRenderer($rendererName, $rendererLibraryPath)) { +if (!\PhpOffice\PhpSpreadsheet\Settings::setPdfRenderer($rendererName, $rendererLibraryPath)) { $helper->log('NOTICE: Please set the $rendererName and $rendererLibraryPath values at the top of this script as appropriate for your directory structure'); } diff --git a/samples/22_Heavily_formatted.php b/samples/22_Heavily_formatted.php index 74e75fd3..541f3149 100644 --- a/samples/22_Heavily_formatted.php +++ b/samples/22_Heavily_formatted.php @@ -4,7 +4,7 @@ require __DIR__ . '/Header.php'; // Create new Spreadsheet object $helper->log('Create new Spreadsheet object'); -$spreadsheet = new \PhpSpreadsheet\Spreadsheet(); +$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet(); // Set document properties $helper->log('Set document properties'); @@ -22,19 +22,19 @@ $spreadsheet->setActiveSheetIndex(0); $spreadsheet->getActiveSheet()->getStyle('A1:T100')->applyFromArray( ['fill' => [ - 'type' => \PhpSpreadsheet\Style\Fill::FILL_SOLID, + 'type' => \PhpOffice\PhpSpreadsheet\Style\Fill::FILL_SOLID, 'color' => ['argb' => 'FFCCFFCC'], ], 'borders' => [ - 'bottom' => ['style' => \PhpSpreadsheet\Style\Border::BORDER_THIN], - 'right' => ['style' => \PhpSpreadsheet\Style\Border::BORDER_MEDIUM], + 'bottom' => ['style' => \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_THIN], + 'right' => ['style' => \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_MEDIUM], ], ] ); $spreadsheet->getActiveSheet()->getStyle('C5:R95')->applyFromArray( ['fill' => [ - 'type' => \PhpSpreadsheet\Style\Fill::FILL_SOLID, + 'type' => \PhpOffice\PhpSpreadsheet\Style\Fill::FILL_SOLID, 'color' => ['argb' => 'FFFFFF00'], ], ] diff --git a/samples/23_Sharedstyles.php b/samples/23_Sharedstyles.php index e65bb027..48ffb1ad 100644 --- a/samples/23_Sharedstyles.php +++ b/samples/23_Sharedstyles.php @@ -4,7 +4,7 @@ require __DIR__ . '/Header.php'; // Create new Spreadsheet object $helper->log('Create new Spreadsheet object'); -$spreadsheet = new \PhpSpreadsheet\Spreadsheet(); +$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet(); // Set document properties $helper->log('Set document properties'); @@ -20,29 +20,29 @@ $spreadsheet->getProperties()->setCreator('Maarten Balliauw') $helper->log('Add some data'); $spreadsheet->setActiveSheetIndex(0); -$sharedStyle1 = new \PhpSpreadsheet\Style(); -$sharedStyle2 = new \PhpSpreadsheet\Style(); +$sharedStyle1 = new \PhpOffice\PhpSpreadsheet\Style(); +$sharedStyle2 = new \PhpOffice\PhpSpreadsheet\Style(); $sharedStyle1->applyFromArray( ['fill' => [ - 'type' => \PhpSpreadsheet\Style\Fill::FILL_SOLID, + 'type' => \PhpOffice\PhpSpreadsheet\Style\Fill::FILL_SOLID, 'color' => ['argb' => 'FFCCFFCC'], ], 'borders' => [ - 'bottom' => ['style' => \PhpSpreadsheet\Style\Border::BORDER_THIN], - 'right' => ['style' => \PhpSpreadsheet\Style\Border::BORDER_MEDIUM], + 'bottom' => ['style' => \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_THIN], + 'right' => ['style' => \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_MEDIUM], ], ] ); $sharedStyle2->applyFromArray( ['fill' => [ - 'type' => \PhpSpreadsheet\Style\Fill::FILL_SOLID, + 'type' => \PhpOffice\PhpSpreadsheet\Style\Fill::FILL_SOLID, 'color' => ['argb' => 'FFFFFF00'], ], 'borders' => [ - 'bottom' => ['style' => \PhpSpreadsheet\Style\Border::BORDER_THIN], - 'right' => ['style' => \PhpSpreadsheet\Style\Border::BORDER_MEDIUM], + 'bottom' => ['style' => \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_THIN], + 'right' => ['style' => \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_MEDIUM], ], ] ); diff --git a/samples/24_Readfilter.php b/samples/24_Readfilter.php index d6cdb5f2..50c68809 100644 --- a/samples/24_Readfilter.php +++ b/samples/24_Readfilter.php @@ -1,18 +1,18 @@ getTemporaryFilename(); $callStartTime = microtime(true); $writer->save($filename); $helper->logWrite($writer, $filename, $callStartTime); -class MyReadFilter implements \PhpSpreadsheet\Reader\IReadFilter +class MyReadFilter implements \PhpOffice\PhpSpreadsheet\Reader\IReadFilter { public function readCell($column, $row, $worksheetName = '') { @@ -26,7 +26,7 @@ class MyReadFilter implements \PhpSpreadsheet\Reader\IReadFilter } $helper->log('Load from Excel2007 file'); -$reader = \PhpSpreadsheet\IOFactory::createReader('Excel2007'); +$reader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader('Excel2007'); $reader->setReadFilter(new MyReadFilter()); $callStartTime = microtime(true); $spreadsheet = $reader->load($filename); diff --git a/samples/25_In_memory_image.php b/samples/25_In_memory_image.php index 1708c89d..877f2f1b 100644 --- a/samples/25_In_memory_image.php +++ b/samples/25_In_memory_image.php @@ -4,7 +4,7 @@ require __DIR__ . '/Header.php'; // Create new Spreadsheet object $helper->log('Create new Spreadsheet object'); -$spreadsheet = new \PhpSpreadsheet\Spreadsheet(); +$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet(); // Set document properties $helper->log('Set document properties'); @@ -24,12 +24,12 @@ imagestring($gdImage, 1, 5, 5, 'Created with PhpSpreadsheet', $textColor); // Add a drawing to the worksheet $helper->log('Add a drawing to the worksheet'); -$drawing = new \PhpSpreadsheet\Worksheet\MemoryDrawing(); +$drawing = new \PhpOffice\PhpSpreadsheet\Worksheet\MemoryDrawing(); $drawing->setName('Sample image'); $drawing->setDescription('Sample image'); $drawing->setImageResource($gdImage); -$drawing->setRenderingFunction(\PhpSpreadsheet\Worksheet\MemoryDrawing::RENDERING_JPEG); -$drawing->setMimeType(\PhpSpreadsheet\Worksheet\MemoryDrawing::MIMETYPE_DEFAULT); +$drawing->setRenderingFunction(\PhpOffice\PhpSpreadsheet\Worksheet\MemoryDrawing::RENDERING_JPEG); +$drawing->setMimeType(\PhpOffice\PhpSpreadsheet\Worksheet\MemoryDrawing::MIMETYPE_DEFAULT); $drawing->setHeight(36); $drawing->setWorksheet($spreadsheet->getActiveSheet()); diff --git a/samples/26_Utf8.php b/samples/26_Utf8.php index 06c604bd..5039efe7 100644 --- a/samples/26_Utf8.php +++ b/samples/26_Utf8.php @@ -4,9 +4,9 @@ require __DIR__ . '/Header.php'; // Change these values to select the PDF Rendering library that you wish to use // and its directory location on your server -//$rendererName = \PhpSpreadsheet\Settings::PDF_RENDERER_TCPDF; -//$rendererName = \PhpSpreadsheet\Settings::PDF_RENDERER_MPDF; -$rendererName = \PhpSpreadsheet\Settings::PDF_RENDERER_DOMPDF; +//$rendererName = \PhpOffice\PhpSpreadsheet\Settings::PDF_RENDERER_TCPDF; +//$rendererName = \PhpOffice\PhpSpreadsheet\Settings::PDF_RENDERER_MPDF; +$rendererName = \PhpOffice\PhpSpreadsheet\Settings::PDF_RENDERER_DOMPDF; //$rendererLibrary = 'tcPDF5.9'; //$rendererLibrary = 'mPDF5.4'; $rendererLibrary = 'domPDF0.6.0beta3'; @@ -14,7 +14,7 @@ $rendererLibraryPath = '/php/libraries/PDF/' . $rendererLibrary; // Read from Excel2007 (.xlsx) template $helper->log('Load Excel2007 template file'); -$reader = \PhpSpreadsheet\IOFactory::createReader('Excel2007'); +$reader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader('Excel2007'); $spreadsheet = $reader->load(__DIR__ . '/templates/26template.xlsx'); /* at this point, we could do some manipulations with the template, but we skip this step */ @@ -23,7 +23,7 @@ $helper->write($spreadsheet, __FILE__, ['Excel2007' => 'xlsx', 'Excel5' => 'xls' // Export to PDF (.pdf) $helper->log('Write to PDF format'); try { - if (!\PhpSpreadsheet\Settings::setPdfRenderer($rendererName, $rendererLibraryPath)) { + if (!\PhpOffice\PhpSpreadsheet\Settings::setPdfRenderer($rendererName, $rendererLibraryPath)) { $helper->log('NOTICE: Please set the $rendererName and $rendererLibraryPath values at the top of this script as appropriate for your directory structure'); } else { $helper->write($spreadsheet, __FILE__, ['PDF' => 'pdf']); @@ -39,7 +39,7 @@ $worksheet->removeRow(1, 2); // Export to CSV (.csv) $helper->log('Write to CSV format'); -$writer = \PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'CSV'); +$writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'CSV'); $filename = $helper->getFilename(__FILE__, 'csv'); $callStartTime = microtime(true); $writer->save($filename); diff --git a/samples/27_Images_excel5.php b/samples/27_Images_excel5.php index d12aa65b..11e32311 100644 --- a/samples/27_Images_excel5.php +++ b/samples/27_Images_excel5.php @@ -4,7 +4,7 @@ require __DIR__ . '/Header.php'; // Read from Excel5 (.xls) template $helper->log('Load Excel2007 template file'); -$reader = \PhpSpreadsheet\IOFactory::createReader('Excel5'); +$reader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader('Excel5'); $spreadsheet = $reader->load(__DIR__ . '/templates/27template.xls'); // Save diff --git a/samples/28_Iterator.php b/samples/28_Iterator.php index 1d2bdb8b..0128ea9b 100644 --- a/samples/28_Iterator.php +++ b/samples/28_Iterator.php @@ -4,13 +4,13 @@ require __DIR__ . '/Header.php'; $sampleSpreadsheet = require __DIR__ . '/templates/sampleSpreadsheet.php'; $filename = $helper->getTemporaryFilename(); -$writer = new \PhpSpreadsheet\Writer\Excel2007($sampleSpreadsheet); +$writer = new \PhpOffice\PhpSpreadsheet\Writer\Excel2007($sampleSpreadsheet); $callStartTime = microtime(true); $writer->save($filename); $helper->logWrite($writer, $filename, $callStartTime); $callStartTime = microtime(true); -$reader = \PhpSpreadsheet\IOFactory::createReader('Excel2007'); +$reader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader('Excel2007'); $spreadsheet = $reader->load($filename); $helper->logRead('Excel2007', $filename, $callStartTime); $helper->log('Iterate worksheets'); diff --git a/samples/29_Advanced_value_binder.php b/samples/29_Advanced_value_binder.php index 0cca608e..82657347 100644 --- a/samples/29_Advanced_value_binder.php +++ b/samples/29_Advanced_value_binder.php @@ -1,6 +1,6 @@ log('Set value binder'); -\PhpSpreadsheet\Cell::setValueBinder(new \PhpSpreadsheet\Cell\AdvancedValueBinder()); +\PhpOffice\PhpSpreadsheet\Cell::setValueBinder(new \PhpOffice\PhpSpreadsheet\Cell\AdvancedValueBinder()); // Create new Spreadsheet object $helper->log('Create new Spreadsheet object'); -$spreadsheet = new \PhpSpreadsheet\Spreadsheet(); +$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet(); // Set document properties $helper->log('Set document properties'); diff --git a/samples/30_Template.php b/samples/30_Template.php index 11f93e87..cb708c75 100644 --- a/samples/30_Template.php +++ b/samples/30_Template.php @@ -3,7 +3,7 @@ require __DIR__ . '/Header.php'; $helper->log('Load from Excel5 template'); -$reader = \PhpSpreadsheet\IOFactory::createReader('Excel5'); +$reader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader('Excel5'); $spreadsheet = $reader->load(__DIR__ . '/templates/30template.xls'); $helper->log('Add new data to the template'); @@ -21,7 +21,7 @@ $data = [['title' => 'Excel for dummies', ], ]; -$spreadsheet->getActiveSheet()->setCellValue('D1', \PhpSpreadsheet\Shared\Date::PHPToExcel(time())); +$spreadsheet->getActiveSheet()->setCellValue('D1', \PhpOffice\PhpSpreadsheet\Shared\Date::PHPToExcel(time())); $baseRow = 5; foreach ($data as $r => $dataRow) { diff --git a/samples/31_Document_properties_write.php b/samples/31_Document_properties_write.php index c1b5daf3..20bfac27 100644 --- a/samples/31_Document_properties_write.php +++ b/samples/31_Document_properties_write.php @@ -5,7 +5,7 @@ require __DIR__ . '/Header.php'; $inputFileType = 'Excel2007'; $inputFileName = __DIR__ . '/templates/31docproperties.xlsx'; -$spreadsheetReader = \PhpSpreadsheet\IOFactory::createReader($inputFileType); +$spreadsheetReader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader($inputFileType); $callStartTime = microtime(true); $spreadsheet = $spreadsheetReader->load($inputFileName); $helper->logRead($inputFileType, $inputFileName, $callStartTime); @@ -18,7 +18,7 @@ $spreadsheet->getProperties()->setTitle('Office 2007 XLSX Test Document') // Save Excel 2007 file $filename = $helper->getFilename(__FILE__); -$writer = \PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Excel2007'); +$writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Excel2007'); $callStartTime = microtime(true); $writer->save($filename); $helper->logWrite($writer, $filename, $callStartTime); @@ -28,7 +28,7 @@ $helper->logEndingNotes(); // Reread File $helper->log('Reread Excel2007 file'); -$spreadsheetRead = \PhpSpreadsheet\IOFactory::load($filename); +$spreadsheetRead = \PhpOffice\PhpSpreadsheet\IOFactory::load($filename); // Set properties $helper->log('Get properties'); @@ -53,9 +53,9 @@ $customProperties = $spreadsheet->getProperties()->getCustomProperties(); foreach ($customProperties as $customProperty) { $propertyValue = $spreadsheet->getProperties()->getCustomPropertyValue($customProperty); $propertyType = $spreadsheet->getProperties()->getCustomPropertyType($customProperty); - if ($propertyType == \PhpSpreadsheet\Document\Properties::PROPERTY_TYPE_DATE) { + if ($propertyType == \PhpOffice\PhpSpreadsheet\Document\Properties::PROPERTY_TYPE_DATE) { $formattedValue = date('d-M-Y H:i:s', $propertyValue); - } elseif ($propertyType == \PhpSpreadsheet\Document\Properties::PROPERTY_TYPE_BOOLEAN) { + } elseif ($propertyType == \PhpOffice\PhpSpreadsheet\Document\Properties::PROPERTY_TYPE_BOOLEAN) { $formattedValue = $propertyValue ? 'TRUE' : 'FALSE'; } else { $formattedValue = $propertyValue; diff --git a/samples/31_Document_properties_write_xls.php b/samples/31_Document_properties_write_xls.php index 25e750dd..dfdbef3b 100644 --- a/samples/31_Document_properties_write_xls.php +++ b/samples/31_Document_properties_write_xls.php @@ -5,7 +5,7 @@ require __DIR__ . '/Header.php'; $inputFileType = 'Excel5'; $inputFileName = __DIR__ . '/templates/31docproperties.xls'; -$spreadsheetReader = \PhpSpreadsheet\IOFactory::createReader($inputFileType); +$spreadsheetReader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader($inputFileType); $callStartTime = microtime(true); $spreadsheet = $spreadsheetReader->load($inputFileName); $helper->logRead($inputFileType, $inputFileName, $callStartTime); @@ -18,7 +18,7 @@ $spreadsheet->getProperties()->setTitle('Office 95 XLS Test Document') // Save Excel 95 file $filename = $helper->getFilename(__FILE__, 'xls'); -$writer = \PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Excel5'); +$writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Excel5'); $callStartTime = microtime(true); $writer->save($filename); $helper->logWrite($writer, $filename, $callStartTime); @@ -28,7 +28,7 @@ $helper->logEndingNotes(); // Reread File $helper->log('Reread Excel5 file'); -$spreadsheetRead = \PhpSpreadsheet\IOFactory::load($filename); +$spreadsheetRead = \PhpOffice\PhpSpreadsheet\IOFactory::load($filename); // Set properties $helper->log('Get properties'); @@ -53,9 +53,9 @@ $customProperties = $spreadsheet->getProperties()->getCustomProperties(); foreach ($customProperties as $customProperty) { $propertyValue = $spreadsheet->getProperties()->getCustomPropertyValue($customProperty); $propertyType = $spreadsheet->getProperties()->getCustomPropertyType($customProperty); - if ($propertyType == \PhpSpreadsheet\Document\Properties::PROPERTY_TYPE_DATE) { + if ($propertyType == \PhpOffice\PhpSpreadsheet\Document\Properties::PROPERTY_TYPE_DATE) { $formattedValue = date('d-M-Y H:i:s', $propertyValue); - } elseif ($propertyType == \PhpSpreadsheet\Document\Properties::PROPERTY_TYPE_BOOLEAN) { + } elseif ($propertyType == \PhpOffice\PhpSpreadsheet\Document\Properties::PROPERTY_TYPE_BOOLEAN) { $formattedValue = $propertyValue ? 'TRUE' : 'FALSE'; } else { $formattedValue = $propertyValue; diff --git a/samples/32_Chart_read_write.php b/samples/32_Chart_read_write.php index d98edbee..cbd11d61 100644 --- a/samples/32_Chart_read_write.php +++ b/samples/32_Chart_read_write.php @@ -20,7 +20,7 @@ foreach ($inputFileNames as $inputFileName) { $helper->log('File ' . $inputFileNameShort . ' does not exist'); continue; } - $reader = \PhpSpreadsheet\IOFactory::createReader($inputFileType); + $reader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader($inputFileType); $reader->setIncludeCharts(true); $callStartTime = microtime(true); $spreadsheet = $reader->load($inputFileName); @@ -69,7 +69,7 @@ foreach ($inputFileNames as $inputFileName) { } $outputFileName = $helper->getFilename($inputFileName); - $writer = \PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Excel2007'); + $writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Excel2007'); $writer->setIncludeCharts(true); $callStartTime = microtime(true); $writer->save($outputFileName); diff --git a/samples/32_Chart_read_write_HTML.php b/samples/32_Chart_read_write_HTML.php index c34caf5b..859cd38f 100644 --- a/samples/32_Chart_read_write_HTML.php +++ b/samples/32_Chart_read_write_HTML.php @@ -4,11 +4,11 @@ require __DIR__ . '/Header.php'; // Change these values to select the Rendering library that you wish to use // and its directory location on your server -$rendererName = PhpSpreadsheet\Settings::CHART_RENDERER_JPGRAPH; +$rendererName = \PhpOffice\PhpSpreadsheet\Settings::CHART_RENDERER_JPGRAPH; $rendererLibrary = 'jpgraph3.5.0b1/src/'; $rendererLibraryPath = '/php/libraries/Charts/' . $rendererLibrary; -if (!PhpSpreadsheet\Settings::setChartRenderer($rendererName, $rendererLibraryPath)) { +if (!\PhpOffice\PhpSpreadsheet\Settings::setChartRenderer($rendererName, $rendererLibraryPath)) { $helper->log('NOTICE: Please set the $rendererName and $rendererLibraryPath values at the top of this script as appropriate for your directory structure'); return; @@ -35,7 +35,7 @@ foreach ($inputFileNames as $inputFileName) { $helper->log("Load Test from $inputFileType file " . $inputFileNameShort); - $reader = \PhpSpreadsheet\IOFactory::createReader($inputFileType); + $reader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader($inputFileType); $reader->setIncludeCharts(true); $spreadsheet = $reader->load($inputFileName); @@ -83,7 +83,7 @@ foreach ($inputFileNames as $inputFileName) { // Save $filename = $helper->getFilename($inputFileName); - $writer = \PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'HTML'); + $writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'HTML'); $writer->setIncludeCharts(true); $callStartTime = microtime(true); $writer->save($filename); diff --git a/samples/32_Chart_read_write_PDF.php b/samples/32_Chart_read_write_PDF.php index 44496383..613f032c 100644 --- a/samples/32_Chart_read_write_PDF.php +++ b/samples/32_Chart_read_write_PDF.php @@ -4,15 +4,15 @@ require __DIR__ . '/Header.php'; // Change these values to select the Rendering library that you wish to use // for PDF files, and its directory location on your server -//$rendererName = PhpSpreadsheet\Settings::PDF_RENDERER_TCPDF; -$rendererName = PhpSpreadsheet\Settings::PDF_RENDERER_MPDF; -//$rendererName = PhpSpreadsheet\Settings::PDF_RENDERER_DOMPDF; +//$rendererName = \PhpOffice\PhpSpreadsheet\Settings::PDF_RENDERER_TCPDF; +$rendererName = \PhpOffice\PhpSpreadsheet\Settings::PDF_RENDERER_MPDF; +//$rendererName = \PhpOffice\PhpSpreadsheet\Settings::PDF_RENDERER_DOMPDF; //$rendererLibrary = 'tcPDF5.9'; $rendererLibrary = 'mPDF5.4'; //$rendererLibrary = 'domPDF0.6.0beta3'; $rendererLibraryPath = '/php/libraries/PDF/' . $rendererLibrary; -if (!PhpSpreadsheet\Settings::setPdfRenderer($rendererName, $rendererLibraryPath)) { +if (!\PhpOffice\PhpSpreadsheet\Settings::setPdfRenderer($rendererName, $rendererLibraryPath)) { $helper->log('NOTICE: Please set the $rendererName and $rendererLibraryPath values at the top of this script as appropriate for your directory structure'); return; @@ -20,11 +20,11 @@ if (!PhpSpreadsheet\Settings::setPdfRenderer($rendererName, $rendererLibraryPath // Change these values to select the Rendering library that you wish to use // for Chart images, and its directory location on your server -$rendererName = PhpSpreadsheet\Settings::CHART_RENDERER_JPGRAPH; +$rendererName = \PhpOffice\PhpSpreadsheet\Settings::CHART_RENDERER_JPGRAPH; $rendererLibrary = 'jpgraph3.5.0b1/src/'; $rendererLibraryPath = '/php/libraries/Charts/' . $rendererLibrary; -if (!PhpSpreadsheet\Settings::setChartRenderer($rendererName, $rendererLibraryPath)) { +if (!\PhpOffice\PhpSpreadsheet\Settings::setChartRenderer($rendererName, $rendererLibraryPath)) { $helper->log('NOTICE: Please set the $rendererName and $rendererLibraryPath values at the top of this script as appropriate for your directory structure'); return; @@ -51,7 +51,7 @@ foreach ($inputFileNames as $inputFileName) { $helper->log("Load Test from $inputFileType file " . $inputFileNameShort); - $reader = \PhpSpreadsheet\IOFactory::createReader($inputFileType); + $reader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader($inputFileType); $reader->setIncludeCharts(true); $spreadsheet = $reader->load($inputFileName); @@ -99,7 +99,7 @@ foreach ($inputFileNames as $inputFileName) { // Save $filename = $helper->getFilename($inputFileName); - $writer = \PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'PDF'); + $writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'PDF'); $writer->setIncludeCharts(true); $callStartTime = microtime(true); $writer->save($filename); diff --git a/samples/33_Chart_create_area.php b/samples/33_Chart_create_area.php index 614b8627..b19cf496 100644 --- a/samples/33_Chart_create_area.php +++ b/samples/33_Chart_create_area.php @@ -1,9 +1,9 @@ getActiveSheet(); $worksheet->fromArray( [ @@ -23,9 +23,9 @@ $worksheet->fromArray( // Data values // Data Marker $dataSeriesLabels = [ - new \PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$B$1', null, 1), // 2010 - new \PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$C$1', null, 1), // 2011 - new \PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$D$1', null, 1), // 2012 + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$B$1', null, 1), // 2010 + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$C$1', null, 1), // 2011 + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$D$1', null, 1), // 2012 ]; // Set the X-Axis Labels // Datatype @@ -35,7 +35,7 @@ $dataSeriesLabels = [ // Data values // Data Marker $xAxisTickValues = [ - new \PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$A$2:$A$5', null, 4), // Q1 to Q4 + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$A$2:$A$5', null, 4), // Q1 to Q4 ]; // Set the Data values for each data series we want to plot // Datatype @@ -45,15 +45,15 @@ $xAxisTickValues = [ // Data values // Data Marker $dataSeriesValues = [ - new \PhpSpreadsheet\Chart\DataSeriesValues('Number', 'Worksheet!$B$2:$B$5', null, 4), - new \PhpSpreadsheet\Chart\DataSeriesValues('Number', 'Worksheet!$C$2:$C$5', null, 4), - new \PhpSpreadsheet\Chart\DataSeriesValues('Number', 'Worksheet!$D$2:$D$5', null, 4), + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('Number', 'Worksheet!$B$2:$B$5', null, 4), + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('Number', 'Worksheet!$C$2:$C$5', null, 4), + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('Number', 'Worksheet!$D$2:$D$5', null, 4), ]; // Build the dataseries -$series = new \PhpSpreadsheet\Chart\DataSeries( - \PhpSpreadsheet\Chart\DataSeries::TYPE_AREACHART, // plotType - \PhpSpreadsheet\Chart\DataSeries::GROUPING_PERCENT_STACKED, // plotGrouping +$series = new \PhpOffice\PhpSpreadsheet\Chart\DataSeries( + \PhpOffice\PhpSpreadsheet\Chart\DataSeries::TYPE_AREACHART, // plotType + \PhpOffice\PhpSpreadsheet\Chart\DataSeries::GROUPING_PERCENT_STACKED, // plotGrouping range(0, count($dataSeriesValues) - 1), // plotOrder $dataSeriesLabels, // plotLabel $xAxisTickValues, // plotCategory @@ -61,15 +61,15 @@ $series = new \PhpSpreadsheet\Chart\DataSeries( ); // Set the series in the plot area -$plotArea = new \PhpSpreadsheet\Chart\PlotArea(null, [$series]); +$plotArea = new \PhpOffice\PhpSpreadsheet\Chart\PlotArea(null, [$series]); // Set the chart legend -$legend = new \PhpSpreadsheet\Chart\Legend(\PhpSpreadsheet\Chart\Legend::POSITION_TOPRIGHT, null, false); +$legend = new \PhpOffice\PhpSpreadsheet\Chart\Legend(\PhpOffice\PhpSpreadsheet\Chart\Legend::POSITION_TOPRIGHT, null, false); -$title = new \PhpSpreadsheet\Chart\Title('Test %age-Stacked Area Chart'); -$yAxisLabel = new \PhpSpreadsheet\Chart\Title('Value ($k)'); +$title = new \PhpOffice\PhpSpreadsheet\Chart\Title('Test %age-Stacked Area Chart'); +$yAxisLabel = new \PhpOffice\PhpSpreadsheet\Chart\Title('Value ($k)'); // Create the chart -$chart = new \PhpSpreadsheet\Chart( +$chart = new \PhpOffice\PhpSpreadsheet\Chart( 'chart1', // name $title, // title $legend, // legend @@ -89,7 +89,7 @@ $worksheet->addChart($chart); // Save Excel 2007 file $filename = $helper->getFilename(__FILE__); -$writer = \PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Excel2007'); +$writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Excel2007'); $writer->setIncludeCharts(true); $callStartTime = microtime(true); $writer->save($filename); diff --git a/samples/33_Chart_create_bar.php b/samples/33_Chart_create_bar.php index 7842dc32..76c10aa2 100644 --- a/samples/33_Chart_create_bar.php +++ b/samples/33_Chart_create_bar.php @@ -1,13 +1,13 @@ getFilename(__FILE__); -$writer = \PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Excel2007'); +$writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Excel2007'); $writer->setIncludeCharts(true); $callStartTime = microtime(true); $writer->save($filename); diff --git a/samples/33_Chart_create_bar_stacked.php b/samples/33_Chart_create_bar_stacked.php index b1b62eb5..6f84a483 100644 --- a/samples/33_Chart_create_bar_stacked.php +++ b/samples/33_Chart_create_bar_stacked.php @@ -1,9 +1,9 @@ getActiveSheet(); $worksheet->fromArray( [ @@ -23,9 +23,9 @@ $worksheet->fromArray( // Data values // Data Marker $dataSeriesLabels = [ - new \PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$B$1', null, 1), // 2010 - new \PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$C$1', null, 1), // 2011 - new \PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$D$1', null, 1), // 2012 + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$B$1', null, 1), // 2010 + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$C$1', null, 1), // 2011 + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$D$1', null, 1), // 2012 ]; // Set the X-Axis Labels // Datatype @@ -35,7 +35,7 @@ $dataSeriesLabels = [ // Data values // Data Marker $xAxisTickValues = [ - new \PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$A$2:$A$5', null, 4), // Q1 to Q4 + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$A$2:$A$5', null, 4), // Q1 to Q4 ]; // Set the Data values for each data series we want to plot // Datatype @@ -45,15 +45,15 @@ $xAxisTickValues = [ // Data values // Data Marker $dataSeriesValues = [ - new \PhpSpreadsheet\Chart\DataSeriesValues('Number', 'Worksheet!$B$2:$B$5', null, 4), - new \PhpSpreadsheet\Chart\DataSeriesValues('Number', 'Worksheet!$C$2:$C$5', null, 4), - new \PhpSpreadsheet\Chart\DataSeriesValues('Number', 'Worksheet!$D$2:$D$5', null, 4), + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('Number', 'Worksheet!$B$2:$B$5', null, 4), + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('Number', 'Worksheet!$C$2:$C$5', null, 4), + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('Number', 'Worksheet!$D$2:$D$5', null, 4), ]; // Build the dataseries -$series = new \PhpSpreadsheet\Chart\DataSeries( - \PhpSpreadsheet\Chart\DataSeries::TYPE_BARCHART, // plotType - \PhpSpreadsheet\Chart\DataSeries::GROUPING_STACKED, // plotGrouping +$series = new \PhpOffice\PhpSpreadsheet\Chart\DataSeries( + \PhpOffice\PhpSpreadsheet\Chart\DataSeries::TYPE_BARCHART, // plotType + \PhpOffice\PhpSpreadsheet\Chart\DataSeries::GROUPING_STACKED, // plotGrouping range(0, count($dataSeriesValues) - 1), // plotOrder $dataSeriesLabels, // plotLabel $xAxisTickValues, // plotCategory @@ -61,18 +61,18 @@ $series = new \PhpSpreadsheet\Chart\DataSeries( ); // Set additional dataseries parameters // Make it a horizontal bar rather than a vertical column graph -$series->setPlotDirection(\PhpSpreadsheet\Chart\DataSeries::DIRECTION_BAR); +$series->setPlotDirection(\PhpOffice\PhpSpreadsheet\Chart\DataSeries::DIRECTION_BAR); // Set the series in the plot area -$plotArea = new \PhpSpreadsheet\Chart\PlotArea(null, [$series]); +$plotArea = new \PhpOffice\PhpSpreadsheet\Chart\PlotArea(null, [$series]); // Set the chart legend -$legend = new \PhpSpreadsheet\Chart\Legend(\PhpSpreadsheet\Chart\Legend::POSITION_RIGHT, null, false); +$legend = new \PhpOffice\PhpSpreadsheet\Chart\Legend(\PhpOffice\PhpSpreadsheet\Chart\Legend::POSITION_RIGHT, null, false); -$title = new \PhpSpreadsheet\Chart\Title('Test Chart'); -$yAxisLabel = new \PhpSpreadsheet\Chart\Title('Value ($k)'); +$title = new \PhpOffice\PhpSpreadsheet\Chart\Title('Test Chart'); +$yAxisLabel = new \PhpOffice\PhpSpreadsheet\Chart\Title('Value ($k)'); // Create the chart -$chart = new \PhpSpreadsheet\Chart( +$chart = new \PhpOffice\PhpSpreadsheet\Chart( 'chart1', // name $title, // title $legend, // legend @@ -92,7 +92,7 @@ $worksheet->addChart($chart); // Save Excel 2007 file $filename = $helper->getFilename(__FILE__); -$writer = \PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Excel2007'); +$writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Excel2007'); $writer->setIncludeCharts(true); $callStartTime = microtime(true); $writer->save($filename); diff --git a/samples/33_Chart_create_column.php b/samples/33_Chart_create_column.php index 6bec5bcb..57b00db0 100644 --- a/samples/33_Chart_create_column.php +++ b/samples/33_Chart_create_column.php @@ -1,9 +1,9 @@ getActiveSheet(); $worksheet->fromArray( [ @@ -23,9 +23,9 @@ $worksheet->fromArray( // Data values // Data Marker $dataSeriesLabels = [ - new \PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$B$1', null, 1), // 2010 - new \PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$C$1', null, 1), // 2011 - new \PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$D$1', null, 1), // 2012 + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$B$1', null, 1), // 2010 + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$C$1', null, 1), // 2011 + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$D$1', null, 1), // 2012 ]; // Set the X-Axis Labels // Datatype @@ -35,7 +35,7 @@ $dataSeriesLabels = [ // Data values // Data Marker $xAxisTickValues = [ - new \PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$A$2:$A$5', null, 4), // Q1 to Q4 + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$A$2:$A$5', null, 4), // Q1 to Q4 ]; // Set the Data values for each data series we want to plot // Datatype @@ -45,15 +45,15 @@ $xAxisTickValues = [ // Data values // Data Marker $dataSeriesValues = [ - new \PhpSpreadsheet\Chart\DataSeriesValues('Number', 'Worksheet!$B$2:$B$5', null, 4), - new \PhpSpreadsheet\Chart\DataSeriesValues('Number', 'Worksheet!$C$2:$C$5', null, 4), - new \PhpSpreadsheet\Chart\DataSeriesValues('Number', 'Worksheet!$D$2:$D$5', null, 4), + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('Number', 'Worksheet!$B$2:$B$5', null, 4), + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('Number', 'Worksheet!$C$2:$C$5', null, 4), + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('Number', 'Worksheet!$D$2:$D$5', null, 4), ]; // Build the dataseries -$series = new \PhpSpreadsheet\Chart\DataSeries( - \PhpSpreadsheet\Chart\DataSeries::TYPE_BARCHART, // plotType - \PhpSpreadsheet\Chart\DataSeries::GROUPING_STANDARD, // plotGrouping +$series = new \PhpOffice\PhpSpreadsheet\Chart\DataSeries( + \PhpOffice\PhpSpreadsheet\Chart\DataSeries::TYPE_BARCHART, // plotType + \PhpOffice\PhpSpreadsheet\Chart\DataSeries::GROUPING_STANDARD, // plotGrouping range(0, count($dataSeriesValues) - 1), // plotOrder $dataSeriesLabels, // plotLabel $xAxisTickValues, // plotCategory @@ -61,18 +61,18 @@ $series = new \PhpSpreadsheet\Chart\DataSeries( ); // Set additional dataseries parameters // Make it a vertical column rather than a horizontal bar graph -$series->setPlotDirection(\PhpSpreadsheet\Chart\DataSeries::DIRECTION_COL); +$series->setPlotDirection(\PhpOffice\PhpSpreadsheet\Chart\DataSeries::DIRECTION_COL); // Set the series in the plot area -$plotArea = new \PhpSpreadsheet\Chart\PlotArea(null, [$series]); +$plotArea = new \PhpOffice\PhpSpreadsheet\Chart\PlotArea(null, [$series]); // Set the chart legend -$legend = new \PhpSpreadsheet\Chart\Legend(\PhpSpreadsheet\Chart\Legend::POSITION_RIGHT, null, false); +$legend = new \PhpOffice\PhpSpreadsheet\Chart\Legend(\PhpOffice\PhpSpreadsheet\Chart\Legend::POSITION_RIGHT, null, false); -$title = new \PhpSpreadsheet\Chart\Title('Test Column Chart'); -$yAxisLabel = new \PhpSpreadsheet\Chart\Title('Value ($k)'); +$title = new \PhpOffice\PhpSpreadsheet\Chart\Title('Test Column Chart'); +$yAxisLabel = new \PhpOffice\PhpSpreadsheet\Chart\Title('Value ($k)'); // Create the chart -$chart = new \PhpSpreadsheet\Chart( +$chart = new \PhpOffice\PhpSpreadsheet\Chart( 'chart1', // name $title, // title $legend, // legend @@ -92,7 +92,7 @@ $worksheet->addChart($chart); // Save Excel 2007 file $filename = $helper->getFilename(__FILE__); -$writer = \PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Excel2007'); +$writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Excel2007'); $writer->setIncludeCharts(true); $callStartTime = microtime(true); $writer->save($filename); diff --git a/samples/33_Chart_create_column_2.php b/samples/33_Chart_create_column_2.php index 2d64cc7e..5df2fb30 100644 --- a/samples/33_Chart_create_column_2.php +++ b/samples/33_Chart_create_column_2.php @@ -1,9 +1,9 @@ getActiveSheet(); $worksheet->fromArray( [ @@ -31,9 +31,9 @@ $worksheet->fromArray( // Data values // Data Marker $dataSeriesLabels = [ - new \PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$C$1', null, 1), // 'Budget' - new \PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$D$1', null, 1), // 'Forecast' - new \PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$E$1', null, 1), // 'Actual' + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$C$1', null, 1), // 'Budget' + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$D$1', null, 1), // 'Forecast' + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$E$1', null, 1), // 'Actual' ]; // Set the X-Axis Labels // Datatype @@ -43,7 +43,7 @@ $dataSeriesLabels = [ // Data values // Data Marker $xAxisTickValues = [ - new \PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$A$2:$B$13', null, 12), // Q1 to Q4 for 2010 to 2012 + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$A$2:$B$13', null, 12), // Q1 to Q4 for 2010 to 2012 ]; // Set the Data values for each data series we want to plot // Datatype @@ -53,15 +53,15 @@ $xAxisTickValues = [ // Data values // Data Marker $dataSeriesValues = [ - new \PhpSpreadsheet\Chart\DataSeriesValues('Number', 'Worksheet!$C$2:$C$13', null, 12), - new \PhpSpreadsheet\Chart\DataSeriesValues('Number', 'Worksheet!$D$2:$D$13', null, 12), - new \PhpSpreadsheet\Chart\DataSeriesValues('Number', 'Worksheet!$E$2:$E$13', null, 12), + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('Number', 'Worksheet!$C$2:$C$13', null, 12), + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('Number', 'Worksheet!$D$2:$D$13', null, 12), + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('Number', 'Worksheet!$E$2:$E$13', null, 12), ]; // Build the dataseries -$series = new \PhpSpreadsheet\Chart\DataSeries( - \PhpSpreadsheet\Chart\DataSeries::TYPE_BARCHART, // plotType - \PhpSpreadsheet\Chart\DataSeries::GROUPING_CLUSTERED, // plotGrouping +$series = new \PhpOffice\PhpSpreadsheet\Chart\DataSeries( + \PhpOffice\PhpSpreadsheet\Chart\DataSeries::TYPE_BARCHART, // plotType + \PhpOffice\PhpSpreadsheet\Chart\DataSeries::GROUPING_CLUSTERED, // plotGrouping range(0, count($dataSeriesValues) - 1), // plotOrder $dataSeriesLabels, // plotLabel $xAxisTickValues, // plotCategory @@ -69,19 +69,19 @@ $series = new \PhpSpreadsheet\Chart\DataSeries( ); // Set additional dataseries parameters // Make it a vertical column rather than a horizontal bar graph -$series->setPlotDirection(\PhpSpreadsheet\Chart\DataSeries::DIRECTION_COL); +$series->setPlotDirection(\PhpOffice\PhpSpreadsheet\Chart\DataSeries::DIRECTION_COL); // Set the series in the plot area -$plotArea = new \PhpSpreadsheet\Chart\PlotArea(null, [$series]); +$plotArea = new \PhpOffice\PhpSpreadsheet\Chart\PlotArea(null, [$series]); // Set the chart legend -$legend = new \PhpSpreadsheet\Chart\Legend(\PhpSpreadsheet\Chart\Legend::POSITION_BOTTOM, null, false); +$legend = new \PhpOffice\PhpSpreadsheet\Chart\Legend(\PhpOffice\PhpSpreadsheet\Chart\Legend::POSITION_BOTTOM, null, false); -$title = new \PhpSpreadsheet\Chart\Title('Test Grouped Column Chart'); -$xAxisLabel = new \PhpSpreadsheet\Chart\Title('Financial Period'); -$yAxisLabel = new \PhpSpreadsheet\Chart\Title('Value ($k)'); +$title = new \PhpOffice\PhpSpreadsheet\Chart\Title('Test Grouped Column Chart'); +$xAxisLabel = new \PhpOffice\PhpSpreadsheet\Chart\Title('Financial Period'); +$yAxisLabel = new \PhpOffice\PhpSpreadsheet\Chart\Title('Value ($k)'); // Create the chart -$chart = new \PhpSpreadsheet\Chart( +$chart = new \PhpOffice\PhpSpreadsheet\Chart( 'chart1', // name $title, // title $legend, // legend @@ -101,7 +101,7 @@ $worksheet->addChart($chart); // Save Excel 2007 file $filename = $helper->getFilename(__FILE__); -$writer = \PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Excel2007'); +$writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Excel2007'); $writer->setIncludeCharts(true); $callStartTime = microtime(true); $writer->save($filename); diff --git a/samples/33_Chart_create_composite.php b/samples/33_Chart_create_composite.php index f55b3cc9..af801d8d 100644 --- a/samples/33_Chart_create_composite.php +++ b/samples/33_Chart_create_composite.php @@ -1,9 +1,9 @@ getActiveSheet(); $worksheet->fromArray( [ @@ -31,13 +31,13 @@ $worksheet->fromArray( // Data values // Data Marker $dataSeriesLabels1 = [ - new \PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$B$1', null, 1), // Temperature + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$B$1', null, 1), // Temperature ]; $dataSeriesLabels2 = [ - new \PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$C$1', null, 1), // Rainfall + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$C$1', null, 1), // Rainfall ]; $dataSeriesLabels3 = [ - new \PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$D$1', null, 1), // Humidity + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$D$1', null, 1), // Humidity ]; // Set the X-Axis Labels @@ -48,7 +48,7 @@ $dataSeriesLabels3 = [ // Data values // Data Marker $xAxisTickValues = [ - new \PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$A$2:$A$13', null, 12), // Jan to Dec + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$A$2:$A$13', null, 12), // Jan to Dec ]; // Set the Data values for each data series we want to plot @@ -59,13 +59,13 @@ $xAxisTickValues = [ // Data values // Data Marker $dataSeriesValues1 = [ - new \PhpSpreadsheet\Chart\DataSeriesValues('Number', 'Worksheet!$B$2:$B$13', null, 12), + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('Number', 'Worksheet!$B$2:$B$13', null, 12), ]; // Build the dataseries -$series1 = new \PhpSpreadsheet\Chart\DataSeries( - \PhpSpreadsheet\Chart\DataSeries::TYPE_BARCHART, // plotType - \PhpSpreadsheet\Chart\DataSeries::GROUPING_CLUSTERED, // plotGrouping +$series1 = new \PhpOffice\PhpSpreadsheet\Chart\DataSeries( + \PhpOffice\PhpSpreadsheet\Chart\DataSeries::TYPE_BARCHART, // plotType + \PhpOffice\PhpSpreadsheet\Chart\DataSeries::GROUPING_CLUSTERED, // plotGrouping range(0, count($dataSeriesValues1) - 1), // plotOrder $dataSeriesLabels1, // plotLabel $xAxisTickValues, // plotCategory @@ -73,7 +73,7 @@ $series1 = new \PhpSpreadsheet\Chart\DataSeries( ); // Set additional dataseries parameters // Make it a vertical column rather than a horizontal bar graph -$series1->setPlotDirection(\PhpSpreadsheet\Chart\DataSeries::DIRECTION_COL); +$series1->setPlotDirection(\PhpOffice\PhpSpreadsheet\Chart\DataSeries::DIRECTION_COL); // Set the Data values for each data series we want to plot // Datatype @@ -83,13 +83,13 @@ $series1->setPlotDirection(\PhpSpreadsheet\Chart\DataSeries::DIRECTION_COL); // Data values // Data Marker $dataSeriesValues2 = [ - new \PhpSpreadsheet\Chart\DataSeriesValues('Number', 'Worksheet!$C$2:$C$13', null, 12), + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('Number', 'Worksheet!$C$2:$C$13', null, 12), ]; // Build the dataseries -$series2 = new \PhpSpreadsheet\Chart\DataSeries( - \PhpSpreadsheet\Chart\DataSeries::TYPE_LINECHART, // plotType - \PhpSpreadsheet\Chart\DataSeries::GROUPING_STANDARD, // plotGrouping +$series2 = new \PhpOffice\PhpSpreadsheet\Chart\DataSeries( + \PhpOffice\PhpSpreadsheet\Chart\DataSeries::TYPE_LINECHART, // plotType + \PhpOffice\PhpSpreadsheet\Chart\DataSeries::GROUPING_STANDARD, // plotGrouping range(0, count($dataSeriesValues2) - 1), // plotOrder $dataSeriesLabels2, // plotLabel null, // plotCategory @@ -104,13 +104,13 @@ $series2 = new \PhpSpreadsheet\Chart\DataSeries( // Data values // Data Marker $dataSeriesValues3 = [ - new \PhpSpreadsheet\Chart\DataSeriesValues('Number', 'Worksheet!$D$2:$D$13', null, 12), + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('Number', 'Worksheet!$D$2:$D$13', null, 12), ]; // Build the dataseries -$series3 = new \PhpSpreadsheet\Chart\DataSeries( - \PhpSpreadsheet\Chart\DataSeries::TYPE_AREACHART, // plotType - \PhpSpreadsheet\Chart\DataSeries::GROUPING_STANDARD, // plotGrouping +$series3 = new \PhpOffice\PhpSpreadsheet\Chart\DataSeries( + \PhpOffice\PhpSpreadsheet\Chart\DataSeries::TYPE_AREACHART, // plotType + \PhpOffice\PhpSpreadsheet\Chart\DataSeries::GROUPING_STANDARD, // plotGrouping range(0, count($dataSeriesValues2) - 1), // plotOrder $dataSeriesLabels3, // plotLabel null, // plotCategory @@ -118,14 +118,14 @@ $series3 = new \PhpSpreadsheet\Chart\DataSeries( ); // Set the series in the plot area -$plotArea = new \PhpSpreadsheet\Chart\PlotArea(null, [$series1, $series2, $series3]); +$plotArea = new \PhpOffice\PhpSpreadsheet\Chart\PlotArea(null, [$series1, $series2, $series3]); // Set the chart legend -$legend = new \PhpSpreadsheet\Chart\Legend(\PhpSpreadsheet\Chart\Legend::POSITION_RIGHT, null, false); +$legend = new \PhpOffice\PhpSpreadsheet\Chart\Legend(\PhpOffice\PhpSpreadsheet\Chart\Legend::POSITION_RIGHT, null, false); -$title = new \PhpSpreadsheet\Chart\Title('Average Weather Chart for Crete'); +$title = new \PhpOffice\PhpSpreadsheet\Chart\Title('Average Weather Chart for Crete'); // Create the chart -$chart = new \PhpSpreadsheet\Chart( +$chart = new \PhpOffice\PhpSpreadsheet\Chart( 'chart1', // name $title, // title $legend, // legend @@ -145,7 +145,7 @@ $worksheet->addChart($chart); // Save Excel 2007 file $filename = $helper->getFilename(__FILE__); -$writer = \PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Excel2007'); +$writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Excel2007'); $writer->setIncludeCharts(true); $callStartTime = microtime(true); $writer->save($filename); diff --git a/samples/33_Chart_create_line.php b/samples/33_Chart_create_line.php index 78254a6f..5b2fc06c 100644 --- a/samples/33_Chart_create_line.php +++ b/samples/33_Chart_create_line.php @@ -1,9 +1,9 @@ getActiveSheet(); $worksheet->fromArray( [ @@ -23,9 +23,9 @@ $worksheet->fromArray( // Data values // Data Marker $dataSeriesLabels = [ - new \PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$B$1', null, 1), // 2010 - new \PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$C$1', null, 1), // 2011 - new \PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$D$1', null, 1), // 2012 + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$B$1', null, 1), // 2010 + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$C$1', null, 1), // 2011 + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$D$1', null, 1), // 2012 ]; // Set the X-Axis Labels // Datatype @@ -35,7 +35,7 @@ $dataSeriesLabels = [ // Data values // Data Marker $xAxisTickValues = [ - new \PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$A$2:$A$5', null, 4), // Q1 to Q4 + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$A$2:$A$5', null, 4), // Q1 to Q4 ]; // Set the Data values for each data series we want to plot // Datatype @@ -45,15 +45,15 @@ $xAxisTickValues = [ // Data values // Data Marker $dataSeriesValues = [ - new \PhpSpreadsheet\Chart\DataSeriesValues('Number', 'Worksheet!$B$2:$B$5', null, 4), - new \PhpSpreadsheet\Chart\DataSeriesValues('Number', 'Worksheet!$C$2:$C$5', null, 4), - new \PhpSpreadsheet\Chart\DataSeriesValues('Number', 'Worksheet!$D$2:$D$5', null, 4), + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('Number', 'Worksheet!$B$2:$B$5', null, 4), + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('Number', 'Worksheet!$C$2:$C$5', null, 4), + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('Number', 'Worksheet!$D$2:$D$5', null, 4), ]; // Build the dataseries -$series = new \PhpSpreadsheet\Chart\DataSeries( - \PhpSpreadsheet\Chart\DataSeries::TYPE_LINECHART, // plotType - \PhpSpreadsheet\Chart\DataSeries::GROUPING_STACKED, // plotGrouping +$series = new \PhpOffice\PhpSpreadsheet\Chart\DataSeries( + \PhpOffice\PhpSpreadsheet\Chart\DataSeries::TYPE_LINECHART, // plotType + \PhpOffice\PhpSpreadsheet\Chart\DataSeries::GROUPING_STACKED, // plotGrouping range(0, count($dataSeriesValues) - 1), // plotOrder $dataSeriesLabels, // plotLabel $xAxisTickValues, // plotCategory @@ -61,15 +61,15 @@ $series = new \PhpSpreadsheet\Chart\DataSeries( ); // Set the series in the plot area -$plotArea = new \PhpSpreadsheet\Chart\PlotArea(null, [$series]); +$plotArea = new \PhpOffice\PhpSpreadsheet\Chart\PlotArea(null, [$series]); // Set the chart legend -$legend = new \PhpSpreadsheet\Chart\Legend(\PhpSpreadsheet\Chart\Legend::POSITION_TOPRIGHT, null, false); +$legend = new \PhpOffice\PhpSpreadsheet\Chart\Legend(\PhpOffice\PhpSpreadsheet\Chart\Legend::POSITION_TOPRIGHT, null, false); -$title = new \PhpSpreadsheet\Chart\Title('Test Stacked Line Chart'); -$yAxisLabel = new \PhpSpreadsheet\Chart\Title('Value ($k)'); +$title = new \PhpOffice\PhpSpreadsheet\Chart\Title('Test Stacked Line Chart'); +$yAxisLabel = new \PhpOffice\PhpSpreadsheet\Chart\Title('Value ($k)'); // Create the chart -$chart = new \PhpSpreadsheet\Chart( +$chart = new \PhpOffice\PhpSpreadsheet\Chart( 'chart1', // name $title, // title $legend, // legend @@ -89,7 +89,7 @@ $worksheet->addChart($chart); // Save Excel 2007 file $filename = $helper->getFilename(__FILE__); -$writer = \PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Excel2007'); +$writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Excel2007'); $writer->setIncludeCharts(true); $callStartTime = microtime(true); $writer->save($filename); diff --git a/samples/33_Chart_create_multiple_charts.php b/samples/33_Chart_create_multiple_charts.php index 9edd5b79..fd6ed83c 100644 --- a/samples/33_Chart_create_multiple_charts.php +++ b/samples/33_Chart_create_multiple_charts.php @@ -1,9 +1,9 @@ getActiveSheet(); $worksheet->fromArray( [ @@ -23,9 +23,9 @@ $worksheet->fromArray( // Data values // Data Marker $dataSeriesLabels1 = [ - new \PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$B$1', null, 1), // 2010 - new \PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$C$1', null, 1), // 2011 - new \PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$D$1', null, 1), // 2012 + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$B$1', null, 1), // 2010 + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$C$1', null, 1), // 2011 + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$D$1', null, 1), // 2012 ]; // Set the X-Axis Labels // Datatype @@ -35,7 +35,7 @@ $dataSeriesLabels1 = [ // Data values // Data Marker $xAxisTickValues1 = [ - new \PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$A$2:$A$5', null, 4), // Q1 to Q4 + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$A$2:$A$5', null, 4), // Q1 to Q4 ]; // Set the Data values for each data series we want to plot // Datatype @@ -45,15 +45,15 @@ $xAxisTickValues1 = [ // Data values // Data Marker $dataSeriesValues1 = [ - new \PhpSpreadsheet\Chart\DataSeriesValues('Number', 'Worksheet!$B$2:$B$5', null, 4), - new \PhpSpreadsheet\Chart\DataSeriesValues('Number', 'Worksheet!$C$2:$C$5', null, 4), - new \PhpSpreadsheet\Chart\DataSeriesValues('Number', 'Worksheet!$D$2:$D$5', null, 4), + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('Number', 'Worksheet!$B$2:$B$5', null, 4), + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('Number', 'Worksheet!$C$2:$C$5', null, 4), + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('Number', 'Worksheet!$D$2:$D$5', null, 4), ]; // Build the dataseries -$series1 = new \PhpSpreadsheet\Chart\DataSeries( - \PhpSpreadsheet\Chart\DataSeries::TYPE_AREACHART, // plotType - \PhpSpreadsheet\Chart\DataSeries::GROUPING_PERCENT_STACKED, // plotGrouping +$series1 = new \PhpOffice\PhpSpreadsheet\Chart\DataSeries( + \PhpOffice\PhpSpreadsheet\Chart\DataSeries::TYPE_AREACHART, // plotType + \PhpOffice\PhpSpreadsheet\Chart\DataSeries::GROUPING_PERCENT_STACKED, // plotGrouping range(0, count($dataSeriesValues1) - 1), // plotOrder $dataSeriesLabels1, // plotLabel $xAxisTickValues1, // plotCategory @@ -61,15 +61,15 @@ $series1 = new \PhpSpreadsheet\Chart\DataSeries( ); // Set the series in the plot area -$plotArea1 = new \PhpSpreadsheet\Chart\PlotArea(null, [$series1]); +$plotArea1 = new \PhpOffice\PhpSpreadsheet\Chart\PlotArea(null, [$series1]); // Set the chart legend -$legend1 = new \PhpSpreadsheet\Chart\Legend(\PhpSpreadsheet\Chart\Legend::POSITION_TOPRIGHT, null, false); +$legend1 = new \PhpOffice\PhpSpreadsheet\Chart\Legend(\PhpOffice\PhpSpreadsheet\Chart\Legend::POSITION_TOPRIGHT, null, false); -$title1 = new \PhpSpreadsheet\Chart\Title('Test %age-Stacked Area Chart'); -$yAxisLabel1 = new \PhpSpreadsheet\Chart\Title('Value ($k)'); +$title1 = new \PhpOffice\PhpSpreadsheet\Chart\Title('Test %age-Stacked Area Chart'); +$yAxisLabel1 = new \PhpOffice\PhpSpreadsheet\Chart\Title('Value ($k)'); // Create the chart -$chart1 = new \PhpSpreadsheet\Chart( +$chart1 = new \PhpOffice\PhpSpreadsheet\Chart( 'chart1', // name $title1, // title $legend1, // legend @@ -95,9 +95,9 @@ $worksheet->addChart($chart1); // Data values // Data Marker $dataSeriesLabels2 = [ - new \PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$B$1', null, 1), // 2010 - new \PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$C$1', null, 1), // 2011 - new \PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$D$1', null, 1), // 2012 + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$B$1', null, 1), // 2010 + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$C$1', null, 1), // 2011 + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$D$1', null, 1), // 2012 ]; // Set the X-Axis Labels // Datatype @@ -107,7 +107,7 @@ $dataSeriesLabels2 = [ // Data values // Data Marker $xAxisTickValues2 = [ - new \PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$A$2:$A$5', null, 4), // Q1 to Q4 + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$A$2:$A$5', null, 4), // Q1 to Q4 ]; // Set the Data values for each data series we want to plot // Datatype @@ -117,15 +117,15 @@ $xAxisTickValues2 = [ // Data values // Data Marker $dataSeriesValues2 = [ - new \PhpSpreadsheet\Chart\DataSeriesValues('Number', 'Worksheet!$B$2:$B$5', null, 4), - new \PhpSpreadsheet\Chart\DataSeriesValues('Number', 'Worksheet!$C$2:$C$5', null, 4), - new \PhpSpreadsheet\Chart\DataSeriesValues('Number', 'Worksheet!$D$2:$D$5', null, 4), + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('Number', 'Worksheet!$B$2:$B$5', null, 4), + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('Number', 'Worksheet!$C$2:$C$5', null, 4), + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('Number', 'Worksheet!$D$2:$D$5', null, 4), ]; // Build the dataseries -$series2 = new \PhpSpreadsheet\Chart\DataSeries( - \PhpSpreadsheet\Chart\DataSeries::TYPE_BARCHART, // plotType - \PhpSpreadsheet\Chart\DataSeries::GROUPING_STANDARD, // plotGrouping +$series2 = new \PhpOffice\PhpSpreadsheet\Chart\DataSeries( + \PhpOffice\PhpSpreadsheet\Chart\DataSeries::TYPE_BARCHART, // plotType + \PhpOffice\PhpSpreadsheet\Chart\DataSeries::GROUPING_STANDARD, // plotGrouping range(0, count($dataSeriesValues2) - 1), // plotOrder $dataSeriesLabels2, // plotLabel $xAxisTickValues2, // plotCategory @@ -133,18 +133,18 @@ $series2 = new \PhpSpreadsheet\Chart\DataSeries( ); // Set additional dataseries parameters // Make it a vertical column rather than a horizontal bar graph -$series2->setPlotDirection(\PhpSpreadsheet\Chart\DataSeries::DIRECTION_COL); +$series2->setPlotDirection(\PhpOffice\PhpSpreadsheet\Chart\DataSeries::DIRECTION_COL); // Set the series in the plot area -$plotArea2 = new \PhpSpreadsheet\Chart\PlotArea(null, [$series2]); +$plotArea2 = new \PhpOffice\PhpSpreadsheet\Chart\PlotArea(null, [$series2]); // Set the chart legend -$legend2 = new \PhpSpreadsheet\Chart\Legend(\PhpSpreadsheet\Chart\Legend::POSITION_RIGHT, null, false); +$legend2 = new \PhpOffice\PhpSpreadsheet\Chart\Legend(\PhpOffice\PhpSpreadsheet\Chart\Legend::POSITION_RIGHT, null, false); -$title2 = new \PhpSpreadsheet\Chart\Title('Test Column Chart'); -$yAxisLabel2 = new \PhpSpreadsheet\Chart\Title('Value ($k)'); +$title2 = new \PhpOffice\PhpSpreadsheet\Chart\Title('Test Column Chart'); +$yAxisLabel2 = new \PhpOffice\PhpSpreadsheet\Chart\Title('Value ($k)'); // Create the chart -$chart2 = new \PhpSpreadsheet\Chart( +$chart2 = new \PhpOffice\PhpSpreadsheet\Chart( 'chart2', // name $title2, // title $legend2, // legend @@ -164,7 +164,7 @@ $worksheet->addChart($chart2); // Save Excel 2007 file $filename = $helper->getFilename(__FILE__); -$writer = \PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Excel2007'); +$writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Excel2007'); $writer->setIncludeCharts(true); $callStartTime = microtime(true); $writer->save($filename); diff --git a/samples/33_Chart_create_pie.php b/samples/33_Chart_create_pie.php index f792adf3..6ee0aa1e 100644 --- a/samples/33_Chart_create_pie.php +++ b/samples/33_Chart_create_pie.php @@ -1,9 +1,9 @@ getActiveSheet(); $worksheet->fromArray( [ @@ -23,7 +23,7 @@ $worksheet->fromArray( // Data values // Data Marker $dataSeriesLabels1 = [ - new \PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$C$1', null, 1), // 2011 + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$C$1', null, 1), // 2011 ]; // Set the X-Axis Labels // Datatype @@ -33,7 +33,7 @@ $dataSeriesLabels1 = [ // Data values // Data Marker $xAxisTickValues1 = [ - new \PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$A$2:$A$5', null, 4), // Q1 to Q4 + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$A$2:$A$5', null, 4), // Q1 to Q4 ]; // Set the Data values for each data series we want to plot // Datatype @@ -43,12 +43,12 @@ $xAxisTickValues1 = [ // Data values // Data Marker $dataSeriesValues1 = [ - new \PhpSpreadsheet\Chart\DataSeriesValues('Number', 'Worksheet!$C$2:$C$5', null, 4), + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('Number', 'Worksheet!$C$2:$C$5', null, 4), ]; // Build the dataseries -$series1 = new \PhpSpreadsheet\Chart\DataSeries( - \PhpSpreadsheet\Chart\DataSeries::TYPE_PIECHART, // plotType +$series1 = new \PhpOffice\PhpSpreadsheet\Chart\DataSeries( + \PhpOffice\PhpSpreadsheet\Chart\DataSeries::TYPE_PIECHART, // plotType null, // plotGrouping (Pie charts don't have any grouping) range(0, count($dataSeriesValues1) - 1), // plotOrder $dataSeriesLabels1, // plotLabel @@ -57,19 +57,19 @@ $series1 = new \PhpSpreadsheet\Chart\DataSeries( ); // Set up a layout object for the Pie chart -$layout1 = new \PhpSpreadsheet\Chart\Layout(); +$layout1 = new \PhpOffice\PhpSpreadsheet\Chart\Layout(); $layout1->setShowVal(true); $layout1->setShowPercent(true); // Set the series in the plot area -$plotArea1 = new \PhpSpreadsheet\Chart\PlotArea($layout1, [$series1]); +$plotArea1 = new \PhpOffice\PhpSpreadsheet\Chart\PlotArea($layout1, [$series1]); // Set the chart legend -$legend1 = new \PhpSpreadsheet\Chart\Legend(\PhpSpreadsheet\Chart\Legend::POSITION_RIGHT, null, false); +$legend1 = new \PhpOffice\PhpSpreadsheet\Chart\Legend(\PhpOffice\PhpSpreadsheet\Chart\Legend::POSITION_RIGHT, null, false); -$title1 = new \PhpSpreadsheet\Chart\Title('Test Pie Chart'); +$title1 = new \PhpOffice\PhpSpreadsheet\Chart\Title('Test Pie Chart'); // Create the chart -$chart1 = new \PhpSpreadsheet\Chart( +$chart1 = new \PhpOffice\PhpSpreadsheet\Chart( 'chart1', // name $title1, // title $legend1, // legend @@ -95,7 +95,7 @@ $worksheet->addChart($chart1); // Data values // Data Marker $dataSeriesLabels2 = [ - new \PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$C$1', null, 1), // 2011 + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$C$1', null, 1), // 2011 ]; // Set the X-Axis Labels // Datatype @@ -105,7 +105,7 @@ $dataSeriesLabels2 = [ // Data values // Data Marker $xAxisTickValues2 = [ - new \PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$A$2:$A$5', null, 4), // Q1 to Q4 + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$A$2:$A$5', null, 4), // Q1 to Q4 ]; // Set the Data values for each data series we want to plot // Datatype @@ -115,12 +115,12 @@ $xAxisTickValues2 = [ // Data values // Data Marker $dataSeriesValues2 = [ - new \PhpSpreadsheet\Chart\DataSeriesValues('Number', 'Worksheet!$C$2:$C$5', null, 4), + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('Number', 'Worksheet!$C$2:$C$5', null, 4), ]; // Build the dataseries -$series2 = new \PhpSpreadsheet\Chart\DataSeries( - \PhpSpreadsheet\Chart\DataSeries::TYPE_DONUTCHART, // plotType +$series2 = new \PhpOffice\PhpSpreadsheet\Chart\DataSeries( + \PhpOffice\PhpSpreadsheet\Chart\DataSeries::TYPE_DONUTCHART, // plotType null, // plotGrouping (Donut charts don't have any grouping) range(0, count($dataSeriesValues2) - 1), // plotOrder $dataSeriesLabels2, // plotLabel @@ -129,17 +129,17 @@ $series2 = new \PhpSpreadsheet\Chart\DataSeries( ); // Set up a layout object for the Pie chart -$layout2 = new \PhpSpreadsheet\Chart\Layout(); +$layout2 = new \PhpOffice\PhpSpreadsheet\Chart\Layout(); $layout2->setShowVal(true); $layout2->setShowCatName(true); // Set the series in the plot area -$plotArea2 = new \PhpSpreadsheet\Chart\PlotArea($layout2, [$series2]); +$plotArea2 = new \PhpOffice\PhpSpreadsheet\Chart\PlotArea($layout2, [$series2]); -$title2 = new \PhpSpreadsheet\Chart\Title('Test Donut Chart'); +$title2 = new \PhpOffice\PhpSpreadsheet\Chart\Title('Test Donut Chart'); // Create the chart -$chart2 = new \PhpSpreadsheet\Chart( +$chart2 = new \PhpOffice\PhpSpreadsheet\Chart( 'chart2', // name $title2, // title null, // legend @@ -159,7 +159,7 @@ $worksheet->addChart($chart2); // Save Excel 2007 file $filename = $helper->getFilename(__FILE__); -$writer = \PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Excel2007'); +$writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Excel2007'); $writer->setIncludeCharts(true); $callStartTime = microtime(true); $writer->save($filename); diff --git a/samples/33_Chart_create_radar.php b/samples/33_Chart_create_radar.php index 8ea22b51..b2d792f2 100644 --- a/samples/33_Chart_create_radar.php +++ b/samples/33_Chart_create_radar.php @@ -1,9 +1,9 @@ getActiveSheet(); $worksheet->fromArray( [ @@ -31,8 +31,8 @@ $worksheet->fromArray( // Data values // Data Marker $dataSeriesLabels = [ - new \PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$C$1', null, 1), // 2011 - new \PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$D$1', null, 1), // 2012 + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$C$1', null, 1), // 2011 + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$D$1', null, 1), // 2012 ]; // Set the X-Axis Labels // Datatype @@ -42,8 +42,8 @@ $dataSeriesLabels = [ // Data values // Data Marker $xAxisTickValues = [ - new \PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$A$2:$A$13', null, 12), // Jan to Dec - new \PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$A$2:$A$13', null, 12), // Jan to Dec + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$A$2:$A$13', null, 12), // Jan to Dec + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$A$2:$A$13', null, 12), // Jan to Dec ]; // Set the Data values for each data series we want to plot // Datatype @@ -53,13 +53,13 @@ $xAxisTickValues = [ // Data values // Data Marker $dataSeriesValues = [ - new \PhpSpreadsheet\Chart\DataSeriesValues('Number', 'Worksheet!$C$2:$C$13', null, 12), - new \PhpSpreadsheet\Chart\DataSeriesValues('Number', 'Worksheet!$D$2:$D$13', null, 12), + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('Number', 'Worksheet!$C$2:$C$13', null, 12), + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('Number', 'Worksheet!$D$2:$D$13', null, 12), ]; // Build the dataseries -$series = new \PhpSpreadsheet\Chart\DataSeries( - \PhpSpreadsheet\Chart\DataSeries::TYPE_RADARCHART, // plotType +$series = new \PhpOffice\PhpSpreadsheet\Chart\DataSeries( + \PhpOffice\PhpSpreadsheet\Chart\DataSeries::TYPE_RADARCHART, // plotType null, // plotGrouping (Radar charts don't have any grouping) range(0, count($dataSeriesValues) - 1), // plotOrder $dataSeriesLabels, // plotLabel @@ -67,21 +67,21 @@ $series = new \PhpSpreadsheet\Chart\DataSeries( $dataSeriesValues, // plotValues null, // plotDirection null, // smooth line - \PhpSpreadsheet\Chart\DataSeries::STYLE_MARKER // plotStyle + \PhpOffice\PhpSpreadsheet\Chart\DataSeries::STYLE_MARKER // plotStyle ); // Set up a layout object for the Pie chart -$layout = new \PhpSpreadsheet\Chart\Layout(); +$layout = new \PhpOffice\PhpSpreadsheet\Chart\Layout(); // Set the series in the plot area -$plotArea = new \PhpSpreadsheet\Chart\PlotArea($layout, [$series]); +$plotArea = new \PhpOffice\PhpSpreadsheet\Chart\PlotArea($layout, [$series]); // Set the chart legend -$legend = new \PhpSpreadsheet\Chart\Legend(\PhpSpreadsheet\Chart\Legend::POSITION_RIGHT, null, false); +$legend = new \PhpOffice\PhpSpreadsheet\Chart\Legend(\PhpOffice\PhpSpreadsheet\Chart\Legend::POSITION_RIGHT, null, false); -$title = new \PhpSpreadsheet\Chart\Title('Test Radar Chart'); +$title = new \PhpOffice\PhpSpreadsheet\Chart\Title('Test Radar Chart'); // Create the chart -$chart = new \PhpSpreadsheet\Chart( +$chart = new \PhpOffice\PhpSpreadsheet\Chart( 'chart1', // name $title, // title $legend, // legend @@ -101,7 +101,7 @@ $worksheet->addChart($chart); // Save Excel 2007 file $filename = $helper->getFilename(__FILE__); -$writer = \PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Excel2007'); +$writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Excel2007'); $writer->setIncludeCharts(true); $callStartTime = microtime(true); $writer->save($filename); diff --git a/samples/33_Chart_create_scatter.php b/samples/33_Chart_create_scatter.php index 1d904a07..937b0fff 100644 --- a/samples/33_Chart_create_scatter.php +++ b/samples/33_Chart_create_scatter.php @@ -1,9 +1,9 @@ getActiveSheet(); $worksheet->fromArray( [ @@ -23,13 +23,13 @@ $worksheet->fromArray( // Data values // Data Marker $dataSeriesLabels = [ - new \PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$B$1', null, 1), // 2010 - new \PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$C$1', null, 1), // 2011 - new \PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$D$1', null, 1), // 2012 + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$B$1', null, 1), // 2010 + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$C$1', null, 1), // 2011 + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$D$1', null, 1), // 2012 ]; // Set the X-Axis Labels $xAxisTickValues = [ - new \PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$A$2:$A$5', null, 4), // Q1 to Q4 + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$A$2:$A$5', null, 4), // Q1 to Q4 ]; // Set the Data values for each data series we want to plot // Datatype @@ -39,14 +39,14 @@ $xAxisTickValues = [ // Data values // Data Marker $dataSeriesValues = [ - new \PhpSpreadsheet\Chart\DataSeriesValues('Number', 'Worksheet!$B$2:$B$5', null, 4), - new \PhpSpreadsheet\Chart\DataSeriesValues('Number', 'Worksheet!$C$2:$C$5', null, 4), - new \PhpSpreadsheet\Chart\DataSeriesValues('Number', 'Worksheet!$D$2:$D$5', null, 4), + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('Number', 'Worksheet!$B$2:$B$5', null, 4), + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('Number', 'Worksheet!$C$2:$C$5', null, 4), + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('Number', 'Worksheet!$D$2:$D$5', null, 4), ]; // Build the dataseries -$series = new \PhpSpreadsheet\Chart\DataSeries( - \PhpSpreadsheet\Chart\DataSeries::TYPE_SCATTERCHART, // plotType +$series = new \PhpOffice\PhpSpreadsheet\Chart\DataSeries( + \PhpOffice\PhpSpreadsheet\Chart\DataSeries::TYPE_SCATTERCHART, // plotType null, // plotGrouping (Scatter charts don't have any grouping) range(0, count($dataSeriesValues) - 1), // plotOrder $dataSeriesLabels, // plotLabel @@ -54,19 +54,19 @@ $series = new \PhpSpreadsheet\Chart\DataSeries( $dataSeriesValues, // plotValues null, // plotDirection null, // smooth line - \PhpSpreadsheet\Chart\DataSeries::STYLE_LINEMARKER // plotStyle + \PhpOffice\PhpSpreadsheet\Chart\DataSeries::STYLE_LINEMARKER // plotStyle ); // Set the series in the plot area -$plotArea = new \PhpSpreadsheet\Chart\PlotArea(null, [$series]); +$plotArea = new \PhpOffice\PhpSpreadsheet\Chart\PlotArea(null, [$series]); // Set the chart legend -$legend = new \PhpSpreadsheet\Chart\Legend(\PhpSpreadsheet\Chart\Legend::POSITION_TOPRIGHT, null, false); +$legend = new \PhpOffice\PhpSpreadsheet\Chart\Legend(\PhpOffice\PhpSpreadsheet\Chart\Legend::POSITION_TOPRIGHT, null, false); -$title = new \PhpSpreadsheet\Chart\Title('Test Scatter Chart'); -$yAxisLabel = new \PhpSpreadsheet\Chart\Title('Value ($k)'); +$title = new \PhpOffice\PhpSpreadsheet\Chart\Title('Test Scatter Chart'); +$yAxisLabel = new \PhpOffice\PhpSpreadsheet\Chart\Title('Value ($k)'); // Create the chart -$chart = new \PhpSpreadsheet\Chart( +$chart = new \PhpOffice\PhpSpreadsheet\Chart( 'chart1', // name $title, // title $legend, // legend @@ -86,7 +86,7 @@ $worksheet->addChart($chart); // Save Excel 2007 file $filename = $helper->getFilename(__FILE__); -$writer = \PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Excel2007'); +$writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Excel2007'); $writer->setIncludeCharts(true); $callStartTime = microtime(true); $writer->save($filename); diff --git a/samples/33_Chart_create_stock.php b/samples/33_Chart_create_stock.php index 37478c03..e6605bf9 100644 --- a/samples/33_Chart_create_stock.php +++ b/samples/33_Chart_create_stock.php @@ -1,9 +1,9 @@ getActiveSheet(); $worksheet->fromArray( [ @@ -18,7 +18,7 @@ $worksheet->fromArray( 'A1', true ); -$worksheet->getStyle('B2:E6')->getNumberFormat()->setFormatCode(PhpSpreadsheet\Style\NumberFormat::FORMAT_NUMBER_00); +$worksheet->getStyle('B2:E6')->getNumberFormat()->setFormatCode(\PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_NUMBER_00); // Set the Labels for each data series we want to plot // Datatype @@ -28,10 +28,10 @@ $worksheet->getStyle('B2:E6')->getNumberFormat()->setFormatCode(PhpSpreadsheet\S // Data values // Data Marker $dataSeriesLabels = [ - new \PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$B$1', null, 1), //Max / Open - new \PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$C$1', null, 1), //Min / Close - new \PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$D$1', null, 1), //Min Threshold / Min - new \PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$E$1', null, 1), //Max Threshold / Max + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$B$1', null, 1), //Max / Open + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$C$1', null, 1), //Min / Close + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$D$1', null, 1), //Min Threshold / Min + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$E$1', null, 1), //Max Threshold / Max ]; // Set the X-Axis Labels // Datatype @@ -41,7 +41,7 @@ $dataSeriesLabels = [ // Data values // Data Marker $xAxisTickValues = [ - new \PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$A$2:$A$6', null, 5), // Counts + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$A$2:$A$6', null, 5), // Counts ]; // Set the Data values for each data series we want to plot // Datatype @@ -51,15 +51,15 @@ $xAxisTickValues = [ // Data values // Data Marker $dataSeriesValues = [ - new \PhpSpreadsheet\Chart\DataSeriesValues('Number', 'Worksheet!$B$2:$B$6', null, 5), - new \PhpSpreadsheet\Chart\DataSeriesValues('Number', 'Worksheet!$C$2:$C$6', null, 5), - new \PhpSpreadsheet\Chart\DataSeriesValues('Number', 'Worksheet!$D$2:$D$6', null, 5), - new \PhpSpreadsheet\Chart\DataSeriesValues('Number', 'Worksheet!$E$2:$E$6', null, 5), + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('Number', 'Worksheet!$B$2:$B$6', null, 5), + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('Number', 'Worksheet!$C$2:$C$6', null, 5), + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('Number', 'Worksheet!$D$2:$D$6', null, 5), + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('Number', 'Worksheet!$E$2:$E$6', null, 5), ]; // Build the dataseries -$series = new \PhpSpreadsheet\Chart\DataSeries( - \PhpSpreadsheet\Chart\DataSeries::TYPE_STOCKCHART, // plotType +$series = new \PhpOffice\PhpSpreadsheet\Chart\DataSeries( + \PhpOffice\PhpSpreadsheet\Chart\DataSeries::TYPE_STOCKCHART, // plotType null, // plotGrouping - if we set this to not null, then xlsx throws error range(0, count($dataSeriesValues) - 1), // plotOrder $dataSeriesLabels, // plotLabel @@ -68,16 +68,16 @@ $series = new \PhpSpreadsheet\Chart\DataSeries( ); // Set the series in the plot area -$plotArea = new \PhpSpreadsheet\Chart\PlotArea(null, [$series]); +$plotArea = new \PhpOffice\PhpSpreadsheet\Chart\PlotArea(null, [$series]); // Set the chart legend -$legend = new \PhpSpreadsheet\Chart\Legend(\PhpSpreadsheet\Chart\Legend::POSITION_RIGHT, null, false); +$legend = new \PhpOffice\PhpSpreadsheet\Chart\Legend(\PhpOffice\PhpSpreadsheet\Chart\Legend::POSITION_RIGHT, null, false); -$title = new \PhpSpreadsheet\Chart\Title('Test Stock Chart'); -$xAxisLabel = new \PhpSpreadsheet\Chart\Title('Counts'); -$yAxisLabel = new \PhpSpreadsheet\Chart\Title('Values'); +$title = new \PhpOffice\PhpSpreadsheet\Chart\Title('Test Stock Chart'); +$xAxisLabel = new \PhpOffice\PhpSpreadsheet\Chart\Title('Counts'); +$yAxisLabel = new \PhpOffice\PhpSpreadsheet\Chart\Title('Values'); // Create the chart -$chart = new \PhpSpreadsheet\Chart( +$chart = new \PhpOffice\PhpSpreadsheet\Chart( 'stock-chart', // name $title, // title $legend, // legend @@ -97,7 +97,7 @@ $worksheet->addChart($chart); // Save Excel 2007 file $filename = $helper->getFilename(__FILE__); -$writer = \PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Excel2007'); +$writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Excel2007'); $writer->setIncludeCharts(true); $callStartTime = microtime(true); $writer->save($filename); diff --git a/samples/34_Chart_update.php b/samples/34_Chart_update.php index 40cc6d5a..1357fa0f 100644 --- a/samples/34_Chart_update.php +++ b/samples/34_Chart_update.php @@ -1,16 +1,16 @@ getTemporaryFilename(); -$writer = new \PhpSpreadsheet\Writer\Excel2007($sampleSpreadsheet); +$writer = new \PhpOffice\PhpSpreadsheet\Writer\Excel2007($sampleSpreadsheet); $writer->save($filename); $helper->log('Load from Excel2007 file'); -$reader = \PhpSpreadsheet\IOFactory::createReader('Excel2007'); +$reader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader('Excel2007'); $reader->setIncludeCharts(true); $spreadsheet = $reader->load($filename); @@ -29,7 +29,7 @@ $worksheet->fromArray( // Save Excel 2007 file $filename = $helper->getFilename(__FILE__); -$writer = \PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Excel2007'); +$writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Excel2007'); $writer->setIncludeCharts(true); $callStartTime = microtime(true); $writer->save($filename); diff --git a/samples/35_Chart_render.php b/samples/35_Chart_render.php index 486cdd4c..cb06eff4 100644 --- a/samples/35_Chart_render.php +++ b/samples/35_Chart_render.php @@ -4,11 +4,11 @@ require __DIR__ . '/Header.php'; // Change these values to select the Rendering library that you wish to use // and its directory location on your server -$rendererName = PhpSpreadsheet\Settings::CHART_RENDERER_JPGRAPH; +$rendererName = \PhpOffice\PhpSpreadsheet\Settings::CHART_RENDERER_JPGRAPH; $rendererLibrary = 'jpgraph3.5.0b1/src/'; $rendererLibraryPath = '/php/libraries/Charts/' . $rendererLibrary; -if (!PhpSpreadsheet\Settings::setChartRenderer($rendererName, $rendererLibraryPath)) { +if (!\PhpOffice\PhpSpreadsheet\Settings::setChartRenderer($rendererName, $rendererLibraryPath)) { $helper->log('NOTICE: Please set the $rendererName and $rendererLibraryPath values at the top of this script as appropriate for your directory structure'); return; @@ -35,7 +35,7 @@ foreach ($inputFileNames as $inputFileName) { $helper->log("Load Test from $inputFileType file ", $inputFileNameShort); - $reader = \PhpSpreadsheet\IOFactory::createReader($inputFileType); + $reader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader($inputFileType); $reader->setIncludeCharts(true); $spreadsheet = $reader->load($inputFileName); diff --git a/samples/37_Page_layout_view.php b/samples/37_Page_layout_view.php index bcefa6ba..42cc1beb 100644 --- a/samples/37_Page_layout_view.php +++ b/samples/37_Page_layout_view.php @@ -4,7 +4,7 @@ require __DIR__ . '/Header.php'; // Create new Spreadsheet object $helper->log('Create new Spreadsheet object'); -$spreadsheet = new \PhpSpreadsheet\Spreadsheet(); +$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet(); // Set document properties $helper->log('Set document properties'); @@ -23,7 +23,7 @@ $spreadsheet->setActiveSheetIndex(0) ->setCellValue('B2', 'world!'); // Set the page layout view as page layout -$spreadsheet->getActiveSheet()->getSheetView()->setView(PhpSpreadsheet\Worksheet\SheetView::SHEETVIEW_PAGE_LAYOUT); +$spreadsheet->getActiveSheet()->getSheetView()->setView(\PhpOffice\PhpSpreadsheet\Worksheet\SheetView::SHEETVIEW_PAGE_LAYOUT); // Save $helper->write($spreadsheet, __FILE__); diff --git a/samples/38_Clone_worksheet.php b/samples/38_Clone_worksheet.php index 103955ca..aa555c39 100644 --- a/samples/38_Clone_worksheet.php +++ b/samples/38_Clone_worksheet.php @@ -4,7 +4,7 @@ require __DIR__ . '/Header.php'; // Create new Spreadsheet object $helper->log('Create new Spreadsheet object'); -$spreadsheet = new \PhpSpreadsheet\Spreadsheet(); +$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet(); // Set document properties $helper->log('Set document properties'); diff --git a/samples/39_Dropdown.php b/samples/39_Dropdown.php index 049b4ab3..d4c0306e 100644 --- a/samples/39_Dropdown.php +++ b/samples/39_Dropdown.php @@ -4,7 +4,7 @@ require __DIR__ . '/Header.php'; // Create new Spreadsheet object $helper->log('Create new Spreadsheet object'); -$spreadsheet = new \PhpSpreadsheet\Spreadsheet(); +$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet(); // Set document properties $helper->log('Set document properties'); @@ -39,7 +39,7 @@ foreach ($continents as $key => $filename) { $spreadsheet->getActiveSheet() ->fromArray($countries, null, $column . '1'); $spreadsheet->addNamedRange( - new PhpSpreadsheet\NamedRange( + new \PhpOffice\PhpSpreadsheet\NamedRange( $continent, $spreadsheet->getActiveSheet(), $column . '1:' . $column . $countryCount @@ -61,7 +61,7 @@ $spreadsheet->getActiveSheet() ->setVisible(false); $spreadsheet->addNamedRange( - new PhpSpreadsheet\NamedRange( + new \PhpOffice\PhpSpreadsheet\NamedRange( 'Continents', $spreadsheet->getActiveSheet(), $continentColumn . '1:' . $continentColumn . count($continents) @@ -85,8 +85,8 @@ $spreadsheet->getActiveSheet() $validation = $spreadsheet->getActiveSheet() ->getCell('B1') ->getDataValidation(); -$validation->setType(PhpSpreadsheet\Cell\DataValidation::TYPE_LIST) - ->setErrorStyle(PhpSpreadsheet\Cell\DataValidation::STYLE_INFORMATION) +$validation->setType(\PhpOffice\PhpSpreadsheet\Cell\DataValidation::TYPE_LIST) + ->setErrorStyle(\PhpOffice\PhpSpreadsheet\Cell\DataValidation::STYLE_INFORMATION) ->setAllowBlank(false) ->setShowInputMessage(true) ->setShowErrorMessage(true) @@ -106,8 +106,8 @@ $spreadsheet->getActiveSheet() $validation = $spreadsheet->getActiveSheet() ->getCell('B3') ->getDataValidation(); -$validation->setType(PhpSpreadsheet\Cell\DataValidation::TYPE_LIST) - ->setErrorStyle(PhpSpreadsheet\Cell\DataValidation::STYLE_INFORMATION) +$validation->setType(\PhpOffice\PhpSpreadsheet\Cell\DataValidation::TYPE_LIST) + ->setErrorStyle(\PhpOffice\PhpSpreadsheet\Cell\DataValidation::STYLE_INFORMATION) ->setAllowBlank(false) ->setShowInputMessage(true) ->setShowErrorMessage(true) diff --git a/samples/40_Duplicate_style.php b/samples/40_Duplicate_style.php index f2eeff2f..dca84817 100644 --- a/samples/40_Duplicate_style.php +++ b/samples/40_Duplicate_style.php @@ -3,13 +3,13 @@ require __DIR__ . '/Header.php'; $helper->log('Create new Spreadsheet object'); -$spreadsheet = new \PhpSpreadsheet\Spreadsheet(); +$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet(); $worksheet = $spreadsheet->getActiveSheet(); $helper->log('Create styles array'); $styles = []; for ($i = 0; $i < 10; ++$i) { - $style = new \PhpSpreadsheet\Style(); + $style = new \PhpOffice\PhpSpreadsheet\Style(); $style->getFont()->setSize($i + 4); $styles[] = $style; } @@ -20,7 +20,7 @@ for ($col = 0; $col < 50; ++$col) { for ($row = 0; $row < 100; ++$row) { $str = ($row + $col); $style = $styles[$row % 10]; - $coord = \PhpSpreadsheet\Cell::stringFromColumnIndex($col) . ($row + 1); + $coord = \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($col) . ($row + 1); $worksheet->setCellValue($coord, $str); $worksheet->duplicateStyle($style, $coord); } diff --git a/samples/42_RichText.php b/samples/42_RichText.php index 3cd33863..d65bd8d9 100644 --- a/samples/42_RichText.php +++ b/samples/42_RichText.php @@ -4,7 +4,7 @@ require __DIR__ . '/Header.php'; // Create new Spreadsheet object $helper->log('Create new Spreadsheet object'); -$spreadsheet = new \PhpSpreadsheet\Spreadsheet(); +$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet(); // Set document properties $helper->log('Set document properties'); @@ -48,7 +48,7 @@ $html4 = 'H2SO4 is the chemical formula for Sulphuric acid $html5 = 'bold, italic, bold+italic'; -$wizard = new \PhpSpreadsheet\Helper\HTML(); +$wizard = new \PhpOffice\PhpSpreadsheet\Helper\HTML(); $richText = $wizard->toRichTextObject($html1); $spreadsheet->getActiveSheet() diff --git a/samples/43_Merge_workbooks.php b/samples/43_Merge_workbooks.php index d55dae74..7e76d1b8 100644 --- a/samples/43_Merge_workbooks.php +++ b/samples/43_Merge_workbooks.php @@ -5,13 +5,13 @@ require __DIR__ . '/Header.php'; $helper->log('Load MergeBook1 from Excel2007 file'); $filename1 = __DIR__ . '/templates/43mergeBook1.xlsx'; $callStartTime = microtime(true); -$spreadsheet1 = \PhpSpreadsheet\IOFactory::load($filename1); +$spreadsheet1 = \PhpOffice\PhpSpreadsheet\IOFactory::load($filename1); $helper->logRead('Excel2007', $filename1, $callStartTime); $helper->log('Load MergeBook2 from Excel2007 file'); $filename2 = __DIR__ . '/templates/43mergeBook2.xlsx'; $callStartTime = microtime(true); -$spreadsheet2 = \PhpSpreadsheet\IOFactory::load($filename2); +$spreadsheet2 = \PhpOffice\PhpSpreadsheet\IOFactory::load($filename2); $helper->logRead('Excel2007', $filename2, $callStartTime); foreach ($spreadsheet2->getSheetNames() as $sheetName) { diff --git a/samples/44_Worksheet_info.php b/samples/44_Worksheet_info.php index 608b53b6..7265a483 100644 --- a/samples/44_Worksheet_info.php +++ b/samples/44_Worksheet_info.php @@ -5,11 +5,11 @@ require __DIR__ . '/Header.php'; // Create temporary file that will be read $sampleSpreadsheet = require __DIR__ . '/templates/sampleSpreadsheet.php'; $filename = $helper->getTemporaryFilename(); -$writer = new \PhpSpreadsheet\Writer\Excel2007($sampleSpreadsheet); +$writer = new \PhpOffice\PhpSpreadsheet\Writer\Excel2007($sampleSpreadsheet); $writer->save($filename); -$inputFileType = \PhpSpreadsheet\IOFactory::identify($filename); -$reader = \PhpSpreadsheet\IOFactory::createReader($inputFileType); +$inputFileType = \PhpOffice\PhpSpreadsheet\IOFactory::identify($filename); +$reader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader($inputFileType); $sheetList = $reader->listWorksheetNames($filename); $sheetInfo = $reader->listWorksheetInfo($filename); diff --git a/samples/Header.php b/samples/Header.php index 6e22112d..b406ba1b 100644 --- a/samples/Header.php +++ b/samples/Header.php @@ -6,7 +6,7 @@ error_reporting(E_ALL); require_once __DIR__ . '/../src/Bootstrap.php'; -$helper = new \PhpSpreadsheet\Helper\Sample(); +$helper = new \PhpOffice\PhpSpreadsheet\Helper\Sample(); if (!defined('EOL')) { define('EOL', $helper->isCli() ? PHP_EOL : '
'); } diff --git a/samples/templates/chartSpreadsheet.php b/samples/templates/chartSpreadsheet.php index 8b3a3564..f6fb8b00 100644 --- a/samples/templates/chartSpreadsheet.php +++ b/samples/templates/chartSpreadsheet.php @@ -1,6 +1,6 @@ getActiveSheet(); $worksheet->fromArray( [ @@ -20,9 +20,9 @@ $worksheet->fromArray( // Data values // Data Marker $dataSeriesLabels = [ - new \PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$B$1', null, 1), // 2010 - new \PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$C$1', null, 1), // 2011 - new \PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$D$1', null, 1), // 2012 + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$B$1', null, 1), // 2010 + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$C$1', null, 1), // 2011 + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$D$1', null, 1), // 2012 ]; // Set the X-Axis Labels // Datatype @@ -32,7 +32,7 @@ $dataSeriesLabels = [ // Data values // Data Marker $xAxisTickValues = [ - new \PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$A$2:$A$5', null, 4), // Q1 to Q4 + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('String', 'Worksheet!$A$2:$A$5', null, 4), // Q1 to Q4 ]; // Set the Data values for each data series we want to plot // Datatype @@ -42,15 +42,15 @@ $xAxisTickValues = [ // Data values // Data Marker $dataSeriesValues = [ - new \PhpSpreadsheet\Chart\DataSeriesValues('Number', 'Worksheet!$B$2:$B$5', null, 4), - new \PhpSpreadsheet\Chart\DataSeriesValues('Number', 'Worksheet!$C$2:$C$5', null, 4), - new \PhpSpreadsheet\Chart\DataSeriesValues('Number', 'Worksheet!$D$2:$D$5', null, 4), + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('Number', 'Worksheet!$B$2:$B$5', null, 4), + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('Number', 'Worksheet!$C$2:$C$5', null, 4), + new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('Number', 'Worksheet!$D$2:$D$5', null, 4), ]; // Build the dataseries -$series = new \PhpSpreadsheet\Chart\DataSeries( - \PhpSpreadsheet\Chart\DataSeries::TYPE_BARCHART, // plotType - \PhpSpreadsheet\Chart\DataSeries::GROUPING_CLUSTERED, // plotGrouping +$series = new \PhpOffice\PhpSpreadsheet\Chart\DataSeries( + \PhpOffice\PhpSpreadsheet\Chart\DataSeries::TYPE_BARCHART, // plotType + \PhpOffice\PhpSpreadsheet\Chart\DataSeries::GROUPING_CLUSTERED, // plotGrouping range(0, count($dataSeriesValues) - 1), // plotOrder $dataSeriesLabels, // plotLabel $xAxisTickValues, // plotCategory @@ -58,18 +58,18 @@ $series = new \PhpSpreadsheet\Chart\DataSeries( ); // Set additional dataseries parameters // Make it a horizontal bar rather than a vertical column graph -$series->setPlotDirection(\PhpSpreadsheet\Chart\DataSeries::DIRECTION_BAR); +$series->setPlotDirection(\PhpOffice\PhpSpreadsheet\Chart\DataSeries::DIRECTION_BAR); // Set the series in the plot area -$plotArea = new \PhpSpreadsheet\Chart\PlotArea(null, [$series]); +$plotArea = new \PhpOffice\PhpSpreadsheet\Chart\PlotArea(null, [$series]); // Set the chart legend -$legend = new \PhpSpreadsheet\Chart\Legend(\PhpSpreadsheet\Chart\Legend::POSITION_RIGHT, null, false); +$legend = new \PhpOffice\PhpSpreadsheet\Chart\Legend(\PhpOffice\PhpSpreadsheet\Chart\Legend::POSITION_RIGHT, null, false); -$title = new \PhpSpreadsheet\Chart\Title('Test Bar Chart'); -$yAxisLabel = new \PhpSpreadsheet\Chart\Title('Value ($k)'); +$title = new \PhpOffice\PhpSpreadsheet\Chart\Title('Test Bar Chart'); +$yAxisLabel = new \PhpOffice\PhpSpreadsheet\Chart\Title('Value ($k)'); // Create the chart -$chart = new \PhpSpreadsheet\Chart( +$chart = new \PhpOffice\PhpSpreadsheet\Chart( 'chart1', // name $title, // title $legend, // legend diff --git a/samples/templates/largeSpreadsheet.php b/samples/templates/largeSpreadsheet.php index 75ac99b8..76ecb5d0 100644 --- a/samples/templates/largeSpreadsheet.php +++ b/samples/templates/largeSpreadsheet.php @@ -2,7 +2,7 @@ // Create new Spreadsheet object $helper->log('Create new Spreadsheet object'); -$spreadsheet = new \PhpSpreadsheet\Spreadsheet(); +$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet(); // Set document properties $helper->log('Set properties'); diff --git a/samples/templates/sampleSpreadsheet.php b/samples/templates/sampleSpreadsheet.php index 2b90af33..479d0b03 100644 --- a/samples/templates/sampleSpreadsheet.php +++ b/samples/templates/sampleSpreadsheet.php @@ -2,7 +2,7 @@ // Create new Spreadsheet object $helper->log('Create new Spreadsheet object'); -$spreadsheet = new \PhpSpreadsheet\Spreadsheet(); +$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet(); // Set document properties $helper->log('Set document properties'); @@ -18,8 +18,8 @@ $spreadsheet->getProperties()->setCreator('Maarten Balliauw') $helper->log('Add some data'); $spreadsheet->setActiveSheetIndex(0); $spreadsheet->getActiveSheet()->setCellValue('B1', 'Invoice'); -$spreadsheet->getActiveSheet()->setCellValue('D1', \PhpSpreadsheet\Shared\Date::PHPToExcel(gmmktime(0, 0, 0, date('m'), date('d'), date('Y')))); -$spreadsheet->getActiveSheet()->getStyle('D1')->getNumberFormat()->setFormatCode(\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_XLSX15); +$spreadsheet->getActiveSheet()->setCellValue('D1', \PhpOffice\PhpSpreadsheet\Shared\Date::PHPToExcel(gmmktime(0, 0, 0, date('m'), date('d'), date('Y')))); +$spreadsheet->getActiveSheet()->getStyle('D1')->getNumberFormat()->setFormatCode(\PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_XLSX15); $spreadsheet->getActiveSheet()->setCellValue('E1', '#12566'); $spreadsheet->getActiveSheet()->setCellValue('A3', 'Product Id'); @@ -81,13 +81,13 @@ $spreadsheet->getActiveSheet()->getComment('E13')->getFillColor()->setRGB('EEEEE // Add rich-text string $helper->log('Add rich-text string'); -$richText = new \PhpSpreadsheet\RichText(); +$richText = new \PhpOffice\PhpSpreadsheet\RichText(); $richText->createText('This invoice is '); $payable = $richText->createTextRun('payable within thirty days after the end of the month'); $payable->getFont()->setBold(true); $payable->getFont()->setItalic(true); -$payable->getFont()->setColor(new \PhpSpreadsheet\Style\Color(\PhpSpreadsheet\Style\Color::COLOR_DARKGREEN)); +$payable->getFont()->setColor(new \PhpOffice\PhpSpreadsheet\Style\Color(\PhpOffice\PhpSpreadsheet\Style\Color::COLOR_DARKGREEN)); $richText->createText(', unless specified otherwise on the invoice.'); @@ -105,7 +105,7 @@ $spreadsheet->getActiveSheet()->protectCells('A3:E13', 'PhpSpreadsheet'); // Set cell number formats $helper->log('Set cell number formats'); -$spreadsheet->getActiveSheet()->getStyle('E4:E13')->getNumberFormat()->setFormatCode(\PhpSpreadsheet\Style\NumberFormat::FORMAT_CURRENCY_EUR_SIMPLE); +$spreadsheet->getActiveSheet()->getStyle('E4:E13')->getNumberFormat()->setFormatCode(\PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_CURRENCY_EUR_SIMPLE); // Set column widths $helper->log('Set column widths'); @@ -118,23 +118,23 @@ $helper->log('Set fonts'); $spreadsheet->getActiveSheet()->getStyle('B1')->getFont()->setName('Candara'); $spreadsheet->getActiveSheet()->getStyle('B1')->getFont()->setSize(20); $spreadsheet->getActiveSheet()->getStyle('B1')->getFont()->setBold(true); -$spreadsheet->getActiveSheet()->getStyle('B1')->getFont()->setUnderline(\PhpSpreadsheet\Style\Font::UNDERLINE_SINGLE); -$spreadsheet->getActiveSheet()->getStyle('B1')->getFont()->getColor()->setARGB(\PhpSpreadsheet\Style\Color::COLOR_WHITE); +$spreadsheet->getActiveSheet()->getStyle('B1')->getFont()->setUnderline(\PhpOffice\PhpSpreadsheet\Style\Font::UNDERLINE_SINGLE); +$spreadsheet->getActiveSheet()->getStyle('B1')->getFont()->getColor()->setARGB(\PhpOffice\PhpSpreadsheet\Style\Color::COLOR_WHITE); -$spreadsheet->getActiveSheet()->getStyle('D1')->getFont()->getColor()->setARGB(\PhpSpreadsheet\Style\Color::COLOR_WHITE); -$spreadsheet->getActiveSheet()->getStyle('E1')->getFont()->getColor()->setARGB(\PhpSpreadsheet\Style\Color::COLOR_WHITE); +$spreadsheet->getActiveSheet()->getStyle('D1')->getFont()->getColor()->setARGB(\PhpOffice\PhpSpreadsheet\Style\Color::COLOR_WHITE); +$spreadsheet->getActiveSheet()->getStyle('E1')->getFont()->getColor()->setARGB(\PhpOffice\PhpSpreadsheet\Style\Color::COLOR_WHITE); $spreadsheet->getActiveSheet()->getStyle('D13')->getFont()->setBold(true); $spreadsheet->getActiveSheet()->getStyle('E13')->getFont()->setBold(true); // Set alignments $helper->log('Set alignments'); -$spreadsheet->getActiveSheet()->getStyle('D11')->getAlignment()->setHorizontal(\PhpSpreadsheet\Style\Alignment::HORIZONTAL_RIGHT); -$spreadsheet->getActiveSheet()->getStyle('D12')->getAlignment()->setHorizontal(\PhpSpreadsheet\Style\Alignment::HORIZONTAL_RIGHT); -$spreadsheet->getActiveSheet()->getStyle('D13')->getAlignment()->setHorizontal(\PhpSpreadsheet\Style\Alignment::HORIZONTAL_RIGHT); +$spreadsheet->getActiveSheet()->getStyle('D11')->getAlignment()->setHorizontal(\PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_RIGHT); +$spreadsheet->getActiveSheet()->getStyle('D12')->getAlignment()->setHorizontal(\PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_RIGHT); +$spreadsheet->getActiveSheet()->getStyle('D13')->getAlignment()->setHorizontal(\PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_RIGHT); -$spreadsheet->getActiveSheet()->getStyle('A18')->getAlignment()->setHorizontal(\PhpSpreadsheet\Style\Alignment::HORIZONTAL_JUSTIFY); -$spreadsheet->getActiveSheet()->getStyle('A18')->getAlignment()->setVertical(\PhpSpreadsheet\Style\Alignment::VERTICAL_CENTER); +$spreadsheet->getActiveSheet()->getStyle('A18')->getAlignment()->setHorizontal(\PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_JUSTIFY); +$spreadsheet->getActiveSheet()->getStyle('A18')->getAlignment()->setVertical(\PhpOffice\PhpSpreadsheet\Style\Alignment::VERTICAL_CENTER); $spreadsheet->getActiveSheet()->getStyle('B5')->getAlignment()->setShrinkToFit(true); @@ -143,7 +143,7 @@ $helper->log('Set thin black border outline around column'); $styleThinBlackBorderOutline = [ 'borders' => [ 'outline' => [ - 'style' => \PhpSpreadsheet\Style\Border::BORDER_THIN, + 'style' => \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_THIN, 'color' => ['argb' => 'FF000000'], ], ], @@ -155,7 +155,7 @@ $helper->log('Set thick brown border outline around Total'); $styleThickBrownBorderOutline = [ 'borders' => [ 'outline' => [ - 'style' => \PhpSpreadsheet\Style\Border::BORDER_THICK, + 'style' => \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_THICK, 'color' => ['argb' => 'FF993300'], ], ], @@ -164,7 +164,7 @@ $spreadsheet->getActiveSheet()->getStyle('D13:E13')->applyFromArray($styleThickB // Set fills $helper->log('Set fills'); -$spreadsheet->getActiveSheet()->getStyle('A1:E1')->getFill()->setFillType(\PhpSpreadsheet\Style\Fill::FILL_SOLID); +$spreadsheet->getActiveSheet()->getStyle('A1:E1')->getFill()->setFillType(\PhpOffice\PhpSpreadsheet\Style\Fill::FILL_SOLID); $spreadsheet->getActiveSheet()->getStyle('A1:E1')->getFill()->getStartColor()->setARGB('FF808080'); // Set style for header row using alternative method @@ -175,15 +175,15 @@ $spreadsheet->getActiveSheet()->getStyle('A3:E3')->applyFromArray( 'bold' => true, ], 'alignment' => [ - 'horizontal' => \PhpSpreadsheet\Style\Alignment::HORIZONTAL_RIGHT, + 'horizontal' => \PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_RIGHT, ], 'borders' => [ 'top' => [ - 'style' => \PhpSpreadsheet\Style\Border::BORDER_THIN, + 'style' => \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_THIN, ], ], 'fill' => [ - 'type' => \PhpSpreadsheet\Style\Fill::FILL_GRADIENT_LINEAR, + 'type' => \PhpOffice\PhpSpreadsheet\Style\Fill::FILL_GRADIENT_LINEAR, 'rotation' => 90, 'startcolor' => [ 'argb' => 'FFA0A0A0', @@ -198,11 +198,11 @@ $spreadsheet->getActiveSheet()->getStyle('A3:E3')->applyFromArray( $spreadsheet->getActiveSheet()->getStyle('A3')->applyFromArray( [ 'alignment' => [ - 'horizontal' => \PhpSpreadsheet\Style\Alignment::HORIZONTAL_LEFT, + 'horizontal' => \PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_LEFT, ], 'borders' => [ 'left' => [ - 'style' => \PhpSpreadsheet\Style\Border::BORDER_THIN, + 'style' => \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_THIN, ], ], ] @@ -211,7 +211,7 @@ $spreadsheet->getActiveSheet()->getStyle('A3')->applyFromArray( $spreadsheet->getActiveSheet()->getStyle('B3')->applyFromArray( [ 'alignment' => [ - 'horizontal' => \PhpSpreadsheet\Style\Alignment::HORIZONTAL_LEFT, + 'horizontal' => \PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_LEFT, ], ] ); @@ -220,7 +220,7 @@ $spreadsheet->getActiveSheet()->getStyle('E3')->applyFromArray( [ 'borders' => [ 'right' => [ - 'style' => \PhpSpreadsheet\Style\Border::BORDER_THIN, + 'style' => \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_THIN, ], ], ] @@ -228,24 +228,24 @@ $spreadsheet->getActiveSheet()->getStyle('E3')->applyFromArray( // Unprotect a cell $helper->log('Unprotect a cell'); -$spreadsheet->getActiveSheet()->getStyle('B1')->getProtection()->setLocked(\PhpSpreadsheet\Style\Protection::PROTECTION_UNPROTECTED); +$spreadsheet->getActiveSheet()->getStyle('B1')->getProtection()->setLocked(\PhpOffice\PhpSpreadsheet\Style\Protection::PROTECTION_UNPROTECTED); // Add a hyperlink to the sheet $helper->log('Add a hyperlink to an external website'); $spreadsheet->getActiveSheet()->setCellValue('E26', 'www.phpexcel.net'); $spreadsheet->getActiveSheet()->getCell('E26')->getHyperlink()->setUrl('http://www.phpexcel.net'); $spreadsheet->getActiveSheet()->getCell('E26')->getHyperlink()->setTooltip('Navigate to website'); -$spreadsheet->getActiveSheet()->getStyle('E26')->getAlignment()->setHorizontal(\PhpSpreadsheet\Style\Alignment::HORIZONTAL_RIGHT); +$spreadsheet->getActiveSheet()->getStyle('E26')->getAlignment()->setHorizontal(\PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_RIGHT); $helper->log('Add a hyperlink to another cell on a different worksheet within the workbook'); $spreadsheet->getActiveSheet()->setCellValue('E27', 'Terms and conditions'); $spreadsheet->getActiveSheet()->getCell('E27')->getHyperlink()->setUrl("sheet://'Terms and conditions'!A1"); $spreadsheet->getActiveSheet()->getCell('E27')->getHyperlink()->setTooltip('Review terms and conditions'); -$spreadsheet->getActiveSheet()->getStyle('E27')->getAlignment()->setHorizontal(\PhpSpreadsheet\Style\Alignment::HORIZONTAL_RIGHT); +$spreadsheet->getActiveSheet()->getStyle('E27')->getAlignment()->setHorizontal(\PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_RIGHT); // Add a drawing to the worksheet $helper->log('Add a drawing to the worksheet'); -$drawing = new \PhpSpreadsheet\Worksheet\Drawing(); +$drawing = new \PhpOffice\PhpSpreadsheet\Worksheet\Drawing(); $drawing->setName('Logo'); $drawing->setDescription('Logo'); $drawing->setPath(__DIR__ . '/../images/officelogo.jpg'); @@ -254,7 +254,7 @@ $drawing->setWorksheet($spreadsheet->getActiveSheet()); // Add a drawing to the worksheet $helper->log('Add a drawing to the worksheet'); -$drawing = new \PhpSpreadsheet\Worksheet\Drawing(); +$drawing = new \PhpOffice\PhpSpreadsheet\Worksheet\Drawing(); $drawing->setName('Paid'); $drawing->setDescription('Paid'); $drawing->setPath(__DIR__ . '/../images/paid.png'); @@ -267,7 +267,7 @@ $drawing->setWorksheet($spreadsheet->getActiveSheet()); // Add a drawing to the worksheet $helper->log('Add a drawing to the worksheet'); -$drawing = new \PhpSpreadsheet\Worksheet\Drawing(); +$drawing = new \PhpOffice\PhpSpreadsheet\Worksheet\Drawing(); $drawing->setName('PhpSpreadsheet logo'); $drawing->setDescription('PhpSpreadsheet logo'); $drawing->setPath(__DIR__ . '/../images/PhpSpreadsheet_logo.gif'); @@ -290,8 +290,8 @@ $spreadsheet->getActiveSheet()->getHeaderFooter()->setOddFooter('&L&B' . $spread // Set page orientation and size $helper->log('Set page orientation and size'); -$spreadsheet->getActiveSheet()->getPageSetup()->setOrientation(\PhpSpreadsheet\Worksheet\PageSetup::ORIENTATION_PORTRAIT); -$spreadsheet->getActiveSheet()->getPageSetup()->setPaperSize(\PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_A4); +$spreadsheet->getActiveSheet()->getPageSetup()->setOrientation(\PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::ORIENTATION_PORTRAIT); +$spreadsheet->getActiveSheet()->getPageSetup()->setPaperSize(\PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_A4); // Rename first worksheet $helper->log('Rename first worksheet'); @@ -330,13 +330,13 @@ $helper->log('Set fonts'); $spreadsheet->getActiveSheet()->getStyle('A1')->getFont()->setName('Candara'); $spreadsheet->getActiveSheet()->getStyle('A1')->getFont()->setSize(20); $spreadsheet->getActiveSheet()->getStyle('A1')->getFont()->setBold(true); -$spreadsheet->getActiveSheet()->getStyle('A1')->getFont()->setUnderline(\PhpSpreadsheet\Style\Font::UNDERLINE_SINGLE); +$spreadsheet->getActiveSheet()->getStyle('A1')->getFont()->setUnderline(\PhpOffice\PhpSpreadsheet\Style\Font::UNDERLINE_SINGLE); $spreadsheet->getActiveSheet()->getStyle('A3:A6')->getFont()->setSize(8); // Add a drawing to the worksheet $helper->log('Add a drawing to the worksheet'); -$drawing = new \PhpSpreadsheet\Worksheet\Drawing(); +$drawing = new \PhpOffice\PhpSpreadsheet\Worksheet\Drawing(); $drawing->setName('Terms and conditions'); $drawing->setDescription('Terms and conditions'); $drawing->setPath(__DIR__ . '/../images/termsconditions.jpg'); @@ -345,8 +345,8 @@ $drawing->setWorksheet($spreadsheet->getActiveSheet()); // Set page orientation and size $helper->log('Set page orientation and size'); -$spreadsheet->getActiveSheet()->getPageSetup()->setOrientation(\PhpSpreadsheet\Worksheet\PageSetup::ORIENTATION_LANDSCAPE); -$spreadsheet->getActiveSheet()->getPageSetup()->setPaperSize(\PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_A4); +$spreadsheet->getActiveSheet()->getPageSetup()->setOrientation(\PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::ORIENTATION_LANDSCAPE); +$spreadsheet->getActiveSheet()->getPageSetup()->setPaperSize(\PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_A4); // Rename second worksheet $helper->log('Rename second worksheet'); diff --git a/src/Autoloader.php b/src/Autoloader.php index 7bca2ef9..14f7fb21 100644 --- a/src/Autoloader.php +++ b/src/Autoloader.php @@ -1,6 +1,6 @@ cacheTime )) { $this->__destruct(); - throw new \PhpSpreadsheet\Exception('Failed to store cell ' . $this->currentObjectID . ' in APC'); + throw new \PhpOffice\PhpSpreadsheet\Exception('Failed to store cell ' . $this->currentObjectID . ' in APC'); } $this->currentCellIsDirty = false; } @@ -68,11 +68,11 @@ class APC 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 \PhpSpreadsheet\Cell $cell Cell to update - * @throws \PhpSpreadsheet\Exception - * @return \PhpSpreadsheet\Cell + * @param \PhpOffice\PhpSpreadsheet\Cell $cell Cell to update + * @throws \PhpOffice\PhpSpreadsheet\Exception + * @return \PhpOffice\PhpSpreadsheet\Cell */ - public function addCacheData($pCoord, \PhpSpreadsheet\Cell $cell) + public function addCacheData($pCoord, \PhpOffice\PhpSpreadsheet\Cell $cell) { if (($pCoord !== $this->currentObjectID) && ($this->currentObjectID !== null)) { $this->storeData(); @@ -87,10 +87,10 @@ class APC extends CacheBase implements ICache } /** - * Is a value set in the current \PhpSpreadsheet\CachedObjectStorage\ICache for an indexed cell? + * Is a value set in the current \PhpOffice\PhpSpreadsheet\CachedObjectStorage\ICache for an indexed cell? * * @param string $pCoord Coordinate address of the cell to check - * @throws \PhpSpreadsheet\Exception + * @throws \PhpOffice\PhpSpreadsheet\Exception * @return bool */ public function isDataSet($pCoord) @@ -105,7 +105,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 \PhpSpreadsheet\Exception('Cell entry ' . $pCoord . ' no longer exists in APC cache'); + throw new \PhpOffice\PhpSpreadsheet\Exception('Cell entry ' . $pCoord . ' no longer exists in APC cache'); } return true; @@ -118,8 +118,8 @@ class APC extends CacheBase implements ICache * Get cell at a specific coordinate * * @param string $pCoord Coordinate of the cell - * @throws \PhpSpreadsheet\Exception - * @return \PhpSpreadsheet\Cell Cell that was found, or null if not found + * @throws \PhpOffice\PhpSpreadsheet\Exception + * @return \PhpOffice\PhpSpreadsheet\Cell Cell that was found, or null if not found */ public function getCacheData($pCoord) { @@ -134,7 +134,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 \PhpSpreadsheet\Exception('Cell entry ' . $pCoord . ' no longer exists in APC cache'); + throw new \PhpOffice\PhpSpreadsheet\Exception('Cell entry ' . $pCoord . ' no longer exists in APC cache'); } } else { // Return null if requested entry doesn't exist in cache @@ -169,7 +169,7 @@ class APC extends CacheBase implements ICache * Delete a cell in cache identified by coordinate address * * @param string $pCoord Coordinate address of the cell to delete - * @throws \PhpSpreadsheet\Exception + * @throws \PhpOffice\PhpSpreadsheet\Exception */ public function deleteCacheData($pCoord) { @@ -183,10 +183,10 @@ class APC extends CacheBase implements ICache /** * Clone the cell collection * - * @param \PhpSpreadsheet\Worksheet $parent The new worksheet that we're copying to - * @throws \PhpSpreadsheet\Exception + * @param \PhpOffice\PhpSpreadsheet\Worksheet $parent The new worksheet that we're copying to + * @throws \PhpOffice\PhpSpreadsheet\Exception */ - public function copyCellCollection(\PhpSpreadsheet\Worksheet $parent) + public function copyCellCollection(\PhpOffice\PhpSpreadsheet\Worksheet $parent) { parent::copyCellCollection($parent); // Get a new id for the new file name @@ -199,11 +199,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 \PhpSpreadsheet\Exception('Cell entry ' . $cellID . ' no longer exists in APC'); + throw new \PhpOffice\PhpSpreadsheet\Exception('Cell entry ' . $cellID . ' no longer exists in APC'); } if (!apc_store($newCachePrefix . $cellID . '.cache', $obj, $this->cacheTime)) { $this->__destruct(); - throw new \PhpSpreadsheet\Exception('Failed to store cell ' . $cellID . ' in APC'); + throw new \PhpOffice\PhpSpreadsheet\Exception('Failed to store cell ' . $cellID . ' in APC'); } } } @@ -232,10 +232,10 @@ class APC extends CacheBase implements ICache /** * Initialise this new cell collection * - * @param \PhpSpreadsheet\Worksheet $parent The worksheet for this cell collection + * @param \PhpOffice\PhpSpreadsheet\Worksheet $parent The worksheet for this cell collection * @param array of mixed $arguments Additional initialisation arguments */ - public function __construct(\PhpSpreadsheet\Worksheet $parent, $arguments) + public function __construct(\PhpOffice\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 787eac29..4ed22cc2 100644 --- a/src/PhpSpreadsheet/CachedObjectStorage/CacheBase.php +++ b/src/PhpSpreadsheet/CachedObjectStorage/CacheBase.php @@ -1,6 +1,6 @@ parent = $parent; } @@ -78,7 +78,7 @@ abstract class CacheBase /** * Return the parent worksheet for this cell collection * - * @return \PhpSpreadsheet\Worksheet + * @return \PhpOffice\PhpSpreadsheet\Worksheet */ public function getParent() { @@ -86,7 +86,7 @@ abstract class CacheBase } /** - * Is a value set in the current \PhpSpreadsheet\CachedObjectStorage\ICache for an indexed cell? + * Is a value set in the current \PhpOffice\PhpSpreadsheet\CachedObjectStorage\ICache for an indexed cell? * * @param string $pCoord Coordinate address of the cell to check * @return bool @@ -124,11 +124,11 @@ abstract class CacheBase /** * Add or Update a cell in cache * - * @param \PhpSpreadsheet\Cell $cell Cell to update - * @throws \PhpSpreadsheet\Exception - * @return \PhpSpreadsheet\Cell + * @param \PhpOffice\PhpSpreadsheet\Cell $cell Cell to update + * @throws \PhpOffice\PhpSpreadsheet\Exception + * @return \PhpOffice\PhpSpreadsheet\Cell */ - public function updateCacheData(\PhpSpreadsheet\Cell $cell) + public function updateCacheData(\PhpOffice\PhpSpreadsheet\Cell $cell) { return $this->addCacheData($cell->getCoordinate(), $cell); } @@ -137,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 \PhpSpreadsheet\Exception + * @throws \PhpOffice\PhpSpreadsheet\Exception */ public function deleteCacheData($pCoord) { @@ -262,10 +262,10 @@ abstract class CacheBase if ($r != $row) { continue; } - $columnList[] = \PhpSpreadsheet\Cell::columnIndexFromString($c); + $columnList[] = \PhpOffice\PhpSpreadsheet\Cell::columnIndexFromString($c); } - return \PhpSpreadsheet\Cell::stringFromColumnIndex(max($columnList) - 1); + return \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex(max($columnList) - 1); } /** @@ -314,9 +314,9 @@ abstract class CacheBase /** * Clone the cell collection * - * @param \PhpSpreadsheet\Worksheet $parent The new worksheet that we're copying to + * @param \PhpOffice\PhpSpreadsheet\Worksheet $parent The new worksheet that we're copying to */ - public function copyCellCollection(\PhpSpreadsheet\Worksheet $parent) + public function copyCellCollection(\PhpOffice\PhpSpreadsheet\Worksheet $parent) { $this->currentCellIsDirty; $this->storeData(); diff --git a/src/PhpSpreadsheet/CachedObjectStorage/DiscISAM.php b/src/PhpSpreadsheet/CachedObjectStorage/DiscISAM.php index 826e6637..e85e433b 100644 --- a/src/PhpSpreadsheet/CachedObjectStorage/DiscISAM.php +++ b/src/PhpSpreadsheet/CachedObjectStorage/DiscISAM.php @@ -1,6 +1,6 @@ currentObjectID) && ($this->currentObjectID !== null)) { $this->storeData(); @@ -94,8 +94,8 @@ class DiscISAM extends CacheBase implements ICache * Get cell at a specific coordinate * * @param string $pCoord Coordinate of the cell - * @throws \PhpSpreadsheet\Exception - * @return \PhpSpreadsheet\Cell Cell that was found, or null if not found + * @throws \PhpOffice\PhpSpreadsheet\Exception + * @return \PhpOffice\PhpSpreadsheet\Cell Cell that was found, or null if not found */ public function getCacheData($pCoord) { @@ -138,9 +138,9 @@ class DiscISAM extends CacheBase implements ICache /** * Clone the cell collection * - * @param \PhpSpreadsheet\Worksheet $parent The new worksheet that we're copying to + * @param \PhpOffice\PhpSpreadsheet\Worksheet $parent The new worksheet that we're copying to */ - public function copyCellCollection(\PhpSpreadsheet\Worksheet $parent) + public function copyCellCollection(\PhpOffice\PhpSpreadsheet\Worksheet $parent) { parent::copyCellCollection($parent); // Get a new id for the new file name @@ -174,14 +174,14 @@ class DiscISAM extends CacheBase implements ICache /** * Initialise this new cell collection * - * @param \PhpSpreadsheet\Worksheet $parent The worksheet for this cell collection + * @param \PhpOffice\PhpSpreadsheet\Worksheet $parent The worksheet for this cell collection * @param array of mixed $arguments Additional initialisation arguments */ - public function __construct(\PhpSpreadsheet\Worksheet $parent, $arguments) + public function __construct(\PhpOffice\PhpSpreadsheet\Worksheet $parent, $arguments) { $this->cacheDirectory = ((isset($arguments['dir'])) && ($arguments['dir'] !== null)) ? $arguments['dir'] - : \PhpSpreadsheet\Shared\File::sysGetTempDir(); + : \PhpOffice\PhpSpreadsheet\Shared\File::sysGetTempDir(); parent::__construct($parent); if (is_null($this->fileHandle)) { diff --git a/src/PhpSpreadsheet/CachedObjectStorage/ICache.php b/src/PhpSpreadsheet/CachedObjectStorage/ICache.php index da9c4495..7c34c3f9 100644 --- a/src/PhpSpreadsheet/CachedObjectStorage/ICache.php +++ b/src/PhpSpreadsheet/CachedObjectStorage/ICache.php @@ -1,6 +1,6 @@ currentObjectID) && ($this->currentObjectID !== null)) { $this->storeData(); @@ -68,8 +68,8 @@ class Igbinary extends CacheBase implements ICache * Get cell at a specific coordinate * * @param string $pCoord Coordinate of the cell - * @throws \PhpSpreadsheet\Exception - * @return \PhpSpreadsheet\Cell Cell that was found, or null if not found + * @throws \PhpOffice\PhpSpreadsheet\Exception + * @return \PhpOffice\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 959c2801..06cc1790 100644 --- a/src/PhpSpreadsheet/CachedObjectStorage/Memcache.php +++ b/src/PhpSpreadsheet/CachedObjectStorage/Memcache.php @@ -1,6 +1,6 @@ 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 \PhpSpreadsheet\Exception("Failed to store cell {$this->currentObjectID} in MemCache"); + throw new \PhpOffice\PhpSpreadsheet\Exception("Failed to store cell {$this->currentObjectID} in MemCache"); } } $this->currentCellIsDirty = false; @@ -74,11 +74,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 \PhpSpreadsheet\Cell $cell Cell to update - * @throws \PhpSpreadsheet\Exception - * @return \PhpSpreadsheet\Cell + * @param \PhpOffice\PhpSpreadsheet\Cell $cell Cell to update + * @throws \PhpOffice\PhpSpreadsheet\Exception + * @return \PhpOffice\PhpSpreadsheet\Cell */ - public function addCacheData($pCoord, \PhpSpreadsheet\Cell $cell) + public function addCacheData($pCoord, \PhpOffice\PhpSpreadsheet\Cell $cell) { if (($pCoord !== $this->currentObjectID) && ($this->currentObjectID !== null)) { $this->storeData(); @@ -93,10 +93,10 @@ class Memcache extends CacheBase implements ICache } /** - * Is a value set in the current \PhpSpreadsheet\CachedObjectStorage\ICache for an indexed cell? + * Is a value set in the current \PhpOffice\PhpSpreadsheet\CachedObjectStorage\ICache for an indexed cell? * * @param string $pCoord Coordinate address of the cell to check - * @throws \PhpSpreadsheet\Exception + * @throws \PhpOffice\PhpSpreadsheet\Exception * @return bool */ public function isDataSet($pCoord) @@ -111,7 +111,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 \PhpSpreadsheet\Exception('Cell entry ' . $pCoord . ' no longer exists in MemCache'); + throw new \PhpOffice\PhpSpreadsheet\Exception('Cell entry ' . $pCoord . ' no longer exists in MemCache'); } return true; @@ -124,8 +124,8 @@ class Memcache extends CacheBase implements ICache * Get cell at a specific coordinate * * @param string $pCoord Coordinate of the cell - * @throws \PhpSpreadsheet\Exception - * @return \PhpSpreadsheet\Cell Cell that was found, or null if not found + * @throws \PhpOffice\PhpSpreadsheet\Exception + * @return \PhpOffice\PhpSpreadsheet\Cell Cell that was found, or null if not found */ public function getCacheData($pCoord) { @@ -140,7 +140,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 \PhpSpreadsheet\Exception("Cell entry {$pCoord} no longer exists in MemCache"); + throw new \PhpOffice\PhpSpreadsheet\Exception("Cell entry {$pCoord} no longer exists in MemCache"); } } else { // Return null if requested entry doesn't exist in cache @@ -175,7 +175,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 \PhpSpreadsheet\Exception + * @throws \PhpOffice\PhpSpreadsheet\Exception */ public function deleteCacheData($pCoord) { @@ -189,10 +189,10 @@ class Memcache extends CacheBase implements ICache /** * Clone the cell collection * - * @param \PhpSpreadsheet\Worksheet $parent The new worksheet that we're copying to - * @throws \PhpSpreadsheet\Exception + * @param \PhpOffice\PhpSpreadsheet\Worksheet $parent The new worksheet that we're copying to + * @throws \PhpOffice\PhpSpreadsheet\Exception */ - public function copyCellCollection(\PhpSpreadsheet\Worksheet $parent) + public function copyCellCollection(\PhpOffice\PhpSpreadsheet\Worksheet $parent) { parent::copyCellCollection($parent); // Get a new id for the new file name @@ -205,11 +205,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 \PhpSpreadsheet\Exception("Cell entry {$cellID} no longer exists in MemCache"); + throw new \PhpOffice\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 \PhpSpreadsheet\Exception("Failed to store cell {$cellID} in MemCache"); + throw new \PhpOffice\PhpSpreadsheet\Exception("Failed to store cell {$cellID} in MemCache"); } } } @@ -238,11 +238,11 @@ class Memcache extends CacheBase implements ICache /** * Initialise this new cell collection * - * @param \PhpSpreadsheet\Worksheet $parent The worksheet for this cell collection + * @param \PhpOffice\PhpSpreadsheet\Worksheet $parent The worksheet for this cell collection * @param mixed[] $arguments Additional initialisation arguments - * @throws \PhpSpreadsheet\Exception + * @throws \PhpOffice\PhpSpreadsheet\Exception */ - public function __construct(\PhpSpreadsheet\Worksheet $parent, $arguments) + public function __construct(\PhpOffice\PhpSpreadsheet\Worksheet $parent, $arguments) { $memcacheServer = (isset($arguments['memcacheServer'])) ? $arguments['memcacheServer'] : 'localhost'; $memcachePort = (isset($arguments['memcachePort'])) ? $arguments['memcachePort'] : 11211; @@ -255,7 +255,7 @@ class Memcache extends CacheBase implements ICache // Set a new Memcache object and connect to the Memcache server $this->memcache = new self(); if (!$this->memcache->addServer($memcacheServer, $memcachePort, false, 50, 5, 5, true, [$this, 'failureCallback'])) { - throw new \PhpSpreadsheet\Exception("Could not connect to MemCache server at {$memcacheServer}:{$memcachePort}"); + throw new \PhpOffice\PhpSpreadsheet\Exception("Could not connect to MemCache server at {$memcacheServer}:{$memcachePort}"); } $this->cacheTime = $cacheTime; @@ -268,11 +268,11 @@ class Memcache extends CacheBase implements ICache * * @param string $host Memcache server * @param int $port Memcache port - * @throws \PhpSpreadsheet\Exception + * @throws \PhpOffice\PhpSpreadsheet\Exception */ public function failureCallback($host, $port) { - throw new \PhpSpreadsheet\Exception("memcache {$host}:{$port} failed"); + throw new \PhpOffice\PhpSpreadsheet\Exception("memcache {$host}:{$port} failed"); } /** diff --git a/src/PhpSpreadsheet/CachedObjectStorage/Memory.php b/src/PhpSpreadsheet/CachedObjectStorage/Memory.php index 0f3a8a7e..18a27203 100644 --- a/src/PhpSpreadsheet/CachedObjectStorage/Memory.php +++ b/src/PhpSpreadsheet/CachedObjectStorage/Memory.php @@ -1,6 +1,6 @@ cellCache[$pCoord] = $cell; @@ -55,8 +55,8 @@ class Memory extends CacheBase implements ICache * Get cell at a specific coordinate * * @param string $pCoord Coordinate of the cell - * @throws \PhpSpreadsheet\Exception - * @return \PhpSpreadsheet\Cell Cell that was found, or null if not found + * @throws \PhpOffice\PhpSpreadsheet\Exception + * @return \PhpOffice\PhpSpreadsheet\Cell Cell that was found, or null if not found */ public function getCacheData($pCoord) { @@ -77,9 +77,9 @@ class Memory extends CacheBase implements ICache /** * Clone the cell collection * - * @param \PhpSpreadsheet\Worksheet $parent The new worksheet that we're copying to + * @param \PhpOffice\PhpSpreadsheet\Worksheet $parent The new worksheet that we're copying to */ - public function copyCellCollection(\PhpSpreadsheet\Worksheet $parent) + public function copyCellCollection(\PhpOffice\PhpSpreadsheet\Worksheet $parent) { parent::copyCellCollection($parent); diff --git a/src/PhpSpreadsheet/CachedObjectStorage/MemoryGZip.php b/src/PhpSpreadsheet/CachedObjectStorage/MemoryGZip.php index 823c76f6..81e904b0 100644 --- a/src/PhpSpreadsheet/CachedObjectStorage/MemoryGZip.php +++ b/src/PhpSpreadsheet/CachedObjectStorage/MemoryGZip.php @@ -1,6 +1,6 @@ currentObjectID) && ($this->currentObjectID !== null)) { $this->storeData(); @@ -68,8 +68,8 @@ class MemoryGZip extends CacheBase implements ICache * Get cell at a specific coordinate * * @param string $pCoord Coordinate of the cell - * @throws \PhpSpreadsheet\Exception - * @return \PhpSpreadsheet\Cell Cell that was found, or null if not found + * @throws \PhpOffice\PhpSpreadsheet\Exception + * @return \PhpOffice\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 4114bb3d..07f966e0 100644 --- a/src/PhpSpreadsheet/CachedObjectStorage/MemorySerialized.php +++ b/src/PhpSpreadsheet/CachedObjectStorage/MemorySerialized.php @@ -1,6 +1,6 @@ currentObjectID) && ($this->currentObjectID !== null)) { $this->storeData(); @@ -68,8 +68,8 @@ class MemorySerialized extends CacheBase implements ICache * Get cell at a specific coordinate * * @param string $pCoord Coordinate of the cell - * @throws \PhpSpreadsheet\Exception - * @return \PhpSpreadsheet\Cell Cell that was found, or null if not found + * @throws \PhpOffice\PhpSpreadsheet\Exception + * @return \PhpOffice\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 ea2664c9..080007eb 100644 --- a/src/PhpSpreadsheet/CachedObjectStorage/PHPTemp.php +++ b/src/PhpSpreadsheet/CachedObjectStorage/PHPTemp.php @@ -1,6 +1,6 @@ currentObjectID) && ($this->currentObjectID !== null)) { $this->storeData(); @@ -87,8 +87,8 @@ class PHPTemp extends CacheBase implements ICache * Get cell at a specific coordinate * * @param string $pCoord Coordinate of the cell - * @throws \PhpSpreadsheet\Exception - * @return \PhpSpreadsheet\Cell Cell that was found, or null if not found + * @throws \PhpOffice\PhpSpreadsheet\Exception + * @return \PhpOffice\PhpSpreadsheet\Cell Cell that was found, or null if not found */ public function getCacheData($pCoord) { @@ -131,9 +131,9 @@ class PHPTemp extends CacheBase implements ICache /** * Clone the cell collection * - * @param \PhpSpreadsheet\Worksheet $parent The new worksheet that we're copying to + * @param \PhpOffice\PhpSpreadsheet\Worksheet $parent The new worksheet that we're copying to */ - public function copyCellCollection(\PhpSpreadsheet\Worksheet $parent) + public function copyCellCollection(\PhpOffice\PhpSpreadsheet\Worksheet $parent) { parent::copyCellCollection($parent); // Open a new stream for the cell cache data @@ -167,10 +167,10 @@ class PHPTemp extends CacheBase implements ICache /** * Initialise this new cell collection * - * @param \PhpSpreadsheet\Worksheet $parent The worksheet for this cell collection + * @param \PhpOffice\PhpSpreadsheet\Worksheet $parent The worksheet for this cell collection * @param mixed[] $arguments Additional initialisation arguments */ - public function __construct(\PhpSpreadsheet\Worksheet $parent, $arguments) + public function __construct(\PhpOffice\PhpSpreadsheet\Worksheet $parent, $arguments) { $this->memoryCacheSize = (isset($arguments['memoryCacheSize'])) ? $arguments['memoryCacheSize'] : 1 * 1024 * 1024; diff --git a/src/PhpSpreadsheet/CachedObjectStorage/SQLite.php b/src/PhpSpreadsheet/CachedObjectStorage/SQLite.php index 33a5d78f..1b1cac4d 100644 --- a/src/PhpSpreadsheet/CachedObjectStorage/SQLite.php +++ b/src/PhpSpreadsheet/CachedObjectStorage/SQLite.php @@ -1,6 +1,6 @@ currentObject->detach(); if (!$this->DBHandle->queryExec('INSERT OR REPLACE INTO kvp_' . $this->TableName . " VALUES('" . $this->currentObjectID . "','" . sqlite_escape_string(serialize($this->currentObject)) . "')")) { - throw new \PhpSpreadsheet\Exception(sqlite_error_string($this->DBHandle->lastError())); + throw new \PhpOffice\PhpSpreadsheet\Exception(sqlite_error_string($this->DBHandle->lastError())); } $this->currentCellIsDirty = false; } @@ -63,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 \PhpSpreadsheet\Cell $cell Cell to update - * @throws \PhpSpreadsheet\Exception - * @return \PhpSpreadsheet\Cell + * @param \PhpOffice\PhpSpreadsheet\Cell $cell Cell to update + * @throws \PhpOffice\PhpSpreadsheet\Exception + * @return \PhpOffice\PhpSpreadsheet\Cell */ - public function addCacheData($pCoord, \PhpSpreadsheet\Cell $cell) + public function addCacheData($pCoord, \PhpOffice\PhpSpreadsheet\Cell $cell) { if (($pCoord !== $this->currentObjectID) && ($this->currentObjectID !== null)) { $this->storeData(); @@ -84,8 +84,8 @@ class SQLite extends CacheBase implements ICache * Get cell at a specific coordinate * * @param string $pCoord Coordinate of the cell - * @throws \PhpSpreadsheet\Exception - * @return \PhpSpreadsheet\Cell Cell that was found, or null if not found + * @throws \PhpOffice\PhpSpreadsheet\Exception + * @return \PhpOffice\PhpSpreadsheet\Cell Cell that was found, or null if not found */ public function getCacheData($pCoord) { @@ -97,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 \PhpSpreadsheet\Exception(sqlite_error_string($this->DBHandle->lastError())); + throw new \PhpOffice\PhpSpreadsheet\Exception(sqlite_error_string($this->DBHandle->lastError())); } elseif ($cellResultSet->numRows() == 0) { // Return null if requested entry doesn't exist in cache return null; @@ -119,7 +119,7 @@ class SQLite extends CacheBase implements ICache * Is a value set for an indexed cell? * * @param string $pCoord Coordinate address of the cell to check - * @throws \PhpSpreadsheet\Exception + * @throws \PhpOffice\PhpSpreadsheet\Exception * @return bool */ public function isDataSet($pCoord) @@ -132,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 \PhpSpreadsheet\Exception(sqlite_error_string($this->DBHandle->lastError())); + throw new \PhpOffice\PhpSpreadsheet\Exception(sqlite_error_string($this->DBHandle->lastError())); } elseif ($cellResultSet->numRows() == 0) { // Return null if requested entry doesn't exist in cache return false; @@ -145,7 +145,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 \PhpSpreadsheet\Exception + * @throws \PhpOffice\PhpSpreadsheet\Exception */ public function deleteCacheData($pCoord) { @@ -157,7 +157,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 \PhpSpreadsheet\Exception(sqlite_error_string($this->DBHandle->lastError())); + throw new \PhpOffice\PhpSpreadsheet\Exception(sqlite_error_string($this->DBHandle->lastError())); } $this->currentCellIsDirty = false; @@ -168,7 +168,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 \PhpSpreadsheet\Exception + * @throws \PhpOffice\PhpSpreadsheet\Exception * @return bool */ public function moveCell($fromAddress, $toAddress) @@ -180,13 +180,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 \PhpSpreadsheet\Exception($this->DBHandle->lastErrorMsg()); + throw new \PhpOffice\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 \PhpSpreadsheet\Exception($this->DBHandle->lastErrorMsg()); + throw new \PhpOffice\PhpSpreadsheet\Exception($this->DBHandle->lastErrorMsg()); } return true; @@ -195,7 +195,7 @@ class SQLite extends CacheBase implements ICache /** * Get a list of all cell addresses currently held in cache * - * @throws \PhpSpreadsheet\Exception + * @throws \PhpOffice\PhpSpreadsheet\Exception * @return string[] */ public function getCellList() @@ -207,7 +207,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 \PhpSpreadsheet\Exception(sqlite_error_string($this->DBHandle->lastError())); + throw new \PhpOffice\PhpSpreadsheet\Exception(sqlite_error_string($this->DBHandle->lastError())); } $cellKeys = []; @@ -221,10 +221,10 @@ class SQLite extends CacheBase implements ICache /** * Clone the cell collection * - * @param \PhpSpreadsheet\Worksheet $parent The new worksheet that we're copying to - * @throws \PhpSpreadsheet\Exception + * @param \PhpOffice\PhpSpreadsheet\Worksheet $parent The new worksheet that we're copying to + * @throws \PhpOffice\PhpSpreadsheet\Exception */ - public function copyCellCollection(\PhpSpreadsheet\Worksheet $parent) + public function copyCellCollection(\PhpOffice\PhpSpreadsheet\Worksheet $parent) { $this->currentCellIsDirty; $this->storeData(); @@ -234,7 +234,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 \PhpSpreadsheet\Exception(sqlite_error_string($this->DBHandle->lastError())); + throw new \PhpOffice\PhpSpreadsheet\Exception(sqlite_error_string($this->DBHandle->lastError())); } // Copy the existing cell cache file @@ -260,10 +260,10 @@ class SQLite extends CacheBase implements ICache /** * Initialise this new cell collection * - * @param \PhpSpreadsheet\Worksheet $parent The worksheet for this cell collection - * @throws \PhpSpreadsheet\Exception + * @param \PhpOffice\PhpSpreadsheet\Worksheet $parent The worksheet for this cell collection + * @throws \PhpOffice\PhpSpreadsheet\Exception */ - public function __construct(\PhpSpreadsheet\Worksheet $parent) + public function __construct(\PhpOffice\PhpSpreadsheet\Worksheet $parent) { parent::__construct($parent); if (is_null($this->DBHandle)) { @@ -272,10 +272,10 @@ class SQLite extends CacheBase implements ICache $this->DBHandle = new SQLiteDatabase($_DBName); if ($this->DBHandle === false) { - throw new \PhpSpreadsheet\Exception(sqlite_error_string($this->DBHandle->lastError())); + throw new \PhpOffice\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 \PhpSpreadsheet\Exception(sqlite_error_string($this->DBHandle->lastError())); + throw new \PhpOffice\PhpSpreadsheet\Exception(sqlite_error_string($this->DBHandle->lastError())); } } } diff --git a/src/PhpSpreadsheet/CachedObjectStorage/SQLite3.php b/src/PhpSpreadsheet/CachedObjectStorage/SQLite3.php index 6acb1f4a..989e6e5b 100644 --- a/src/PhpSpreadsheet/CachedObjectStorage/SQLite3.php +++ b/src/PhpSpreadsheet/CachedObjectStorage/SQLite3.php @@ -1,6 +1,6 @@ insertQuery->bindValue('data', serialize($this->currentObject), SQLITE3_BLOB); $result = $this->insertQuery->execute(); if ($result === false) { - throw new \PhpSpreadsheet\Exception($this->DBHandle->lastErrorMsg()); + throw new \PhpOffice\PhpSpreadsheet\Exception($this->DBHandle->lastErrorMsg()); } $this->currentCellIsDirty = false; } @@ -94,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 \PhpSpreadsheet\Cell $cell Cell to update - * @throws \PhpSpreadsheet\Exception - * @return \PhpSpreadsheet\Cell + * @param \PhpOffice\PhpSpreadsheet\Cell $cell Cell to update + * @throws \PhpOffice\PhpSpreadsheet\Exception + * @return \PhpOffice\PhpSpreadsheet\Cell */ - public function addCacheData($pCoord, \PhpSpreadsheet\Cell $cell) + public function addCacheData($pCoord, \PhpOffice\PhpSpreadsheet\Cell $cell) { if (($pCoord !== $this->currentObjectID) && ($this->currentObjectID !== null)) { $this->storeData(); @@ -115,9 +115,9 @@ class SQLite3 extends CacheBase implements ICache * Get cell at a specific coordinate * * @param string $pCoord Coordinate of the cell - * @throws \PhpSpreadsheet\Exception - * @throws \PhpSpreadsheet\Exception - * @return \PhpSpreadsheet\Cell Cell that was found, or null if not found + * @throws \PhpOffice\PhpSpreadsheet\Exception + * @throws \PhpOffice\PhpSpreadsheet\Exception + * @return \PhpOffice\PhpSpreadsheet\Cell Cell that was found, or null if not found */ public function getCacheData($pCoord) { @@ -129,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 \PhpSpreadsheet\Exception($this->DBHandle->lastErrorMsg()); + throw new \PhpOffice\PhpSpreadsheet\Exception($this->DBHandle->lastErrorMsg()); } $cellData = $cellResult->fetchArray(SQLITE3_ASSOC); if ($cellData === false) { @@ -152,7 +152,7 @@ class SQLite3 extends CacheBase implements ICache * Is a value set for an indexed cell? * * @param string $pCoord Coordinate address of the cell to check - * @throws \PhpSpreadsheet\Exception + * @throws \PhpOffice\PhpSpreadsheet\Exception * @return bool */ public function isDataSet($pCoord) @@ -165,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 \PhpSpreadsheet\Exception($this->DBHandle->lastErrorMsg()); + throw new \PhpOffice\PhpSpreadsheet\Exception($this->DBHandle->lastErrorMsg()); } $cellData = $cellResult->fetchArray(SQLITE3_ASSOC); @@ -176,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 \PhpSpreadsheet\Exception + * @throws \PhpOffice\PhpSpreadsheet\Exception */ public function deleteCacheData($pCoord) { @@ -189,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 \PhpSpreadsheet\Exception($this->DBHandle->lastErrorMsg()); + throw new \PhpOffice\PhpSpreadsheet\Exception($this->DBHandle->lastErrorMsg()); } $this->currentCellIsDirty = false; @@ -200,7 +200,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 - * @throws \PhpSpreadsheet\Exception + * @throws \PhpOffice\PhpSpreadsheet\Exception * @return bool */ public function moveCell($fromAddress, $toAddress) @@ -212,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 \PhpSpreadsheet\Exception($this->DBHandle->lastErrorMsg()); + throw new \PhpOffice\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 \PhpSpreadsheet\Exception($this->DBHandle->lastErrorMsg()); + throw new \PhpOffice\PhpSpreadsheet\Exception($this->DBHandle->lastErrorMsg()); } return true; @@ -228,7 +228,7 @@ class SQLite3 extends CacheBase implements ICache /** * Get a list of all cell addresses currently held in cache * - * @throws \PhpSpreadsheet\Exception + * @throws \PhpOffice\PhpSpreadsheet\Exception * @return string[] */ public function getCellList() @@ -240,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 \PhpSpreadsheet\Exception($this->DBHandle->lastErrorMsg()); + throw new \PhpOffice\PhpSpreadsheet\Exception($this->DBHandle->lastErrorMsg()); } $cellKeys = []; @@ -254,10 +254,10 @@ class SQLite3 extends CacheBase implements ICache /** * Clone the cell collection * - * @param \PhpSpreadsheet\Worksheet $parent The new worksheet that we're copying to - * @throws \PhpSpreadsheet\Exception + * @param \PhpOffice\PhpSpreadsheet\Worksheet $parent The new worksheet that we're copying to + * @throws \PhpOffice\PhpSpreadsheet\Exception */ - public function copyCellCollection(\PhpSpreadsheet\Worksheet $parent) + public function copyCellCollection(\PhpOffice\PhpSpreadsheet\Worksheet $parent) { $this->currentCellIsDirty; $this->storeData(); @@ -267,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 \PhpSpreadsheet\Exception($this->DBHandle->lastErrorMsg()); + throw new \PhpOffice\PhpSpreadsheet\Exception($this->DBHandle->lastErrorMsg()); } // Copy the existing cell cache file @@ -293,10 +293,10 @@ class SQLite3 extends CacheBase implements ICache /** * Initialise this new cell collection * - * @param \PhpSpreadsheet\Worksheet $parent The worksheet for this cell collection - * @throws \PhpSpreadsheet\Exception + * @param \PhpOffice\PhpSpreadsheet\Worksheet $parent The worksheet for this cell collection + * @throws \PhpOffice\PhpSpreadsheet\Exception */ - public function __construct(\PhpSpreadsheet\Worksheet $parent) + public function __construct(\PhpOffice\PhpSpreadsheet\Worksheet $parent) { parent::__construct($parent); if (is_null($this->DBHandle)) { @@ -305,10 +305,10 @@ class SQLite3 extends CacheBase implements ICache $this->DBHandle = new \SQLite3($_DBName); if ($this->DBHandle === false) { - throw new \PhpSpreadsheet\Exception($this->DBHandle->lastErrorMsg()); + throw new \PhpOffice\PhpSpreadsheet\Exception($this->DBHandle->lastErrorMsg()); } if (!$this->DBHandle->exec('CREATE TABLE kvp_' . $this->TableName . ' (id VARCHAR(12) PRIMARY KEY, value BLOB)')) { - throw new \PhpSpreadsheet\Exception($this->DBHandle->lastErrorMsg()); + throw new \PhpOffice\PhpSpreadsheet\Exception($this->DBHandle->lastErrorMsg()); } } diff --git a/src/PhpSpreadsheet/CachedObjectStorage/Wincache.php b/src/PhpSpreadsheet/CachedObjectStorage/Wincache.php index caea7dab..a467cc63 100644 --- a/src/PhpSpreadsheet/CachedObjectStorage/Wincache.php +++ b/src/PhpSpreadsheet/CachedObjectStorage/Wincache.php @@ -1,6 +1,6 @@ cachePrefix . $this->currentObjectID . '.cache')) { if (!wincache_ucache_set($this->cachePrefix . $this->currentObjectID . '.cache', $obj, $this->cacheTime)) { $this->__destruct(); - throw new \PhpSpreadsheet\Exception('Failed to store cell ' . $this->currentObjectID . ' in WinCache'); + throw new \PhpOffice\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 \PhpSpreadsheet\Exception('Failed to store cell ' . $this->currentObjectID . ' in WinCache'); + throw new \PhpOffice\PhpSpreadsheet\Exception('Failed to store cell ' . $this->currentObjectID . ' in WinCache'); } } $this->currentCellIsDirty = false; @@ -73,11 +73,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 \PhpSpreadsheet\Cell $cell Cell to update - * @throws \PhpSpreadsheet\Exception - * @return \PhpSpreadsheet\Cell + * @param \PhpOffice\PhpSpreadsheet\Cell $cell Cell to update + * @throws \PhpOffice\PhpSpreadsheet\Exception + * @return \PhpOffice\PhpSpreadsheet\Cell */ - public function addCacheData($pCoord, \PhpSpreadsheet\Cell $cell) + public function addCacheData($pCoord, \PhpOffice\PhpSpreadsheet\Cell $cell) { if (($pCoord !== $this->currentObjectID) && ($this->currentObjectID !== null)) { $this->storeData(); @@ -92,10 +92,10 @@ class Wincache extends CacheBase implements ICache } /** - * Is a value set in the current \PhpSpreadsheet\CachedObjectStorage\ICache for an indexed cell? + * Is a value set in the current \PhpOffice\PhpSpreadsheet\CachedObjectStorage\ICache for an indexed cell? * * @param string $pCoord Coordinate address of the cell to check - * @throws \PhpSpreadsheet\Exception + * @throws \PhpOffice\PhpSpreadsheet\Exception * @return bool */ public function isDataSet($pCoord) @@ -110,7 +110,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 \PhpSpreadsheet\Exception('Cell entry ' . $pCoord . ' no longer exists in WinCache'); + throw new \PhpOffice\PhpSpreadsheet\Exception('Cell entry ' . $pCoord . ' no longer exists in WinCache'); } return true; @@ -123,8 +123,8 @@ class Wincache extends CacheBase implements ICache * Get cell at a specific coordinate * * @param string $pCoord Coordinate of the cell - * @throws \PhpSpreadsheet\Exception - * @return \PhpSpreadsheet\Cell Cell that was found, or null if not found + * @throws \PhpOffice\PhpSpreadsheet\Exception + * @return \PhpOffice\PhpSpreadsheet\Cell Cell that was found, or null if not found */ public function getCacheData($pCoord) { @@ -141,7 +141,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 \PhpSpreadsheet\Exception('Cell entry ' . $pCoord . ' no longer exists in WinCache'); + throw new \PhpOffice\PhpSpreadsheet\Exception('Cell entry ' . $pCoord . ' no longer exists in WinCache'); } } else { // Return null if requested entry doesn't exist in cache @@ -176,7 +176,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 \PhpSpreadsheet\Exception + * @throws \PhpOffice\PhpSpreadsheet\Exception */ public function deleteCacheData($pCoord) { @@ -190,10 +190,10 @@ class Wincache extends CacheBase implements ICache /** * Clone the cell collection * - * @param \PhpSpreadsheet\Worksheet $parent The new worksheet that we're copying to - * @throws \PhpSpreadsheet\Exception + * @param \PhpOffice\PhpSpreadsheet\Worksheet $parent The new worksheet that we're copying to + * @throws \PhpOffice\PhpSpreadsheet\Exception */ - public function copyCellCollection(\PhpSpreadsheet\Worksheet $parent) + public function copyCellCollection(\PhpOffice\PhpSpreadsheet\Worksheet $parent) { parent::copyCellCollection($parent); // Get a new id for the new file name @@ -207,11 +207,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 \PhpSpreadsheet\Exception('Cell entry ' . $cellID . ' no longer exists in Wincache'); + throw new \PhpOffice\PhpSpreadsheet\Exception('Cell entry ' . $cellID . ' no longer exists in Wincache'); } if (!wincache_ucache_add($newCachePrefix . $cellID . '.cache', $obj, $this->cacheTime)) { $this->__destruct(); - throw new \PhpSpreadsheet\Exception('Failed to store cell ' . $cellID . ' in Wincache'); + throw new \PhpOffice\PhpSpreadsheet\Exception('Failed to store cell ' . $cellID . ' in Wincache'); } } } @@ -240,10 +240,10 @@ class Wincache extends CacheBase implements ICache /** * Initialise this new cell collection * - * @param \PhpSpreadsheet\Worksheet $parent The worksheet for this cell collection + * @param \PhpOffice\PhpSpreadsheet\Worksheet $parent The worksheet for this cell collection * @param mixed[] $arguments Additional initialisation arguments */ - public function __construct(\PhpSpreadsheet\Worksheet $parent, $arguments) + public function __construct(\PhpOffice\PhpSpreadsheet\Worksheet $parent, $arguments) { $cacheTime = (isset($arguments['cacheTime'])) ? $arguments['cacheTime'] : 600; diff --git a/src/PhpSpreadsheet/CachedObjectStorageFactory.php b/src/PhpSpreadsheet/CachedObjectStorageFactory.php index ab83153e..8960e3d1 100644 --- a/src/PhpSpreadsheet/CachedObjectStorageFactory.php +++ b/src/PhpSpreadsheet/CachedObjectStorageFactory.php @@ -1,6 +1,6 @@ [ 'category' => Calculation\Categories::CATEGORY_FINANCIAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Financial::ACCRINT', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Financial::ACCRINT', 'argumentCount' => '4-7', ], 'ACCRINTM' => [ 'category' => Calculation\Categories::CATEGORY_FINANCIAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Financial::ACCRINTM', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Financial::ACCRINTM', 'argumentCount' => '3-5', ], 'ACOS' => [ @@ -259,22 +259,22 @@ class Calculation ], 'ADDRESS' => [ 'category' => Calculation\Categories::CATEGORY_LOOKUP_AND_REFERENCE, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\LookupRef::cellAddress', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\LookupRef::cellAddress', 'argumentCount' => '2-5', ], 'AMORDEGRC' => [ 'category' => Calculation\Categories::CATEGORY_FINANCIAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Financial::AMORDEGRC', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Financial::AMORDEGRC', 'argumentCount' => '6,7', ], 'AMORLINC' => [ 'category' => Calculation\Categories::CATEGORY_FINANCIAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Financial::AMORLINC', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Financial::AMORLINC', 'argumentCount' => '6,7', ], 'AND' => [ 'category' => Calculation\Categories::CATEGORY_LOGICAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Logical::logicalAnd', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Logical::logicalAnd', 'argumentCount' => '1+', ], 'AREAS' => [ @@ -304,7 +304,7 @@ class Calculation ], 'ATAN2' => [ 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\MathTrig::ATAN2', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\MathTrig::ATAN2', 'argumentCount' => '2', ], 'ATANH' => [ @@ -314,22 +314,22 @@ class Calculation ], 'AVEDEV' => [ 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::AVEDEV', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical::AVEDEV', 'argumentCount' => '1+', ], 'AVERAGE' => [ 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::AVERAGE', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical::AVERAGE', 'argumentCount' => '1+', ], 'AVERAGEA' => [ 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::AVERAGEA', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical::AVERAGEA', 'argumentCount' => '1+', ], 'AVERAGEIF' => [ 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::AVERAGEIF', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical::AVERAGEIF', 'argumentCount' => '2,3', ], 'AVERAGEIFS' => [ @@ -344,57 +344,57 @@ class Calculation ], 'BESSELI' => [ 'category' => Calculation\Categories::CATEGORY_ENGINEERING, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Engineering::BESSELI', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Engineering::BESSELI', 'argumentCount' => '2', ], 'BESSELJ' => [ 'category' => Calculation\Categories::CATEGORY_ENGINEERING, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Engineering::BESSELJ', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Engineering::BESSELJ', 'argumentCount' => '2', ], 'BESSELK' => [ 'category' => Calculation\Categories::CATEGORY_ENGINEERING, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Engineering::BESSELK', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Engineering::BESSELK', 'argumentCount' => '2', ], 'BESSELY' => [ 'category' => Calculation\Categories::CATEGORY_ENGINEERING, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Engineering::BESSELY', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Engineering::BESSELY', 'argumentCount' => '2', ], 'BETADIST' => [ 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::BETADIST', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical::BETADIST', 'argumentCount' => '3-5', ], 'BETAINV' => [ 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::BETAINV', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical::BETAINV', 'argumentCount' => '3-5', ], 'BIN2DEC' => [ 'category' => Calculation\Categories::CATEGORY_ENGINEERING, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Engineering::BINTODEC', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Engineering::BINTODEC', 'argumentCount' => '1', ], 'BIN2HEX' => [ 'category' => Calculation\Categories::CATEGORY_ENGINEERING, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Engineering::BINTOHEX', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Engineering::BINTOHEX', 'argumentCount' => '1,2', ], 'BIN2OCT' => [ 'category' => Calculation\Categories::CATEGORY_ENGINEERING, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Engineering::BINTOOCT', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Engineering::BINTOOCT', 'argumentCount' => '1,2', ], 'BINOMDIST' => [ 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::BINOMDIST', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical::BINOMDIST', 'argumentCount' => '4', ], 'CEILING' => [ 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\MathTrig::CEILING', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\MathTrig::CEILING', 'argumentCount' => '2', ], 'CELL' => [ @@ -404,17 +404,17 @@ class Calculation ], 'CHAR' => [ 'category' => Calculation\Categories::CATEGORY_TEXT_AND_DATA, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\TextData::CHARACTER', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\TextData::CHARACTER', 'argumentCount' => '1', ], 'CHIDIST' => [ 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::CHIDIST', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical::CHIDIST', 'argumentCount' => '2', ], 'CHIINV' => [ 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::CHIINV', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical::CHIINV', 'argumentCount' => '2', ], 'CHITEST' => [ @@ -424,58 +424,58 @@ class Calculation ], 'CHOOSE' => [ 'category' => Calculation\Categories::CATEGORY_LOOKUP_AND_REFERENCE, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\LookupRef::CHOOSE', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\LookupRef::CHOOSE', 'argumentCount' => '2+', ], 'CLEAN' => [ 'category' => Calculation\Categories::CATEGORY_TEXT_AND_DATA, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\TextData::TRIMNONPRINTABLE', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\TextData::TRIMNONPRINTABLE', 'argumentCount' => '1', ], 'CODE' => [ 'category' => Calculation\Categories::CATEGORY_TEXT_AND_DATA, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\TextData::ASCIICODE', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\TextData::ASCIICODE', 'argumentCount' => '1', ], 'COLUMN' => [ 'category' => Calculation\Categories::CATEGORY_LOOKUP_AND_REFERENCE, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\LookupRef::COLUMN', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\LookupRef::COLUMN', 'argumentCount' => '-1', 'passByReference' => [true], ], 'COLUMNS' => [ 'category' => Calculation\Categories::CATEGORY_LOOKUP_AND_REFERENCE, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\LookupRef::COLUMNS', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\LookupRef::COLUMNS', 'argumentCount' => '1', ], 'COMBIN' => [ 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\MathTrig::COMBIN', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\MathTrig::COMBIN', 'argumentCount' => '2', ], 'COMPLEX' => [ 'category' => Calculation\Categories::CATEGORY_ENGINEERING, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Engineering::COMPLEX', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Engineering::COMPLEX', 'argumentCount' => '2,3', ], 'CONCATENATE' => [ 'category' => Calculation\Categories::CATEGORY_TEXT_AND_DATA, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\TextData::CONCATENATE', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\TextData::CONCATENATE', 'argumentCount' => '1+', ], 'CONFIDENCE' => [ 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::CONFIDENCE', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical::CONFIDENCE', 'argumentCount' => '3', ], 'CONVERT' => [ 'category' => Calculation\Categories::CATEGORY_ENGINEERING, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Engineering::CONVERTUOM', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Engineering::CONVERTUOM', 'argumentCount' => '3', ], 'CORREL' => [ 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::CORREL', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical::CORREL', 'argumentCount' => '2', ], 'COS' => [ @@ -490,22 +490,22 @@ class Calculation ], 'COUNT' => [ 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::COUNT', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical::COUNT', 'argumentCount' => '1+', ], 'COUNTA' => [ 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::COUNTA', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical::COUNTA', 'argumentCount' => '1+', ], 'COUNTBLANK' => [ 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::COUNTBLANK', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical::COUNTBLANK', 'argumentCount' => '1', ], 'COUNTIF' => [ 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::COUNTIF', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical::COUNTIF', 'argumentCount' => '2', ], 'COUNTIFS' => [ @@ -515,42 +515,42 @@ class Calculation ], 'COUPDAYBS' => [ 'category' => Calculation\Categories::CATEGORY_FINANCIAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Financial::COUPDAYBS', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Financial::COUPDAYBS', 'argumentCount' => '3,4', ], 'COUPDAYS' => [ 'category' => Calculation\Categories::CATEGORY_FINANCIAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Financial::COUPDAYS', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Financial::COUPDAYS', 'argumentCount' => '3,4', ], 'COUPDAYSNC' => [ 'category' => Calculation\Categories::CATEGORY_FINANCIAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Financial::COUPDAYSNC', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Financial::COUPDAYSNC', 'argumentCount' => '3,4', ], 'COUPNCD' => [ 'category' => Calculation\Categories::CATEGORY_FINANCIAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Financial::COUPNCD', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Financial::COUPNCD', 'argumentCount' => '3,4', ], 'COUPNUM' => [ 'category' => Calculation\Categories::CATEGORY_FINANCIAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Financial::COUPNUM', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Financial::COUPNUM', 'argumentCount' => '3,4', ], 'COUPPCD' => [ 'category' => Calculation\Categories::CATEGORY_FINANCIAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Financial::COUPPCD', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Financial::COUPPCD', 'argumentCount' => '3,4', ], 'COVAR' => [ 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::COVAR', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical::COVAR', 'argumentCount' => '2', ], 'CRITBINOM' => [ 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::CRITBINOM', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical::CRITBINOM', 'argumentCount' => '3', ], 'CUBEKPIMEMBER' => [ @@ -590,77 +590,77 @@ class Calculation ], 'CUMIPMT' => [ 'category' => Calculation\Categories::CATEGORY_FINANCIAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Financial::CUMIPMT', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Financial::CUMIPMT', 'argumentCount' => '6', ], 'CUMPRINC' => [ 'category' => Calculation\Categories::CATEGORY_FINANCIAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Financial::CUMPRINC', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Financial::CUMPRINC', 'argumentCount' => '6', ], 'DATE' => [ 'category' => Calculation\Categories::CATEGORY_DATE_AND_TIME, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\DateTime::DATE', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\DateTime::DATE', 'argumentCount' => '3', ], 'DATEDIF' => [ 'category' => Calculation\Categories::CATEGORY_DATE_AND_TIME, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\DateTime::DATEDIF', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\DateTime::DATEDIF', 'argumentCount' => '2,3', ], 'DATEVALUE' => [ 'category' => Calculation\Categories::CATEGORY_DATE_AND_TIME, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\DateTime::DATEVALUE', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\DateTime::DATEVALUE', 'argumentCount' => '1', ], 'DAVERAGE' => [ 'category' => Calculation\Categories::CATEGORY_DATABASE, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Database::DAVERAGE', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Database::DAVERAGE', 'argumentCount' => '3', ], 'DAY' => [ 'category' => Calculation\Categories::CATEGORY_DATE_AND_TIME, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\DateTime::DAYOFMONTH', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\DateTime::DAYOFMONTH', 'argumentCount' => '1', ], 'DAYS360' => [ 'category' => Calculation\Categories::CATEGORY_DATE_AND_TIME, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\DateTime::DAYS360', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\DateTime::DAYS360', 'argumentCount' => '2,3', ], 'DB' => [ 'category' => Calculation\Categories::CATEGORY_FINANCIAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Financial::DB', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Financial::DB', 'argumentCount' => '4,5', ], 'DCOUNT' => [ 'category' => Calculation\Categories::CATEGORY_DATABASE, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Database::DCOUNT', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Database::DCOUNT', 'argumentCount' => '3', ], 'DCOUNTA' => [ 'category' => Calculation\Categories::CATEGORY_DATABASE, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Database::DCOUNTA', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Database::DCOUNTA', 'argumentCount' => '3', ], 'DDB' => [ 'category' => Calculation\Categories::CATEGORY_FINANCIAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Financial::DDB', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Financial::DDB', 'argumentCount' => '4,5', ], 'DEC2BIN' => [ 'category' => Calculation\Categories::CATEGORY_ENGINEERING, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Engineering::DECTOBIN', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Engineering::DECTOBIN', 'argumentCount' => '1,2', ], 'DEC2HEX' => [ 'category' => Calculation\Categories::CATEGORY_ENGINEERING, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Engineering::DECTOHEX', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Engineering::DECTOHEX', 'argumentCount' => '1,2', ], 'DEC2OCT' => [ 'category' => Calculation\Categories::CATEGORY_ENGINEERING, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Engineering::DECTOOCT', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Engineering::DECTOOCT', 'argumentCount' => '1,2', ], 'DEGREES' => [ @@ -670,67 +670,67 @@ class Calculation ], 'DELTA' => [ 'category' => Calculation\Categories::CATEGORY_ENGINEERING, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Engineering::DELTA', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Engineering::DELTA', 'argumentCount' => '1,2', ], 'DEVSQ' => [ 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::DEVSQ', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical::DEVSQ', 'argumentCount' => '1+', ], 'DGET' => [ 'category' => Calculation\Categories::CATEGORY_DATABASE, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Database::DGET', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Database::DGET', 'argumentCount' => '3', ], 'DISC' => [ 'category' => Calculation\Categories::CATEGORY_FINANCIAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Financial::DISC', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Financial::DISC', 'argumentCount' => '4,5', ], 'DMAX' => [ 'category' => Calculation\Categories::CATEGORY_DATABASE, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Database::DMAX', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Database::DMAX', 'argumentCount' => '3', ], 'DMIN' => [ 'category' => Calculation\Categories::CATEGORY_DATABASE, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Database::DMIN', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Database::DMIN', 'argumentCount' => '3', ], 'DOLLAR' => [ 'category' => Calculation\Categories::CATEGORY_TEXT_AND_DATA, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\TextData::DOLLAR', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\TextData::DOLLAR', 'argumentCount' => '1,2', ], 'DOLLARDE' => [ 'category' => Calculation\Categories::CATEGORY_FINANCIAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Financial::DOLLARDE', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Financial::DOLLARDE', 'argumentCount' => '2', ], 'DOLLARFR' => [ 'category' => Calculation\Categories::CATEGORY_FINANCIAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Financial::DOLLARFR', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Financial::DOLLARFR', 'argumentCount' => '2', ], 'DPRODUCT' => [ 'category' => Calculation\Categories::CATEGORY_DATABASE, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Database::DPRODUCT', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Database::DPRODUCT', 'argumentCount' => '3', ], 'DSTDEV' => [ 'category' => Calculation\Categories::CATEGORY_DATABASE, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Database::DSTDEV', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Database::DSTDEV', 'argumentCount' => '3', ], 'DSTDEVP' => [ 'category' => Calculation\Categories::CATEGORY_DATABASE, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Database::DSTDEVP', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Database::DSTDEVP', 'argumentCount' => '3', ], 'DSUM' => [ 'category' => Calculation\Categories::CATEGORY_DATABASE, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Database::DSUM', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Database::DSUM', 'argumentCount' => '3', ], 'DURATION' => [ @@ -740,37 +740,37 @@ class Calculation ], 'DVAR' => [ 'category' => Calculation\Categories::CATEGORY_DATABASE, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Database::DVAR', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Database::DVAR', 'argumentCount' => '3', ], 'DVARP' => [ 'category' => Calculation\Categories::CATEGORY_DATABASE, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Database::DVARP', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Database::DVARP', 'argumentCount' => '3', ], 'EDATE' => [ 'category' => Calculation\Categories::CATEGORY_DATE_AND_TIME, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\DateTime::EDATE', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\DateTime::EDATE', 'argumentCount' => '2', ], 'EFFECT' => [ 'category' => Calculation\Categories::CATEGORY_FINANCIAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Financial::EFFECT', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Financial::EFFECT', 'argumentCount' => '2', ], 'EOMONTH' => [ 'category' => Calculation\Categories::CATEGORY_DATE_AND_TIME, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\DateTime::EOMONTH', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\DateTime::EOMONTH', 'argumentCount' => '2', ], 'ERF' => [ 'category' => Calculation\Categories::CATEGORY_ENGINEERING, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Engineering::ERF', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Engineering::ERF', 'argumentCount' => '1,2', ], 'ERFC' => [ 'category' => Calculation\Categories::CATEGORY_ENGINEERING, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Engineering::ERFC', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Engineering::ERFC', 'argumentCount' => '1', ], 'ERROR.TYPE' => [ @@ -780,7 +780,7 @@ class Calculation ], 'EVEN' => [ 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\MathTrig::EVEN', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\MathTrig::EVEN', 'argumentCount' => '1', ], 'EXACT' => [ @@ -795,22 +795,22 @@ class Calculation ], 'EXPONDIST' => [ 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::EXPONDIST', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical::EXPONDIST', 'argumentCount' => '3', ], 'FACT' => [ 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\MathTrig::FACT', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\MathTrig::FACT', 'argumentCount' => '1', ], 'FACTDOUBLE' => [ 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\MathTrig::FACTDOUBLE', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\MathTrig::FACTDOUBLE', 'argumentCount' => '1', ], 'FALSE' => [ 'category' => Calculation\Categories::CATEGORY_LOGICAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Logical::FALSE', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Logical::FALSE', 'argumentCount' => '0', ], 'FDIST' => [ @@ -820,12 +820,12 @@ class Calculation ], 'FIND' => [ 'category' => Calculation\Categories::CATEGORY_TEXT_AND_DATA, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\TextData::SEARCHSENSITIVE', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\TextData::SEARCHSENSITIVE', 'argumentCount' => '2,3', ], 'FINDB' => [ 'category' => Calculation\Categories::CATEGORY_TEXT_AND_DATA, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\TextData::SEARCHSENSITIVE', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\TextData::SEARCHSENSITIVE', 'argumentCount' => '2,3', ], 'FINV' => [ @@ -835,27 +835,27 @@ class Calculation ], 'FISHER' => [ 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::FISHER', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical::FISHER', 'argumentCount' => '1', ], 'FISHERINV' => [ 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::FISHERINV', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical::FISHERINV', 'argumentCount' => '1', ], 'FIXED' => [ 'category' => Calculation\Categories::CATEGORY_TEXT_AND_DATA, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\TextData::FIXEDFORMAT', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\TextData::FIXEDFORMAT', 'argumentCount' => '1-3', ], 'FLOOR' => [ 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\MathTrig::FLOOR', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\MathTrig::FLOOR', 'argumentCount' => '2', ], 'FORECAST' => [ 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::FORECAST', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical::FORECAST', 'argumentCount' => '3', ], 'FREQUENCY' => [ @@ -870,42 +870,42 @@ class Calculation ], 'FV' => [ 'category' => Calculation\Categories::CATEGORY_FINANCIAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Financial::FV', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Financial::FV', 'argumentCount' => '3-5', ], 'FVSCHEDULE' => [ 'category' => Calculation\Categories::CATEGORY_FINANCIAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Financial::FVSCHEDULE', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Financial::FVSCHEDULE', 'argumentCount' => '2', ], 'GAMMADIST' => [ 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::GAMMADIST', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical::GAMMADIST', 'argumentCount' => '4', ], 'GAMMAINV' => [ 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::GAMMAINV', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical::GAMMAINV', 'argumentCount' => '3', ], 'GAMMALN' => [ 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::GAMMALN', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical::GAMMALN', 'argumentCount' => '1', ], 'GCD' => [ 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\MathTrig::GCD', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\MathTrig::GCD', 'argumentCount' => '1+', ], 'GEOMEAN' => [ 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::GEOMEAN', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical::GEOMEAN', 'argumentCount' => '1+', ], 'GESTEP' => [ 'category' => Calculation\Categories::CATEGORY_ENGINEERING, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Engineering::GESTEP', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Engineering::GESTEP', 'argumentCount' => '1,2', ], 'GETPIVOTDATA' => [ @@ -915,153 +915,153 @@ class Calculation ], 'GROWTH' => [ 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::GROWTH', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical::GROWTH', 'argumentCount' => '1-4', ], 'HARMEAN' => [ 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::HARMEAN', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical::HARMEAN', 'argumentCount' => '1+', ], 'HEX2BIN' => [ 'category' => Calculation\Categories::CATEGORY_ENGINEERING, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Engineering::HEXTOBIN', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Engineering::HEXTOBIN', 'argumentCount' => '1,2', ], 'HEX2DEC' => [ 'category' => Calculation\Categories::CATEGORY_ENGINEERING, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Engineering::HEXTODEC', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Engineering::HEXTODEC', 'argumentCount' => '1', ], 'HEX2OCT' => [ 'category' => Calculation\Categories::CATEGORY_ENGINEERING, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Engineering::HEXTOOCT', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Engineering::HEXTOOCT', 'argumentCount' => '1,2', ], 'HLOOKUP' => [ 'category' => Calculation\Categories::CATEGORY_LOOKUP_AND_REFERENCE, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\LookupRef::HLOOKUP', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\LookupRef::HLOOKUP', 'argumentCount' => '3,4', ], 'HOUR' => [ 'category' => Calculation\Categories::CATEGORY_DATE_AND_TIME, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\DateTime::HOUROFDAY', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\DateTime::HOUROFDAY', 'argumentCount' => '1', ], 'HYPERLINK' => [ 'category' => Calculation\Categories::CATEGORY_LOOKUP_AND_REFERENCE, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\LookupRef::HYPERLINK', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\LookupRef::HYPERLINK', 'argumentCount' => '1,2', 'passCellReference' => true, ], 'HYPGEOMDIST' => [ 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::HYPGEOMDIST', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical::HYPGEOMDIST', 'argumentCount' => '4', ], 'IF' => [ 'category' => Calculation\Categories::CATEGORY_LOGICAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Logical::statementIf', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Logical::statementIf', 'argumentCount' => '1-3', ], 'IFERROR' => [ 'category' => Calculation\Categories::CATEGORY_LOGICAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Logical::IFERROR', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Logical::IFERROR', 'argumentCount' => '2', ], 'IMABS' => [ 'category' => Calculation\Categories::CATEGORY_ENGINEERING, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Engineering::IMABS', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Engineering::IMABS', 'argumentCount' => '1', ], 'IMAGINARY' => [ 'category' => Calculation\Categories::CATEGORY_ENGINEERING, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Engineering::IMAGINARY', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Engineering::IMAGINARY', 'argumentCount' => '1', ], 'IMARGUMENT' => [ 'category' => Calculation\Categories::CATEGORY_ENGINEERING, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Engineering::IMARGUMENT', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Engineering::IMARGUMENT', 'argumentCount' => '1', ], 'IMCONJUGATE' => [ 'category' => Calculation\Categories::CATEGORY_ENGINEERING, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Engineering::IMCONJUGATE', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Engineering::IMCONJUGATE', 'argumentCount' => '1', ], 'IMCOS' => [ 'category' => Calculation\Categories::CATEGORY_ENGINEERING, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Engineering::IMCOS', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Engineering::IMCOS', 'argumentCount' => '1', ], 'IMDIV' => [ 'category' => Calculation\Categories::CATEGORY_ENGINEERING, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Engineering::IMDIV', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Engineering::IMDIV', 'argumentCount' => '2', ], 'IMEXP' => [ 'category' => Calculation\Categories::CATEGORY_ENGINEERING, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Engineering::IMEXP', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Engineering::IMEXP', 'argumentCount' => '1', ], 'IMLN' => [ 'category' => Calculation\Categories::CATEGORY_ENGINEERING, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Engineering::IMLN', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Engineering::IMLN', 'argumentCount' => '1', ], 'IMLOG10' => [ 'category' => Calculation\Categories::CATEGORY_ENGINEERING, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Engineering::IMLOG10', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Engineering::IMLOG10', 'argumentCount' => '1', ], 'IMLOG2' => [ 'category' => Calculation\Categories::CATEGORY_ENGINEERING, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Engineering::IMLOG2', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Engineering::IMLOG2', 'argumentCount' => '1', ], 'IMPOWER' => [ 'category' => Calculation\Categories::CATEGORY_ENGINEERING, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Engineering::IMPOWER', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Engineering::IMPOWER', 'argumentCount' => '2', ], 'IMPRODUCT' => [ 'category' => Calculation\Categories::CATEGORY_ENGINEERING, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Engineering::IMPRODUCT', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Engineering::IMPRODUCT', 'argumentCount' => '1+', ], 'IMREAL' => [ 'category' => Calculation\Categories::CATEGORY_ENGINEERING, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Engineering::IMREAL', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Engineering::IMREAL', 'argumentCount' => '1', ], 'IMSIN' => [ 'category' => Calculation\Categories::CATEGORY_ENGINEERING, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Engineering::IMSIN', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Engineering::IMSIN', 'argumentCount' => '1', ], 'IMSQRT' => [ 'category' => Calculation\Categories::CATEGORY_ENGINEERING, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Engineering::IMSQRT', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Engineering::IMSQRT', 'argumentCount' => '1', ], 'IMSUB' => [ 'category' => Calculation\Categories::CATEGORY_ENGINEERING, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Engineering::IMSUB', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Engineering::IMSUB', 'argumentCount' => '2', ], 'IMSUM' => [ 'category' => Calculation\Categories::CATEGORY_ENGINEERING, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Engineering::IMSUM', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Engineering::IMSUM', 'argumentCount' => '1+', ], 'INDEX' => [ 'category' => Calculation\Categories::CATEGORY_LOOKUP_AND_REFERENCE, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\LookupRef::INDEX', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\LookupRef::INDEX', 'argumentCount' => '1-4', ], 'INDIRECT' => [ 'category' => Calculation\Categories::CATEGORY_LOOKUP_AND_REFERENCE, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\LookupRef::INDIRECT', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\LookupRef::INDIRECT', 'argumentCount' => '1,2', 'passCellReference' => true, ], @@ -1072,27 +1072,27 @@ class Calculation ], 'INT' => [ 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\MathTrig::INT', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\MathTrig::INT', 'argumentCount' => '1', ], 'INTERCEPT' => [ 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::INTERCEPT', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical::INTERCEPT', 'argumentCount' => '2', ], 'INTRATE' => [ 'category' => Calculation\Categories::CATEGORY_FINANCIAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Financial::INTRATE', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Financial::INTRATE', 'argumentCount' => '4,5', ], 'IPMT' => [ 'category' => Calculation\Categories::CATEGORY_FINANCIAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Financial::IPMT', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Financial::IPMT', 'argumentCount' => '4-6', ], 'IRR' => [ 'category' => Calculation\Categories::CATEGORY_FINANCIAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Financial::IRR', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Financial::IRR', 'argumentCount' => '1,2', ], 'ISBLANK' => [ @@ -1142,7 +1142,7 @@ class Calculation ], 'ISPMT' => [ 'category' => Calculation\Categories::CATEGORY_FINANCIAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Financial::ISPMT', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Financial::ISPMT', 'argumentCount' => '4', ], 'ISREF' => [ @@ -1162,42 +1162,42 @@ class Calculation ], 'KURT' => [ 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::KURT', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical::KURT', 'argumentCount' => '1+', ], 'LARGE' => [ 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::LARGE', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical::LARGE', 'argumentCount' => '2', ], 'LCM' => [ 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\MathTrig::LCM', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\MathTrig::LCM', 'argumentCount' => '1+', ], 'LEFT' => [ 'category' => Calculation\Categories::CATEGORY_TEXT_AND_DATA, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\TextData::LEFT', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\TextData::LEFT', 'argumentCount' => '1,2', ], 'LEFTB' => [ 'category' => Calculation\Categories::CATEGORY_TEXT_AND_DATA, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\TextData::LEFT', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\TextData::LEFT', 'argumentCount' => '1,2', ], 'LEN' => [ 'category' => Calculation\Categories::CATEGORY_TEXT_AND_DATA, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\TextData::STRINGLENGTH', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\TextData::STRINGLENGTH', 'argumentCount' => '1', ], 'LENB' => [ 'category' => Calculation\Categories::CATEGORY_TEXT_AND_DATA, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\TextData::STRINGLENGTH', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\TextData::STRINGLENGTH', 'argumentCount' => '1', ], 'LINEST' => [ 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::LINEST', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical::LINEST', 'argumentCount' => '1-4', ], 'LN' => [ @@ -1207,7 +1207,7 @@ class Calculation ], 'LOG' => [ 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\MathTrig::logBase', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\MathTrig::logBase', 'argumentCount' => '1,2', ], 'LOG10' => [ @@ -1217,52 +1217,52 @@ class Calculation ], 'LOGEST' => [ 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::LOGEST', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical::LOGEST', 'argumentCount' => '1-4', ], 'LOGINV' => [ 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::LOGINV', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical::LOGINV', 'argumentCount' => '3', ], 'LOGNORMDIST' => [ 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::LOGNORMDIST', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical::LOGNORMDIST', 'argumentCount' => '3', ], 'LOOKUP' => [ 'category' => Calculation\Categories::CATEGORY_LOOKUP_AND_REFERENCE, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\LookupRef::LOOKUP', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\LookupRef::LOOKUP', 'argumentCount' => '2,3', ], 'LOWER' => [ 'category' => Calculation\Categories::CATEGORY_TEXT_AND_DATA, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\TextData::LOWERCASE', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\TextData::LOWERCASE', 'argumentCount' => '1', ], 'MATCH' => [ 'category' => Calculation\Categories::CATEGORY_LOOKUP_AND_REFERENCE, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\LookupRef::MATCH', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\LookupRef::MATCH', 'argumentCount' => '2,3', ], 'MAX' => [ 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::MAX', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical::MAX', 'argumentCount' => '1+', ], 'MAXA' => [ 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::MAXA', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical::MAXA', 'argumentCount' => '1+', ], 'MAXIF' => [ 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::MAXIF', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical::MAXIF', 'argumentCount' => '2+', ], 'MDETERM' => [ 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\MathTrig::MDETERM', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\MathTrig::MDETERM', 'argumentCount' => '1', ], 'MDURATION' => [ @@ -1272,7 +1272,7 @@ class Calculation ], 'MEDIAN' => [ 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::MEDIAN', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical::MEDIAN', 'argumentCount' => '1+', ], 'MEDIANIF' => [ @@ -1282,72 +1282,72 @@ class Calculation ], 'MID' => [ 'category' => Calculation\Categories::CATEGORY_TEXT_AND_DATA, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\TextData::MID', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\TextData::MID', 'argumentCount' => '3', ], 'MIDB' => [ 'category' => Calculation\Categories::CATEGORY_TEXT_AND_DATA, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\TextData::MID', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\TextData::MID', 'argumentCount' => '3', ], 'MIN' => [ 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::MIN', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical::MIN', 'argumentCount' => '1+', ], 'MINA' => [ 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::MINA', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical::MINA', 'argumentCount' => '1+', ], 'MINIF' => [ 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::MINIF', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical::MINIF', 'argumentCount' => '2+', ], 'MINUTE' => [ 'category' => Calculation\Categories::CATEGORY_DATE_AND_TIME, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\DateTime::MINUTEOFHOUR', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\DateTime::MINUTEOFHOUR', 'argumentCount' => '1', ], 'MINVERSE' => [ 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\MathTrig::MINVERSE', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\MathTrig::MINVERSE', 'argumentCount' => '1', ], 'MIRR' => [ 'category' => Calculation\Categories::CATEGORY_FINANCIAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Financial::MIRR', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Financial::MIRR', 'argumentCount' => '3', ], 'MMULT' => [ 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\MathTrig::MMULT', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\MathTrig::MMULT', 'argumentCount' => '2', ], 'MOD' => [ 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\MathTrig::MOD', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\MathTrig::MOD', 'argumentCount' => '2', ], 'MODE' => [ 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::MODE', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical::MODE', 'argumentCount' => '1+', ], 'MONTH' => [ 'category' => Calculation\Categories::CATEGORY_DATE_AND_TIME, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\DateTime::MONTHOFYEAR', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\DateTime::MONTHOFYEAR', 'argumentCount' => '1', ], 'MROUND' => [ 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\MathTrig::MROUND', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\MathTrig::MROUND', 'argumentCount' => '2', ], 'MULTINOMIAL' => [ 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\MathTrig::MULTINOMIAL', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\MathTrig::MULTINOMIAL', 'argumentCount' => '1+', ], 'N' => [ @@ -1362,77 +1362,77 @@ class Calculation ], 'NEGBINOMDIST' => [ 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::NEGBINOMDIST', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical::NEGBINOMDIST', 'argumentCount' => '3', ], 'NETWORKDAYS' => [ 'category' => Calculation\Categories::CATEGORY_DATE_AND_TIME, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\DateTime::NETWORKDAYS', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\DateTime::NETWORKDAYS', 'argumentCount' => '2+', ], 'NOMINAL' => [ 'category' => Calculation\Categories::CATEGORY_FINANCIAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Financial::NOMINAL', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Financial::NOMINAL', 'argumentCount' => '2', ], 'NORMDIST' => [ 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::NORMDIST', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical::NORMDIST', 'argumentCount' => '4', ], 'NORMINV' => [ 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::NORMINV', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical::NORMINV', 'argumentCount' => '3', ], 'NORMSDIST' => [ 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::NORMSDIST', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical::NORMSDIST', 'argumentCount' => '1', ], 'NORMSINV' => [ 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::NORMSINV', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical::NORMSINV', 'argumentCount' => '1', ], 'NOT' => [ 'category' => Calculation\Categories::CATEGORY_LOGICAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Logical::NOT', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Logical::NOT', 'argumentCount' => '1', ], 'NOW' => [ 'category' => Calculation\Categories::CATEGORY_DATE_AND_TIME, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\DateTime::DATETIMENOW', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\DateTime::DATETIMENOW', 'argumentCount' => '0', ], 'NPER' => [ 'category' => Calculation\Categories::CATEGORY_FINANCIAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Financial::NPER', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Financial::NPER', 'argumentCount' => '3-5', ], 'NPV' => [ 'category' => Calculation\Categories::CATEGORY_FINANCIAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Financial::NPV', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Financial::NPV', 'argumentCount' => '2+', ], 'OCT2BIN' => [ 'category' => Calculation\Categories::CATEGORY_ENGINEERING, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Engineering::OCTTOBIN', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Engineering::OCTTOBIN', 'argumentCount' => '1,2', ], 'OCT2DEC' => [ 'category' => Calculation\Categories::CATEGORY_ENGINEERING, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Engineering::OCTTODEC', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Engineering::OCTTODEC', 'argumentCount' => '1', ], 'OCT2HEX' => [ 'category' => Calculation\Categories::CATEGORY_ENGINEERING, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Engineering::OCTTOHEX', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Engineering::OCTTOHEX', 'argumentCount' => '1,2', ], 'ODD' => [ 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\MathTrig::ODD', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\MathTrig::ODD', 'argumentCount' => '1', ], 'ODDFPRICE' => [ @@ -1457,34 +1457,34 @@ class Calculation ], 'OFFSET' => [ 'category' => Calculation\Categories::CATEGORY_LOOKUP_AND_REFERENCE, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\LookupRef::OFFSET', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\LookupRef::OFFSET', 'argumentCount' => '3-5', 'passCellReference' => true, 'passByReference' => [true], ], 'OR' => [ 'category' => Calculation\Categories::CATEGORY_LOGICAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Logical::logicalOr', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Logical::logicalOr', 'argumentCount' => '1+', ], 'PEARSON' => [ 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::CORREL', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical::CORREL', 'argumentCount' => '2', ], 'PERCENTILE' => [ 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::PERCENTILE', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical::PERCENTILE', 'argumentCount' => '2', ], 'PERCENTRANK' => [ 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::PERCENTRANK', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical::PERCENTRANK', 'argumentCount' => '2,3', ], 'PERMUT' => [ 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::PERMUT', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical::PERMUT', 'argumentCount' => '2', ], 'PHONETIC' => [ @@ -1499,37 +1499,37 @@ class Calculation ], 'PMT' => [ 'category' => Calculation\Categories::CATEGORY_FINANCIAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Financial::PMT', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Financial::PMT', 'argumentCount' => '3-5', ], 'POISSON' => [ 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::POISSON', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical::POISSON', 'argumentCount' => '3', ], 'POWER' => [ 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\MathTrig::POWER', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\MathTrig::POWER', 'argumentCount' => '2', ], 'PPMT' => [ 'category' => Calculation\Categories::CATEGORY_FINANCIAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Financial::PPMT', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Financial::PPMT', 'argumentCount' => '4-6', ], 'PRICE' => [ 'category' => Calculation\Categories::CATEGORY_FINANCIAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Financial::PRICE', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Financial::PRICE', 'argumentCount' => '6,7', ], 'PRICEDISC' => [ 'category' => Calculation\Categories::CATEGORY_FINANCIAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Financial::PRICEDISC', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Financial::PRICEDISC', 'argumentCount' => '4,5', ], 'PRICEMAT' => [ 'category' => Calculation\Categories::CATEGORY_FINANCIAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Financial::PRICEMAT', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Financial::PRICEMAT', 'argumentCount' => '5,6', ], 'PROB' => [ @@ -1539,27 +1539,27 @@ class Calculation ], 'PRODUCT' => [ 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\MathTrig::PRODUCT', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\MathTrig::PRODUCT', 'argumentCount' => '1+', ], 'PROPER' => [ 'category' => Calculation\Categories::CATEGORY_TEXT_AND_DATA, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\TextData::PROPERCASE', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\TextData::PROPERCASE', 'argumentCount' => '1', ], 'PV' => [ 'category' => Calculation\Categories::CATEGORY_FINANCIAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Financial::PV', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Financial::PV', 'argumentCount' => '3-5', ], 'QUARTILE' => [ 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::QUARTILE', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical::QUARTILE', 'argumentCount' => '2', ], 'QUOTIENT' => [ 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\MathTrig::QUOTIENT', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\MathTrig::QUOTIENT', 'argumentCount' => '2', ], 'RADIANS' => [ @@ -1569,37 +1569,37 @@ class Calculation ], 'RAND' => [ 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\MathTrig::RAND', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\MathTrig::RAND', 'argumentCount' => '0', ], 'RANDBETWEEN' => [ 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\MathTrig::RAND', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\MathTrig::RAND', 'argumentCount' => '2', ], 'RANK' => [ 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::RANK', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical::RANK', 'argumentCount' => '2,3', ], 'RATE' => [ 'category' => Calculation\Categories::CATEGORY_FINANCIAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Financial::RATE', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Financial::RATE', 'argumentCount' => '3-6', ], 'RECEIVED' => [ 'category' => Calculation\Categories::CATEGORY_FINANCIAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Financial::RECEIVED', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Financial::RECEIVED', 'argumentCount' => '4-5', ], 'REPLACE' => [ 'category' => Calculation\Categories::CATEGORY_TEXT_AND_DATA, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\TextData::REPLACE', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\TextData::REPLACE', 'argumentCount' => '4', ], 'REPLACEB' => [ 'category' => Calculation\Categories::CATEGORY_TEXT_AND_DATA, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\TextData::REPLACE', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\TextData::REPLACE', 'argumentCount' => '4', ], 'REPT' => [ @@ -1609,17 +1609,17 @@ class Calculation ], 'RIGHT' => [ 'category' => Calculation\Categories::CATEGORY_TEXT_AND_DATA, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\TextData::RIGHT', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\TextData::RIGHT', 'argumentCount' => '1,2', ], 'RIGHTB' => [ 'category' => Calculation\Categories::CATEGORY_TEXT_AND_DATA, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\TextData::RIGHT', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\TextData::RIGHT', 'argumentCount' => '1,2', ], 'ROMAN' => [ 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\MathTrig::ROMAN', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\MathTrig::ROMAN', 'argumentCount' => '1,2', ], 'ROUND' => [ @@ -1629,28 +1629,28 @@ class Calculation ], 'ROUNDDOWN' => [ 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\MathTrig::ROUNDDOWN', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\MathTrig::ROUNDDOWN', 'argumentCount' => '2', ], 'ROUNDUP' => [ 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\MathTrig::ROUNDUP', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\MathTrig::ROUNDUP', 'argumentCount' => '2', ], 'ROW' => [ 'category' => Calculation\Categories::CATEGORY_LOOKUP_AND_REFERENCE, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\LookupRef::ROW', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\LookupRef::ROW', 'argumentCount' => '-1', 'passByReference' => [true], ], 'ROWS' => [ 'category' => Calculation\Categories::CATEGORY_LOOKUP_AND_REFERENCE, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\LookupRef::ROWS', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\LookupRef::ROWS', 'argumentCount' => '1', ], 'RSQ' => [ 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::RSQ', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical::RSQ', 'argumentCount' => '2', ], 'RTD' => [ @@ -1660,27 +1660,27 @@ class Calculation ], 'SEARCH' => [ 'category' => Calculation\Categories::CATEGORY_TEXT_AND_DATA, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\TextData::SEARCHINSENSITIVE', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\TextData::SEARCHINSENSITIVE', 'argumentCount' => '2,3', ], 'SEARCHB' => [ 'category' => Calculation\Categories::CATEGORY_TEXT_AND_DATA, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\TextData::SEARCHINSENSITIVE', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\TextData::SEARCHINSENSITIVE', 'argumentCount' => '2,3', ], 'SECOND' => [ 'category' => Calculation\Categories::CATEGORY_DATE_AND_TIME, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\DateTime::SECONDOFMINUTE', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\DateTime::SECONDOFMINUTE', 'argumentCount' => '1', ], 'SERIESSUM' => [ 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\MathTrig::SERIESSUM', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\MathTrig::SERIESSUM', 'argumentCount' => '4', ], 'SIGN' => [ 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\MathTrig::SIGN', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\MathTrig::SIGN', 'argumentCount' => '1', ], 'SIN' => [ @@ -1695,22 +1695,22 @@ class Calculation ], 'SKEW' => [ 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::SKEW', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical::SKEW', 'argumentCount' => '1+', ], 'SLN' => [ 'category' => Calculation\Categories::CATEGORY_FINANCIAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Financial::SLN', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Financial::SLN', 'argumentCount' => '3', ], 'SLOPE' => [ 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::SLOPE', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical::SLOPE', 'argumentCount' => '2', ], 'SMALL' => [ 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::SMALL', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical::SMALL', 'argumentCount' => '2', ], 'SQRT' => [ @@ -1720,97 +1720,97 @@ class Calculation ], 'SQRTPI' => [ 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\MathTrig::SQRTPI', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\MathTrig::SQRTPI', 'argumentCount' => '1', ], 'STANDARDIZE' => [ 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::STANDARDIZE', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical::STANDARDIZE', 'argumentCount' => '3', ], 'STDEV' => [ 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::STDEV', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical::STDEV', 'argumentCount' => '1+', ], 'STDEVA' => [ 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::STDEVA', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical::STDEVA', 'argumentCount' => '1+', ], 'STDEVP' => [ 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::STDEVP', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical::STDEVP', 'argumentCount' => '1+', ], 'STDEVPA' => [ 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::STDEVPA', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical::STDEVPA', 'argumentCount' => '1+', ], 'STEYX' => [ 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::STEYX', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical::STEYX', 'argumentCount' => '2', ], 'SUBSTITUTE' => [ 'category' => Calculation\Categories::CATEGORY_TEXT_AND_DATA, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\TextData::SUBSTITUTE', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\TextData::SUBSTITUTE', 'argumentCount' => '3,4', ], 'SUBTOTAL' => [ 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\MathTrig::SUBTOTAL', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\MathTrig::SUBTOTAL', 'argumentCount' => '2+', ], 'SUM' => [ 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\MathTrig::SUM', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\MathTrig::SUM', 'argumentCount' => '1+', ], 'SUMIF' => [ 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\MathTrig::SUMIF', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\MathTrig::SUMIF', 'argumentCount' => '2,3', ], 'SUMIFS' => [ 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\MathTrig::SUMIFS', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\MathTrig::SUMIFS', 'argumentCount' => '3+', ], 'SUMPRODUCT' => [ 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\MathTrig::SUMPRODUCT', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\MathTrig::SUMPRODUCT', 'argumentCount' => '1+', ], 'SUMSQ' => [ 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\MathTrig::SUMSQ', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\MathTrig::SUMSQ', 'argumentCount' => '1+', ], 'SUMX2MY2' => [ 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\MathTrig::SUMX2MY2', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\MathTrig::SUMX2MY2', 'argumentCount' => '2', ], 'SUMX2PY2' => [ 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\MathTrig::SUMX2PY2', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\MathTrig::SUMX2PY2', 'argumentCount' => '2', ], 'SUMXMY2' => [ 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\MathTrig::SUMXMY2', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\MathTrig::SUMXMY2', 'argumentCount' => '2', ], 'SYD' => [ 'category' => Calculation\Categories::CATEGORY_FINANCIAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Financial::SYD', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Financial::SYD', 'argumentCount' => '4', ], 'T' => [ 'category' => Calculation\Categories::CATEGORY_TEXT_AND_DATA, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\TextData::RETURNSTRING', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\TextData::RETURNSTRING', 'argumentCount' => '1', ], 'TAN' => [ @@ -1825,77 +1825,77 @@ class Calculation ], 'TBILLEQ' => [ 'category' => Calculation\Categories::CATEGORY_FINANCIAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Financial::TBILLEQ', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Financial::TBILLEQ', 'argumentCount' => '3', ], 'TBILLPRICE' => [ 'category' => Calculation\Categories::CATEGORY_FINANCIAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Financial::TBILLPRICE', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Financial::TBILLPRICE', 'argumentCount' => '3', ], 'TBILLYIELD' => [ 'category' => Calculation\Categories::CATEGORY_FINANCIAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Financial::TBILLYIELD', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Financial::TBILLYIELD', 'argumentCount' => '3', ], 'TDIST' => [ 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::TDIST', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical::TDIST', 'argumentCount' => '3', ], 'TEXT' => [ 'category' => Calculation\Categories::CATEGORY_TEXT_AND_DATA, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\TextData::TEXTFORMAT', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\TextData::TEXTFORMAT', 'argumentCount' => '2', ], 'TIME' => [ 'category' => Calculation\Categories::CATEGORY_DATE_AND_TIME, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\DateTime::TIME', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\DateTime::TIME', 'argumentCount' => '3', ], 'TIMEVALUE' => [ 'category' => Calculation\Categories::CATEGORY_DATE_AND_TIME, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\DateTime::TIMEVALUE', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\DateTime::TIMEVALUE', 'argumentCount' => '1', ], 'TINV' => [ 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::TINV', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical::TINV', 'argumentCount' => '2', ], 'TODAY' => [ 'category' => Calculation\Categories::CATEGORY_DATE_AND_TIME, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\DateTime::DATENOW', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\DateTime::DATENOW', 'argumentCount' => '0', ], 'TRANSPOSE' => [ 'category' => Calculation\Categories::CATEGORY_LOOKUP_AND_REFERENCE, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\LookupRef::TRANSPOSE', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\LookupRef::TRANSPOSE', 'argumentCount' => '1', ], 'TREND' => [ 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::TREND', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical::TREND', 'argumentCount' => '1-4', ], 'TRIM' => [ 'category' => Calculation\Categories::CATEGORY_TEXT_AND_DATA, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\TextData::TRIMSPACES', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\TextData::TRIMSPACES', 'argumentCount' => '1', ], 'TRIMMEAN' => [ 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::TRIMMEAN', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical::TRIMMEAN', 'argumentCount' => '2', ], 'TRUE' => [ 'category' => Calculation\Categories::CATEGORY_LOGICAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Logical::TRUE', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Logical::TRUE', 'argumentCount' => '0', ], 'TRUNC' => [ 'category' => Calculation\Categories::CATEGORY_MATH_AND_TRIG, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\MathTrig::TRUNC', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\MathTrig::TRUNC', 'argumentCount' => '1,2', ], 'TTEST' => [ @@ -1910,7 +1910,7 @@ class Calculation ], 'UPPER' => [ 'category' => Calculation\Categories::CATEGORY_TEXT_AND_DATA, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\TextData::UPPERCASE', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\TextData::UPPERCASE', 'argumentCount' => '1', ], 'USDOLLAR' => [ @@ -1920,27 +1920,27 @@ class Calculation ], 'VALUE' => [ 'category' => Calculation\Categories::CATEGORY_TEXT_AND_DATA, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\TextData::VALUE', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\TextData::VALUE', 'argumentCount' => '1', ], 'VAR' => [ 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::VARFunc', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical::VARFunc', 'argumentCount' => '1+', ], 'VARA' => [ 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::VARA', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical::VARA', 'argumentCount' => '1+', ], 'VARP' => [ 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::VARP', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical::VARP', 'argumentCount' => '1+', ], 'VARPA' => [ 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::VARPA', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical::VARPA', 'argumentCount' => '1+', ], 'VDB' => [ @@ -1955,47 +1955,47 @@ class Calculation ], 'VLOOKUP' => [ 'category' => Calculation\Categories::CATEGORY_LOOKUP_AND_REFERENCE, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\LookupRef::VLOOKUP', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\LookupRef::VLOOKUP', 'argumentCount' => '3,4', ], 'WEEKDAY' => [ 'category' => Calculation\Categories::CATEGORY_DATE_AND_TIME, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\DateTime::DAYOFWEEK', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\DateTime::DAYOFWEEK', 'argumentCount' => '1,2', ], 'WEEKNUM' => [ 'category' => Calculation\Categories::CATEGORY_DATE_AND_TIME, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\DateTime::WEEKOFYEAR', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\DateTime::WEEKOFYEAR', 'argumentCount' => '1,2', ], 'WEIBULL' => [ 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::WEIBULL', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical::WEIBULL', 'argumentCount' => '4', ], 'WORKDAY' => [ 'category' => Calculation\Categories::CATEGORY_DATE_AND_TIME, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\DateTime::WORKDAY', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\DateTime::WORKDAY', 'argumentCount' => '2+', ], 'XIRR' => [ 'category' => Calculation\Categories::CATEGORY_FINANCIAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Financial::XIRR', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Financial::XIRR', 'argumentCount' => '2,3', ], 'XNPV' => [ 'category' => Calculation\Categories::CATEGORY_FINANCIAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Financial::XNPV', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Financial::XNPV', 'argumentCount' => '3', ], 'YEAR' => [ 'category' => Calculation\Categories::CATEGORY_DATE_AND_TIME, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\DateTime::YEAR', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\DateTime::YEAR', 'argumentCount' => '1', ], 'YEARFRAC' => [ 'category' => Calculation\Categories::CATEGORY_DATE_AND_TIME, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\DateTime::YEARFRAC', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\DateTime::YEARFRAC', 'argumentCount' => '2,3', ], 'YIELD' => [ @@ -2005,17 +2005,17 @@ class Calculation ], 'YIELDDISC' => [ 'category' => Calculation\Categories::CATEGORY_FINANCIAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Financial::YIELDDISC', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Financial::YIELDDISC', 'argumentCount' => '4,5', ], 'YIELDMAT' => [ 'category' => Calculation\Categories::CATEGORY_FINANCIAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Financial::YIELDMAT', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Financial::YIELDMAT', 'argumentCount' => '5,6', ], 'ZTEST' => [ 'category' => Calculation\Categories::CATEGORY_STATISTICAL, - 'functionCall' => '\\PhpSpreadsheet\\Calculation\\Statistical::ZTEST', + 'functionCall' => '\\PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical::ZTEST', 'argumentCount' => '2-3', ], ]; @@ -2065,7 +2065,7 @@ class Calculation } if (!isset(self::$instance) || (self::$instance === null)) { - self::$instance = new \PhpSpreadsheet\Calculation(); + self::$instance = new \PhpOffice\PhpSpreadsheet\Calculation(); } return self::$instance; @@ -2083,7 +2083,7 @@ class Calculation /** * Flush the calculation cache for any existing instance of this class - * but only if a \PhpSpreadsheet\Calculation instance exists + * but only if a \PhpOffice\PhpSpreadsheet\Calculation instance exists */ public function flushInstance() { diff --git a/src/PhpSpreadsheet/Calculation/Categories.php b/src/PhpSpreadsheet/Calculation/Categories.php index 8f3ba238..9d992d3e 100644 --- a/src/PhpSpreadsheet/Calculation/Categories.php +++ b/src/PhpSpreadsheet/Calculation/Categories.php @@ -1,6 +1,6 @@ _calculateFormulaValue('=' . $testConditionList); + $result = \PhpOffice\PhpSpreadsheet\Calculation::getInstance()->_calculateFormulaValue('=' . $testConditionList); // If the row failed to meet the criteria, remove it from the database if (!$result) { unset($database[$dataRow]); diff --git a/src/PhpSpreadsheet/Calculation/DateTime.php b/src/PhpSpreadsheet/Calculation/DateTime.php index 2efb017d..ceda521c 100644 --- a/src/PhpSpreadsheet/Calculation/DateTime.php +++ b/src/PhpSpreadsheet/Calculation/DateTime.php @@ -1,6 +1,6 @@ format('m'); $oYear = (int) $PHPDateObject->format('Y'); @@ -167,7 +167,7 @@ class DateTime $retValue = false; switch (Functions::getReturnDateType()) { case Functions::RETURNDATE_EXCEL: - $retValue = (float) \PhpSpreadsheet\Shared\Date::PHPToExcel(time()); + $retValue = (float) \PhpOffice\PhpSpreadsheet\Shared\Date::PHPToExcel(time()); break; case Functions::RETURNDATE_PHP_NUMERIC: $retValue = (integer) time(); @@ -204,16 +204,16 @@ class DateTime $saveTimeZone = date_default_timezone_get(); date_default_timezone_set('UTC'); $retValue = false; - $excelDateTime = floor(\PhpSpreadsheet\Shared\Date::PHPToExcel(time())); + $excelDateTime = floor(\PhpOffice\PhpSpreadsheet\Shared\Date::PHPToExcel(time())); switch (Functions::getReturnDateType()) { case Functions::RETURNDATE_EXCEL: $retValue = (float) $excelDateTime; break; case Functions::RETURNDATE_PHP_NUMERIC: - $retValue = (integer) \PhpSpreadsheet\Shared\Date::excelToTimestamp($excelDateTime); + $retValue = (integer) \PhpOffice\PhpSpreadsheet\Shared\Date::excelToTimestamp($excelDateTime); break; case Functions::RETURNDATE_PHP_OBJECT: - $retValue = \PhpSpreadsheet\Shared\Date::excelToDateTimeObject($excelDateTime); + $retValue = \PhpOffice\PhpSpreadsheet\Shared\Date::excelToDateTimeObject($excelDateTime); break; } date_default_timezone_set($saveTimeZone); @@ -277,16 +277,16 @@ class DateTime $day = Functions::flattenSingleValue($day); if (($month !== null) && (!is_numeric($month))) { - $month = \PhpSpreadsheet\Shared\Date::monthStringToNumber($month); + $month = \PhpOffice\PhpSpreadsheet\Shared\Date::monthStringToNumber($month); } if (($day !== null) && (!is_numeric($day))) { - $day = \PhpSpreadsheet\Shared\Date::dayStringToNumber($day); + $day = \PhpOffice\PhpSpreadsheet\Shared\Date::dayStringToNumber($day); } - $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; + $year = ($year !== null) ? \PhpOffice\PhpSpreadsheet\Shared\StringHelper::testStringAsNumeric($year) : 0; + $month = ($month !== null) ? \PhpOffice\PhpSpreadsheet\Shared\StringHelper::testStringAsNumeric($month) : 0; + $day = ($day !== null) ? \PhpOffice\PhpSpreadsheet\Shared\StringHelper::testStringAsNumeric($day) : 0; if ((!is_numeric($year)) || (!is_numeric($month)) || (!is_numeric($day))) { @@ -296,7 +296,7 @@ class DateTime $month = (integer) $month; $day = (integer) $day; - $baseYear = \PhpSpreadsheet\Shared\Date::getExcelCalendar(); + $baseYear = \PhpOffice\PhpSpreadsheet\Shared\Date::getExcelCalendar(); // Validate parameters if ($year < ($baseYear - 1900)) { return Functions::NAN(); @@ -326,14 +326,14 @@ class DateTime } // Execute function - $excelDateValue = \PhpSpreadsheet\Shared\Date::formattedPHPToExcel($year, $month, $day); + $excelDateValue = \PhpOffice\PhpSpreadsheet\Shared\Date::formattedPHPToExcel($year, $month, $day); switch (Functions::getReturnDateType()) { case Functions::RETURNDATE_EXCEL: return (float) $excelDateValue; case Functions::RETURNDATE_PHP_NUMERIC: - return (integer) \PhpSpreadsheet\Shared\Date::excelToTimestamp($excelDateValue); + return (integer) \PhpOffice\PhpSpreadsheet\Shared\Date::excelToTimestamp($excelDateValue); case Functions::RETURNDATE_PHP_OBJECT: - return \PhpSpreadsheet\Shared\Date::excelToDateTimeObject($excelDateValue); + return \PhpOffice\PhpSpreadsheet\Shared\Date::excelToDateTimeObject($excelDateValue); } } @@ -417,14 +417,14 @@ class DateTime switch (Functions::getReturnDateType()) { case Functions::RETURNDATE_EXCEL: $date = 0; - $calendar = \PhpSpreadsheet\Shared\Date::getExcelCalendar(); - if ($calendar != \PhpSpreadsheet\Shared\Date::CALENDAR_WINDOWS_1900) { + $calendar = \PhpOffice\PhpSpreadsheet\Shared\Date::getExcelCalendar(); + if ($calendar != \PhpOffice\PhpSpreadsheet\Shared\Date::CALENDAR_WINDOWS_1900) { $date = 1; } - return (float) \PhpSpreadsheet\Shared\Date::formattedPHPToExcel($calendar, 1, $date, $hour, $minute, $second); + return (float) \PhpOffice\PhpSpreadsheet\Shared\Date::formattedPHPToExcel($calendar, 1, $date, $hour, $minute, $second); case Functions::RETURNDATE_PHP_NUMERIC: - return (integer) \PhpSpreadsheet\Shared\Date::excelToTimestamp(\PhpSpreadsheet\Shared\Date::formattedPHPToExcel(1970, 1, 1, $hour, $minute, $second)); // -2147468400; // -2147472000 + 3600 + return (integer) \PhpOffice\PhpSpreadsheet\Shared\Date::excelToTimestamp(\PhpOffice\PhpSpreadsheet\Shared\Date::formattedPHPToExcel(1970, 1, 1, $hour, $minute, $second)); // -2147468400; // -2147472000 + 3600 case Functions::RETURNDATE_PHP_OBJECT: $dayAdjust = 0; if ($hour < 0) { @@ -559,7 +559,7 @@ class DateTime return Functions::VALUE(); } $excelDateValue = floor( - \PhpSpreadsheet\Shared\Date::formattedPHPToExcel( + \PhpOffice\PhpSpreadsheet\Shared\Date::formattedPHPToExcel( $PHPDateArray['year'], $PHPDateArray['month'], $PHPDateArray['day'], @@ -572,7 +572,7 @@ class DateTime case Functions::RETURNDATE_EXCEL: return (float) $excelDateValue; case Functions::RETURNDATE_PHP_NUMERIC: - return (integer) \PhpSpreadsheet\Shared\Date::excelToTimestamp($excelDateValue); + return (integer) \PhpOffice\PhpSpreadsheet\Shared\Date::excelToTimestamp($excelDateValue); case Functions::RETURNDATE_PHP_OBJECT: return new \DateTime($PHPDateArray['year'] . '-' . $PHPDateArray['month'] . '-' . $PHPDateArray['day'] . ' 00:00:00'); } @@ -616,7 +616,7 @@ class DateTime $PHPDateArray = date_parse($timeValue); if (($PHPDateArray !== false) && ($PHPDateArray['error_count'] == 0)) { if (Functions::getCompatibilityMode() == Functions::COMPATIBILITY_OPENOFFICE) { - $excelDateValue = \PhpSpreadsheet\Shared\Date::formattedPHPToExcel( + $excelDateValue = \PhpOffice\PhpSpreadsheet\Shared\Date::formattedPHPToExcel( $PHPDateArray['year'], $PHPDateArray['month'], $PHPDateArray['day'], @@ -625,14 +625,14 @@ class DateTime $PHPDateArray['second'] ); } else { - $excelDateValue = \PhpSpreadsheet\Shared\Date::formattedPHPToExcel(1900, 1, 1, $PHPDateArray['hour'], $PHPDateArray['minute'], $PHPDateArray['second']) - 1; + $excelDateValue = \PhpOffice\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 = \PhpSpreadsheet\Shared\Date::excelToTimestamp($excelDateValue + 25569) - 3600; + return (integer) $phpDateValue = \PhpOffice\PhpSpreadsheet\Shared\Date::excelToTimestamp($excelDateValue + 25569) - 3600; case Functions::RETURNDATE_PHP_OBJECT: return new \DateTime('1900-01-01 ' . $PHPDateArray['hour'] . ':' . $PHPDateArray['minute'] . ':' . $PHPDateArray['second']); } @@ -672,12 +672,12 @@ class DateTime // Execute function $difference = $endDate - $startDate; - $PHPStartDateObject = \PhpSpreadsheet\Shared\Date::excelToDateTimeObject($startDate); + $PHPStartDateObject = \PhpOffice\PhpSpreadsheet\Shared\Date::excelToDateTimeObject($startDate); $startDays = $PHPStartDateObject->format('j'); $startMonths = $PHPStartDateObject->format('n'); $startYears = $PHPStartDateObject->format('Y'); - $PHPEndDateObject = \PhpSpreadsheet\Shared\Date::excelToDateTimeObject($endDate); + $PHPEndDateObject = \PhpOffice\PhpSpreadsheet\Shared\Date::excelToDateTimeObject($endDate); $endDays = $PHPEndDateObject->format('j'); $endMonths = $PHPEndDateObject->format('n'); $endYears = $PHPEndDateObject->format('Y'); @@ -791,12 +791,12 @@ class DateTime } // Execute function - $PHPStartDateObject = \PhpSpreadsheet\Shared\Date::excelToDateTimeObject($startDate); + $PHPStartDateObject = \PhpOffice\PhpSpreadsheet\Shared\Date::excelToDateTimeObject($startDate); $startDay = $PHPStartDateObject->format('j'); $startMonth = $PHPStartDateObject->format('n'); $startYear = $PHPStartDateObject->format('Y'); - $PHPEndDateObject = \PhpSpreadsheet\Shared\Date::excelToDateTimeObject($endDate); + $PHPEndDateObject = \PhpOffice\PhpSpreadsheet\Shared\Date::excelToDateTimeObject($endDate); $endDay = $PHPEndDateObject->format('j'); $endMonth = $PHPEndDateObject->format('n'); $endYear = $PHPEndDateObject->format('Y'); @@ -1087,9 +1087,9 @@ class DateTime case Functions::RETURNDATE_EXCEL: return (float) $endDate; case Functions::RETURNDATE_PHP_NUMERIC: - return (integer) \PhpSpreadsheet\Shared\Date::excelToTimestamp($endDate); + return (integer) \PhpOffice\PhpSpreadsheet\Shared\Date::excelToTimestamp($endDate); case Functions::RETURNDATE_PHP_OBJECT: - return \PhpSpreadsheet\Shared\Date::excelToDateTimeObject($endDate); + return \PhpOffice\PhpSpreadsheet\Shared\Date::excelToDateTimeObject($endDate); } } @@ -1121,7 +1121,7 @@ class DateTime } // Execute function - $PHPDateObject = \PhpSpreadsheet\Shared\Date::excelToDateTimeObject($dateValue); + $PHPDateObject = \PhpOffice\PhpSpreadsheet\Shared\Date::excelToDateTimeObject($dateValue); return (int) $PHPDateObject->format('j'); } @@ -1164,7 +1164,7 @@ class DateTime } // Execute function - $PHPDateObject = \PhpSpreadsheet\Shared\Date::excelToDateTimeObject($dateValue); + $PHPDateObject = \PhpOffice\PhpSpreadsheet\Shared\Date::excelToDateTimeObject($dateValue); $DoW = $PHPDateObject->format('w'); $firstDay = 1; @@ -1239,7 +1239,7 @@ class DateTime } // Execute function - $PHPDateObject = \PhpSpreadsheet\Shared\Date::excelToDateTimeObject($dateValue); + $PHPDateObject = \PhpOffice\PhpSpreadsheet\Shared\Date::excelToDateTimeObject($dateValue); $dayOfYear = $PHPDateObject->format('z'); $PHPDateObject->modify('-' . $dayOfYear . ' days'); $dow = $PHPDateObject->format('w'); @@ -1277,7 +1277,7 @@ class DateTime } // Execute function - $PHPDateObject = \PhpSpreadsheet\Shared\Date::excelToDateTimeObject($dateValue); + $PHPDateObject = \PhpOffice\PhpSpreadsheet\Shared\Date::excelToDateTimeObject($dateValue); return (int) $PHPDateObject->format('n'); } @@ -1308,7 +1308,7 @@ class DateTime } // Execute function - $PHPDateObject = \PhpSpreadsheet\Shared\Date::excelToDateTimeObject($dateValue); + $PHPDateObject = \PhpOffice\PhpSpreadsheet\Shared\Date::excelToDateTimeObject($dateValue); return (int) $PHPDateObject->format('Y'); } @@ -1348,7 +1348,7 @@ class DateTime } elseif ($timeValue < 0.0) { return Functions::NAN(); } - $timeValue = \PhpSpreadsheet\Shared\Date::excelToTimestamp($timeValue); + $timeValue = \PhpOffice\PhpSpreadsheet\Shared\Date::excelToTimestamp($timeValue); return (int) gmdate('G', $timeValue); } @@ -1388,7 +1388,7 @@ class DateTime } elseif ($timeValue < 0.0) { return Functions::NAN(); } - $timeValue = \PhpSpreadsheet\Shared\Date::excelToTimestamp($timeValue); + $timeValue = \PhpOffice\PhpSpreadsheet\Shared\Date::excelToTimestamp($timeValue); return (int) gmdate('i', $timeValue); } @@ -1428,7 +1428,7 @@ class DateTime } elseif ($timeValue < 0.0) { return Functions::NAN(); } - $timeValue = \PhpSpreadsheet\Shared\Date::excelToTimestamp($timeValue); + $timeValue = \PhpOffice\PhpSpreadsheet\Shared\Date::excelToTimestamp($timeValue); return (int) gmdate('s', $timeValue); } @@ -1471,9 +1471,9 @@ class DateTime switch (Functions::getReturnDateType()) { case Functions::RETURNDATE_EXCEL: - return (float) \PhpSpreadsheet\Shared\Date::PHPToExcel($PHPDateObject); + return (float) \PhpOffice\PhpSpreadsheet\Shared\Date::PHPToExcel($PHPDateObject); case Functions::RETURNDATE_PHP_NUMERIC: - return (integer) \PhpSpreadsheet\Shared\Date::excelToTimestamp(\PhpSpreadsheet\Shared\Date::PHPToExcel($PHPDateObject)); + return (integer) \PhpOffice\PhpSpreadsheet\Shared\Date::excelToTimestamp(\PhpOffice\PhpSpreadsheet\Shared\Date::PHPToExcel($PHPDateObject)); case Functions::RETURNDATE_PHP_OBJECT: return $PHPDateObject; } @@ -1519,9 +1519,9 @@ class DateTime switch (Functions::getReturnDateType()) { case Functions::RETURNDATE_EXCEL: - return (float) \PhpSpreadsheet\Shared\Date::PHPToExcel($PHPDateObject); + return (float) \PhpOffice\PhpSpreadsheet\Shared\Date::PHPToExcel($PHPDateObject); case Functions::RETURNDATE_PHP_NUMERIC: - return (integer) \PhpSpreadsheet\Shared\Date::excelToTimestamp(\PhpSpreadsheet\Shared\Date::PHPToExcel($PHPDateObject)); + return (integer) \PhpOffice\PhpSpreadsheet\Shared\Date::excelToTimestamp(\PhpOffice\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 d893f1a1..d764aa1a 100644 --- a/src/PhpSpreadsheet/Calculation/Engineering.php +++ b/src/PhpSpreadsheet/Calculation/Engineering.php @@ -1,6 +1,6 @@ modify('-' . $months . ' months'); } if ($next) { @@ -76,7 +76,7 @@ class Financial $result->modify('-1 day'); } - return \PhpSpreadsheet\Shared\Date::PHPToExcel($result); + return \PhpOffice\PhpSpreadsheet\Shared\Date::PHPToExcel($result); } private static function isValidFrequency($frequency) diff --git a/src/PhpSpreadsheet/Calculation/FormulaParser.php b/src/PhpSpreadsheet/Calculation/FormulaParser.php index c2a364f3..817ea71a 100644 --- a/src/PhpSpreadsheet/Calculation/FormulaParser.php +++ b/src/PhpSpreadsheet/Calculation/FormulaParser.php @@ -1,6 +1,6 @@ ', '<', '='])) { if (!is_numeric($condition)) { - $condition = \PhpSpreadsheet\Calculation::wrapResult(strtoupper($condition)); + $condition = \PhpOffice\PhpSpreadsheet\Calculation::wrapResult(strtoupper($condition)); } return '=' . $condition; @@ -294,7 +294,7 @@ class Functions if (!is_numeric($operand)) { $operand = str_replace('"', '""', $operand); - $operand = \PhpSpreadsheet\Calculation::wrapResult(strtoupper($operand)); + $operand = \PhpOffice\PhpSpreadsheet\Calculation::wrapResult(strtoupper($operand)); } return $operator . $operand; diff --git a/src/PhpSpreadsheet/Calculation/Logical.php b/src/PhpSpreadsheet/Calculation/Logical.php index d99eefd1..bdf555a0 100644 --- a/src/PhpSpreadsheet/Calculation/Logical.php +++ b/src/PhpSpreadsheet/Calculation/Logical.php @@ -1,6 +1,6 @@ $value) { $columnKey = preg_replace('/[^a-z]/i', '', $columnKey); - return (integer) \PhpSpreadsheet\Cell::columnIndexFromString($columnKey); + return (integer) \PhpOffice\PhpSpreadsheet\Cell::columnIndexFromString($columnKey); } } else { if (strpos($cellAddress, '!') !== false) { @@ -123,14 +123,14 @@ class LookupRef $endAddress = preg_replace('/[^a-z]/i', '', $endAddress); $returnValue = []; do { - $returnValue[] = (integer) \PhpSpreadsheet\Cell::columnIndexFromString($startAddress); + $returnValue[] = (integer) \PhpOffice\PhpSpreadsheet\Cell::columnIndexFromString($startAddress); } while ($startAddress++ != $endAddress); return $returnValue; } else { $cellAddress = preg_replace('/[^a-z]/i', '', $cellAddress); - return (integer) \PhpSpreadsheet\Cell::columnIndexFromString($cellAddress); + return (integer) \PhpOffice\PhpSpreadsheet\Cell::columnIndexFromString($cellAddress); } } } @@ -156,7 +156,7 @@ class LookupRef reset($cellAddress); $isMatrix = (is_numeric(key($cellAddress))); - list($columns, $rows) = \PhpSpreadsheet\Calculation::_getMatrixDimensions($cellAddress); + list($columns, $rows) = \PhpOffice\PhpSpreadsheet\Calculation::_getMatrixDimensions($cellAddress); if ($isMatrix) { return $rows; @@ -234,7 +234,7 @@ class LookupRef reset($cellAddress); $isMatrix = (is_numeric(key($cellAddress))); - list($columns, $rows) = \PhpSpreadsheet\Calculation::_getMatrixDimensions($cellAddress); + list($columns, $rows) = \PhpOffice\PhpSpreadsheet\Calculation::_getMatrixDimensions($cellAddress); if ($isMatrix) { return $columns; @@ -252,10 +252,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 \PhpSpreadsheet\Cell $pCell The cell to set the hyperlink in + * @param \PhpOffice\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, \PhpSpreadsheet\Cell $pCell = null) + public static function HYPERLINK($linkURL = '', $displayName = null, \PhpOffice\PhpSpreadsheet\Cell $pCell = null) { $args = func_get_args(); $pCell = array_pop($args); @@ -289,12 +289,12 @@ 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 \PhpSpreadsheet\Cell $pCell The current cell (containing this formula) + * @param \PhpOffice\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, \PhpSpreadsheet\Cell $pCell = null) + public static function INDIRECT($cellAddress = null, \PhpOffice\PhpSpreadsheet\Cell $pCell = null) { $cellAddress = Functions::flattenSingleValue($cellAddress); if (is_null($cellAddress) || $cellAddress === '') { @@ -307,9 +307,9 @@ class LookupRef list($cellAddress1, $cellAddress2) = explode(':', $cellAddress); } - 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)) { + if ((!preg_match('/^' . \PhpOffice\PhpSpreadsheet\Calculation::CALCULATION_REGEXP_CELLREF . '$/i', $cellAddress1, $matches)) || + ((!is_null($cellAddress2)) && (!preg_match('/^' . \PhpOffice\PhpSpreadsheet\Calculation::CALCULATION_REGEXP_CELLREF . '$/i', $cellAddress2, $matches)))) { + if (!preg_match('/^' . \PhpOffice\PhpSpreadsheet\Calculation::CALCULATION_REGEXP_NAMEDRANGE . '$/i', $cellAddress1, $matches)) { return Functions::REF(); } @@ -321,7 +321,7 @@ class LookupRef $pSheet = $pCell->getWorksheet(); } - return \PhpSpreadsheet\Calculation::getInstance()->extractNamedRange($cellAddress, $pSheet, false); + return \PhpOffice\PhpSpreadsheet\Calculation::getInstance()->extractNamedRange($cellAddress, $pSheet, false); } if (strpos($cellAddress, '!') !== false) { @@ -332,7 +332,7 @@ class LookupRef $pSheet = $pCell->getWorksheet(); } - return \PhpSpreadsheet\Calculation::getInstance()->extractCellRange($cellAddress, $pSheet, false); + return \PhpOffice\PhpSpreadsheet\Calculation::getInstance()->extractCellRange($cellAddress, $pSheet, false); } /** @@ -386,23 +386,23 @@ class LookupRef } else { $startCell = $endCell = $cellAddress; } - list($startCellColumn, $startCellRow) = \PhpSpreadsheet\Cell::coordinateFromString($startCell); - list($endCellColumn, $endCellRow) = \PhpSpreadsheet\Cell::coordinateFromString($endCell); + list($startCellColumn, $startCellRow) = \PhpOffice\PhpSpreadsheet\Cell::coordinateFromString($startCell); + list($endCellColumn, $endCellRow) = \PhpOffice\PhpSpreadsheet\Cell::coordinateFromString($endCell); $startCellRow += $rows; - $startCellColumn = \PhpSpreadsheet\Cell::columnIndexFromString($startCellColumn) - 1; + $startCellColumn = \PhpOffice\PhpSpreadsheet\Cell::columnIndexFromString($startCellColumn) - 1; $startCellColumn += $columns; if (($startCellRow <= 0) || ($startCellColumn < 0)) { return Functions::REF(); } - $endCellColumn = \PhpSpreadsheet\Cell::columnIndexFromString($endCellColumn) - 1; + $endCellColumn = \PhpOffice\PhpSpreadsheet\Cell::columnIndexFromString($endCellColumn) - 1; if (($width != null) && (!is_object($width))) { $endCellColumn = $startCellColumn + $width - 1; } else { $endCellColumn += $columns; } - $startCellColumn = \PhpSpreadsheet\Cell::stringFromColumnIndex($startCellColumn); + $startCellColumn = \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($startCellColumn); if (($height != null) && (!is_object($height))) { $endCellRow = $startCellRow + $height - 1; @@ -413,7 +413,7 @@ class LookupRef if (($endCellRow <= 0) || ($endCellColumn < 0)) { return Functions::REF(); } - $endCellColumn = \PhpSpreadsheet\Cell::stringFromColumnIndex($endCellColumn); + $endCellColumn = \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($endCellColumn); $cellAddress = $startCellColumn . $startCellRow; if (($startCellColumn != $endCellColumn) || ($startCellRow != $endCellRow)) { @@ -426,7 +426,7 @@ class LookupRef $pSheet = $pCell->getWorksheet(); } - return \PhpSpreadsheet\Calculation::getInstance()->extractCellRange($cellAddress, $pSheet, false); + return \PhpOffice\PhpSpreadsheet\Calculation::getInstance()->extractCellRange($cellAddress, $pSheet, false); } /** diff --git a/src/PhpSpreadsheet/Calculation/MathTrig.php b/src/PhpSpreadsheet/Calculation/MathTrig.php index 186df4a6..cb3c5f54 100644 --- a/src/PhpSpreadsheet/Calculation/MathTrig.php +++ b/src/PhpSpreadsheet/Calculation/MathTrig.php @@ -1,6 +1,6 @@ det(); - } catch (\PhpSpreadsheet\Exception $ex) { + } catch (\PhpOffice\PhpSpreadsheet\Exception $ex) { return Functions::VALUE(); } } @@ -596,10 +596,10 @@ class MathTrig } try { - $matrix = new \PhpSpreadsheet\Shared\JAMA\Matrix($matrixData); + $matrix = new \PhpOffice\PhpSpreadsheet\Shared\JAMA\Matrix($matrixData); return $matrix->inverse()->getArray(); - } catch (\PhpSpreadsheet\Exception $ex) { + } catch (\PhpOffice\PhpSpreadsheet\Exception $ex) { return Functions::VALUE(); } } @@ -637,7 +637,7 @@ class MathTrig } ++$rowA; } - $matrixA = new \PhpSpreadsheet\Shared\JAMA\Matrix($matrixAData); + $matrixA = new \PhpOffice\PhpSpreadsheet\Shared\JAMA\Matrix($matrixAData); $rowB = 0; foreach ($matrixData2 as $matrixRow) { if (!is_array($matrixRow)) { @@ -653,14 +653,14 @@ class MathTrig } ++$rowB; } - $matrixB = new \PhpSpreadsheet\Shared\JAMA\Matrix($matrixBData); + $matrixB = new \PhpOffice\PhpSpreadsheet\Shared\JAMA\Matrix($matrixBData); if ($columnA != $rowB) { return Functions::VALUE(); } return $matrixA->times($matrixB)->getArray(); - } catch (\PhpSpreadsheet\Exception $ex) { + } catch (\PhpOffice\PhpSpreadsheet\Exception $ex) { return Functions::VALUE(); } } @@ -1183,11 +1183,11 @@ class MathTrig foreach ($aArgs as $key => $arg) { if (!is_numeric($arg)) { $arg = str_replace('"', '""', $arg); - $arg = \PhpSpreadsheet\Calculation::wrapResult(strtoupper($arg)); + $arg = \PhpOffice\PhpSpreadsheet\Calculation::wrapResult(strtoupper($arg)); } $testCondition = '=' . $arg . $condition; - if (\PhpSpreadsheet\Calculation::getInstance()->_calculateFormulaValue($testCondition)) { + if (\PhpOffice\PhpSpreadsheet\Calculation::getInstance()->_calculateFormulaValue($testCondition)) { // Is it a value within our criteria $returnValue += $sumArgs[$key]; } @@ -1230,10 +1230,10 @@ class MathTrig // Loop through arguments foreach ($aArgs as $key => $arg) { if (!is_numeric($arg)) { - $arg = \PhpSpreadsheet\Calculation::wrapResult(strtoupper($arg)); + $arg = \PhpOffice\PhpSpreadsheet\Calculation::wrapResult(strtoupper($arg)); } $testCondition = '=' . $arg . $condition; - if (\PhpSpreadsheet\Calculation::getInstance()->_calculateFormulaValue($testCondition)) { + if (\PhpOffice\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 754644fe..06f1a118 100644 --- a/src/PhpSpreadsheet/Calculation/Statistical.php +++ b/src/PhpSpreadsheet/Calculation/Statistical.php @@ -1,6 +1,6 @@ $arg) { if (!is_numeric($arg)) { - $arg = \PhpSpreadsheet\Calculation::wrapResult(strtoupper($arg)); + $arg = \PhpOffice\PhpSpreadsheet\Calculation::wrapResult(strtoupper($arg)); } $testCondition = '=' . $arg . $condition; - if (\PhpSpreadsheet\Calculation::getInstance()->_calculateFormulaValue($testCondition)) { + if (\PhpOffice\PhpSpreadsheet\Calculation::getInstance()->_calculateFormulaValue($testCondition)) { if ((is_null($returnValue)) || ($arg > $returnValue)) { $returnValue += $arg; ++$aCount; @@ -1156,7 +1156,7 @@ class Statistical return Functions::DIV0(); } - $bestFitLinear = \PhpSpreadsheet\Shared\trend\trend::calculate(\PhpSpreadsheet\Shared\trend\trend::TREND_LINEAR, $yValues, $xValues); + $bestFitLinear = \PhpOffice\PhpSpreadsheet\Shared\trend\trend::calculate(\PhpOffice\PhpSpreadsheet\Shared\trend\trend::TREND_LINEAR, $yValues, $xValues); return $bestFitLinear->getCorrelation(); } @@ -1271,10 +1271,10 @@ class Statistical // Loop through arguments foreach ($aArgs as $arg) { if (!is_numeric($arg)) { - $arg = \PhpSpreadsheet\Calculation::wrapResult(strtoupper($arg)); + $arg = \PhpOffice\PhpSpreadsheet\Calculation::wrapResult(strtoupper($arg)); } $testCondition = '=' . $arg . $condition; - if (\PhpSpreadsheet\Calculation::getInstance()->_calculateFormulaValue($testCondition)) { + if (\PhpOffice\PhpSpreadsheet\Calculation::getInstance()->_calculateFormulaValue($testCondition)) { // Is it a value within our criteria ++$returnValue; } @@ -1306,7 +1306,7 @@ class Statistical return Functions::DIV0(); } - $bestFitLinear = \PhpSpreadsheet\Shared\trend\trend::calculate(\PhpSpreadsheet\Shared\trend\trend::TREND_LINEAR, $yValues, $xValues); + $bestFitLinear = \PhpOffice\PhpSpreadsheet\Shared\trend\trend::calculate(\PhpOffice\PhpSpreadsheet\Shared\trend\trend::TREND_LINEAR, $yValues, $xValues); return $bestFitLinear->getCovariance(); } @@ -1590,7 +1590,7 @@ class Statistical return Functions::DIV0(); } - $bestFitLinear = \PhpSpreadsheet\Shared\trend\trend::calculate(\PhpSpreadsheet\Shared\trend\trend::TREND_LINEAR, $yValues, $xValues); + $bestFitLinear = \PhpOffice\PhpSpreadsheet\Shared\trend\trend::calculate(\PhpOffice\PhpSpreadsheet\Shared\trend\trend::TREND_LINEAR, $yValues, $xValues); return $bestFitLinear->getValueOfYForX($xValue); } @@ -1760,7 +1760,7 @@ class Statistical $newValues = Functions::flattenArray($newValues); $const = (is_null($const)) ? true : (boolean) Functions::flattenSingleValue($const); - $bestFitExponential = \PhpSpreadsheet\Shared\trend\trend::calculate(\PhpSpreadsheet\Shared\trend\trend::TREND_EXPONENTIAL, $yValues, $xValues, $const); + $bestFitExponential = \PhpOffice\PhpSpreadsheet\Shared\trend\trend::calculate(\PhpOffice\PhpSpreadsheet\Shared\trend\trend::TREND_EXPONENTIAL, $yValues, $xValues, $const); if (empty($newValues)) { $newValues = $bestFitExponential->getXValues(); } @@ -1881,7 +1881,7 @@ class Statistical return Functions::DIV0(); } - $bestFitLinear = \PhpSpreadsheet\Shared\trend\trend::calculate(\PhpSpreadsheet\Shared\trend\trend::TREND_LINEAR, $yValues, $xValues); + $bestFitLinear = \PhpOffice\PhpSpreadsheet\Shared\trend\trend::calculate(\PhpOffice\PhpSpreadsheet\Shared\trend\trend::TREND_LINEAR, $yValues, $xValues); return $bestFitLinear->getIntersect(); } @@ -2001,7 +2001,7 @@ class Statistical return 0; } - $bestFitLinear = \PhpSpreadsheet\Shared\trend\trend::calculate(\PhpSpreadsheet\Shared\trend\trend::TREND_LINEAR, $yValues, $xValues, $const); + $bestFitLinear = \PhpOffice\PhpSpreadsheet\Shared\trend\trend::calculate(\PhpOffice\PhpSpreadsheet\Shared\trend\trend::TREND_LINEAR, $yValues, $xValues, $const); if ($stats) { return [ [ @@ -2065,7 +2065,7 @@ class Statistical return 1; } - $bestFitExponential = \PhpSpreadsheet\Shared\trend\trend::calculate(\PhpSpreadsheet\Shared\trend\trend::TREND_EXPONENTIAL, $yValues, $xValues, $const); + $bestFitExponential = \PhpOffice\PhpSpreadsheet\Shared\trend\trend::calculate(\PhpOffice\PhpSpreadsheet\Shared\trend\trend::TREND_EXPONENTIAL, $yValues, $xValues, $const); if ($stats) { return [ [ @@ -2250,10 +2250,10 @@ class Statistical // Loop through arguments foreach ($aArgs as $key => $arg) { if (!is_numeric($arg)) { - $arg = \PhpSpreadsheet\Calculation::wrapResult(strtoupper($arg)); + $arg = \PhpOffice\PhpSpreadsheet\Calculation::wrapResult(strtoupper($arg)); } $testCondition = '=' . $arg . $condition; - if (\PhpSpreadsheet\Calculation::getInstance()->_calculateFormulaValue($testCondition)) { + if (\PhpOffice\PhpSpreadsheet\Calculation::getInstance()->_calculateFormulaValue($testCondition)) { if ((is_null($returnValue)) || ($arg > $returnValue)) { $returnValue = $arg; } @@ -2404,10 +2404,10 @@ class Statistical // Loop through arguments foreach ($aArgs as $key => $arg) { if (!is_numeric($arg)) { - $arg = \PhpSpreadsheet\Calculation::wrapResult(strtoupper($arg)); + $arg = \PhpOffice\PhpSpreadsheet\Calculation::wrapResult(strtoupper($arg)); } $testCondition = '=' . $arg . $condition; - if (\PhpSpreadsheet\Calculation::getInstance()->_calculateFormulaValue($testCondition)) { + if (\PhpOffice\PhpSpreadsheet\Calculation::getInstance()->_calculateFormulaValue($testCondition)) { if ((is_null($returnValue)) || ($arg < $returnValue)) { $returnValue = $arg; } @@ -2876,7 +2876,7 @@ class Statistical return Functions::DIV0(); } - $bestFitLinear = \PhpSpreadsheet\Shared\trend\trend::calculate(\PhpSpreadsheet\Shared\trend\trend::TREND_LINEAR, $yValues, $xValues); + $bestFitLinear = \PhpOffice\PhpSpreadsheet\Shared\trend\trend::calculate(\PhpOffice\PhpSpreadsheet\Shared\trend\trend::TREND_LINEAR, $yValues, $xValues); return $bestFitLinear->getGoodnessOfFit(); } @@ -2942,7 +2942,7 @@ class Statistical return Functions::DIV0(); } - $bestFitLinear = \PhpSpreadsheet\Shared\trend\trend::calculate(\PhpSpreadsheet\Shared\trend\trend::TREND_LINEAR, $yValues, $xValues); + $bestFitLinear = \PhpOffice\PhpSpreadsheet\Shared\trend\trend::calculate(\PhpOffice\PhpSpreadsheet\Shared\trend\trend::TREND_LINEAR, $yValues, $xValues); return $bestFitLinear->getSlope(); } @@ -3232,7 +3232,7 @@ class Statistical return Functions::DIV0(); } - $bestFitLinear = \PhpSpreadsheet\Shared\trend\trend::calculate(\PhpSpreadsheet\Shared\trend\trend::TREND_LINEAR, $yValues, $xValues); + $bestFitLinear = \PhpOffice\PhpSpreadsheet\Shared\trend\trend::calculate(\PhpOffice\PhpSpreadsheet\Shared\trend\trend::TREND_LINEAR, $yValues, $xValues); return $bestFitLinear->getStdevOfResiduals(); } @@ -3376,7 +3376,7 @@ class Statistical $newValues = Functions::flattenArray($newValues); $const = (is_null($const)) ? true : (boolean) Functions::flattenSingleValue($const); - $bestFitLinear = \PhpSpreadsheet\Shared\trend\trend::calculate(\PhpSpreadsheet\Shared\trend\trend::TREND_LINEAR, $yValues, $xValues, $const); + $bestFitLinear = \PhpOffice\PhpSpreadsheet\Shared\trend\trend::calculate(\PhpOffice\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 0b446fee..4d523f83 100644 --- a/src/PhpSpreadsheet/Calculation/TextData.php +++ b/src/PhpSpreadsheet/Calculation/TextData.php @@ -1,6 +1,6 @@ 0) && (\PhpSpreadsheet\Shared\StringHelper::countCharacters($haystack) > $offset)) { - if (\PhpSpreadsheet\Shared\StringHelper::countCharacters($needle) == 0) { + if (($offset > 0) && (\PhpOffice\PhpSpreadsheet\Shared\StringHelper::countCharacters($haystack) > $offset)) { + if (\PhpOffice\PhpSpreadsheet\Shared\StringHelper::countCharacters($needle) == 0) { return $offset; } if (function_exists('mb_strpos')) { @@ -267,11 +267,11 @@ class TextData if (!is_bool($needle)) { if (is_bool($haystack)) { - $haystack = ($haystack) ? \PhpSpreadsheet\Calculation::getTRUE() : \PhpSpreadsheet\Calculation::getFALSE(); + $haystack = ($haystack) ? \PhpOffice\PhpSpreadsheet\Calculation::getTRUE() : \PhpOffice\PhpSpreadsheet\Calculation::getFALSE(); } - if (($offset > 0) && (\PhpSpreadsheet\Shared\StringHelper::countCharacters($haystack) > $offset)) { - if (\PhpSpreadsheet\Shared\StringHelper::countCharacters($needle) == 0) { + if (($offset > 0) && (\PhpOffice\PhpSpreadsheet\Shared\StringHelper::countCharacters($haystack) > $offset)) { + if (\PhpOffice\PhpSpreadsheet\Shared\StringHelper::countCharacters($needle) == 0) { return $offset; } if (function_exists('mb_stripos')) { @@ -336,7 +336,7 @@ class TextData } if (is_bool($value)) { - $value = ($value) ? \PhpSpreadsheet\Calculation::getTRUE() : \PhpSpreadsheet\Calculation::getFALSE(); + $value = ($value) ? \PhpOffice\PhpSpreadsheet\Calculation::getTRUE() : \PhpOffice\PhpSpreadsheet\Calculation::getFALSE(); } if (function_exists('mb_substr')) { @@ -365,7 +365,7 @@ class TextData } if (is_bool($value)) { - $value = ($value) ? \PhpSpreadsheet\Calculation::getTRUE() : \PhpSpreadsheet\Calculation::getFALSE(); + $value = ($value) ? \PhpOffice\PhpSpreadsheet\Calculation::getTRUE() : \PhpOffice\PhpSpreadsheet\Calculation::getFALSE(); } if (empty($chars)) { @@ -395,7 +395,7 @@ class TextData } if (is_bool($value)) { - $value = ($value) ? \PhpSpreadsheet\Calculation::getTRUE() : \PhpSpreadsheet\Calculation::getFALSE(); + $value = ($value) ? \PhpOffice\PhpSpreadsheet\Calculation::getTRUE() : \PhpOffice\PhpSpreadsheet\Calculation::getFALSE(); } if ((function_exists('mb_substr')) && (function_exists('mb_strlen'))) { @@ -416,7 +416,7 @@ class TextData $value = Functions::flattenSingleValue($value); if (is_bool($value)) { - $value = ($value) ? \PhpSpreadsheet\Calculation::getTRUE() : \PhpSpreadsheet\Calculation::getFALSE(); + $value = ($value) ? \PhpOffice\PhpSpreadsheet\Calculation::getTRUE() : \PhpOffice\PhpSpreadsheet\Calculation::getFALSE(); } if (function_exists('mb_strlen')) { @@ -439,10 +439,10 @@ class TextData $mixedCaseString = Functions::flattenSingleValue($mixedCaseString); if (is_bool($mixedCaseString)) { - $mixedCaseString = ($mixedCaseString) ? \PhpSpreadsheet\Calculation::getTRUE() : \PhpSpreadsheet\Calculation::getFALSE(); + $mixedCaseString = ($mixedCaseString) ? \PhpOffice\PhpSpreadsheet\Calculation::getTRUE() : \PhpOffice\PhpSpreadsheet\Calculation::getFALSE(); } - return \PhpSpreadsheet\Shared\StringHelper::strToLower($mixedCaseString); + return \PhpOffice\PhpSpreadsheet\Shared\StringHelper::strToLower($mixedCaseString); } /** @@ -458,10 +458,10 @@ class TextData $mixedCaseString = Functions::flattenSingleValue($mixedCaseString); if (is_bool($mixedCaseString)) { - $mixedCaseString = ($mixedCaseString) ? \PhpSpreadsheet\Calculation::getTRUE() : \PhpSpreadsheet\Calculation::getFALSE(); + $mixedCaseString = ($mixedCaseString) ? \PhpOffice\PhpSpreadsheet\Calculation::getTRUE() : \PhpOffice\PhpSpreadsheet\Calculation::getFALSE(); } - return \PhpSpreadsheet\Shared\StringHelper::strToUpper($mixedCaseString); + return \PhpOffice\PhpSpreadsheet\Shared\StringHelper::strToUpper($mixedCaseString); } /** @@ -477,10 +477,10 @@ class TextData $mixedCaseString = Functions::flattenSingleValue($mixedCaseString); if (is_bool($mixedCaseString)) { - $mixedCaseString = ($mixedCaseString) ? \PhpSpreadsheet\Calculation::getTRUE() : \PhpSpreadsheet\Calculation::getFALSE(); + $mixedCaseString = ($mixedCaseString) ? \PhpOffice\PhpSpreadsheet\Calculation::getTRUE() : \PhpOffice\PhpSpreadsheet\Calculation::getFALSE(); } - return \PhpSpreadsheet\Shared\StringHelper::strToTitle($mixedCaseString); + return \PhpOffice\PhpSpreadsheet\Shared\StringHelper::strToTitle($mixedCaseString); } /** @@ -581,11 +581,11 @@ class TextData $value = Functions::flattenSingleValue($value); $format = Functions::flattenSingleValue($format); - if ((is_string($value)) && (!is_numeric($value)) && \PhpSpreadsheet\Shared\Date::isDateTimeFormatCode($format)) { + if ((is_string($value)) && (!is_numeric($value)) && \PhpOffice\PhpSpreadsheet\Shared\Date::isDateTimeFormatCode($format)) { $value = DateTime::DATEVALUE($value); } - return (string) \PhpSpreadsheet\Style\NumberFormat::toFormattedString($value, $format); + return (string) \PhpOffice\PhpSpreadsheet\Style\NumberFormat::toFormattedString($value, $format); } /** @@ -600,9 +600,9 @@ class TextData if (!is_numeric($value)) { $numberValue = str_replace( - \PhpSpreadsheet\Shared\StringHelper::getThousandsSeparator(), + \PhpOffice\PhpSpreadsheet\Shared\StringHelper::getThousandsSeparator(), '', - trim($value, " \t\n\r\0\x0B" . \PhpSpreadsheet\Shared\StringHelper::getCurrencyCode()) + trim($value, " \t\n\r\0\x0B" . \PhpOffice\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 4385b64f..8120f40a 100644 --- a/src/PhpSpreadsheet/Calculation/Token/Stack.php +++ b/src/PhpSpreadsheet/Calculation/Token/Stack.php @@ -1,6 +1,6 @@ $reference, ]; if ($type == 'Function') { - $localeFunction = \PhpSpreadsheet\Calculation::localeFunc($value); + $localeFunction = \PhpOffice\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 8f5ff4db..291ddfa3 100644 --- a/src/PhpSpreadsheet/Cell.php +++ b/src/PhpSpreadsheet/Cell.php @@ -1,6 +1,6 @@ setValueExplicit(true, DataType::TYPE_BOOL); return true; - } elseif ($value == \PhpSpreadsheet\Calculation::getFALSE()) { + } elseif ($value == \PhpOffice\PhpSpreadsheet\Calculation::getFALSE()) { $cell->setValueExplicit(false, DataType::TYPE_BOOL); return true; } // Check for number in scientific format - if (preg_match('/^' . \PhpSpreadsheet\Calculation::CALCULATION_REGEXP_NUMBER . '$/', $value)) { + if (preg_match('/^' . \PhpOffice\PhpSpreadsheet\Calculation::CALCULATION_REGEXP_NUMBER . '$/', $value)) { $cell->setValueExplicit((float) $value, DataType::TYPE_NUMERIC); return true; @@ -97,15 +97,15 @@ class AdvancedValueBinder extends DefaultValueBinder implements IValueBinder $cell->setValueExplicit($value, DataType::TYPE_NUMERIC); // Set style $cell->getWorksheet()->getStyle($cell->getCoordinate()) - ->getNumberFormat()->setFormatCode(\PhpSpreadsheet\Style\NumberFormat::FORMAT_PERCENTAGE_00); + ->getNumberFormat()->setFormatCode(\PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_PERCENTAGE_00); return true; } // Check for currency - $currencyCode = \PhpSpreadsheet\Shared\StringHelper::getCurrencyCode(); - $decimalSeparator = \PhpSpreadsheet\Shared\StringHelper::getDecimalSeparator(); - $thousandsSeparator = \PhpSpreadsheet\Shared\StringHelper::getThousandsSeparator(); + $currencyCode = \PhpOffice\PhpSpreadsheet\Shared\StringHelper::getCurrencyCode(); + $decimalSeparator = \PhpOffice\PhpSpreadsheet\Shared\StringHelper::getDecimalSeparator(); + $thousandsSeparator = \PhpOffice\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([$currencyCode, $thousandsSeparator, $decimalSeparator], ['', '', '.'], $value)); @@ -113,7 +113,7 @@ class AdvancedValueBinder extends DefaultValueBinder implements IValueBinder // Set style $cell->getWorksheet()->getStyle($cell->getCoordinate()) ->getNumberFormat()->setFormatCode( - str_replace('$', $currencyCode, \PhpSpreadsheet\Style\NumberFormat::FORMAT_CURRENCY_USD_SIMPLE) + str_replace('$', $currencyCode, \PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_CURRENCY_USD_SIMPLE) ); return true; @@ -123,7 +123,7 @@ class AdvancedValueBinder extends DefaultValueBinder implements IValueBinder $cell->setValueExplicit($value, DataType::TYPE_NUMERIC); // Set style $cell->getWorksheet()->getStyle($cell->getCoordinate()) - ->getNumberFormat()->setFormatCode(\PhpSpreadsheet\Style\NumberFormat::FORMAT_CURRENCY_USD_SIMPLE); + ->getNumberFormat()->setFormatCode(\PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_CURRENCY_USD_SIMPLE); return true; } @@ -136,7 +136,7 @@ class AdvancedValueBinder extends DefaultValueBinder implements IValueBinder $cell->setValueExplicit($days, DataType::TYPE_NUMERIC); // Set style $cell->getWorksheet()->getStyle($cell->getCoordinate()) - ->getNumberFormat()->setFormatCode(\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_TIME3); + ->getNumberFormat()->setFormatCode(\PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_TIME3); return true; } @@ -150,13 +150,13 @@ class AdvancedValueBinder extends DefaultValueBinder implements IValueBinder $cell->setValueExplicit($days, DataType::TYPE_NUMERIC); // Set style $cell->getWorksheet()->getStyle($cell->getCoordinate()) - ->getNumberFormat()->setFormatCode(\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_TIME4); + ->getNumberFormat()->setFormatCode(\PhpOffice\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 = \PhpSpreadsheet\Shared\Date::stringToExcel($value)) !== false) { + if (($d = \PhpOffice\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 ':' @@ -173,7 +173,7 @@ class AdvancedValueBinder extends DefaultValueBinder implements IValueBinder // Check for newline character "\n" if (strpos($value, "\n") !== false) { - $value = \PhpSpreadsheet\Shared\StringHelper::sanitizeUTF8($value); + $value = \PhpOffice\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 ab9dfb99..c9765c79 100644 --- a/src/PhpSpreadsheet/Cell/DataType.php +++ b/src/PhpSpreadsheet/Cell/DataType.php @@ -1,6 +1,6 @@ format('Y-m-d H:i:s'); - } elseif (!($value instanceof \PhpSpreadsheet\RichText)) { + } elseif (!($value instanceof \PhpOffice\PhpSpreadsheet\RichText)) { $value = (string) $value; } } @@ -67,7 +67,7 @@ class DefaultValueBinder implements IValueBinder return DataType::TYPE_NULL; } elseif ($pValue === '') { return DataType::TYPE_STRING; - } elseif ($pValue instanceof \PhpSpreadsheet\RichText) { + } elseif ($pValue instanceof \PhpOffice\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 e6cd58ae..fe111134 100644 --- a/src/PhpSpreadsheet/Cell/Hyperlink.php +++ b/src/PhpSpreadsheet/Cell/Hyperlink.php @@ -1,6 +1,6 @@ plotValues as $plotValues) { if ($plotValues !== null) { diff --git a/src/PhpSpreadsheet/Chart/DataSeriesValues.php b/src/PhpSpreadsheet/Chart/DataSeriesValues.php index 1ab3140e..ba3cc269 100644 --- a/src/PhpSpreadsheet/Chart/DataSeriesValues.php +++ b/src/PhpSpreadsheet/Chart/DataSeriesValues.php @@ -1,6 +1,6 @@ dataValues = \PhpSpreadsheet\Calculation\Functions::flattenArray($dataValues); + $this->dataValues = \PhpOffice\PhpSpreadsheet\Calculation\Functions::flattenArray($dataValues); $this->pointCount = count($dataValues); if ($refreshDataSource) { @@ -287,11 +287,11 @@ class DataSeriesValues return $var !== null; } - public function refresh(\PhpSpreadsheet\Worksheet $worksheet, $flatten = true) + public function refresh(\PhpOffice\PhpSpreadsheet\Worksheet $worksheet, $flatten = true) { if ($this->dataSource !== null) { - $calcEngine = \PhpSpreadsheet\Calculation::getInstance($worksheet->getParent()); - $newDataValues = \PhpSpreadsheet\Calculation::unwrapResult( + $calcEngine = \PhpOffice\PhpSpreadsheet\Calculation::getInstance($worksheet->getParent()); + $newDataValues = \PhpOffice\PhpSpreadsheet\Calculation::unwrapResult( $calcEngine->_calculateFormulaValue( '=' . $this->dataSource, null, @@ -299,7 +299,7 @@ class DataSeriesValues ) ); if ($flatten) { - $this->dataValues = \PhpSpreadsheet\Calculation\Functions::flattenArray($newDataValues); + $this->dataValues = \PhpOffice\PhpSpreadsheet\Calculation\Functions::flattenArray($newDataValues); foreach ($this->dataValues as &$dataValue) { if ((!empty($dataValue)) && ($dataValue[0] == '#')) { $dataValue = 0.0; @@ -312,9 +312,9 @@ class DataSeriesValues list(, $cellRange) = $cellRange; } - $dimensions = \PhpSpreadsheet\Cell::rangeDimension(str_replace('$', '', $cellRange)); + $dimensions = \PhpOffice\PhpSpreadsheet\Cell::rangeDimension(str_replace('$', '', $cellRange)); if (($dimensions[0] == 1) || ($dimensions[1] == 1)) { - $this->dataValues = \PhpSpreadsheet\Calculation\Functions::flattenArray($newDataValues); + $this->dataValues = \PhpOffice\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 5dd2d11c..996e73f2 100644 --- a/src/PhpSpreadsheet/Chart/Exception.php +++ b/src/PhpSpreadsheet/Chart/Exception.php @@ -1,6 +1,6 @@ plotSeries as $plotSeries) { $plotSeries->refresh($worksheet); diff --git a/src/PhpSpreadsheet/Chart/Properties.php b/src/PhpSpreadsheet/Chart/Properties.php index 0e2c3f3b..86d349f2 100644 --- a/src/PhpSpreadsheet/Chart/Properties.php +++ b/src/PhpSpreadsheet/Chart/Properties.php @@ -1,6 +1,6 @@ renderCartesianPlotArea(); @@ -555,7 +555,7 @@ class JpGraph private function renderLineChart($groupCount, $dimensions = '2d') { - require_once \PhpSpreadsheet\Settings::getChartRendererPath() . 'jpgraph_line.php'; + require_once \PhpOffice\PhpSpreadsheet\Settings::getChartRendererPath() . 'jpgraph_line.php'; $this->renderCartesianPlotArea(); @@ -566,7 +566,7 @@ class JpGraph private function renderBarChart($groupCount, $dimensions = '2d') { - require_once \PhpSpreadsheet\Settings::getChartRendererPath() . 'jpgraph_bar.php'; + require_once \PhpOffice\PhpSpreadsheet\Settings::getChartRendererPath() . 'jpgraph_bar.php'; $this->renderCartesianPlotArea(); @@ -577,9 +577,9 @@ class JpGraph private function renderScatterChart($groupCount) { - require_once \PhpSpreadsheet\Settings::getChartRendererPath() . 'jpgraph_scatter.php'; - require_once \PhpSpreadsheet\Settings::getChartRendererPath() . 'jpgraph_regstat.php'; - require_once \PhpSpreadsheet\Settings::getChartRendererPath() . 'jpgraph_line.php'; + require_once \PhpOffice\PhpSpreadsheet\Settings::getChartRendererPath() . 'jpgraph_scatter.php'; + require_once \PhpOffice\PhpSpreadsheet\Settings::getChartRendererPath() . 'jpgraph_regstat.php'; + require_once \PhpOffice\PhpSpreadsheet\Settings::getChartRendererPath() . 'jpgraph_line.php'; $this->renderCartesianPlotArea('linlin'); @@ -590,7 +590,7 @@ class JpGraph private function renderBubbleChart($groupCount) { - require_once \PhpSpreadsheet\Settings::getChartRendererPath() . 'jpgraph_scatter.php'; + require_once \PhpOffice\PhpSpreadsheet\Settings::getChartRendererPath() . 'jpgraph_scatter.php'; $this->renderCartesianPlotArea('linlin'); @@ -601,9 +601,9 @@ class JpGraph private function renderPieChart($groupCount, $dimensions = '2d', $doughnut = false, $multiplePlots = false) { - require_once \PhpSpreadsheet\Settings::getChartRendererPath() . 'jpgraph_pie.php'; + require_once \PhpOffice\PhpSpreadsheet\Settings::getChartRendererPath() . 'jpgraph_pie.php'; if ($dimensions == '3d') { - require_once \PhpSpreadsheet\Settings::getChartRendererPath() . 'jpgraph_pie3d.php'; + require_once \PhpOffice\PhpSpreadsheet\Settings::getChartRendererPath() . 'jpgraph_pie3d.php'; } $this->renderPiePlotArea($doughnut); @@ -677,7 +677,7 @@ class JpGraph private function renderRadarChart($groupCount) { - require_once \PhpSpreadsheet\Settings::getChartRendererPath() . 'jpgraph_radar.php'; + require_once \PhpOffice\PhpSpreadsheet\Settings::getChartRendererPath() . 'jpgraph_radar.php'; $this->renderRadarPlotArea(); @@ -688,7 +688,7 @@ class JpGraph private function renderStockChart($groupCount) { - require_once \PhpSpreadsheet\Settings::getChartRendererPath() . 'jpgraph_stock.php'; + require_once \PhpOffice\PhpSpreadsheet\Settings::getChartRendererPath() . 'jpgraph_stock.php'; $this->renderCartesianPlotArea('intint'); @@ -699,7 +699,7 @@ class JpGraph private function renderContourChart($groupCount, $dimensions) { - require_once \PhpSpreadsheet\Settings::getChartRendererPath() . 'jpgraph_contour.php'; + require_once \PhpOffice\PhpSpreadsheet\Settings::getChartRendererPath() . 'jpgraph_contour.php'; $this->renderCartesianPlotArea('intint'); @@ -710,11 +710,11 @@ class JpGraph private function renderCombinationChart($groupCount, $dimensions, $outputDestination) { - 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'; + require_once \PhpOffice\PhpSpreadsheet\Settings::getChartRendererPath() . 'jpgraph_line.php'; + require_once \PhpOffice\PhpSpreadsheet\Settings::getChartRendererPath() . 'jpgraph_bar.php'; + require_once \PhpOffice\PhpSpreadsheet\Settings::getChartRendererPath() . 'jpgraph_scatter.php'; + require_once \PhpOffice\PhpSpreadsheet\Settings::getChartRendererPath() . 'jpgraph_regstat.php'; + require_once \PhpOffice\PhpSpreadsheet\Settings::getChartRendererPath() . 'jpgraph_line.php'; $this->renderCartesianPlotArea(); @@ -850,7 +850,7 @@ class JpGraph /** * Create a new jpgraph */ - public function __construct(\PhpSpreadsheet\Chart $chart) + public function __construct(\PhpOffice\PhpSpreadsheet\Chart $chart) { $this->graph = null; $this->chart = $chart; diff --git a/src/PhpSpreadsheet/Chart/Title.php b/src/PhpSpreadsheet/Chart/Title.php index dbf3a243..8dba8408 100644 --- a/src/PhpSpreadsheet/Chart/Title.php +++ b/src/PhpSpreadsheet/Chart/Title.php @@ -1,6 +1,6 @@ revisionsPassword = $pValue; @@ -196,7 +196,7 @@ class Security public function setWorkbookPassword($pValue = '', $pAlreadyHashed = false) { if (!$pAlreadyHashed) { - $pValue = \PhpSpreadsheet\Shared\PasswordHasher::hashPassword($pValue); + $pValue = \PhpOffice\PhpSpreadsheet\Shared\PasswordHasher::hashPassword($pValue); } $this->workbookPassword = $pValue; diff --git a/src/PhpSpreadsheet/Exception.php b/src/PhpSpreadsheet/Exception.php index aa460cfa..ad8d2486 100644 --- a/src/PhpSpreadsheet/Exception.php +++ b/src/PhpSpreadsheet/Exception.php @@ -1,10 +1,8 @@ preserveWhiteSpace = false; - $this->richTextObject = new \PhpSpreadsheet\RichText(); + $this->richTextObject = new \PhpOffice\PhpSpreadsheet\RichText(); $this->parseElements($dom); // Clean any further spurious whitespace @@ -663,7 +663,7 @@ class HTML $richtextRun->getFont()->setSize($this->size); } if ($this->color) { - $richtextRun->getFont()->setColor(new \PhpSpreadsheet\Style\Color('ff' . $this->color)); + $richtextRun->getFont()->setColor(new \PhpOffice\PhpSpreadsheet\Style\Color('ff' . $this->color)); } if ($this->bold) { $richtextRun->getFont()->setBold(true); @@ -672,7 +672,7 @@ class HTML $richtextRun->getFont()->setItalic(true); } if ($this->underline) { - $richtextRun->getFont()->setUnderline(\PhpSpreadsheet\Style\Font::UNDERLINE_SINGLE); + $richtextRun->getFont()->setUnderline(\PhpOffice\PhpSpreadsheet\Style\Font::UNDERLINE_SINGLE); } if ($this->superscript) { $richtextRun->getFont()->setSuperScript(true); diff --git a/src/PhpSpreadsheet/Helper/Sample.php b/src/PhpSpreadsheet/Helper/Sample.php index 922937be..fc262f40 100644 --- a/src/PhpSpreadsheet/Helper/Sample.php +++ b/src/PhpSpreadsheet/Helper/Sample.php @@ -1,9 +1,9 @@ 'IWriter', 'path' => 'PhpSpreadsheet/Writer/{0}.php', 'class' => '\\PhpSpreadsheet\\Writer\\{0}'], - ['type' => 'IReader', 'path' => 'PhpSpreadsheet/Reader/{0}.php', 'class' => '\\PhpSpreadsheet\\Reader\\{0}'], + ['type' => 'IWriter', 'path' => 'PhpSpreadsheet/Writer/{0}.php', 'class' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\{0}'], + ['type' => 'IReader', 'path' => 'PhpSpreadsheet/Reader/{0}.php', 'class' => '\\PhpOffice\\PhpSpreadsheet\\Reader\\{0}'], ]; /** diff --git a/src/PhpSpreadsheet/NamedRange.php b/src/PhpSpreadsheet/NamedRange.php index 07aa7b3c..4ccb7b81 100644 --- a/src/PhpSpreadsheet/NamedRange.php +++ b/src/PhpSpreadsheet/NamedRange.php @@ -1,10 +1,8 @@ loadIntoExisting($pFilename, $spreadsheet); @@ -274,7 +274,7 @@ class CSV extends BaseReader implements IReader // Convert encoding if necessary if ($this->inputEncoding !== 'UTF-8') { - $rowDatum = \PhpSpreadsheet\Shared\StringHelper::convertEncoding($rowDatum, 'UTF-8', $this->inputEncoding); + $rowDatum = \PhpOffice\PhpSpreadsheet\Shared\StringHelper::convertEncoding($rowDatum, 'UTF-8', $this->inputEncoding); } // Set cell value diff --git a/src/PhpSpreadsheet/Reader/DefaultReadFilter.php b/src/PhpSpreadsheet/Reader/DefaultReadFilter.php index 1d208ee2..ab08b862 100644 --- a/src/PhpSpreadsheet/Reader/DefaultReadFilter.php +++ b/src/PhpSpreadsheet/Reader/DefaultReadFilter.php @@ -1,6 +1,6 @@ securityScan(file_get_contents($pFilename)), 'SimpleXMLElement', - \PhpSpreadsheet\Settings::getLibXmlLoaderOptions() + \PhpOffice\PhpSpreadsheet\Settings::getLibXmlLoaderOptions() ); $namespaces = $xml->getNamespaces(true); @@ -152,7 +152,7 @@ class Excel2003XML extends BaseReader implements IReader $xml = simplexml_load_string( $this->securityScan(file_get_contents($pFilename)), 'SimpleXMLElement', - \PhpSpreadsheet\Settings::getLibXmlLoaderOptions() + \PhpOffice\PhpSpreadsheet\Settings::getLibXmlLoaderOptions() ); $namespaces = $xml->getNamespaces(true); @@ -198,7 +198,7 @@ class Excel2003XML extends BaseReader implements IReader } } - $tmpInfo['lastColumnLetter'] = \PhpSpreadsheet\Cell::stringFromColumnIndex($tmpInfo['lastColumnIndex']); + $tmpInfo['lastColumnLetter'] = \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($tmpInfo['lastColumnIndex']); $tmpInfo['totalColumns'] = $tmpInfo['lastColumnIndex'] + 1; $worksheetInfo[] = $tmpInfo; @@ -213,7 +213,7 @@ class Excel2003XML extends BaseReader implements IReader * * @param string $pFilename * @throws Exception - * @return \PhpSpreadsheet\Spreadsheet + * @return \PhpOffice\PhpSpreadsheet\Spreadsheet */ public function load($pFilename) { @@ -277,35 +277,35 @@ class Excel2003XML extends BaseReader implements IReader * Loads from file into Spreadsheet instance * * @param string $pFilename - * @param \PhpSpreadsheet\Spreadsheet $spreadsheet + * @param \PhpOffice\PhpSpreadsheet\Spreadsheet $spreadsheet * @throws Exception - * @return \PhpSpreadsheet\Spreadsheet + * @return \PhpOffice\PhpSpreadsheet\Spreadsheet */ - public function loadIntoExisting($pFilename, \PhpSpreadsheet\Spreadsheet $spreadsheet) + public function loadIntoExisting($pFilename, \PhpOffice\PhpSpreadsheet\Spreadsheet $spreadsheet) { $fromFormats = ['\-', '\ ']; $toFormats = ['-', ' ']; $underlineStyles = [ - \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, + \PhpOffice\PhpSpreadsheet\Style\Font::UNDERLINE_NONE, + \PhpOffice\PhpSpreadsheet\Style\Font::UNDERLINE_DOUBLE, + \PhpOffice\PhpSpreadsheet\Style\Font::UNDERLINE_DOUBLEACCOUNTING, + \PhpOffice\PhpSpreadsheet\Style\Font::UNDERLINE_SINGLE, + \PhpOffice\PhpSpreadsheet\Style\Font::UNDERLINE_SINGLEACCOUNTING, ]; $verticalAlignmentStyles = [ - \PhpSpreadsheet\Style\Alignment::VERTICAL_BOTTOM, - \PhpSpreadsheet\Style\Alignment::VERTICAL_TOP, - \PhpSpreadsheet\Style\Alignment::VERTICAL_CENTER, - \PhpSpreadsheet\Style\Alignment::VERTICAL_JUSTIFY, + \PhpOffice\PhpSpreadsheet\Style\Alignment::VERTICAL_BOTTOM, + \PhpOffice\PhpSpreadsheet\Style\Alignment::VERTICAL_TOP, + \PhpOffice\PhpSpreadsheet\Style\Alignment::VERTICAL_CENTER, + \PhpOffice\PhpSpreadsheet\Style\Alignment::VERTICAL_JUSTIFY, ]; $horizontalAlignmentStyles = [ - \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, + \PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_GENERAL, + \PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_LEFT, + \PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_RIGHT, + \PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_CENTER, + \PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_CENTER_CONTINUOUS, + \PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_JUSTIFY, ]; $timezoneObj = new \DateTimeZone('Europe/London'); @@ -323,7 +323,7 @@ class Excel2003XML extends BaseReader implements IReader $xml = simplexml_load_string( $this->securityScan(file_get_contents($pFilename)), 'SimpleXMLElement', - \PhpSpreadsheet\Settings::getLibXmlLoaderOptions() + \PhpOffice\PhpSpreadsheet\Settings::getLibXmlLoaderOptions() ); $namespaces = $xml->getNamespaces(true); @@ -373,26 +373,26 @@ class Excel2003XML extends BaseReader implements IReader foreach ($xml->CustomDocumentProperties[0] as $propertyName => $propertyValue) { $propertyAttributes = $propertyValue->attributes($namespaces['dt']); $propertyName = preg_replace_callback('/_x([0-9a-z]{4})_/', ['self', 'hex2str'], $propertyName); - $propertyType = \PhpSpreadsheet\Document\Properties::PROPERTY_TYPE_UNKNOWN; + $propertyType = \PhpOffice\PhpSpreadsheet\Document\Properties::PROPERTY_TYPE_UNKNOWN; switch ((string) $propertyAttributes) { case 'string': - $propertyType = \PhpSpreadsheet\Document\Properties::PROPERTY_TYPE_STRING; + $propertyType = \PhpOffice\PhpSpreadsheet\Document\Properties::PROPERTY_TYPE_STRING; $propertyValue = trim($propertyValue); break; case 'boolean': - $propertyType = \PhpSpreadsheet\Document\Properties::PROPERTY_TYPE_BOOLEAN; + $propertyType = \PhpOffice\PhpSpreadsheet\Document\Properties::PROPERTY_TYPE_BOOLEAN; $propertyValue = (bool) $propertyValue; break; case 'integer': - $propertyType = \PhpSpreadsheet\Document\Properties::PROPERTY_TYPE_INTEGER; + $propertyType = \PhpOffice\PhpSpreadsheet\Document\Properties::PROPERTY_TYPE_INTEGER; $propertyValue = intval($propertyValue); break; case 'float': - $propertyType = \PhpSpreadsheet\Document\Properties::PROPERTY_TYPE_FLOAT; + $propertyType = \PhpOffice\PhpSpreadsheet\Document\Properties::PROPERTY_TYPE_FLOAT; $propertyValue = floatval($propertyValue); break; case 'dateTime.tz': - $propertyType = \PhpSpreadsheet\Document\Properties::PROPERTY_TYPE_DATE; + $propertyType = \PhpOffice\PhpSpreadsheet\Document\Properties::PROPERTY_TYPE_DATE; $propertyValue = strtotime(trim($propertyValue)); break; } @@ -434,7 +434,7 @@ class Excel2003XML extends BaseReader implements IReader foreach ($borderAttributes as $borderStyleKey => $borderStyleValue) { switch ($borderStyleKey) { case 'LineStyle': - $thisBorder['style'] = \PhpSpreadsheet\Style\Border::BORDER_MEDIUM; + $thisBorder['style'] = \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_MEDIUM; break; case 'Weight': break; @@ -538,7 +538,7 @@ class Excel2003XML extends BaseReader implements IReader foreach ($worksheet->Table->Column as $columnData) { $columnData_ss = $columnData->attributes($namespaces['ss']); if (isset($columnData_ss['Index'])) { - $columnID = \PhpSpreadsheet\Cell::stringFromColumnIndex($columnData_ss['Index'] - 1); + $columnID = \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($columnData_ss['Index'] - 1); } if (isset($columnData_ss['Width'])) { $columnWidth = $columnData_ss['Width']; @@ -562,7 +562,7 @@ class Excel2003XML extends BaseReader implements IReader foreach ($rowData->Cell as $cell) { $cell_ss = $cell->attributes($namespaces['ss']); if (isset($cell_ss['Index'])) { - $columnID = \PhpSpreadsheet\Cell::stringFromColumnIndex($cell_ss['Index'] - 1); + $columnID = \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($cell_ss['Index'] - 1); } $cellRange = $columnID . $rowID; @@ -576,7 +576,7 @@ class Excel2003XML extends BaseReader implements IReader $columnTo = $columnID; if (isset($cell_ss['MergeAcross'])) { $additionalMergedCells += (int) $cell_ss['MergeAcross']; - $columnTo = \PhpSpreadsheet\Cell::stringFromColumnIndex(\PhpSpreadsheet\Cell::columnIndexFromString($columnID) + $cell_ss['MergeAcross'] - 1); + $columnTo = \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex(\PhpOffice\PhpSpreadsheet\Cell::columnIndexFromString($columnID) + $cell_ss['MergeAcross'] - 1); } $rowTo = $rowID; if (isset($cell_ss['MergeDown'])) { @@ -598,7 +598,7 @@ class Excel2003XML extends BaseReader implements IReader } if (isset($cell->Data)) { $cellValue = $cellData = $cell->Data; - $type = \PhpSpreadsheet\Cell\DataType::TYPE_NULL; + $type = \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_NULL; $cellData_ss = $cellData->attributes($namespaces['ss']); if (isset($cellData_ss['Type'])) { $cellDataType = $cellData_ss['Type']; @@ -614,32 +614,32 @@ class Excel2003XML extends BaseReader implements IReader */ case 'String': $cellValue = self::convertStringEncoding($cellValue, $this->charSet); - $type = \PhpSpreadsheet\Cell\DataType::TYPE_STRING; + $type = \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING; break; case 'Number': - $type = \PhpSpreadsheet\Cell\DataType::TYPE_NUMERIC; + $type = \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_NUMERIC; $cellValue = (float) $cellValue; if (floor($cellValue) == $cellValue) { $cellValue = (integer) $cellValue; } break; case 'Boolean': - $type = \PhpSpreadsheet\Cell\DataType::TYPE_BOOL; + $type = \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_BOOL; $cellValue = ($cellValue != 0); break; case 'DateTime': - $type = \PhpSpreadsheet\Cell\DataType::TYPE_NUMERIC; - $cellValue = \PhpSpreadsheet\Shared\Date::PHPToExcel(strtotime($cellValue)); + $type = \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_NUMERIC; + $cellValue = \PhpOffice\PhpSpreadsheet\Shared\Date::PHPToExcel(strtotime($cellValue)); break; case 'Error': - $type = \PhpSpreadsheet\Cell\DataType::TYPE_ERROR; + $type = \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_ERROR; break; } } if ($hasCalculatedValue) { - $type = \PhpSpreadsheet\Cell\DataType::TYPE_FORMULA; - $columnNumber = \PhpSpreadsheet\Cell::columnIndexFromString($columnID); + $type = \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_FORMULA; + $columnNumber = \PhpOffice\PhpSpreadsheet\Cell::columnIndexFromString($columnID); if (substr($cellDataFormula, 0, 3) == 'of:') { $cellDataFormula = substr($cellDataFormula, 3); $temp = explode('"', $cellDataFormula); @@ -683,7 +683,7 @@ class Excel2003XML extends BaseReader implements IReader if ($columnReference{0} == '[') { $columnReference = $columnNumber + trim($columnReference, '[]'); } - $A1CellReference = \PhpSpreadsheet\Cell::stringFromColumnIndex($columnReference - 1) . $rowReference; + $A1CellReference = \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($columnReference - 1) . $rowReference; $value = substr_replace($value, $A1CellReference, $cellReference[0][1], strlen($cellReference[0][0])); } } @@ -751,7 +751,7 @@ class Excel2003XML extends BaseReader implements IReader protected static function convertStringEncoding($string, $charset) { if ($charset != 'UTF-8') { - return \PhpSpreadsheet\Shared\StringHelper::convertEncoding($string, 'UTF-8', $charset); + return \PhpOffice\PhpSpreadsheet\Shared\StringHelper::convertEncoding($string, 'UTF-8', $charset); } return $string; @@ -759,7 +759,7 @@ class Excel2003XML extends BaseReader implements IReader protected function parseRichText($is = '') { - $value = new \PhpSpreadsheet\RichText(); + $value = new \PhpOffice\PhpSpreadsheet\RichText(); $value->createText(self::convertStringEncoding($is, $this->charSet)); diff --git a/src/PhpSpreadsheet/Reader/Excel2007.php b/src/PhpSpreadsheet/Reader/Excel2007.php index 023a3148..a44c8b7f 100644 --- a/src/PhpSpreadsheet/Reader/Excel2007.php +++ b/src/PhpSpreadsheet/Reader/Excel2007.php @@ -1,6 +1,6 @@ readFilter = new DefaultReadFilter(); - $this->referenceHelper = \PhpSpreadsheet\ReferenceHelper::getInstance(); + $this->referenceHelper = \PhpOffice\PhpSpreadsheet\ReferenceHelper::getInstance(); } /** @@ -63,7 +63,7 @@ class Excel2007 extends BaseReader implements IReader throw new Exception('Could not open ' . $pFilename . ' for reading! File does not exist.'); } - $zipClass = \PhpSpreadsheet\Settings::getZipClass(); + $zipClass = \PhpOffice\PhpSpreadsheet\Settings::getZipClass(); // Check if zip class exists // if (!class_exists($zipClass, false)) { @@ -80,7 +80,7 @@ class Excel2007 extends BaseReader implements IReader $this->getFromZipArchive($zip, '_rels/.rels') ), 'SimpleXMLElement', - \PhpSpreadsheet\Settings::getLibXmlLoaderOptions() + \PhpOffice\PhpSpreadsheet\Settings::getLibXmlLoaderOptions() ); if ($rels !== false) { foreach ($rels->Relationship as $rel) { @@ -114,7 +114,7 @@ class Excel2007 extends BaseReader implements IReader $worksheetNames = []; - $zipClass = \PhpSpreadsheet\Settings::getZipClass(); + $zipClass = \PhpOffice\PhpSpreadsheet\Settings::getZipClass(); $zip = new $zipClass(); $zip->open($pFilename); @@ -124,7 +124,7 @@ class Excel2007 extends BaseReader implements IReader $this->securityScan( $this->getFromZipArchive($zip, '_rels/.rels'), 'SimpleXMLElement', - \PhpSpreadsheet\Settings::getLibXmlLoaderOptions() + \PhpOffice\PhpSpreadsheet\Settings::getLibXmlLoaderOptions() ) ); //~ http://schemas.openxmlformats.org/package/2006/relationships"); foreach ($rels->Relationship as $rel) { @@ -134,7 +134,7 @@ class Excel2007 extends BaseReader implements IReader $this->securityScan( $this->getFromZipArchive($zip, "{$rel['Target']}"), 'SimpleXMLElement', - \PhpSpreadsheet\Settings::getLibXmlLoaderOptions() + \PhpOffice\PhpSpreadsheet\Settings::getLibXmlLoaderOptions() ) ); //~ http://schemas.openxmlformats.org/spreadsheetml/2006/main" @@ -167,7 +167,7 @@ class Excel2007 extends BaseReader implements IReader $worksheetInfo = []; - $zipClass = \PhpSpreadsheet\Settings::getZipClass(); + $zipClass = \PhpOffice\PhpSpreadsheet\Settings::getZipClass(); $zip = new $zipClass(); $zip->open($pFilename); @@ -176,7 +176,7 @@ class Excel2007 extends BaseReader implements IReader //~ http://schemas.openxmlformats.org/package/2006/relationships" $this->securityScan($this->getFromZipArchive($zip, '_rels/.rels')), 'SimpleXMLElement', - \PhpSpreadsheet\Settings::getLibXmlLoaderOptions() + \PhpOffice\PhpSpreadsheet\Settings::getLibXmlLoaderOptions() ); foreach ($rels->Relationship as $rel) { if ($rel['Type'] == 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument') { @@ -187,7 +187,7 @@ class Excel2007 extends BaseReader implements IReader $this->getFromZipArchive($zip, "$dir/_rels/" . basename($rel['Target']) . '.rels') ), 'SimpleXMLElement', - \PhpSpreadsheet\Settings::getLibXmlLoaderOptions() + \PhpOffice\PhpSpreadsheet\Settings::getLibXmlLoaderOptions() ); $relsWorkbook->registerXPathNamespace('rel', 'http://schemas.openxmlformats.org/package/2006/relationships'); @@ -204,7 +204,7 @@ class Excel2007 extends BaseReader implements IReader $this->getFromZipArchive($zip, "{$rel['Target']}") ), 'SimpleXMLElement', - \PhpSpreadsheet\Settings::getLibXmlLoaderOptions() + \PhpOffice\PhpSpreadsheet\Settings::getLibXmlLoaderOptions() ); if ($xmlWorkbook->sheets) { $dir = dirname($rel['Target']); @@ -222,10 +222,10 @@ class Excel2007 extends BaseReader implements IReader $xml = new \XMLReader(); $res = $xml->xml( $this->securityScanFile( - 'zip://' . \PhpSpreadsheet\Shared\File::realpath($pFilename) . '#' . "$dir/$fileWorksheet" + 'zip://' . \PhpOffice\PhpSpreadsheet\Shared\File::realpath($pFilename) . '#' . "$dir/$fileWorksheet" ), null, - \PhpSpreadsheet\Settings::getLibXmlLoaderOptions() + \PhpOffice\PhpSpreadsheet\Settings::getLibXmlLoaderOptions() ); $xml->setParserProperty(2, true); @@ -244,7 +244,7 @@ class Excel2007 extends BaseReader implements IReader $xml->close(); $tmpInfo['lastColumnIndex'] = $tmpInfo['totalColumns'] - 1; - $tmpInfo['lastColumnLetter'] = \PhpSpreadsheet\Cell::stringFromColumnIndex($tmpInfo['lastColumnIndex']); + $tmpInfo['lastColumnLetter'] = \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($tmpInfo['lastColumnIndex']); $worksheetInfo[] = $tmpInfo; } @@ -294,11 +294,11 @@ class Excel2007 extends BaseReader implements IReader if (!isset($sharedFormulas[(string) $c->f['si']])) { $sharedFormulas[$instance] = ['master' => $r, 'formula' => $value]; } else { - $master = \PhpSpreadsheet\Cell::coordinateFromString($sharedFormulas[$instance]['master']); - $current = \PhpSpreadsheet\Cell::coordinateFromString($r); + $master = \PhpOffice\PhpSpreadsheet\Cell::coordinateFromString($sharedFormulas[$instance]['master']); + $current = \PhpOffice\PhpSpreadsheet\Cell::coordinateFromString($r); $difference = [0, 0]; - $difference[0] = \PhpSpreadsheet\Cell::columnIndexFromString($current[0]) - \PhpSpreadsheet\Cell::columnIndexFromString($master[0]); + $difference[0] = \PhpOffice\PhpSpreadsheet\Cell::columnIndexFromString($current[0]) - \PhpOffice\PhpSpreadsheet\Cell::columnIndexFromString($master[0]); $difference[1] = $current[1] - $master[1]; $value = $this->referenceHelper->updateFormulaReferences($sharedFormulas[$instance]['formula'], 'A1', $difference[0], $difference[1]); @@ -312,7 +312,7 @@ class Excel2007 extends BaseReader implements IReader if (strpos($fileName, '//') !== false) { $fileName = substr($fileName, strpos($fileName, '//') + 1); } - $fileName = \PhpSpreadsheet\Shared\File::realpath($fileName); + $fileName = \PhpOffice\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 @@ -345,14 +345,14 @@ class Excel2007 extends BaseReader implements IReader } // Initialisations - $excel = new \PhpSpreadsheet\Spreadsheet(); + $excel = new \PhpOffice\PhpSpreadsheet\Spreadsheet(); $excel->removeSheetByIndex(0); if (!$this->readDataOnly) { $excel->removeCellStyleXfByIndex(0); // remove the default style $excel->removeCellXfByIndex(0); // remove the default style } - $zipClass = \PhpSpreadsheet\Settings::getZipClass(); + $zipClass = \PhpOffice\PhpSpreadsheet\Settings::getZipClass(); $zip = new $zipClass(); $zip->open($pFilename); @@ -362,7 +362,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', - \PhpSpreadsheet\Settings::getLibXmlLoaderOptions() + \PhpOffice\PhpSpreadsheet\Settings::getLibXmlLoaderOptions() ); foreach ($wbRels->Relationship as $rel) { switch ($rel['Type']) { @@ -373,7 +373,7 @@ class Excel2007 extends BaseReader implements IReader $xmlTheme = simplexml_load_string( $this->securityScan($this->getFromZipArchive($zip, "xl/{$rel['Target']}")), 'SimpleXMLElement', - \PhpSpreadsheet\Settings::getLibXmlLoaderOptions() + \PhpOffice\PhpSpreadsheet\Settings::getLibXmlLoaderOptions() ); if (is_object($xmlTheme)) { $xmlThemeName = $xmlTheme->attributes(); @@ -408,7 +408,7 @@ class Excel2007 extends BaseReader implements IReader //~ http://schemas.openxmlformats.org/package/2006/relationships" $this->securityScan($this->getFromZipArchive($zip, '_rels/.rels')), 'SimpleXMLElement', - \PhpSpreadsheet\Settings::getLibXmlLoaderOptions() + \PhpOffice\PhpSpreadsheet\Settings::getLibXmlLoaderOptions() ); foreach ($rels->Relationship as $rel) { switch ($rel['Type']) { @@ -416,7 +416,7 @@ class Excel2007 extends BaseReader implements IReader $xmlCore = simplexml_load_string( $this->securityScan($this->getFromZipArchive($zip, "{$rel['Target']}")), 'SimpleXMLElement', - \PhpSpreadsheet\Settings::getLibXmlLoaderOptions() + \PhpOffice\PhpSpreadsheet\Settings::getLibXmlLoaderOptions() ); if (is_object($xmlCore)) { $xmlCore->registerXPathNamespace('dc', 'http://purl.org/dc/elements/1.1/'); @@ -438,7 +438,7 @@ class Excel2007 extends BaseReader implements IReader $xmlCore = simplexml_load_string( $this->securityScan($this->getFromZipArchive($zip, "{$rel['Target']}")), 'SimpleXMLElement', - \PhpSpreadsheet\Settings::getLibXmlLoaderOptions() + \PhpOffice\PhpSpreadsheet\Settings::getLibXmlLoaderOptions() ); if (is_object($xmlCore)) { $docProps = $excel->getProperties(); @@ -454,7 +454,7 @@ class Excel2007 extends BaseReader implements IReader $xmlCore = simplexml_load_string( $this->securityScan($this->getFromZipArchive($zip, "{$rel['Target']}")), 'SimpleXMLElement', - \PhpSpreadsheet\Settings::getLibXmlLoaderOptions() + \PhpOffice\PhpSpreadsheet\Settings::getLibXmlLoaderOptions() ); if (is_object($xmlCore)) { $docProps = $excel->getProperties(); @@ -465,8 +465,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 = \PhpSpreadsheet\Document\Properties::convertProperty($attributeValue, $attributeType); - $attributeType = \PhpSpreadsheet\Document\Properties::convertPropertyType($attributeType); + $attributeValue = \PhpOffice\PhpSpreadsheet\Document\Properties::convertProperty($attributeValue, $attributeType); + $attributeType = \PhpOffice\PhpSpreadsheet\Document\Properties::convertPropertyType($attributeType); $docProps->setCustomProperty($propertyName, $attributeValue, $attributeType); } } @@ -485,7 +485,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', - \PhpSpreadsheet\Settings::getLibXmlLoaderOptions() + \PhpOffice\PhpSpreadsheet\Settings::getLibXmlLoaderOptions() ); $relsWorkbook->registerXPathNamespace('rel', 'http://schemas.openxmlformats.org/package/2006/relationships'); @@ -495,12 +495,12 @@ class Excel2007 extends BaseReader implements IReader //~ http://schemas.openxmlformats.org/spreadsheetml/2006/main" $this->securityScan($this->getFromZipArchive($zip, "$dir/$xpath[Target]")), 'SimpleXMLElement', - \PhpSpreadsheet\Settings::getLibXmlLoaderOptions() + \PhpOffice\PhpSpreadsheet\Settings::getLibXmlLoaderOptions() ); if (isset($xmlStrings) && isset($xmlStrings->si)) { foreach ($xmlStrings->si as $val) { if (isset($val->t)) { - $sharedStrings[] = \PhpSpreadsheet\Shared\StringHelper::controlCharacterOOXML2PHP((string) $val->t); + $sharedStrings[] = \PhpOffice\PhpSpreadsheet\Shared\StringHelper::controlCharacterOOXML2PHP((string) $val->t); } elseif (isset($val->r)) { $sharedStrings[] = $this->parseRichText($val); } @@ -540,7 +540,7 @@ class Excel2007 extends BaseReader implements IReader //~ http://schemas.openxmlformats.org/spreadsheetml/2006/main" $this->securityScan($this->getFromZipArchive($zip, "$dir/$xpath[Target]")), 'SimpleXMLElement', - \PhpSpreadsheet\Settings::getLibXmlLoaderOptions() + \PhpOffice\PhpSpreadsheet\Settings::getLibXmlLoaderOptions() ); $numFmts = null; if ($xmlStyles && $xmlStyles->numFmts[0]) { @@ -551,7 +551,7 @@ class Excel2007 extends BaseReader implements IReader } if (!$this->readDataOnly && $xmlStyles) { foreach ($xmlStyles->cellXfs->xf as $xf) { - $numFmt = \PhpSpreadsheet\Style\NumberFormat::FORMAT_GENERAL; + $numFmt = \PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_GENERAL; if ($xf['numFmtId']) { if (isset($numFmts)) { @@ -566,8 +566,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 && - \PhpSpreadsheet\Style\NumberFormat::builtInFormatCode((int) $xf['numFmtId']) !== '') { - $numFmt = \PhpSpreadsheet\Style\NumberFormat::builtInFormatCode((int) $xf['numFmtId']); + \PhpOffice\PhpSpreadsheet\Style\NumberFormat::builtInFormatCode((int) $xf['numFmtId']) !== '') { + $numFmt = \PhpOffice\PhpSpreadsheet\Style\NumberFormat::builtInFormatCode((int) $xf['numFmtId']); } } $quotePrefix = false; @@ -587,19 +587,19 @@ class Excel2007 extends BaseReader implements IReader $styles[] = $style; // add style to cellXf collection - $objStyle = new \PhpSpreadsheet\Style(); + $objStyle = new \PhpOffice\PhpSpreadsheet\Style(); self::readStyle($objStyle, $style); $excel->addCellXf($objStyle); } foreach ($xmlStyles->cellStyleXfs->xf as $xf) { - $numFmt = \PhpSpreadsheet\Style\NumberFormat::FORMAT_GENERAL; + $numFmt = \PhpOffice\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 = \PhpSpreadsheet\Style\NumberFormat::builtInFormatCode((int) $xf['numFmtId']); + $numFmt = \PhpOffice\PhpSpreadsheet\Style\NumberFormat::builtInFormatCode((int) $xf['numFmtId']); } } @@ -615,7 +615,7 @@ class Excel2007 extends BaseReader implements IReader $cellStyles[] = $cellStyle; // add style to cellStyleXf collection - $objStyle = new \PhpSpreadsheet\Style(); + $objStyle = new \PhpOffice\PhpSpreadsheet\Style(); self::readStyle($objStyle, $cellStyle); $excel->addCellStyleXf($objStyle); } @@ -626,7 +626,7 @@ class Excel2007 extends BaseReader implements IReader // Conditional Styles if ($xmlStyles->dxfs) { foreach ($xmlStyles->dxfs->dxf as $dxf) { - $style = new \PhpSpreadsheet\Style(false, true); + $style = new \PhpOffice\PhpSpreadsheet\Style(false, true); self::readStyle($style, $dxf); $dxfs[] = $style; } @@ -637,7 +637,7 @@ class Excel2007 extends BaseReader implements IReader if (intval($cellStyle['builtinId']) == 0) { if (isset($cellStyles[intval($cellStyle['xfId'])])) { // Set default style - $style = new \PhpSpreadsheet\Style(); + $style = new \PhpOffice\PhpSpreadsheet\Style(); self::readStyle($style, $cellStyles[intval($cellStyle['xfId'])]); // normal style, currently not using it for anything @@ -651,15 +651,15 @@ class Excel2007 extends BaseReader implements IReader //~ http://schemas.openxmlformats.org/spreadsheetml/2006/main" $this->securityScan($this->getFromZipArchive($zip, "{$rel['Target']}")), 'SimpleXMLElement', - \PhpSpreadsheet\Settings::getLibXmlLoaderOptions() + \PhpOffice\PhpSpreadsheet\Settings::getLibXmlLoaderOptions() ); // Set base date if ($xmlWorkbook->workbookPr) { - \PhpSpreadsheet\Shared\Date::setExcelCalendar(\PhpSpreadsheet\Shared\Date::CALENDAR_WINDOWS_1900); + \PhpOffice\PhpSpreadsheet\Shared\Date::setExcelCalendar(\PhpOffice\PhpSpreadsheet\Shared\Date::CALENDAR_WINDOWS_1900); if (isset($xmlWorkbook->workbookPr['date1904'])) { if (self::boolean((string) $xmlWorkbook->workbookPr['date1904'])) { - \PhpSpreadsheet\Shared\Date::setExcelCalendar(\PhpSpreadsheet\Shared\Date::CALENDAR_MAC_1904); + \PhpOffice\PhpSpreadsheet\Shared\Date::setExcelCalendar(\PhpOffice\PhpSpreadsheet\Shared\Date::CALENDAR_MAC_1904); } } } @@ -698,7 +698,7 @@ class Excel2007 extends BaseReader implements IReader //~ http://schemas.openxmlformats.org/spreadsheetml/2006/main" $this->securityScan($this->getFromZipArchive($zip, "$dir/$fileWorksheet")), 'SimpleXMLElement', - \PhpSpreadsheet\Settings::getLibXmlLoaderOptions() + \PhpOffice\PhpSpreadsheet\Settings::getLibXmlLoaderOptions() ); $sharedFormulas = []; @@ -807,18 +807,18 @@ 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(\PhpSpreadsheet\Cell::stringFromColumnIndex($i))->setXfIndex(intval($col['style'])); + $docSheet->getColumnDimension(\PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($i))->setXfIndex(intval($col['style'])); } if (self::boolean($col['hidden'])) { - $docSheet->getColumnDimension(\PhpSpreadsheet\Cell::stringFromColumnIndex($i))->setVisible(false); + $docSheet->getColumnDimension(\PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($i))->setVisible(false); } if (self::boolean($col['collapsed'])) { - $docSheet->getColumnDimension(\PhpSpreadsheet\Cell::stringFromColumnIndex($i))->setCollapsed(true); + $docSheet->getColumnDimension(\PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($i))->setCollapsed(true); } if ($col['outlineLevel'] > 0) { - $docSheet->getColumnDimension(\PhpSpreadsheet\Cell::stringFromColumnIndex($i))->setOutlineLevel(intval($col['outlineLevel'])); + $docSheet->getColumnDimension(\PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($i))->setOutlineLevel(intval($col['outlineLevel'])); } - $docSheet->getColumnDimension(\PhpSpreadsheet\Cell::stringFromColumnIndex($i))->setWidth(floatval($col['width'])); + $docSheet->getColumnDimension(\PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($i))->setWidth(floatval($col['width'])); if (intval($col['max']) == 16384) { break; @@ -868,7 +868,7 @@ class Excel2007 extends BaseReader implements IReader // Read cell? if ($this->getReadFilter() !== null) { - $coordinates = \PhpSpreadsheet\Cell::coordinateFromString($r); + $coordinates = \PhpOffice\PhpSpreadsheet\Cell::coordinateFromString($r); if (!$this->getReadFilter()->readCell($coordinates[0], $coordinates[1], $docSheet->getTitle())) { continue; @@ -881,7 +881,7 @@ class Excel2007 extends BaseReader implements IReader if ((string) $c->v != '') { $value = $sharedStrings[intval($c->v)]; - if ($value instanceof \PhpSpreadsheet\RichText) { + if ($value instanceof \PhpOffice\PhpSpreadsheet\RichText) { $value = clone $value; } } else { @@ -938,7 +938,7 @@ class Excel2007 extends BaseReader implements IReader } // Rich text? - if ($value instanceof \PhpSpreadsheet\RichText && $this->readDataOnly) { + if ($value instanceof \PhpOffice\PhpSpreadsheet\RichText && $this->readDataOnly) { $value = $value->getPlainText(); } @@ -967,7 +967,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'] == \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'])])) { + if (((string) $cfRule['type'] == \PhpOffice\PhpSpreadsheet\Style\Conditional::CONDITION_NONE || (string) $cfRule['type'] == \PhpOffice\PhpSpreadsheet\Style\Conditional::CONDITION_CELLIS || (string) $cfRule['type'] == \PhpOffice\PhpSpreadsheet\Style\Conditional::CONDITION_CONTAINSTEXT || (string) $cfRule['type'] == \PhpOffice\PhpSpreadsheet\Style\Conditional::CONDITION_EXPRESSION) && isset($dxfs[intval($cfRule['dxfId'])])) { $conditionals[(string) $conditional['sqref']][intval($cfRule['priority'])] = $cfRule; } } @@ -977,7 +977,7 @@ class Excel2007 extends BaseReader implements IReader ksort($cfRules); $conditionalStyles = []; foreach ($cfRules as $cfRule) { - $objConditional = new \PhpSpreadsheet\Style\Conditional(); + $objConditional = new \PhpOffice\PhpSpreadsheet\Style\Conditional(); $objConditional->setConditionType((string) $cfRule['type']); $objConditional->setOperatorType((string) $cfRule['operator']); @@ -1031,17 +1031,17 @@ class Excel2007 extends BaseReader implements IReader $column = $autoFilter->getColumnByOffset((integer) $filterColumn['colId']); // Check for standard filters if ($filterColumn->filters) { - $column->setFilterType(\PhpSpreadsheet\Worksheet\AutoFilter\Column::AUTOFILTER_FILTERTYPE_FILTER); + $column->setFilterType(\PhpOffice\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(\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_FILTER); + $column->createRule()->setRule(null, '')->setRuleType(\PhpOffice\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(\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_FILTER); + $column->createRule()->setRule(null, (string) $filterRule['val'])->setRuleType(\PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_FILTER); } // Or Date Group elements foreach ($filters->dateGroupItem as $dateGroupItem) { @@ -1058,29 +1058,29 @@ class Excel2007 extends BaseReader implements IReader ], (string) $dateGroupItem['dateTimeGrouping'] ) - ->setRuleType(\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DATEGROUP); + ->setRuleType(\PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DATEGROUP); } } // Check for custom filters if ($filterColumn->customFilters) { - $column->setFilterType(\PhpSpreadsheet\Worksheet\AutoFilter\Column::AUTOFILTER_FILTERTYPE_CUSTOMFILTER); + $column->setFilterType(\PhpOffice\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(\PhpSpreadsheet\Worksheet\AutoFilter\Column::AUTOFILTER_COLUMN_JOIN_AND); + $column->setJoin(\PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column::AUTOFILTER_COLUMN_JOIN_AND); } foreach ($customFilters->customFilter as $filterRule) { $column->createRule()->setRule( (string) $filterRule['operator'], (string) $filterRule['val'] ) - ->setRuleType(\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_CUSTOMFILTER); + ->setRuleType(\PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_CUSTOMFILTER); } } // Check for dynamic filters if ($filterColumn->dynamicFilter) { - $column->setFilterType(\PhpSpreadsheet\Worksheet\AutoFilter\Column::AUTOFILTER_FILTERTYPE_DYNAMICFILTER); + $column->setFilterType(\PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column::AUTOFILTER_FILTERTYPE_DYNAMICFILTER); // We should only ever have one dynamic filter foreach ($filterColumn->dynamicFilter as $filterRule) { $column->createRule()->setRule( @@ -1089,7 +1089,7 @@ class Excel2007 extends BaseReader implements IReader (string) $filterRule['val'], (string) $filterRule['type'] ) - ->setRuleType(\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMICFILTER); + ->setRuleType(\PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMICFILTER); if (isset($filterRule['val'])) { $column->setAttribute('val', (string) $filterRule['val']); } @@ -1100,21 +1100,21 @@ class Excel2007 extends BaseReader implements IReader } // Check for dynamic filters if ($filterColumn->top10) { - $column->setFilterType(\PhpSpreadsheet\Worksheet\AutoFilter\Column::AUTOFILTER_FILTERTYPE_TOPTENFILTER); + $column->setFilterType(\PhpOffice\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)) - ? \PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_PERCENT - : \PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_BY_VALUE + ? \PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_PERCENT + : \PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_BY_VALUE ), (string) $filterRule['val'], (((isset($filterRule['top'])) && ($filterRule['top'] == 1)) - ? \PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_TOP - : \PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_BOTTOM + ? \PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_TOP + : \PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_BOTTOM ) ) - ->setRuleType(\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_TOPTENFILTER); + ->setRuleType(\PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_TOPTENFILTER); } } } @@ -1203,14 +1203,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]", \PhpSpreadsheet\Worksheet::BREAK_ROW); + $docSheet->setBreak("A$brk[id]", \PhpOffice\PhpSpreadsheet\Worksheet::BREAK_ROW); } } } if ($xmlSheet && $xmlSheet->colBreaks && $xmlSheet->colBreaks->brk && !$this->readDataOnly) { foreach ($xmlSheet->colBreaks->brk as $brk) { if ($brk['man']) { - $docSheet->setBreak(\PhpSpreadsheet\Cell::stringFromColumnIndex((string) $brk['id']) . '1', \PhpSpreadsheet\Worksheet::BREAK_COLUMN); + $docSheet->setBreak(\PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex((string) $brk['id']) . '1', \PhpOffice\PhpSpreadsheet\Worksheet::BREAK_COLUMN); } } } @@ -1224,7 +1224,7 @@ class Excel2007 extends BaseReader implements IReader $stRange = $docSheet->shrinkRangeToFit($range); // Extract all cell references in $range - foreach (\PhpSpreadsheet\Cell::extractAllCellReferencesInRange($stRange) as $reference) { + foreach (\PhpOffice\PhpSpreadsheet\Cell::extractAllCellReferencesInRange($stRange) as $reference) { // Create validation $docValidation = $docSheet->getCell($reference)->getDataValidation(); $docValidation->setType((string) $dataValidation['type']); @@ -1256,7 +1256,7 @@ class Excel2007 extends BaseReader implements IReader $this->getFromZipArchive($zip, dirname("$dir/$fileWorksheet") . '/_rels/' . basename($fileWorksheet) . '.rels') ), 'SimpleXMLElement', - \PhpSpreadsheet\Settings::getLibXmlLoaderOptions() + \PhpOffice\PhpSpreadsheet\Settings::getLibXmlLoaderOptions() ); foreach ($relsWorksheet->Relationship as $ele) { if ($ele['Type'] == 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink') { @@ -1271,7 +1271,7 @@ class Excel2007 extends BaseReader implements IReader // Link url $linkRel = $hyperlink->attributes('http://schemas.openxmlformats.org/officeDocument/2006/relationships'); - foreach (\PhpSpreadsheet\Cell::extractAllCellReferencesInRange($hyperlink['ref']) as $cellReference) { + foreach (\PhpOffice\PhpSpreadsheet\Cell::extractAllCellReferencesInRange($hyperlink['ref']) as $cellReference) { $cell = $docSheet->getCell($cellReference); if (isset($linkRel['id'])) { $hyperlinkUrl = $hyperlinks[(string) $linkRel['id']]; @@ -1304,7 +1304,7 @@ class Excel2007 extends BaseReader implements IReader $this->getFromZipArchive($zip, dirname("$dir/$fileWorksheet") . '/_rels/' . basename($fileWorksheet) . '.rels') ), 'SimpleXMLElement', - \PhpSpreadsheet\Settings::getLibXmlLoaderOptions() + \PhpOffice\PhpSpreadsheet\Settings::getLibXmlLoaderOptions() ); foreach ($relsWorksheet->Relationship as $ele) { if ($ele['Type'] == 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments') { @@ -1319,11 +1319,11 @@ class Excel2007 extends BaseReader implements IReader // Loop through comments foreach ($comments as $relName => $relPath) { // Load comments file - $relPath = \PhpSpreadsheet\Shared\File::realpath(dirname("$dir/$fileWorksheet") . '/' . $relPath); + $relPath = \PhpOffice\PhpSpreadsheet\Shared\File::realpath(dirname("$dir/$fileWorksheet") . '/' . $relPath); $commentsFile = simplexml_load_string( $this->securityScan($this->getFromZipArchive($zip, $relPath)), 'SimpleXMLElement', - \PhpSpreadsheet\Settings::getLibXmlLoaderOptions() + \PhpOffice\PhpSpreadsheet\Settings::getLibXmlLoaderOptions() ); // Utility variables @@ -1346,11 +1346,11 @@ class Excel2007 extends BaseReader implements IReader // Loop through VML comments foreach ($vmlComments as $relName => $relPath) { // Load VML comments file - $relPath = \PhpSpreadsheet\Shared\File::realpath(dirname("$dir/$fileWorksheet") . '/' . $relPath); + $relPath = \PhpOffice\PhpSpreadsheet\Shared\File::realpath(dirname("$dir/$fileWorksheet") . '/' . $relPath); $vmlCommentsFile = simplexml_load_string( $this->securityScan($this->getFromZipArchive($zip, $relPath)), 'SimpleXMLElement', - \PhpSpreadsheet\Settings::getLibXmlLoaderOptions() + \PhpOffice\PhpSpreadsheet\Settings::getLibXmlLoaderOptions() ); $vmlCommentsFile->registerXPathNamespace('v', 'urn:schemas-microsoft-com:vml'); @@ -1421,7 +1421,7 @@ class Excel2007 extends BaseReader implements IReader $this->getFromZipArchive($zip, dirname("$dir/$fileWorksheet") . '/_rels/' . basename($fileWorksheet) . '.rels') ), 'SimpleXMLElement', - \PhpSpreadsheet\Settings::getLibXmlLoaderOptions() + \PhpOffice\PhpSpreadsheet\Settings::getLibXmlLoaderOptions() ); $vmlRelationship = ''; @@ -1439,7 +1439,7 @@ class Excel2007 extends BaseReader implements IReader $this->getFromZipArchive($zip, dirname($vmlRelationship) . '/_rels/' . basename($vmlRelationship) . '.rels') ), 'SimpleXMLElement', - \PhpSpreadsheet\Settings::getLibXmlLoaderOptions() + \PhpOffice\PhpSpreadsheet\Settings::getLibXmlLoaderOptions() ); $drawings = []; foreach ($relsVML->Relationship as $ele) { @@ -1452,7 +1452,7 @@ class Excel2007 extends BaseReader implements IReader $vmlDrawing = simplexml_load_string( $this->securityScan($this->getFromZipArchive($zip, $vmlRelationship)), 'SimpleXMLElement', - \PhpSpreadsheet\Settings::getLibXmlLoaderOptions() + \PhpOffice\PhpSpreadsheet\Settings::getLibXmlLoaderOptions() ); $vmlDrawing->registerXPathNamespace('v', 'urn:schemas-microsoft-com:vml'); @@ -1467,12 +1467,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 \PhpSpreadsheet\Worksheet\HeaderFooterDrawing(); + $hfImages[(string) $shape['id']] = new \PhpOffice\PhpSpreadsheet\Worksheet\HeaderFooterDrawing(); if (isset($imageData['title'])) { $hfImages[(string) $shape['id']]->setName((string) $imageData['title']); } - $hfImages[(string) $shape['id']]->setPath('zip://' . \PhpSpreadsheet\Shared_File::realpath($pFilename) . '#' . $drawings[(string) $imageData['relid']], false); + $hfImages[(string) $shape['id']]->setPath('zip://' . \PhpOffice\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']); @@ -1497,7 +1497,7 @@ class Excel2007 extends BaseReader implements IReader $this->getFromZipArchive($zip, dirname("$dir/$fileWorksheet") . '/_rels/' . basename($fileWorksheet) . '.rels') ), 'SimpleXMLElement', - \PhpSpreadsheet\Settings::getLibXmlLoaderOptions() + \PhpOffice\PhpSpreadsheet\Settings::getLibXmlLoaderOptions() ); $drawings = []; foreach ($relsWorksheet->Relationship as $ele) { @@ -1514,7 +1514,7 @@ class Excel2007 extends BaseReader implements IReader $this->getFromZipArchive($zip, dirname($fileDrawing) . '/_rels/' . basename($fileDrawing) . '.rels') ), 'SimpleXMLElement', - \PhpSpreadsheet\Settings::getLibXmlLoaderOptions() + \PhpOffice\PhpSpreadsheet\Settings::getLibXmlLoaderOptions() ); $images = []; @@ -1535,7 +1535,7 @@ class Excel2007 extends BaseReader implements IReader $xmlDrawing = simplexml_load_string( $this->securityScan($this->getFromZipArchive($zip, $fileDrawing)), 'SimpleXMLElement', - \PhpSpreadsheet\Settings::getLibXmlLoaderOptions() + \PhpOffice\PhpSpreadsheet\Settings::getLibXmlLoaderOptions() )->children('http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing'); if ($xmlDrawing->oneCellAnchor) { @@ -1544,32 +1544,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 \PhpSpreadsheet\Worksheet\Drawing(); + $objDrawing = new \PhpOffice\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://' . \PhpSpreadsheet\Shared\File::realpath($pFilename) . '#' . + 'zip://' . \PhpOffice\PhpSpreadsheet\Shared\File::realpath($pFilename) . '#' . $images[(string) self::getArrayItem( $blip->attributes('http://schemas.openxmlformats.org/officeDocument/2006/relationships'), 'embed' )], false ); - $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->setCoordinates(\PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex((string) $oneCellAnchor->from->col) . ($oneCellAnchor->from->row + 1)); + $objDrawing->setOffsetX(\PhpOffice\PhpSpreadsheet\Shared\Drawing::EMUToPixels($oneCellAnchor->from->colOff)); + $objDrawing->setOffsetY(\PhpOffice\PhpSpreadsheet\Shared\Drawing::EMUToPixels($oneCellAnchor->from->rowOff)); $objDrawing->setResizeProportional(false); - $objDrawing->setWidth(\PhpSpreadsheet\Shared\Drawing::EMUToPixels(self::getArrayItem($oneCellAnchor->ext->attributes(), 'cx'))); - $objDrawing->setHeight(\PhpSpreadsheet\Shared\Drawing::EMUToPixels(self::getArrayItem($oneCellAnchor->ext->attributes(), 'cy'))); + $objDrawing->setWidth(\PhpOffice\PhpSpreadsheet\Shared\Drawing::EMUToPixels(self::getArrayItem($oneCellAnchor->ext->attributes(), 'cx'))); + $objDrawing->setHeight(\PhpOffice\PhpSpreadsheet\Shared\Drawing::EMUToPixels(self::getArrayItem($oneCellAnchor->ext->attributes(), 'cy'))); if ($xfrm) { - $objDrawing->setRotation(\PhpSpreadsheet\Shared\Drawing::angleToDegrees(self::getArrayItem($xfrm->attributes(), 'rot'))); + $objDrawing->setRotation(\PhpOffice\PhpSpreadsheet\Shared\Drawing::angleToDegrees(self::getArrayItem($xfrm->attributes(), 'rot'))); } if ($outerShdw) { $shadow = $objDrawing->getShadow(); $shadow->setVisible(true); - $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->setBlurRadius(\PhpOffice\PhpSpreadsheet\Shared\Drawing::EMUTopixels(self::getArrayItem($outerShdw->attributes(), 'blurRad'))); + $shadow->setDistance(\PhpOffice\PhpSpreadsheet\Shared\Drawing::EMUTopixels(self::getArrayItem($outerShdw->attributes(), 'dist'))); + $shadow->setDirection(\PhpOffice\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); @@ -1577,11 +1577,11 @@ class Excel2007 extends BaseReader implements IReader $objDrawing->setWorksheet($docSheet); } else { // ? Can charts be positioned with a oneCellAnchor ? - $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')); + $coordinates = \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex((string) $oneCellAnchor->from->col) . ($oneCellAnchor->from->row + 1); + $offsetX = \PhpOffice\PhpSpreadsheet\Shared\Drawing::EMUToPixels($oneCellAnchor->from->colOff); + $offsetY = \PhpOffice\PhpSpreadsheet\Shared\Drawing::EMUToPixels($oneCellAnchor->from->rowOff); + $width = \PhpOffice\PhpSpreadsheet\Shared\Drawing::EMUToPixels(self::getArrayItem($oneCellAnchor->ext->attributes(), 'cx')); + $height = \PhpOffice\PhpSpreadsheet\Shared\Drawing::EMUToPixels(self::getArrayItem($oneCellAnchor->ext->attributes(), 'cy')); } } } @@ -1591,45 +1591,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 \PhpSpreadsheet\Worksheet\Drawing(); + $objDrawing = new \PhpOffice\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://' . \PhpSpreadsheet\Shared\File::realpath($pFilename) . '#' . + 'zip://' . \PhpOffice\PhpSpreadsheet\Shared\File::realpath($pFilename) . '#' . $images[(string) self::getArrayItem( $blip->attributes('http://schemas.openxmlformats.org/officeDocument/2006/relationships'), 'embed' )], false ); - $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->setCoordinates(\PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex((string) $twoCellAnchor->from->col) . ($twoCellAnchor->from->row + 1)); + $objDrawing->setOffsetX(\PhpOffice\PhpSpreadsheet\Shared\Drawing::EMUToPixels($twoCellAnchor->from->colOff)); + $objDrawing->setOffsetY(\PhpOffice\PhpSpreadsheet\Shared\Drawing::EMUToPixels($twoCellAnchor->from->rowOff)); $objDrawing->setResizeProportional(false); if ($xfrm) { - $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'))); + $objDrawing->setWidth(\PhpOffice\PhpSpreadsheet\Shared\Drawing::EMUToPixels(self::getArrayItem($xfrm->ext->attributes(), 'cx'))); + $objDrawing->setHeight(\PhpOffice\PhpSpreadsheet\Shared\Drawing::EMUToPixels(self::getArrayItem($xfrm->ext->attributes(), 'cy'))); + $objDrawing->setRotation(\PhpOffice\PhpSpreadsheet\Shared\Drawing::angleToDegrees(self::getArrayItem($xfrm->attributes(), 'rot'))); } if ($outerShdw) { $shadow = $objDrawing->getShadow(); $shadow->setVisible(true); - $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->setBlurRadius(\PhpOffice\PhpSpreadsheet\Shared\Drawing::EMUTopixels(self::getArrayItem($outerShdw->attributes(), 'blurRad'))); + $shadow->setDistance(\PhpOffice\PhpSpreadsheet\Shared\Drawing::EMUTopixels(self::getArrayItem($outerShdw->attributes(), 'dist'))); + $shadow->setDirection(\PhpOffice\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 = \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); + $fromCoordinate = \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex((string) $twoCellAnchor->from->col) . ($twoCellAnchor->from->row + 1); + $fromOffsetX = \PhpOffice\PhpSpreadsheet\Shared\Drawing::EMUToPixels($twoCellAnchor->from->colOff); + $fromOffsetY = \PhpOffice\PhpSpreadsheet\Shared\Drawing::EMUToPixels($twoCellAnchor->from->rowOff); + $toCoordinate = \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex((string) $twoCellAnchor->to->col) . ($twoCellAnchor->to->row + 1); + $toOffsetX = \PhpOffice\PhpSpreadsheet\Shared\Drawing::EMUToPixels($twoCellAnchor->to->colOff); + $toOffsetY = \PhpOffice\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'); @@ -1760,7 +1760,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 \PhpSpreadsheet\NamedRange((string) $definedName['name'], $worksheet, $extractedRange, true, $scope)); + $excel->addNamedRange(new \PhpOffice\PhpSpreadsheet\NamedRange((string) $definedName['name'], $worksheet, $extractedRange, true, $scope)); } } } @@ -1772,7 +1772,7 @@ class Excel2007 extends BaseReader implements IReader $extractedSheetName = ''; if (strpos((string) $definedName, '!') !== false) { // Extract sheet name - $extractedSheetName = \PhpSpreadsheet\Worksheet::extractSheetTitle((string) $definedName, true); + $extractedSheetName = \PhpOffice\PhpSpreadsheet\Worksheet::extractSheetTitle((string) $definedName, true); $extractedSheetName = $extractedSheetName[0]; // Locate sheet @@ -1784,7 +1784,7 @@ class Excel2007 extends BaseReader implements IReader } if ($locatedSheet !== null) { - $excel->addNamedRange(new \PhpSpreadsheet\NamedRange((string) $definedName['name'], $locatedSheet, $extractedRange, false)); + $excel->addNamedRange(new \PhpOffice\PhpSpreadsheet\NamedRange((string) $definedName['name'], $locatedSheet, $extractedRange, false)); } } } @@ -1815,7 +1815,7 @@ class Excel2007 extends BaseReader implements IReader $this->getFromZipArchive($zip, '[Content_Types].xml') ), 'SimpleXMLElement', - \PhpSpreadsheet\Settings::getLibXmlLoaderOptions() + \PhpOffice\PhpSpreadsheet\Settings::getLibXmlLoaderOptions() ); foreach ($contentTypes->Override as $contentType) { switch ($contentType['ContentType']) { @@ -1827,9 +1827,9 @@ class Excel2007 extends BaseReader implements IReader $this->getFromZipArchive($zip, $chartEntryRef) ), 'SimpleXMLElement', - \PhpSpreadsheet\Settings::getLibXmlLoaderOptions() + \PhpOffice\PhpSpreadsheet\Settings::getLibXmlLoaderOptions() ); - $objChart = \PhpSpreadsheet\Reader\Excel2007\Chart::readChart($chartElements, basename($chartEntryRef, '.xml')); + $objChart = \PhpOffice\PhpSpreadsheet\Reader\Excel2007\Chart::readChart($chartElements, basename($chartEntryRef, '.xml')); // if (isset($charts[$chartEntryRef])) { @@ -1856,13 +1856,13 @@ class Excel2007 extends BaseReader implements IReader if (isset($color['rgb'])) { return (string) $color['rgb']; } elseif (isset($color['indexed'])) { - return \PhpSpreadsheet\Style\Color::indexedColor($color['indexed'] - 7, $background)->getARGB(); + return \PhpOffice\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 = \PhpSpreadsheet\Style\Color::changeBrightness($returnColour, $tintAdjust); + $returnColour = \PhpOffice\PhpSpreadsheet\Style\Color::changeBrightness($returnColour, $tintAdjust); } return 'FF' . $returnColour; @@ -1877,7 +1877,7 @@ class Excel2007 extends BaseReader implements IReader } /** - * @param \PhpSpreadsheet\Style $docStyle + * @param \PhpOffice\PhpSpreadsheet\Style $docStyle * @param \stdClass $style */ private static function readStyle($docStyle, \stdClass $style) @@ -1900,7 +1900,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(\PhpSpreadsheet\Style\Font::UNDERLINE_SINGLE); + $docStyle->getFont()->setUnderline(\PhpOffice\PhpSpreadsheet\Style\Font::UNDERLINE_SINGLE); } elseif (isset($style->font->u) && isset($style->font->u['val'])) { $docStyle->getFont()->setUnderline((string) $style->font->u['val']); } @@ -1946,13 +1946,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(\PhpSpreadsheet\Style\Borders::DIAGONAL_NONE); + $docStyle->getBorders()->setDiagonalDirection(\PhpOffice\PhpSpreadsheet\Style\Borders::DIAGONAL_NONE); } elseif ($diagonalUp && !$diagonalDown) { - $docStyle->getBorders()->setDiagonalDirection(\PhpSpreadsheet\Style\Borders::DIAGONAL_UP); + $docStyle->getBorders()->setDiagonalDirection(\PhpOffice\PhpSpreadsheet\Style\Borders::DIAGONAL_UP); } elseif (!$diagonalUp && $diagonalDown) { - $docStyle->getBorders()->setDiagonalDirection(\PhpSpreadsheet\Style\Borders::DIAGONAL_DOWN); + $docStyle->getBorders()->setDiagonalDirection(\PhpOffice\PhpSpreadsheet\Style\Borders::DIAGONAL_DOWN); } else { - $docStyle->getBorders()->setDiagonalDirection(\PhpSpreadsheet\Style\Borders::DIAGONAL_BOTH); + $docStyle->getBorders()->setDiagonalDirection(\PhpOffice\PhpSpreadsheet\Style\Borders::DIAGONAL_BOTH); } self::readBorder($docStyle->getBorders()->getLeft(), $style->border->left); self::readBorder($docStyle->getBorders()->getRight(), $style->border->right); @@ -1984,17 +1984,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(\PhpSpreadsheet\Style\Protection::PROTECTION_PROTECTED); + $docStyle->getProtection()->setLocked(\PhpOffice\PhpSpreadsheet\Style\Protection::PROTECTION_PROTECTED); } else { - $docStyle->getProtection()->setLocked(\PhpSpreadsheet\Style\Protection::PROTECTION_UNPROTECTED); + $docStyle->getProtection()->setLocked(\PhpOffice\PhpSpreadsheet\Style\Protection::PROTECTION_UNPROTECTED); } } if (isset($style->protection['hidden'])) { if (self::boolean((string) $style->protection['hidden'])) { - $docStyle->getProtection()->setHidden(\PhpSpreadsheet\Style\Protection::PROTECTION_PROTECTED); + $docStyle->getProtection()->setHidden(\PhpOffice\PhpSpreadsheet\Style\Protection::PROTECTION_PROTECTED); } else { - $docStyle->getProtection()->setHidden(\PhpSpreadsheet\Style\Protection::PROTECTION_UNPROTECTED); + $docStyle->getProtection()->setHidden(\PhpOffice\PhpSpreadsheet\Style\Protection::PROTECTION_UNPROTECTED); } } } @@ -2017,17 +2017,17 @@ class Excel2007 extends BaseReader implements IReader private function parseRichText($is = null) { - $value = new \PhpSpreadsheet\RichText(); + $value = new \PhpOffice\PhpSpreadsheet\RichText(); if (isset($is->t)) { - $value->createText(\PhpSpreadsheet\Shared\StringHelper::controlCharacterOOXML2PHP((string) $is->t)); + $value->createText(\PhpOffice\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(\PhpSpreadsheet\Shared\StringHelper::controlCharacterOOXML2PHP((string) $run->t)); + $objText = $value->createText(\PhpOffice\PhpSpreadsheet\Shared\StringHelper::controlCharacterOOXML2PHP((string) $run->t)); } else { - $objText = $value->createTextRun(\PhpSpreadsheet\Shared\StringHelper::controlCharacterOOXML2PHP((string) $run->t)); + $objText = $value->createTextRun(\PhpOffice\PhpSpreadsheet\Shared\StringHelper::controlCharacterOOXML2PHP((string) $run->t)); if (isset($run->rPr->rFont['val'])) { $objText->getFont()->setName((string) $run->rPr->rFont['val']); @@ -2036,7 +2036,7 @@ class Excel2007 extends BaseReader implements IReader $objText->getFont()->setSize((string) $run->rPr->sz['val']); } if (isset($run->rPr->color)) { - $objText->getFont()->setColor(new \PhpSpreadsheet\Style\Color(self::readColor($run->rPr->color))); + $objText->getFont()->setColor(new \PhpOffice\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']))) { @@ -2056,7 +2056,7 @@ class Excel2007 extends BaseReader implements IReader } } if (isset($run->rPr->u) && !isset($run->rPr->u['val'])) { - $objText->getFont()->setUnderline(\PhpSpreadsheet\Style\Font::UNDERLINE_SINGLE); + $objText->getFont()->setUnderline(\PhpOffice\PhpSpreadsheet\Style\Font::UNDERLINE_SINGLE); } elseif (isset($run->rPr->u) && isset($run->rPr->u['val'])) { $objText->getFont()->setUnderline((string) $run->rPr->u['val']); } @@ -2073,9 +2073,9 @@ class Excel2007 extends BaseReader implements IReader } /** - * @param \PhpSpreadsheet\Spreadsheet $excel + * @param \PhpOffice\PhpSpreadsheet\Spreadsheet $excel */ - private function readRibbon(\PhpSpreadsheet\Spreadsheet $excel, $customUITarget, $zip) + private function readRibbon(\PhpOffice\PhpSpreadsheet\Spreadsheet $excel, $customUITarget, $zip) { $baseDir = dirname($customUITarget); $nameCustomUI = basename($customUITarget); @@ -2091,7 +2091,7 @@ class Excel2007 extends BaseReader implements IReader $UIRels = simplexml_load_string( $this->securityScan($dataRels), 'SimpleXMLElement', - \PhpSpreadsheet\Settings::getLibXmlLoaderOptions() + \PhpOffice\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 @@ -2141,15 +2141,15 @@ class Excel2007 extends BaseReader implements IReader } if (strpos($item[1], 'pt') !== false) { $item[1] = str_replace('pt', '', $item[1]); - $item[1] = \PhpSpreadsheet\Shared\Font::fontSizeToPixels($item[1]); + $item[1] = \PhpOffice\PhpSpreadsheet\Shared\Font::fontSizeToPixels($item[1]); } if (strpos($item[1], 'in') !== false) { $item[1] = str_replace('in', '', $item[1]); - $item[1] = \PhpSpreadsheet\Shared\Font::inchSizeToPixels($item[1]); + $item[1] = \PhpOffice\PhpSpreadsheet\Shared\Font::inchSizeToPixels($item[1]); } if (strpos($item[1], 'cm') !== false) { $item[1] = str_replace('cm', '', $item[1]); - $item[1] = \PhpSpreadsheet\Shared\Font::centimeterSizeToPixels($item[1]); + $item[1] = \PhpOffice\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 3f8a3f1f..7ebb73c2 100644 --- a/src/PhpSpreadsheet/Reader/Excel2007/Chart.php +++ b/src/PhpSpreadsheet/Reader/Excel2007/Chart.php @@ -1,6 +1,6 @@ getARGB(); + return \PhpOffice\PhpSpreadsheet\Style\Color::indexedColor($color['indexed'] - 7, $background)->getARGB(); } } @@ -162,9 +162,9 @@ class Chart } } if ($plotAreaLayout == null) { - $plotAreaLayout = new \PhpSpreadsheet\Chart\Layout(); + $plotAreaLayout = new \PhpOffice\PhpSpreadsheet\Chart\Layout(); } - $plotArea = new \PhpSpreadsheet\Chart\PlotArea($plotAreaLayout, $plotSeries); + $plotArea = new \PhpOffice\PhpSpreadsheet\Chart\PlotArea($plotAreaLayout, $plotSeries); self::setChartAttributes($plotAreaLayout, $plotAttributes); break; case 'plotVisOnly': @@ -193,13 +193,13 @@ class Chart break; } } - $legend = new \PhpSpreadsheet\Chart\Legend($legendPos, $legendLayout, $legendOverlay); + $legend = new \PhpOffice\PhpSpreadsheet\Chart\Legend($legendPos, $legendLayout, $legendOverlay); break; } } } } - $chart = new \PhpSpreadsheet\Chart($chartName, $title, $legend, $plotArea, $plotVisOnly, $dispBlanksAs, $XaxisLabel, $YaxisLabel); + $chart = new \PhpOffice\PhpSpreadsheet\Chart($chartName, $title, $legend, $plotArea, $plotVisOnly, $dispBlanksAs, $XaxisLabel, $YaxisLabel); return $chart; } @@ -226,7 +226,7 @@ class Chart } } - return new \PhpSpreadsheet\Chart\Title($caption, $titleLayout); + return new \PhpOffice\PhpSpreadsheet\Chart\Title($caption, $titleLayout); } private static function chartLayoutDetails($chartDetail, $namespacesChartMeta) @@ -243,7 +243,7 @@ class Chart $layout[$detailKey] = self::getAttribute($detail, 'val', 'string'); } - return new \PhpSpreadsheet\Chart\Layout($layout); + return new \PhpOffice\PhpSpreadsheet\Chart\Layout($layout); } private static function chartDataSeries($chartDetail, $namespacesChartMeta, $plotType) @@ -295,7 +295,7 @@ class Chart } } - return new \PhpSpreadsheet\Chart\DataSeries($plotType, $multiSeriesType, $plotOrder, $seriesLabel, $seriesCategory, $seriesValues, $smoothLine); + return new \PhpOffice\PhpSpreadsheet\Chart\DataSeries($plotType, $multiSeriesType, $plotOrder, $seriesLabel, $seriesCategory, $seriesValues, $smoothLine); } private static function chartDataSeriesValueSet($seriesDetail, $namespacesChartMeta, $marker = null, $smoothLine = false) @@ -304,24 +304,24 @@ class Chart $seriesSource = (string) $seriesDetail->strRef->f; $seriesData = self::chartDataSeriesValues($seriesDetail->strRef->strCache->children($namespacesChartMeta['c']), 's'); - return new \PhpSpreadsheet\Chart\DataSeriesValues('String', $seriesSource, $seriesData['formatCode'], $seriesData['pointCount'], $seriesData['dataValues'], $marker, $smoothLine); + return new \PhpOffice\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 \PhpSpreadsheet\Chart\DataSeriesValues('Number', $seriesSource, $seriesData['formatCode'], $seriesData['pointCount'], $seriesData['dataValues'], $marker, $smoothLine); + return new \PhpOffice\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 \PhpSpreadsheet\Chart\DataSeriesValues('String', $seriesSource, $seriesData['formatCode'], $seriesData['pointCount'], $seriesData['dataValues'], $marker, $smoothLine); + return new \PhpOffice\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 \PhpSpreadsheet\Chart\DataSeriesValues('String', $seriesSource, $seriesData['formatCode'], $seriesData['pointCount'], $seriesData['dataValues'], $marker, $smoothLine); + return new \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues('String', $seriesSource, $seriesData['formatCode'], $seriesData['pointCount'], $seriesData['dataValues'], $marker, $smoothLine); } return null; @@ -395,7 +395,7 @@ class Chart private static function parseRichText($titleDetailPart = null) { - $value = new \PhpSpreadsheet\RichText(); + $value = new \PhpOffice\PhpSpreadsheet\RichText(); foreach ($titleDetailPart as $titleDetailElementKey => $titleDetailElement) { if (isset($titleDetailElement->t)) { @@ -413,7 +413,7 @@ class Chart $fontColor = (self::getAttribute($titleDetailElement->rPr, 'color', 'string')); if (!is_null($fontColor)) { - $objText->getFont()->setColor(new \PhpSpreadsheet\Style\Color(self::readColor($fontColor))); + $objText->getFont()->setColor(new \PhpOffice\PhpSpreadsheet\Style\Color(self::readColor($fontColor))); } $bold = self::getAttribute($titleDetailElement->rPr, 'b', 'boolean'); @@ -438,11 +438,11 @@ class Chart $underscore = (self::getAttribute($titleDetailElement->rPr, 'u', 'string')); if (!is_null($underscore)) { if ($underscore == 'sng') { - $objText->getFont()->setUnderline(\PhpSpreadsheet\Style\Font::UNDERLINE_SINGLE); + $objText->getFont()->setUnderline(\PhpOffice\PhpSpreadsheet\Style\Font::UNDERLINE_SINGLE); } elseif ($underscore == 'dbl') { - $objText->getFont()->setUnderline(\PhpSpreadsheet\Style\Font::UNDERLINE_DOUBLE); + $objText->getFont()->setUnderline(\PhpOffice\PhpSpreadsheet\Style\Font::UNDERLINE_DOUBLE); } else { - $objText->getFont()->setUnderline(\PhpSpreadsheet\Style\Font::UNDERLINE_NONE); + $objText->getFont()->setUnderline(\PhpOffice\PhpSpreadsheet\Style\Font::UNDERLINE_NONE); } } @@ -491,9 +491,9 @@ class Chart } /** - * @param \PhpSpreadsheet\Chart\Layout $plotArea + * @param \PhpOffice\PhpSpreadsheet\Chart\Layout $plotArea */ - private static function setChartAttributes(\PhpSpreadsheet\Chart\Layout $plotArea, $plotAttributes) + private static function setChartAttributes(\PhpOffice\PhpSpreadsheet\Chart\Layout $plotArea, $plotAttributes) { foreach ($plotAttributes as $plotAttributeKey => $plotAttributeValue) { switch ($plotAttributeKey) { diff --git a/src/PhpSpreadsheet/Reader/Excel2007/Theme.php b/src/PhpSpreadsheet/Reader/Excel2007/Theme.php index 6d0e0e84..4594790f 100644 --- a/src/PhpSpreadsheet/Reader/Excel2007/Theme.php +++ b/src/PhpSpreadsheet/Reader/Excel2007/Theme.php @@ -1,6 +1,6 @@ read($pFilename); return true; - } catch (\PhpSpreadsheet\Exception $e) { + } catch (\PhpOffice\PhpSpreadsheet\Exception $e) { return false; } } @@ -589,7 +589,7 @@ class Excel5 extends BaseReader implements IReader } } - $tmpInfo['lastColumnLetter'] = \PhpSpreadsheet\Cell::stringFromColumnIndex($tmpInfo['lastColumnIndex']); + $tmpInfo['lastColumnLetter'] = \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($tmpInfo['lastColumnIndex']); $tmpInfo['totalColumns'] = $tmpInfo['lastColumnIndex'] + 1; $worksheetInfo[] = $tmpInfo; @@ -603,7 +603,7 @@ class Excel5 extends BaseReader implements IReader * * @param string $pFilename * @throws Exception - * @return \PhpSpreadsheet\Spreadsheet + * @return \PhpOffice\PhpSpreadsheet\Spreadsheet */ public function load($pFilename) { @@ -611,7 +611,7 @@ class Excel5 extends BaseReader implements IReader $this->loadOLE($pFilename); // Initialisations - $this->spreadsheet = new \PhpSpreadsheet\Spreadsheet(); + $this->spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet(); $this->spreadsheet->removeSheetByIndex(0); // remove 1st sheet if (!$this->readDataOnly) { $this->spreadsheet->removeCellStyleXfByIndex(0); // remove the default style @@ -763,7 +763,7 @@ class Excel5 extends BaseReader implements IReader // treat MSODRAWINGGROUP records, workbook-level Escher if (!$this->readDataOnly && $this->drawingGroupData) { - $escherWorkbook = new \PhpSpreadsheet\Shared\Escher(); + $escherWorkbook = new \PhpOffice\PhpSpreadsheet\Shared\Escher(); $reader = new Excel5\Escher($escherWorkbook); $escherWorkbook = $reader->load($this->drawingGroupData); } @@ -981,7 +981,7 @@ class Excel5 extends BaseReader implements IReader // treat MSODRAWING records, sheet-level Escher if (!$this->readDataOnly && $this->drawingData) { - $escherWorksheet = new \PhpSpreadsheet\Shared\Escher(); + $escherWorksheet = new \PhpOffice\PhpSpreadsheet\Shared\Escher(); $reader = new Excel5\Escher($escherWorksheet); $escherWorksheet = $reader->load($this->drawingData); @@ -1001,20 +1001,20 @@ class Excel5 extends BaseReader implements IReader } // calculate the width and height of the shape - list($startColumn, $startRow) = \PhpSpreadsheet\Cell::coordinateFromString($spContainer->getStartCoordinates()); - list($endColumn, $endRow) = \PhpSpreadsheet\Cell::coordinateFromString($spContainer->getEndCoordinates()); + list($startColumn, $startRow) = \PhpOffice\PhpSpreadsheet\Cell::coordinateFromString($spContainer->getStartCoordinates()); + list($endColumn, $endRow) = \PhpOffice\PhpSpreadsheet\Cell::coordinateFromString($spContainer->getEndCoordinates()); $startOffsetX = $spContainer->getStartOffsetX(); $startOffsetY = $spContainer->getStartOffsetY(); $endOffsetX = $spContainer->getEndOffsetX(); $endOffsetY = $spContainer->getEndOffsetY(); - $width = \PhpSpreadsheet\Shared\Excel5::getDistanceX($this->phpSheet, $startColumn, $startOffsetX, $endColumn, $endOffsetX); - $height = \PhpSpreadsheet\Shared\Excel5::getDistanceY($this->phpSheet, $startRow, $startOffsetY, $endRow, $endOffsetY); + $width = \PhpOffice\PhpSpreadsheet\Shared\Excel5::getDistanceX($this->phpSheet, $startColumn, $startOffsetX, $endColumn, $endOffsetX); + $height = \PhpOffice\PhpSpreadsheet\Shared\Excel5::getDistanceY($this->phpSheet, $startRow, $startOffsetY, $endRow, $endOffsetY); // calculate offsetX and offsetY of the shape - $offsetX = $startOffsetX * \PhpSpreadsheet\Shared\Excel5::sizeCol($this->phpSheet, $startColumn) / 1024; - $offsetY = $startOffsetY * \PhpSpreadsheet\Shared\Excel5::sizeRow($this->phpSheet, $startRow) / 256; + $offsetX = $startOffsetX * \PhpOffice\PhpSpreadsheet\Shared\Excel5::sizeCol($this->phpSheet, $startColumn) / 1024; + $offsetY = $startOffsetY * \PhpOffice\PhpSpreadsheet\Shared\Excel5::sizeRow($this->phpSheet, $startRow) / 256; switch ($obj['otObjType']) { case 0x19: @@ -1039,7 +1039,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 \PhpSpreadsheet\Worksheet\MemoryDrawing(); + $drawing = new \PhpOffice\PhpSpreadsheet\Worksheet\MemoryDrawing(); $drawing->setImageResource($ih); // width, height, offsetX, offsetY @@ -1050,13 +1050,13 @@ class Excel5 extends BaseReader implements IReader $drawing->setOffsetY($offsetY); switch ($blipType) { - case \PhpSpreadsheet\Shared\Escher\DggContainer\BstoreContainer\BSE::BLIPTYPE_JPEG: - $drawing->setRenderingFunction(\PhpSpreadsheet\Worksheet\MemoryDrawing::RENDERING_JPEG); - $drawing->setMimeType(\PhpSpreadsheet\Worksheet\MemoryDrawing::MIMETYPE_JPEG); + case \PhpOffice\PhpSpreadsheet\Shared\Escher\DggContainer\BstoreContainer\BSE::BLIPTYPE_JPEG: + $drawing->setRenderingFunction(\PhpOffice\PhpSpreadsheet\Worksheet\MemoryDrawing::RENDERING_JPEG); + $drawing->setMimeType(\PhpOffice\PhpSpreadsheet\Worksheet\MemoryDrawing::MIMETYPE_JPEG); break; - case \PhpSpreadsheet\Shared\Escher\DggContainer\BstoreContainer\BSE::BLIPTYPE_PNG: - $drawing->setRenderingFunction(\PhpSpreadsheet\Worksheet\MemoryDrawing::RENDERING_PNG); - $drawing->setMimeType(\PhpSpreadsheet\Worksheet\MemoryDrawing::MIMETYPE_PNG); + case \PhpOffice\PhpSpreadsheet\Shared\Escher\DggContainer\BstoreContainer\BSE::BLIPTYPE_PNG: + $drawing->setRenderingFunction(\PhpOffice\PhpSpreadsheet\Worksheet\MemoryDrawing::RENDERING_PNG); + $drawing->setMimeType(\PhpOffice\PhpSpreadsheet\Worksheet\MemoryDrawing::MIMETYPE_PNG); break; } @@ -1074,10 +1074,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) = \PhpSpreadsheet\Cell::coordinateFromString($cell); + list($column, $row) = \PhpOffice\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, \PhpSpreadsheet\Cell\DataType::TYPE_FORMULA); + $this->phpSheet->getCell($cell)->setValueExplicit('=' . $formula, \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_FORMULA); } } } @@ -1149,8 +1149,8 @@ class Excel5 extends BaseReader implements IReader $coordinateStrings = explode(':', $extractedRange); if (count($coordinateStrings) == 2) { - list($firstColumn, $firstRow) = \PhpSpreadsheet\Cell::coordinateFromString($coordinateStrings[0]); - list($lastColumn, $lastRow) = \PhpSpreadsheet\Cell::coordinateFromString($coordinateStrings[1]); + list($firstColumn, $firstRow) = \PhpOffice\PhpSpreadsheet\Cell::coordinateFromString($coordinateStrings[0]); + list($lastColumn, $lastRow) = \PhpOffice\PhpSpreadsheet\Cell::coordinateFromString($coordinateStrings[1]); if ($firstColumn == 'A' and $lastColumn == 'IV') { // then we have repeating rows @@ -1179,7 +1179,7 @@ class Excel5 extends BaseReader implements IReader $scope = ($definedName['scope'] == 0) ? null : $this->spreadsheet->getSheetByName($this->sheets[$definedName['scope'] - 1]['name']); - $this->spreadsheet->addNamedRange(new \PhpSpreadsheet\NamedRange((string) $definedName['name'], $docSheet, $extractedRange, $localOnly, $scope)); + $this->spreadsheet->addNamedRange(new \PhpOffice\PhpSpreadsheet\NamedRange((string) $definedName['name'], $docSheet, $extractedRange, $localOnly, $scope)); } } else { // Named Value @@ -1256,7 +1256,7 @@ class Excel5 extends BaseReader implements IReader private function loadOLE($pFilename) { // OLE reader - $ole = new \PhpSpreadsheet\Shared\OLERead(); + $ole = new \PhpOffice\PhpSpreadsheet\Shared\OLERead(); // get excel data, $ole->read($pFilename); // Get workbook data: workbook stream + sheet streams @@ -1327,12 +1327,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 = \PhpSpreadsheet\Shared\StringHelper::convertEncoding($value, 'UTF-8', $codePage); + $value = \PhpOffice\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 = \PhpSpreadsheet\Shared\OLE::OLE2LocalDate(substr($this->summaryInformation, $secOffset + 4 + $offset, 8)); + $value = \PhpOffice\PhpSpreadsheet\Shared\OLE::OLE2LocalDate(substr($this->summaryInformation, $secOffset + 4 + $offset, 8)); break; case 0x47: // Clipboard format // not needed yet, fix later if necessary @@ -1341,7 +1341,7 @@ class Excel5 extends BaseReader implements IReader switch ($id) { case 0x01: // Code Page - $codePage = \PhpSpreadsheet\Shared\CodePage::numberToName($value); + $codePage = \PhpOffice\PhpSpreadsheet\Shared\CodePage::numberToName($value); break; case 0x02: // Title $this->spreadsheet->getProperties()->setTitle($value); @@ -1465,12 +1465,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 = \PhpSpreadsheet\Shared\StringHelper::convertEncoding($value, 'UTF-8', $codePage); + $value = \PhpOffice\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 = \PhpSpreadsheet\Shared\OLE::OLE2LocalDate(substr($this->documentSummaryInformation, $secOffset + 4 + $offset, 8)); + $value = \PhpOffice\PhpSpreadsheet\Shared\OLE::OLE2LocalDate(substr($this->documentSummaryInformation, $secOffset + 4 + $offset, 8)); break; case 0x47: // Clipboard format // not needed yet, fix later if necessary @@ -1479,7 +1479,7 @@ class Excel5 extends BaseReader implements IReader switch ($id) { case 0x01: // Code Page - $codePage = \PhpSpreadsheet\Shared\CodePage::numberToName($value); + $codePage = \PhpOffice\PhpSpreadsheet\Shared\CodePage::numberToName($value); break; case 0x02: // Category $this->spreadsheet->getProperties()->setCategory($value); @@ -1841,7 +1841,7 @@ class Excel5 extends BaseReader implements IReader // offset: 0; size: 2; code page identifier $codepage = self::getInt2d($recordData, 0); - $this->codepage = \PhpSpreadsheet\Shared\CodePage::numberToName($codepage); + $this->codepage = \PhpOffice\PhpSpreadsheet\Shared\CodePage::numberToName($codepage); } /** @@ -1865,9 +1865,9 @@ class Excel5 extends BaseReader implements IReader $this->pos += 4 + $length; // offset: 0; size: 2; 0 = base 1900, 1 = base 1904 - \PhpSpreadsheet\Shared\Date::setExcelCalendar(\PhpSpreadsheet\Shared\Date::CALENDAR_WINDOWS_1900); + \PhpOffice\PhpSpreadsheet\Shared\Date::setExcelCalendar(\PhpOffice\PhpSpreadsheet\Shared\Date::CALENDAR_WINDOWS_1900); if (ord($recordData{0}) == 1) { - \PhpSpreadsheet\Shared\Date::setExcelCalendar(\PhpSpreadsheet\Shared\Date::CALENDAR_MAC_1904); + \PhpOffice\PhpSpreadsheet\Shared\Date::setExcelCalendar(\PhpOffice\PhpSpreadsheet\Shared\Date::CALENDAR_MAC_1904); } } @@ -1883,7 +1883,7 @@ class Excel5 extends BaseReader implements IReader $this->pos += 4 + $length; if (!$this->readDataOnly) { - $objFont = new \PhpSpreadsheet\Style\Font(); + $objFont = new \PhpOffice\PhpSpreadsheet\Style\Font(); // offset: 0; size: 2; height of the font (in twips = 1/20 of a point) $size = self::getInt2d($recordData, 0); @@ -1933,16 +1933,16 @@ class Excel5 extends BaseReader implements IReader case 0x00: break; // no underline case 0x01: - $objFont->setUnderline(\PhpSpreadsheet\Style\Font::UNDERLINE_SINGLE); + $objFont->setUnderline(\PhpOffice\PhpSpreadsheet\Style\Font::UNDERLINE_SINGLE); break; case 0x02: - $objFont->setUnderline(\PhpSpreadsheet\Style\Font::UNDERLINE_DOUBLE); + $objFont->setUnderline(\PhpOffice\PhpSpreadsheet\Style\Font::UNDERLINE_DOUBLE); break; case 0x21: - $objFont->setUnderline(\PhpSpreadsheet\Style\Font::UNDERLINE_SINGLEACCOUNTING); + $objFont->setUnderline(\PhpOffice\PhpSpreadsheet\Style\Font::UNDERLINE_SINGLEACCOUNTING); break; case 0x22: - $objFont->setUnderline(\PhpSpreadsheet\Style\Font::UNDERLINE_DOUBLEACCOUNTING); + $objFont->setUnderline(\PhpOffice\PhpSpreadsheet\Style\Font::UNDERLINE_DOUBLEACCOUNTING); break; } @@ -2020,7 +2020,7 @@ class Excel5 extends BaseReader implements IReader // move stream pointer to next record $this->pos += 4 + $length; - $objStyle = new \PhpSpreadsheet\Style(); + $objStyle = new \PhpOffice\PhpSpreadsheet\Style(); if (!$this->readDataOnly) { // offset: 0; size: 2; Index to FONT record @@ -2038,7 +2038,7 @@ class Excel5 extends BaseReader implements IReader if (isset($this->formats[$numberFormatIndex])) { // then we have user-defined format code $numberformat = ['code' => $this->formats[$numberFormatIndex]]; - } elseif (($code = \PhpSpreadsheet\Style\NumberFormat::builtInFormatCode($numberFormatIndex)) !== '') { + } elseif (($code = \PhpOffice\PhpSpreadsheet\Style\NumberFormat::builtInFormatCode($numberFormatIndex)) !== '') { // then we have built-in format code $numberformat = ['code' => $code]; } else { @@ -2052,11 +2052,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 ? \PhpSpreadsheet\Style\Protection::PROTECTION_INHERIT : \PhpSpreadsheet\Style\Protection::PROTECTION_UNPROTECTED); + $objStyle->getProtection()->setLocked($isLocked ? \PhpOffice\PhpSpreadsheet\Style\Protection::PROTECTION_INHERIT : \PhpOffice\PhpSpreadsheet\Style\Protection::PROTECTION_UNPROTECTED); // bit 1; mask 0x02; 1 = Formula is hidden $isHidden = (0x02 & $xfTypeProt) >> 1; - $objStyle->getProtection()->setHidden($isHidden ? \PhpSpreadsheet\Style\Protection::PROTECTION_PROTECTED : \PhpSpreadsheet\Style\Protection::PROTECTION_UNPROTECTED); + $objStyle->getProtection()->setHidden($isHidden ? \PhpOffice\PhpSpreadsheet\Style\Protection::PROTECTION_PROTECTED : \PhpOffice\PhpSpreadsheet\Style\Protection::PROTECTION_UNPROTECTED); // bit 2; mask 0x04; 0 = Cell XF, 1 = Cell Style XF $isCellStyleXf = (0x04 & $xfTypeProt) >> 2; @@ -2066,25 +2066,25 @@ class Excel5 extends BaseReader implements IReader $horAlign = (0x07 & ord($recordData{6})) >> 0; switch ($horAlign) { case 0: - $objStyle->getAlignment()->setHorizontal(\PhpSpreadsheet\Style\Alignment::HORIZONTAL_GENERAL); + $objStyle->getAlignment()->setHorizontal(\PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_GENERAL); break; case 1: - $objStyle->getAlignment()->setHorizontal(\PhpSpreadsheet\Style\Alignment::HORIZONTAL_LEFT); + $objStyle->getAlignment()->setHorizontal(\PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_LEFT); break; case 2: - $objStyle->getAlignment()->setHorizontal(\PhpSpreadsheet\Style\Alignment::HORIZONTAL_CENTER); + $objStyle->getAlignment()->setHorizontal(\PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_CENTER); break; case 3: - $objStyle->getAlignment()->setHorizontal(\PhpSpreadsheet\Style\Alignment::HORIZONTAL_RIGHT); + $objStyle->getAlignment()->setHorizontal(\PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_RIGHT); break; case 4: - $objStyle->getAlignment()->setHorizontal(\PhpSpreadsheet\Style\Alignment::HORIZONTAL_FILL); + $objStyle->getAlignment()->setHorizontal(\PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_FILL); break; case 5: - $objStyle->getAlignment()->setHorizontal(\PhpSpreadsheet\Style\Alignment::HORIZONTAL_JUSTIFY); + $objStyle->getAlignment()->setHorizontal(\PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_JUSTIFY); break; case 6: - $objStyle->getAlignment()->setHorizontal(\PhpSpreadsheet\Style\Alignment::HORIZONTAL_CENTER_CONTINUOUS); + $objStyle->getAlignment()->setHorizontal(\PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_CENTER_CONTINUOUS); break; } // bit 3, mask 0x08; wrap text @@ -2101,16 +2101,16 @@ class Excel5 extends BaseReader implements IReader $vertAlign = (0x70 & ord($recordData{6})) >> 4; switch ($vertAlign) { case 0: - $objStyle->getAlignment()->setVertical(\PhpSpreadsheet\Style\Alignment::VERTICAL_TOP); + $objStyle->getAlignment()->setVertical(\PhpOffice\PhpSpreadsheet\Style\Alignment::VERTICAL_TOP); break; case 1: - $objStyle->getAlignment()->setVertical(\PhpSpreadsheet\Style\Alignment::VERTICAL_CENTER); + $objStyle->getAlignment()->setVertical(\PhpOffice\PhpSpreadsheet\Style\Alignment::VERTICAL_CENTER); break; case 2: - $objStyle->getAlignment()->setVertical(\PhpSpreadsheet\Style\Alignment::VERTICAL_BOTTOM); + $objStyle->getAlignment()->setVertical(\PhpOffice\PhpSpreadsheet\Style\Alignment::VERTICAL_BOTTOM); break; case 3: - $objStyle->getAlignment()->setVertical(\PhpSpreadsheet\Style\Alignment::VERTICAL_JUSTIFY); + $objStyle->getAlignment()->setVertical(\PhpOffice\PhpSpreadsheet\Style\Alignment::VERTICAL_JUSTIFY); break; } @@ -2175,13 +2175,13 @@ class Excel5 extends BaseReader implements IReader $diagonalUp = (0x80000000 & self::getInt4d($recordData, 10)) >> 31 ? true : false; if ($diagonalUp == false && $diagonalDown == false) { - $objStyle->getBorders()->setDiagonalDirection(\PhpSpreadsheet\Style\Borders::DIAGONAL_NONE); + $objStyle->getBorders()->setDiagonalDirection(\PhpOffice\PhpSpreadsheet\Style\Borders::DIAGONAL_NONE); } elseif ($diagonalUp == true && $diagonalDown == false) { - $objStyle->getBorders()->setDiagonalDirection(\PhpSpreadsheet\Style\Borders::DIAGONAL_UP); + $objStyle->getBorders()->setDiagonalDirection(\PhpOffice\PhpSpreadsheet\Style\Borders::DIAGONAL_UP); } elseif ($diagonalUp == false && $diagonalDown == true) { - $objStyle->getBorders()->setDiagonalDirection(\PhpSpreadsheet\Style\Borders::DIAGONAL_DOWN); + $objStyle->getBorders()->setDiagonalDirection(\PhpOffice\PhpSpreadsheet\Style\Borders::DIAGONAL_DOWN); } elseif ($diagonalUp == true && $diagonalDown == true) { - $objStyle->getBorders()->setDiagonalDirection(\PhpSpreadsheet\Style\Borders::DIAGONAL_BOTH); + $objStyle->getBorders()->setDiagonalDirection(\PhpOffice\PhpSpreadsheet\Style\Borders::DIAGONAL_BOTH); } // offset: 14; size: 4; @@ -2546,16 +2546,16 @@ class Excel5 extends BaseReader implements IReader // offset: 4; size: 1; sheet state switch (ord($recordData{4})) { case 0x00: - $sheetState = \PhpSpreadsheet\Worksheet::SHEETSTATE_VISIBLE; + $sheetState = \PhpOffice\PhpSpreadsheet\Worksheet::SHEETSTATE_VISIBLE; break; case 0x01: - $sheetState = \PhpSpreadsheet\Worksheet::SHEETSTATE_HIDDEN; + $sheetState = \PhpOffice\PhpSpreadsheet\Worksheet::SHEETSTATE_HIDDEN; break; case 0x02: - $sheetState = \PhpSpreadsheet\Worksheet::SHEETSTATE_VERYHIDDEN; + $sheetState = \PhpOffice\PhpSpreadsheet\Worksheet::SHEETSTATE_VERYHIDDEN; break; default: - $sheetState = \PhpSpreadsheet\Worksheet::SHEETSTATE_VISIBLE; + $sheetState = \PhpOffice\PhpSpreadsheet\Worksheet::SHEETSTATE_VISIBLE; break; } @@ -2752,7 +2752,7 @@ class Excel5 extends BaseReader implements IReader try { $formula = $this->getFormulaFromStructure($formulaStructure); - } catch (\PhpSpreadsheet\Exception $e) { + } catch (\PhpOffice\PhpSpreadsheet\Exception $e) { $formula = ''; } @@ -3048,7 +3048,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, \PhpSpreadsheet\Worksheet::BREAK_ROW); + $this->phpSheet->setBreakByColumnAndRow($cf, $r, \PhpOffice\PhpSpreadsheet\Worksheet::BREAK_ROW); } } } @@ -3075,7 +3075,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, \PhpSpreadsheet\Worksheet::BREAK_COLUMN); + $this->phpSheet->setBreakByColumnAndRow($c, $rf, \PhpOffice\PhpSpreadsheet\Worksheet::BREAK_COLUMN); } } } @@ -3276,10 +3276,10 @@ class Excel5 extends BaseReader implements IReader $this->phpSheet->getPageSetup()->setPaperSize($paperSize); switch ($isPortrait) { case 0: - $this->phpSheet->getPageSetup()->setOrientation(\PhpSpreadsheet\Worksheet\PageSetup::ORIENTATION_LANDSCAPE); + $this->phpSheet->getPageSetup()->setOrientation(\PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::ORIENTATION_LANDSCAPE); break; case 1: - $this->phpSheet->getPageSetup()->setOrientation(\PhpSpreadsheet\Worksheet\PageSetup::ORIENTATION_PORTRAIT); + $this->phpSheet->getPageSetup()->setOrientation(\PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::ORIENTATION_PORTRAIT); break; } @@ -3546,7 +3546,7 @@ class Excel5 extends BaseReader implements IReader // offset: 2; size: 2; index to column $column = self::getInt2d($recordData, 2); - $columnString = \PhpSpreadsheet\Cell::stringFromColumnIndex($column); + $columnString = \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($column); // Read cell? if (($this->getReadFilter() !== null) && $this->getReadFilter()->readCell($columnString, $row + 1, $this->phpSheet->getTitle())) { @@ -3564,7 +3564,7 @@ class Excel5 extends BaseReader implements IReader } // add cell - $cell->setValueExplicit($numValue, \PhpSpreadsheet\Cell\DataType::TYPE_NUMERIC); + $cell->setValueExplicit($numValue, \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_NUMERIC); } } @@ -3590,7 +3590,7 @@ class Excel5 extends BaseReader implements IReader // offset: 2; size: 2; index to column $column = self::getInt2d($recordData, 2); - $columnString = \PhpSpreadsheet\Cell::stringFromColumnIndex($column); + $columnString = \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($column); $emptyCell = true; // Read cell? @@ -3604,18 +3604,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 \PhpSpreadsheet\RichText(); + $richText = new \PhpOffice\PhpSpreadsheet\RichText(); $charPos = 0; $sstCount = count($this->sst[$index]['fmtRuns']); for ($i = 0; $i <= $sstCount; ++$i) { if (isset($fmtRuns[$i])) { - $text = \PhpSpreadsheet\Shared\StringHelper::substring($this->sst[$index]['value'], $charPos, $fmtRuns[$i]['charPos'] - $charPos); + $text = \PhpOffice\PhpSpreadsheet\Shared\StringHelper::substring($this->sst[$index]['value'], $charPos, $fmtRuns[$i]['charPos'] - $charPos); $charPos = $fmtRuns[$i]['charPos']; } else { - $text = \PhpSpreadsheet\Shared\StringHelper::substring($this->sst[$index]['value'], $charPos, \PhpSpreadsheet\Shared\StringHelper::countCharacters($this->sst[$index]['value'])); + $text = \PhpOffice\PhpSpreadsheet\Shared\StringHelper::substring($this->sst[$index]['value'], $charPos, \PhpOffice\PhpSpreadsheet\Shared\StringHelper::countCharacters($this->sst[$index]['value'])); } - if (\PhpSpreadsheet\Shared\StringHelper::countCharacters($text) > 0) { + if (\PhpOffice\PhpSpreadsheet\Shared\StringHelper::countCharacters($text) > 0) { if ($i == 0) { // first text run, no style $richText->createText($text); } else { @@ -3635,13 +3635,13 @@ class Excel5 extends BaseReader implements IReader } if ($this->readEmptyCells || trim($richText->getPlainText()) !== '') { $cell = $this->phpSheet->getCell($columnString . ($row + 1)); - $cell->setValueExplicit($richText, \PhpSpreadsheet\Cell\DataType::TYPE_STRING); + $cell->setValueExplicit($richText, \PhpOffice\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'], \PhpSpreadsheet\Cell\DataType::TYPE_STRING); + $cell->setValueExplicit($this->sst[$index]['value'], \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING); $emptyCell = false; } } @@ -3683,7 +3683,7 @@ class Excel5 extends BaseReader implements IReader $offset = 4; for ($i = 0; $i < $columns; ++$i) { - $columnString = \PhpSpreadsheet\Cell::stringFromColumnIndex($colFirst + $i); + $columnString = \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($colFirst + $i); // Read cell? if (($this->getReadFilter() !== null) && $this->getReadFilter()->readCell($columnString, $row + 1, $this->phpSheet->getTitle())) { @@ -3699,7 +3699,7 @@ class Excel5 extends BaseReader implements IReader } // add cell value - $cell->setValueExplicit($numValue, \PhpSpreadsheet\Cell\DataType::TYPE_NUMERIC); + $cell->setValueExplicit($numValue, \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_NUMERIC); } $offset += 6; @@ -3727,7 +3727,7 @@ class Excel5 extends BaseReader implements IReader // offset: 2; size 2; index to column $column = self::getInt2d($recordData, 2); - $columnString = \PhpSpreadsheet\Cell::stringFromColumnIndex($column); + $columnString = \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($column); // Read cell? if (($this->getReadFilter() !== null) && $this->getReadFilter()->readCell($columnString, $row + 1, $this->phpSheet->getTitle())) { @@ -3743,7 +3743,7 @@ class Excel5 extends BaseReader implements IReader } // add cell value - $cell->setValueExplicit($numValue, \PhpSpreadsheet\Cell\DataType::TYPE_NUMERIC); + $cell->setValueExplicit($numValue, \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_NUMERIC); } } @@ -3768,7 +3768,7 @@ class Excel5 extends BaseReader implements IReader // offset: 2; size: 2; col index $column = self::getInt2d($recordData, 2); - $columnString = \PhpSpreadsheet\Cell::stringFromColumnIndex($column); + $columnString = \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($column); // offset: 20: size: variable; formula structure $formulaStructure = substr($recordData, 20); @@ -3792,7 +3792,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 = \PhpSpreadsheet\Cell::stringFromColumnIndex($baseCol) . ($baseRow + 1); + $this->_baseCell = \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($baseCol) . ($baseRow + 1); } // Read cell? @@ -3810,7 +3810,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 = \PhpSpreadsheet\Cell\DataType::TYPE_STRING; + $dataType = \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING; // read possible SHAREDFMLA record $code = self::getInt2d($this->data, $this->pos); @@ -3824,23 +3824,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 = \PhpSpreadsheet\Cell\DataType::TYPE_BOOL; + $dataType = \PhpOffice\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 = \PhpSpreadsheet\Cell\DataType::TYPE_ERROR; + $dataType = \PhpOffice\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 = \PhpSpreadsheet\Cell\DataType::TYPE_NULL; + $dataType = \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_NULL; $value = ''; } else { // forumla result is a number, first 14 bytes like _NUMBER record - $dataType = \PhpSpreadsheet\Cell\DataType::TYPE_NUMERIC; + $dataType = \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_NUMERIC; $value = self::extractNumber(substr($recordData, 6, 8)); } @@ -3859,8 +3859,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, \PhpSpreadsheet\Cell\DataType::TYPE_FORMULA); - } catch (\PhpSpreadsheet\Exception $e) { + $cell->setValueExplicit('=' . $formula, \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_FORMULA); + } catch (\PhpOffice\PhpSpreadsheet\Exception $e) { $cell->setValueExplicit($value, $dataType); } } else { @@ -3952,7 +3952,7 @@ class Excel5 extends BaseReader implements IReader // offset: 2; size: 2; column index $column = self::getInt2d($recordData, 2); - $columnString = \PhpSpreadsheet\Cell::stringFromColumnIndex($column); + $columnString = \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($column); // Read cell? if (($this->getReadFilter() !== null) && $this->getReadFilter()->readCell($columnString, $row + 1, $this->phpSheet->getTitle())) { @@ -3971,13 +3971,13 @@ class Excel5 extends BaseReader implements IReader $value = (bool) $boolErr; // add cell value - $cell->setValueExplicit($value, \PhpSpreadsheet\Cell\DataType::TYPE_BOOL); + $cell->setValueExplicit($value, \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_BOOL); break; case 1: // error type $value = Excel5\ErrorCode::lookup($boolErr); // add cell value - $cell->setValueExplicit($value, \PhpSpreadsheet\Cell\DataType::TYPE_ERROR); + $cell->setValueExplicit($value, \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_ERROR); break; } @@ -4014,7 +4014,7 @@ class Excel5 extends BaseReader implements IReader // add style information if (!$this->readDataOnly && $this->readEmptyCells) { for ($i = 0; $i < $length / 2 - 3; ++$i) { - $columnString = \PhpSpreadsheet\Cell::stringFromColumnIndex($fc + $i); + $columnString = \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($fc + $i); // Read cell? if (($this->getReadFilter() !== null) && $this->getReadFilter()->readCell($columnString, $row + 1, $this->phpSheet->getTitle())) { @@ -4050,7 +4050,7 @@ class Excel5 extends BaseReader implements IReader // offset: 2; size: 2; index to column $column = self::getInt2d($recordData, 2); - $columnString = \PhpSpreadsheet\Cell::stringFromColumnIndex($column); + $columnString = \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($column); // Read cell? if (($this->getReadFilter() !== null) && $this->getReadFilter()->readCell($columnString, $row + 1, $this->phpSheet->getTitle())) { @@ -4068,7 +4068,7 @@ class Excel5 extends BaseReader implements IReader } if ($this->readEmptyCells || trim($value) !== '') { $cell = $this->phpSheet->getCell($columnString . ($row + 1)); - $cell->setValueExplicit($value, \PhpSpreadsheet\Cell\DataType::TYPE_STRING); + $cell->setValueExplicit($value, \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING); if (!$this->readDataOnly) { // add cell style @@ -4094,7 +4094,7 @@ class Excel5 extends BaseReader implements IReader // offset: 2; size: 2; col index $col = self::getInt2d($recordData, 2); - $columnString = \PhpSpreadsheet\Cell::stringFromColumnIndex($col); + $columnString = \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($col); // Read cell? if (($this->getReadFilter() !== null) && $this->getReadFilter()->readCell($columnString, $row + 1, $this->phpSheet->getTitle())) { @@ -4221,9 +4221,9 @@ class Excel5 extends BaseReader implements IReader //FIXME: set $firstVisibleRow and $firstVisibleColumn - if ($this->phpSheet->getSheetView()->getView() !== \PhpSpreadsheet\Worksheet\SheetView::SHEETVIEW_PAGE_LAYOUT) { + if ($this->phpSheet->getSheetView()->getView() !== \PhpOffice\PhpSpreadsheet\Worksheet\SheetView::SHEETVIEW_PAGE_LAYOUT) { //NOTE: this setting is inferior to page layout view(Excel2007-) - $view = $isPageBreakPreview ? \PhpSpreadsheet\Worksheet\SheetView::SHEETVIEW_PAGE_BREAK_PREVIEW : \PhpSpreadsheet\Worksheet\SheetView::SHEETVIEW_NORMAL; + $view = $isPageBreakPreview ? \PhpOffice\PhpSpreadsheet\Worksheet\SheetView::SHEETVIEW_PAGE_BREAK_PREVIEW : \PhpOffice\PhpSpreadsheet\Worksheet\SheetView::SHEETVIEW_NORMAL; $this->phpSheet->getSheetView()->setView($view); if ($this->version === self::XLS_BIFF8) { $zoomScale = $isPageBreakPreview ? $zoomscaleInPageBreakPreview : $zoomscaleInNormalView; @@ -4264,7 +4264,7 @@ class Excel5 extends BaseReader implements IReader $fWhitespaceHidden = ($grbit >> 3) & 0x01; //no support if ($fPageLayoutView === 1) { - $this->phpSheet->getSheetView()->setView(\PhpSpreadsheet\Worksheet\SheetView::SHEETVIEW_PAGE_LAYOUT); + $this->phpSheet->getSheetView()->setView(\PhpOffice\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. @@ -4311,7 +4311,7 @@ class Excel5 extends BaseReader implements IReader if ($this->frozen) { // frozen panes - $this->phpSheet->freezePane(\PhpSpreadsheet\Cell::stringFromColumnIndex($px) . ($py + 1)); + $this->phpSheet->freezePane(\PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($px) . ($py + 1)); } else { // unfrozen panes; split windows; not supported by PhpSpreadsheet core } @@ -4373,7 +4373,7 @@ class Excel5 extends BaseReader implements IReader $includeCellRange = true; if ($this->getReadFilter() !== null) { $includeCellRange = false; - $rangeBoundaries = \PhpSpreadsheet\Cell::getRangeBoundaries($cellRangeAddress); + $rangeBoundaries = \PhpOffice\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) { @@ -4431,7 +4431,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 (\PhpSpreadsheet\Exception $e) { + } catch (\PhpOffice\PhpSpreadsheet\Exception $e) { return; } @@ -4581,7 +4581,7 @@ class Excel5 extends BaseReader implements IReader } // apply the hyperlink to all the relevant cells - foreach (\PhpSpreadsheet\Cell::extractAllCellReferencesInRange($cellRange) as $coordinate) { + foreach (\PhpOffice\PhpSpreadsheet\Cell::extractAllCellReferencesInRange($cellRange) as $coordinate) { $this->phpSheet->getCell($coordinate)->getHyperLink()->setUrl($url); } } @@ -4621,28 +4621,28 @@ class Excel5 extends BaseReader implements IReader $type = (0x0000000F & $options) >> 0; switch ($type) { case 0x00: - $type = \PhpSpreadsheet\Cell\DataValidation::TYPE_NONE; + $type = \PhpOffice\PhpSpreadsheet\Cell\DataValidation::TYPE_NONE; break; case 0x01: - $type = \PhpSpreadsheet\Cell\DataValidation::TYPE_WHOLE; + $type = \PhpOffice\PhpSpreadsheet\Cell\DataValidation::TYPE_WHOLE; break; case 0x02: - $type = \PhpSpreadsheet\Cell\DataValidation::TYPE_DECIMAL; + $type = \PhpOffice\PhpSpreadsheet\Cell\DataValidation::TYPE_DECIMAL; break; case 0x03: - $type = \PhpSpreadsheet\Cell\DataValidation::TYPE_LIST; + $type = \PhpOffice\PhpSpreadsheet\Cell\DataValidation::TYPE_LIST; break; case 0x04: - $type = \PhpSpreadsheet\Cell\DataValidation::TYPE_DATE; + $type = \PhpOffice\PhpSpreadsheet\Cell\DataValidation::TYPE_DATE; break; case 0x05: - $type = \PhpSpreadsheet\Cell\DataValidation::TYPE_TIME; + $type = \PhpOffice\PhpSpreadsheet\Cell\DataValidation::TYPE_TIME; break; case 0x06: - $type = \PhpSpreadsheet\Cell\DataValidation::TYPE_TEXTLENGTH; + $type = \PhpOffice\PhpSpreadsheet\Cell\DataValidation::TYPE_TEXTLENGTH; break; case 0x07: - $type = \PhpSpreadsheet\Cell\DataValidation::TYPE_CUSTOM; + $type = \PhpOffice\PhpSpreadsheet\Cell\DataValidation::TYPE_CUSTOM; break; } @@ -4650,13 +4650,13 @@ class Excel5 extends BaseReader implements IReader $errorStyle = (0x00000070 & $options) >> 4; switch ($errorStyle) { case 0x00: - $errorStyle = \PhpSpreadsheet\Cell\DataValidation::STYLE_STOP; + $errorStyle = \PhpOffice\PhpSpreadsheet\Cell\DataValidation::STYLE_STOP; break; case 0x01: - $errorStyle = \PhpSpreadsheet\Cell\DataValidation::STYLE_WARNING; + $errorStyle = \PhpOffice\PhpSpreadsheet\Cell\DataValidation::STYLE_WARNING; break; case 0x02: - $errorStyle = \PhpSpreadsheet\Cell\DataValidation::STYLE_INFORMATION; + $errorStyle = \PhpOffice\PhpSpreadsheet\Cell\DataValidation::STYLE_INFORMATION; break; } @@ -4680,28 +4680,28 @@ class Excel5 extends BaseReader implements IReader $operator = (0x00F00000 & $options) >> 20; switch ($operator) { case 0x00: - $operator = \PhpSpreadsheet\Cell\DataValidation::OPERATOR_BETWEEN; + $operator = \PhpOffice\PhpSpreadsheet\Cell\DataValidation::OPERATOR_BETWEEN; break; case 0x01: - $operator = \PhpSpreadsheet\Cell\DataValidation::OPERATOR_NOTBETWEEN; + $operator = \PhpOffice\PhpSpreadsheet\Cell\DataValidation::OPERATOR_NOTBETWEEN; break; case 0x02: - $operator = \PhpSpreadsheet\Cell\DataValidation::OPERATOR_EQUAL; + $operator = \PhpOffice\PhpSpreadsheet\Cell\DataValidation::OPERATOR_EQUAL; break; case 0x03: - $operator = \PhpSpreadsheet\Cell\DataValidation::OPERATOR_NOTEQUAL; + $operator = \PhpOffice\PhpSpreadsheet\Cell\DataValidation::OPERATOR_NOTEQUAL; break; case 0x04: - $operator = \PhpSpreadsheet\Cell\DataValidation::OPERATOR_GREATERTHAN; + $operator = \PhpOffice\PhpSpreadsheet\Cell\DataValidation::OPERATOR_GREATERTHAN; break; case 0x05: - $operator = \PhpSpreadsheet\Cell\DataValidation::OPERATOR_LESSTHAN; + $operator = \PhpOffice\PhpSpreadsheet\Cell\DataValidation::OPERATOR_LESSTHAN; break; case 0x06: - $operator = \PhpSpreadsheet\Cell\DataValidation::OPERATOR_GREATERTHANOREQUAL; + $operator = \PhpOffice\PhpSpreadsheet\Cell\DataValidation::OPERATOR_GREATERTHANOREQUAL; break; case 0x07: - $operator = \PhpSpreadsheet\Cell\DataValidation::OPERATOR_LESSTHANOREQUAL; + $operator = \PhpOffice\PhpSpreadsheet\Cell\DataValidation::OPERATOR_LESSTHANOREQUAL; break; } @@ -4740,10 +4740,10 @@ class Excel5 extends BaseReader implements IReader $formula1 = $this->getFormulaFromStructure($formula1); // in list type validity, null characters are used as item separators - if ($type == \PhpSpreadsheet\Cell\DataValidation::TYPE_LIST) { + if ($type == \PhpOffice\PhpSpreadsheet\Cell\DataValidation::TYPE_LIST) { $formula1 = str_replace(chr(0), ',', $formula1); } - } catch (\PhpSpreadsheet\Exception $e) { + } catch (\PhpOffice\PhpSpreadsheet\Exception $e) { return; } $offset += $sz1; @@ -4760,7 +4760,7 @@ class Excel5 extends BaseReader implements IReader $formula2 = pack('v', $sz2) . $formula2; // prepend the length try { $formula2 = $this->getFormulaFromStructure($formula2); - } catch (\PhpSpreadsheet\Exception $e) { + } catch (\PhpOffice\PhpSpreadsheet\Exception $e) { return; } $offset += $sz2; @@ -4771,7 +4771,7 @@ class Excel5 extends BaseReader implements IReader foreach ($cellRangeAddresses as $cellRange) { $stRange = $this->phpSheet->shrinkRangeToFit($cellRange); - foreach (\PhpSpreadsheet\Cell::extractAllCellReferencesInRange($stRange) as $coordinate) { + foreach (\PhpOffice\PhpSpreadsheet\Cell::extractAllCellReferencesInRange($stRange) as $coordinate) { $objValidation = $this->phpSheet->getCell($coordinate)->getDataValidation(); $objValidation->setType($type); $objValidation->setErrorStyle($errorStyle); @@ -4966,7 +4966,7 @@ class Excel5 extends BaseReader implements IReader for ($i = 0; $i < $cref; ++$i) { try { $cellRange = $this->readBIFF8CellRangeAddressFixed(substr($recordData, 27 + 8 * $i, 8)); - } catch (\PhpSpreadsheet\Exception $e) { + } catch (\PhpOffice\PhpSpreadsheet\Exception $e) { return; } $cellRanges[] = $cellRange; @@ -5048,7 +5048,7 @@ class Excel5 extends BaseReader implements IReader } //imagepng($ih, 'image.png'); - $drawing = new \PhpSpreadsheet\Worksheet\Drawing(); + $drawing = new \PhpOffice\PhpSpreadsheet\Worksheet\Drawing(); $drawing->setPath($filename); $drawing->setWorksheet($this->phpSheet); break; @@ -6604,7 +6604,7 @@ class Excel5 extends BaseReader implements IReader $cellAddress = $this->readBIFF8CellAddress(substr($formulaData, 3, 4)); $data = "$sheetRange!$cellAddress"; - } catch (\PhpSpreadsheet\Exception $e) { + } catch (\PhpOffice\PhpSpreadsheet\Exception $e) { // deleted sheet reference $data = '#REF!'; } @@ -6622,7 +6622,7 @@ class Excel5 extends BaseReader implements IReader $cellRangeAddress = $this->readBIFF8CellRangeAddress(substr($formulaData, 3, 8)); $data = "$sheetRange!$cellRangeAddress"; - } catch (\PhpSpreadsheet\Exception $e) { + } catch (\PhpOffice\PhpSpreadsheet\Exception $e) { // deleted sheet reference $data = '#REF!'; } @@ -6655,7 +6655,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 = \PhpSpreadsheet\Cell::stringFromColumnIndex(0x00FF & self::getInt2d($cellAddressStructure, 2)); + $column = \PhpOffice\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))) { @@ -6680,8 +6680,8 @@ class Excel5 extends BaseReader implements IReader */ private function readBIFF8CellAddressB($cellAddressStructure, $baseCell = 'A1') { - list($baseCol, $baseRow) = \PhpSpreadsheet\Cell::coordinateFromString($baseCell); - $baseCol = \PhpSpreadsheet\Cell::columnIndexFromString($baseCol) - 1; + list($baseCol, $baseRow) = \PhpOffice\PhpSpreadsheet\Cell::coordinateFromString($baseCell); + $baseCol = \PhpOffice\PhpSpreadsheet\Cell::columnIndexFromString($baseCol) - 1; // offset: 0; size: 2; index to row (0... 65535) (or offset (-32768... 32767)) $rowIndex = self::getInt2d($cellAddressStructure, 0); @@ -6693,11 +6693,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 = \PhpSpreadsheet\Cell::stringFromColumnIndex($colIndex); + $column = \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($colIndex); $column = '$' . $column; } else { $colIndex = ($colIndex <= 127) ? $colIndex : $colIndex - 256; - $column = \PhpSpreadsheet\Cell::stringFromColumnIndex($baseCol + $colIndex); + $column = \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($baseCol + $colIndex); } // bit: 15; mask 0x8000; (1 = relative row index, 0 = absolute row index) @@ -6740,8 +6740,8 @@ class Excel5 extends BaseReader implements IReader } // column index to letter - $fc = \PhpSpreadsheet\Cell::stringFromColumnIndex($fc); - $lc = \PhpSpreadsheet\Cell::stringFromColumnIndex($lc); + $fc = \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($fc); + $lc = \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($lc); if ($fr == $lr and $fc == $lc) { return "$fc$fr"; @@ -6779,8 +6779,8 @@ class Excel5 extends BaseReader implements IReader } // column index to letter - $fc = \PhpSpreadsheet\Cell::stringFromColumnIndex($fc); - $lc = \PhpSpreadsheet\Cell::stringFromColumnIndex($lc); + $fc = \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($fc); + $lc = \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($lc); if ($fr == $lr and $fc == $lc) { return "$fc$fr"; @@ -6811,7 +6811,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 = \PhpSpreadsheet\Cell::stringFromColumnIndex(0x00FF & self::getInt2d($subData, 4)); + $fc = \PhpOffice\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))) { @@ -6826,7 +6826,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 = \PhpSpreadsheet\Cell::stringFromColumnIndex(0x00FF & self::getInt2d($subData, 6)); + $lc = \PhpOffice\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))) { @@ -6852,8 +6852,8 @@ class Excel5 extends BaseReader implements IReader */ private function readBIFF8CellRangeAddressB($subData, $baseCell = 'A1') { - list($baseCol, $baseRow) = \PhpSpreadsheet\Cell::coordinateFromString($baseCell); - $baseCol = \PhpSpreadsheet\Cell::columnIndexFromString($baseCol) - 1; + list($baseCol, $baseRow) = \PhpOffice\PhpSpreadsheet\Cell::coordinateFromString($baseCell); + $baseCol = \PhpOffice\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' ? @@ -6872,12 +6872,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 = \PhpSpreadsheet\Cell::stringFromColumnIndex($fcIndex); + $fc = \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($fcIndex); $fc = '$' . $fc; } else { // column offset $fcIndex = ($fcIndex <= 127) ? $fcIndex : $fcIndex - 256; - $fc = \PhpSpreadsheet\Cell::stringFromColumnIndex($baseCol + $fcIndex); + $fc = \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($baseCol + $fcIndex); } // bit: 15; mask 0x8000; (1 = relative row index, 0 = absolute row index) @@ -6896,17 +6896,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 = \PhpSpreadsheet\Cell::stringFromColumnIndex($baseCol + $lcIndex); + $lc = \PhpOffice\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 = \PhpSpreadsheet\Cell::stringFromColumnIndex($lcIndex); + $lc = \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($lcIndex); $lc = '$' . $lc; } else { // column offset $lcIndex = ($lcIndex <= 127) ? $lcIndex : $lcIndex - 256; - $lc = \PhpSpreadsheet\Cell::stringFromColumnIndex($baseCol + $lcIndex); + $lc = \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($baseCol + $lcIndex); } // bit: 15; mask 0x8000; (1 = relative row index, 0 = absolute row index) @@ -7352,7 +7352,7 @@ class Excel5 extends BaseReader implements IReader $string = self::uncompressByteString($string); } - return \PhpSpreadsheet\Shared\StringHelper::convertEncoding($string, 'UTF-8', 'UTF-16LE'); + return \PhpOffice\PhpSpreadsheet\Shared\StringHelper::convertEncoding($string, 'UTF-8', 'UTF-16LE'); } /** @@ -7380,7 +7380,7 @@ class Excel5 extends BaseReader implements IReader */ private function decodeCodepage($string) { - return \PhpSpreadsheet\Shared\StringHelper::convertEncoding($string, 'UTF-8', $this->codepage); + return \PhpOffice\PhpSpreadsheet\Shared\StringHelper::convertEncoding($string, 'UTF-8', $this->codepage); } /** @@ -7420,7 +7420,7 @@ class Excel5 extends BaseReader implements IReader private function parseRichText($is = '') { - $value = new \PhpSpreadsheet\RichText(); + $value = new \PhpOffice\PhpSpreadsheet\RichText(); $value->createText($is); return $value; diff --git a/src/PhpSpreadsheet/Reader/Excel5/Color.php b/src/PhpSpreadsheet/Reader/Excel5/Color.php index 18656a8d..3a61f8f2 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 = \PhpSpreadsheet\Reader\Excel5::getInt2d($this->data, $this->pos + 2); + $fbt = \PhpOffice\PhpSpreadsheet\Reader\Excel5::getInt2d($this->data, $this->pos + 2); switch ($fbt) { case self::DGGCONTAINER: @@ -172,15 +172,15 @@ class Escher private function readDefault() { // offset 0; size: 2; recVer and recInstance - $verInstance = \PhpSpreadsheet\Reader\Excel5::getInt2d($this->data, $this->pos); + $verInstance = \PhpOffice\PhpSpreadsheet\Reader\Excel5::getInt2d($this->data, $this->pos); // offset: 2; size: 2: Record Type - $fbt = \PhpSpreadsheet\Reader\Excel5::getInt2d($this->data, $this->pos + 2); + $fbt = \PhpOffice\PhpSpreadsheet\Reader\Excel5::getInt2d($this->data, $this->pos + 2); // bit: 0-3; mask: 0x000F; recVer $recVer = (0x000F & $verInstance) >> 0; - $length = \PhpSpreadsheet\Reader\Excel5::getInt4d($this->data, $this->pos + 4); + $length = \PhpOffice\PhpSpreadsheet\Reader\Excel5::getInt4d($this->data, $this->pos + 4); $recordData = substr($this->data, $this->pos + 8, $length); // move stream pointer to next record @@ -192,14 +192,14 @@ class Escher */ private function readDggContainer() { - $length = \PhpSpreadsheet\Reader\Excel5::getInt4d($this->data, $this->pos + 4); + $length = \PhpOffice\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 \PhpSpreadsheet\Shared\Escher\DggContainer(); + $dggContainer = new \PhpOffice\PhpSpreadsheet\Shared\Escher\DggContainer(); $this->object->setDggContainer($dggContainer); $reader = new self($dggContainer); $reader->load($recordData); @@ -210,7 +210,7 @@ class Escher */ private function readDgg() { - $length = \PhpSpreadsheet\Reader\Excel5::getInt4d($this->data, $this->pos + 4); + $length = \PhpOffice\PhpSpreadsheet\Reader\Excel5::getInt4d($this->data, $this->pos + 4); $recordData = substr($this->data, $this->pos + 8, $length); // move stream pointer to next record @@ -222,14 +222,14 @@ class Escher */ private function readBstoreContainer() { - $length = \PhpSpreadsheet\Reader\Excel5::getInt4d($this->data, $this->pos + 4); + $length = \PhpOffice\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 \PhpSpreadsheet\Shared\Escher\DggContainer\BstoreContainer(); + $bstoreContainer = new \PhpOffice\PhpSpreadsheet\Shared\Escher\DggContainer\BstoreContainer(); $this->object->setBstoreContainer($bstoreContainer); $reader = new self($bstoreContainer); $reader->load($recordData); @@ -243,16 +243,16 @@ class Escher // offset: 0; size: 2; recVer and recInstance // bit: 4-15; mask: 0xFFF0; recInstance - $recInstance = (0xFFF0 & \PhpSpreadsheet\Reader\Excel5::getInt2d($this->data, $this->pos)) >> 4; + $recInstance = (0xFFF0 & \PhpOffice\PhpSpreadsheet\Reader\Excel5::getInt2d($this->data, $this->pos)) >> 4; - $length = \PhpSpreadsheet\Reader\Excel5::getInt4d($this->data, $this->pos + 4); + $length = \PhpOffice\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 \PhpSpreadsheet\Shared\Escher\DggContainer\BstoreContainer\BSE(); + $BSE = new \PhpOffice\PhpSpreadsheet\Shared\Escher\DggContainer\BstoreContainer\BSE(); $this->object->addBSE($BSE); $BSE->setBLIPType($recInstance); @@ -267,16 +267,16 @@ class Escher $rgbUid = substr($recordData, 2, 16); // offset: 18; size: 2; tag - $tag = \PhpSpreadsheet\Reader\Excel5::getInt2d($recordData, 18); + $tag = \PhpOffice\PhpSpreadsheet\Reader\Excel5::getInt2d($recordData, 18); // offset: 20; size: 4; size of BLIP in bytes - $size = \PhpSpreadsheet\Reader\Excel5::getInt4d($recordData, 20); + $size = \PhpOffice\PhpSpreadsheet\Reader\Excel5::getInt4d($recordData, 20); // offset: 24; size: 4; number of references to this BLIP - $cRef = \PhpSpreadsheet\Reader\Excel5::getInt4d($recordData, 24); + $cRef = \PhpOffice\PhpSpreadsheet\Reader\Excel5::getInt4d($recordData, 24); // offset: 28; size: 4; MSOFO file offset - $foDelay = \PhpSpreadsheet\Reader\Excel5::getInt4d($recordData, 28); + $foDelay = \PhpOffice\PhpSpreadsheet\Reader\Excel5::getInt4d($recordData, 28); // offset: 32; size: 1; unused1 $unused1 = ord($recordData{32}); @@ -297,7 +297,7 @@ class Escher $blipData = substr($recordData, 36 + $cbName); // record is a container, read contents - $reader = new \PhpSpreadsheet\Reader\Excel5\Escher($BSE); + $reader = new \PhpOffice\PhpSpreadsheet\Reader\Excel5\Escher($BSE); $reader->load($blipData); } @@ -309,9 +309,9 @@ class Escher // offset: 0; size: 2; recVer and recInstance // bit: 4-15; mask: 0xFFF0; recInstance - $recInstance = (0xFFF0 & \PhpSpreadsheet\Reader\Excel5::getInt2d($this->data, $this->pos)) >> 4; + $recInstance = (0xFFF0 & \PhpOffice\PhpSpreadsheet\Reader\Excel5::getInt2d($this->data, $this->pos)) >> 4; - $length = \PhpSpreadsheet\Reader\Excel5::getInt4d($this->data, $this->pos + 4); + $length = \PhpOffice\PhpSpreadsheet\Reader\Excel5::getInt4d($this->data, $this->pos + 4); $recordData = substr($this->data, $this->pos + 8, $length); // move stream pointer to next record @@ -336,7 +336,7 @@ class Escher // offset: var; size: var; the raw image data $data = substr($recordData, $pos); - $blip = new \PhpSpreadsheet\Shared\Escher\DggContainer\BstoreContainer\BSE\Blip(); + $blip = new \PhpOffice\PhpSpreadsheet\Shared\Escher\DggContainer\BstoreContainer\BSE\Blip(); $blip->setData($data); $this->object->setBlip($blip); @@ -350,9 +350,9 @@ class Escher // offset: 0; size: 2; recVer and recInstance // bit: 4-15; mask: 0xFFF0; recInstance - $recInstance = (0xFFF0 & \PhpSpreadsheet\Reader\Excel5::getInt2d($this->data, $this->pos)) >> 4; + $recInstance = (0xFFF0 & \PhpOffice\PhpSpreadsheet\Reader\Excel5::getInt2d($this->data, $this->pos)) >> 4; - $length = \PhpSpreadsheet\Reader\Excel5::getInt4d($this->data, $this->pos + 4); + $length = \PhpOffice\PhpSpreadsheet\Reader\Excel5::getInt4d($this->data, $this->pos + 4); $recordData = substr($this->data, $this->pos + 8, $length); // move stream pointer to next record @@ -377,7 +377,7 @@ class Escher // offset: var; size: var; the raw image data $data = substr($recordData, $pos); - $blip = new \PhpSpreadsheet\Shared\Escher\DggContainer\BstoreContainer\BSE\Blip(); + $blip = new \PhpOffice\PhpSpreadsheet\Shared\Escher\DggContainer\BstoreContainer\BSE\Blip(); $blip->setData($data); $this->object->setBlip($blip); @@ -391,9 +391,9 @@ class Escher // offset: 0; size: 2; recVer and recInstance // bit: 4-15; mask: 0xFFF0; recInstance - $recInstance = (0xFFF0 & \PhpSpreadsheet\Reader\Excel5::getInt2d($this->data, $this->pos)) >> 4; + $recInstance = (0xFFF0 & \PhpOffice\PhpSpreadsheet\Reader\Excel5::getInt2d($this->data, $this->pos)) >> 4; - $length = \PhpSpreadsheet\Reader\Excel5::getInt4d($this->data, $this->pos + 4); + $length = \PhpOffice\PhpSpreadsheet\Reader\Excel5::getInt4d($this->data, $this->pos + 4); $recordData = substr($this->data, $this->pos + 8, $length); // move stream pointer to next record @@ -410,9 +410,9 @@ class Escher // offset: 0; size: 2; recVer and recInstance // bit: 4-15; mask: 0xFFF0; recInstance - $recInstance = (0xFFF0 & \PhpSpreadsheet\Reader\Excel5::getInt2d($this->data, $this->pos)) >> 4; + $recInstance = (0xFFF0 & \PhpOffice\PhpSpreadsheet\Reader\Excel5::getInt2d($this->data, $this->pos)) >> 4; - $length = \PhpSpreadsheet\Reader\Excel5::getInt4d($this->data, $this->pos + 4); + $length = \PhpOffice\PhpSpreadsheet\Reader\Excel5::getInt4d($this->data, $this->pos + 4); $recordData = substr($this->data, $this->pos + 8, $length); // move stream pointer to next record @@ -424,7 +424,7 @@ class Escher */ private function readSplitMenuColors() { - $length = \PhpSpreadsheet\Reader\Excel5::getInt4d($this->data, $this->pos + 4); + $length = \PhpOffice\PhpSpreadsheet\Reader\Excel5::getInt4d($this->data, $this->pos + 4); $recordData = substr($this->data, $this->pos + 8, $length); // move stream pointer to next record @@ -436,16 +436,16 @@ class Escher */ private function readDgContainer() { - $length = \PhpSpreadsheet\Reader\Excel5::getInt4d($this->data, $this->pos + 4); + $length = \PhpOffice\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 \PhpSpreadsheet\Shared\Escher\DgContainer(); + $dgContainer = new \PhpOffice\PhpSpreadsheet\Shared\Escher\DgContainer(); $this->object->setDgContainer($dgContainer); - $reader = new \PhpSpreadsheet\Reader\Excel5\Escher($dgContainer); + $reader = new \PhpOffice\PhpSpreadsheet\Reader\Excel5\Escher($dgContainer); $escher = $reader->load($recordData); } @@ -454,7 +454,7 @@ class Escher */ private function readDg() { - $length = \PhpSpreadsheet\Reader\Excel5::getInt4d($this->data, $this->pos + 4); + $length = \PhpOffice\PhpSpreadsheet\Reader\Excel5::getInt4d($this->data, $this->pos + 4); $recordData = substr($this->data, $this->pos + 8, $length); // move stream pointer to next record @@ -468,16 +468,16 @@ class Escher { // context is either context DgContainer or SpgrContainer - $length = \PhpSpreadsheet\Reader\Excel5::getInt4d($this->data, $this->pos + 4); + $length = \PhpOffice\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 \PhpSpreadsheet\Shared\Escher\DgContainer\SpgrContainer(); + $spgrContainer = new \PhpOffice\PhpSpreadsheet\Shared\Escher\DgContainer\SpgrContainer(); - if ($this->object instanceof \PhpSpreadsheet\Shared\Escher\DgContainer) { + if ($this->object instanceof \PhpOffice\PhpSpreadsheet\Shared\Escher\DgContainer) { // DgContainer $this->object->setSpgrContainer($spgrContainer); } else { @@ -494,11 +494,11 @@ class Escher */ private function readSpContainer() { - $length = \PhpSpreadsheet\Reader\Excel5::getInt4d($this->data, $this->pos + 4); + $length = \PhpOffice\PhpSpreadsheet\Reader\Excel5::getInt4d($this->data, $this->pos + 4); $recordData = substr($this->data, $this->pos + 8, $length); // add spContainer to spgrContainer - $spContainer = new \PhpSpreadsheet\Shared\Escher\DgContainer\SpgrContainer\SpContainer(); + $spContainer = new \PhpOffice\PhpSpreadsheet\Shared\Escher\DgContainer\SpgrContainer\SpContainer(); $this->object->addChild($spContainer); // move stream pointer to next record @@ -514,7 +514,7 @@ class Escher */ private function readSpgr() { - $length = \PhpSpreadsheet\Reader\Excel5::getInt4d($this->data, $this->pos + 4); + $length = \PhpOffice\PhpSpreadsheet\Reader\Excel5::getInt4d($this->data, $this->pos + 4); $recordData = substr($this->data, $this->pos + 8, $length); // move stream pointer to next record @@ -529,9 +529,9 @@ class Escher // offset: 0; size: 2; recVer and recInstance // bit: 4-15; mask: 0xFFF0; recInstance - $recInstance = (0xFFF0 & \PhpSpreadsheet\Reader\Excel5::getInt2d($this->data, $this->pos)) >> 4; + $recInstance = (0xFFF0 & \PhpOffice\PhpSpreadsheet\Reader\Excel5::getInt2d($this->data, $this->pos)) >> 4; - $length = \PhpSpreadsheet\Reader\Excel5::getInt4d($this->data, $this->pos + 4); + $length = \PhpOffice\PhpSpreadsheet\Reader\Excel5::getInt4d($this->data, $this->pos + 4); $recordData = substr($this->data, $this->pos + 8, $length); // move stream pointer to next record @@ -546,9 +546,9 @@ class Escher // offset: 0; size: 2; recVer and recInstance // bit: 4-15; mask: 0xFFF0; recInstance - $recInstance = (0xFFF0 & \PhpSpreadsheet\Reader\Excel5::getInt2d($this->data, $this->pos)) >> 4; + $recInstance = (0xFFF0 & \PhpOffice\PhpSpreadsheet\Reader\Excel5::getInt2d($this->data, $this->pos)) >> 4; - $length = \PhpSpreadsheet\Reader\Excel5::getInt4d($this->data, $this->pos + 4); + $length = \PhpOffice\PhpSpreadsheet\Reader\Excel5::getInt4d($this->data, $this->pos + 4); $recordData = substr($this->data, $this->pos + 8, $length); // move stream pointer to next record @@ -560,38 +560,38 @@ class Escher */ private function readClientAnchor() { - $length = \PhpSpreadsheet\Reader\Excel5::getInt4d($this->data, $this->pos + 4); + $length = \PhpOffice\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 = \PhpSpreadsheet\Reader\Excel5::getInt2d($recordData, 2); + $c1 = \PhpOffice\PhpSpreadsheet\Reader\Excel5::getInt2d($recordData, 2); // offset: 4; size: 2; upper-left corner horizontal offset in 1/1024 of column width - $startOffsetX = \PhpSpreadsheet\Reader\Excel5::getInt2d($recordData, 4); + $startOffsetX = \PhpOffice\PhpSpreadsheet\Reader\Excel5::getInt2d($recordData, 4); // offset: 6; size: 2; upper-left corner row index (0-based) - $r1 = \PhpSpreadsheet\Reader\Excel5::getInt2d($recordData, 6); + $r1 = \PhpOffice\PhpSpreadsheet\Reader\Excel5::getInt2d($recordData, 6); // offset: 8; size: 2; upper-left corner vertical offset in 1/256 of row height - $startOffsetY = \PhpSpreadsheet\Reader\Excel5::getInt2d($recordData, 8); + $startOffsetY = \PhpOffice\PhpSpreadsheet\Reader\Excel5::getInt2d($recordData, 8); // offset: 10; size: 2; bottom-right corner column index (0-based) - $c2 = \PhpSpreadsheet\Reader\Excel5::getInt2d($recordData, 10); + $c2 = \PhpOffice\PhpSpreadsheet\Reader\Excel5::getInt2d($recordData, 10); // offset: 12; size: 2; bottom-right corner horizontal offset in 1/1024 of column width - $endOffsetX = \PhpSpreadsheet\Reader\Excel5::getInt2d($recordData, 12); + $endOffsetX = \PhpOffice\PhpSpreadsheet\Reader\Excel5::getInt2d($recordData, 12); // offset: 14; size: 2; bottom-right corner row index (0-based) - $r2 = \PhpSpreadsheet\Reader\Excel5::getInt2d($recordData, 14); + $r2 = \PhpOffice\PhpSpreadsheet\Reader\Excel5::getInt2d($recordData, 14); // offset: 16; size: 2; bottom-right corner vertical offset in 1/256 of row height - $endOffsetY = \PhpSpreadsheet\Reader\Excel5::getInt2d($recordData, 16); + $endOffsetY = \PhpOffice\PhpSpreadsheet\Reader\Excel5::getInt2d($recordData, 16); // set the start coordinates - $this->object->setStartCoordinates(\PhpSpreadsheet\Cell::stringFromColumnIndex($c1) . ($r1 + 1)); + $this->object->setStartCoordinates(\PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($c1) . ($r1 + 1)); // set the start offsetX $this->object->setStartOffsetX($startOffsetX); @@ -600,7 +600,7 @@ class Escher $this->object->setStartOffsetY($startOffsetY); // set the end coordinates - $this->object->setEndCoordinates(\PhpSpreadsheet\Cell::stringFromColumnIndex($c2) . ($r2 + 1)); + $this->object->setEndCoordinates(\PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($c2) . ($r2 + 1)); // set the end offsetX $this->object->setEndOffsetX($endOffsetX); @@ -614,7 +614,7 @@ class Escher */ private function readClientData() { - $length = \PhpSpreadsheet\Reader\Excel5::getInt4d($this->data, $this->pos + 4); + $length = \PhpOffice\PhpSpreadsheet\Reader\Excel5::getInt4d($this->data, $this->pos + 4); $recordData = substr($this->data, $this->pos + 8, $length); // move stream pointer to next record @@ -637,7 +637,7 @@ class Escher $fopte = substr($data, 6 * $i, 6); // offset: 0; size: 2; opid - $opid = \PhpSpreadsheet\Reader\Excel5::getInt2d($fopte, 0); + $opid = \PhpOffice\PhpSpreadsheet\Reader\Excel5::getInt2d($fopte, 0); // bit: 0-13; mask: 0x3FFF; opid.opid $opidOpid = (0x3FFF & $opid) >> 0; @@ -649,7 +649,7 @@ class Escher $opidFComplex = (0x8000 & $opid) >> 15; // offset: 2; size: 4; the value for this property - $op = \PhpSpreadsheet\Reader\Excel5::getInt4d($fopte, 2); + $op = \PhpOffice\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 607a0781..51ab4271 100644 --- a/src/PhpSpreadsheet/Reader/Excel5/MD5.php +++ b/src/PhpSpreadsheet/Reader/Excel5/MD5.php @@ -1,6 +1,6 @@ readFilter = new DefaultReadFilter(); - $this->referenceHelper = \PhpSpreadsheet\ReferenceHelper::getInstance(); + $this->referenceHelper = \PhpOffice\PhpSpreadsheet\ReferenceHelper::getInstance(); } /** @@ -99,7 +99,7 @@ class Gnumeric extends BaseReader implements IReader } $xml = new XMLReader(); - $xml->xml($this->securityScanFile('compress.zlib://' . realpath($pFilename)), null, \PhpSpreadsheet\Settings::getLibXmlLoaderOptions()); + $xml->xml($this->securityScanFile('compress.zlib://' . realpath($pFilename)), null, \PhpOffice\PhpSpreadsheet\Settings::getLibXmlLoaderOptions()); $xml->setParserProperty(2, true); $worksheetNames = []; @@ -130,7 +130,7 @@ class Gnumeric extends BaseReader implements IReader } $xml = new XMLReader(); - $xml->xml($this->securityScanFile('compress.zlib://' . realpath($pFilename)), null, \PhpSpreadsheet\Settings::getLibXmlLoaderOptions()); + $xml->xml($this->securityScanFile('compress.zlib://' . realpath($pFilename)), null, \PhpOffice\PhpSpreadsheet\Settings::getLibXmlLoaderOptions()); $xml->setParserProperty(2, true); $worksheetInfo = []; @@ -158,7 +158,7 @@ class Gnumeric extends BaseReader implements IReader break; } } - $tmpInfo['lastColumnLetter'] = \PhpSpreadsheet\Cell::stringFromColumnIndex($tmpInfo['lastColumnIndex']); + $tmpInfo['lastColumnLetter'] = \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($tmpInfo['lastColumnIndex']); $worksheetInfo[] = $tmpInfo; } } @@ -219,7 +219,7 @@ class Gnumeric extends BaseReader implements IReader $gFileData = $this->gzfileGetContents($pFilename); - $xml = simplexml_load_string($this->securityScan($gFileData), 'SimpleXMLElement', \PhpSpreadsheet\Settings::getLibXmlLoaderOptions()); + $xml = simplexml_load_string($this->securityScan($gFileData), 'SimpleXMLElement', \PhpOffice\PhpSpreadsheet\Settings::getLibXmlLoaderOptions()); $namespacesMeta = $xml->getNamespaces(true); $gnmXML = $xml->children($namespacesMeta['gnm']); @@ -390,7 +390,7 @@ class Gnumeric extends BaseReader implements IReader $maxCol = $column; } - $column = \PhpSpreadsheet\Cell::stringFromColumnIndex($column); + $column = \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($column); // Read cell? if ($this->getReadFilter() !== null) { @@ -401,7 +401,7 @@ class Gnumeric extends BaseReader implements IReader $ValueType = $cellAttributes->ValueType; $ExprID = (string) $cellAttributes->ExprID; - $type = \PhpSpreadsheet\Cell\DataType::TYPE_FORMULA; + $type = \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_FORMULA; if ($ExprID > '') { if (((string) $cell) > '') { $this->expressions[$ExprID] = [ @@ -420,27 +420,27 @@ class Gnumeric extends BaseReader implements IReader $worksheetName ); } - $type = \PhpSpreadsheet\Cell\DataType::TYPE_FORMULA; + $type = \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_FORMULA; } else { switch ($ValueType) { case '10': // NULL - $type = \PhpSpreadsheet\Cell\DataType::TYPE_NULL; + $type = \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_NULL; break; case '20': // Boolean - $type = \PhpSpreadsheet\Cell\DataType::TYPE_BOOL; + $type = \PhpOffice\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 = \PhpSpreadsheet\Cell\DataType::TYPE_NUMERIC; + $type = \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_NUMERIC; break; case '50': // Error - $type = \PhpSpreadsheet\Cell\DataType::TYPE_ERROR; + $type = \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_ERROR; break; case '60': // String - $type = \PhpSpreadsheet\Cell\DataType::TYPE_STRING; + $type = \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING; break; case '70': // Cell Range case '80': // Array @@ -462,11 +462,11 @@ class Gnumeric extends BaseReader implements IReader $styleAttributes = $styleRegion->attributes(); if (($styleAttributes['startRow'] <= $maxRow) && ($styleAttributes['startCol'] <= $maxCol)) { - $startColumn = \PhpSpreadsheet\Cell::stringFromColumnIndex((int) $styleAttributes['startCol']); + $startColumn = \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex((int) $styleAttributes['startCol']); $startRow = $styleAttributes['startRow'] + 1; $endColumn = ($styleAttributes['endCol'] > $maxCol) ? $maxCol : (int) $styleAttributes['endCol']; - $endColumn = \PhpSpreadsheet\Cell::stringFromColumnIndex($endColumn); + $endColumn = \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($endColumn); $endRow = ($styleAttributes['endRow'] > $maxRow) ? $maxRow : $styleAttributes['endRow']; $endRow += 1; $cellRange = $startColumn . $startRow . ':' . $endColumn . $endRow; @@ -475,45 +475,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) || - (\PhpSpreadsheet\Shared\Date::isDateTimeFormatCode((string) $styleAttributes['Format']))) { + (\PhpOffice\PhpSpreadsheet\Shared\Date::isDateTimeFormatCode((string) $styleAttributes['Format']))) { $styleArray = []; $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'] = \PhpSpreadsheet\Style\Alignment::HORIZONTAL_GENERAL; + $styleArray['alignment']['horizontal'] = \PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_GENERAL; break; case '2': - $styleArray['alignment']['horizontal'] = \PhpSpreadsheet\Style\Alignment::HORIZONTAL_LEFT; + $styleArray['alignment']['horizontal'] = \PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_LEFT; break; case '4': - $styleArray['alignment']['horizontal'] = \PhpSpreadsheet\Style\Alignment::HORIZONTAL_RIGHT; + $styleArray['alignment']['horizontal'] = \PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_RIGHT; break; case '8': - $styleArray['alignment']['horizontal'] = \PhpSpreadsheet\Style\Alignment::HORIZONTAL_CENTER; + $styleArray['alignment']['horizontal'] = \PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_CENTER; break; case '16': case '64': - $styleArray['alignment']['horizontal'] = \PhpSpreadsheet\Style\Alignment::HORIZONTAL_CENTER_CONTINUOUS; + $styleArray['alignment']['horizontal'] = \PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_CENTER_CONTINUOUS; break; case '32': - $styleArray['alignment']['horizontal'] = \PhpSpreadsheet\Style\Alignment::HORIZONTAL_JUSTIFY; + $styleArray['alignment']['horizontal'] = \PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_JUSTIFY; break; } switch ($styleAttributes['VAlign']) { case '1': - $styleArray['alignment']['vertical'] = \PhpSpreadsheet\Style\Alignment::VERTICAL_TOP; + $styleArray['alignment']['vertical'] = \PhpOffice\PhpSpreadsheet\Style\Alignment::VERTICAL_TOP; break; case '2': - $styleArray['alignment']['vertical'] = \PhpSpreadsheet\Style\Alignment::VERTICAL_BOTTOM; + $styleArray['alignment']['vertical'] = \PhpOffice\PhpSpreadsheet\Style\Alignment::VERTICAL_BOTTOM; break; case '4': - $styleArray['alignment']['vertical'] = \PhpSpreadsheet\Style\Alignment::VERTICAL_CENTER; + $styleArray['alignment']['vertical'] = \PhpOffice\PhpSpreadsheet\Style\Alignment::VERTICAL_CENTER; break; case '8': - $styleArray['alignment']['vertical'] = \PhpSpreadsheet\Style\Alignment::VERTICAL_JUSTIFY; + $styleArray['alignment']['vertical'] = \PhpOffice\PhpSpreadsheet\Style\Alignment::VERTICAL_JUSTIFY; break; } @@ -531,64 +531,64 @@ class Gnumeric extends BaseReader implements IReader $styleArray['fill']['endcolor']['rgb'] = $RGB2; switch ($shade) { case '1': - $styleArray['fill']['type'] = \PhpSpreadsheet\Style\Fill::FILL_SOLID; + $styleArray['fill']['type'] = \PhpOffice\PhpSpreadsheet\Style\Fill::FILL_SOLID; break; case '2': - $styleArray['fill']['type'] = \PhpSpreadsheet\Style\Fill::FILL_GRADIENT_LINEAR; + $styleArray['fill']['type'] = \PhpOffice\PhpSpreadsheet\Style\Fill::FILL_GRADIENT_LINEAR; break; case '3': - $styleArray['fill']['type'] = \PhpSpreadsheet\Style\Fill::FILL_GRADIENT_PATH; + $styleArray['fill']['type'] = \PhpOffice\PhpSpreadsheet\Style\Fill::FILL_GRADIENT_PATH; break; case '4': - $styleArray['fill']['type'] = \PhpSpreadsheet\Style\Fill::FILL_PATTERN_DARKDOWN; + $styleArray['fill']['type'] = \PhpOffice\PhpSpreadsheet\Style\Fill::FILL_PATTERN_DARKDOWN; break; case '5': - $styleArray['fill']['type'] = \PhpSpreadsheet\Style\Fill::FILL_PATTERN_DARKGRAY; + $styleArray['fill']['type'] = \PhpOffice\PhpSpreadsheet\Style\Fill::FILL_PATTERN_DARKGRAY; break; case '6': - $styleArray['fill']['type'] = \PhpSpreadsheet\Style\Fill::FILL_PATTERN_DARKGRID; + $styleArray['fill']['type'] = \PhpOffice\PhpSpreadsheet\Style\Fill::FILL_PATTERN_DARKGRID; break; case '7': - $styleArray['fill']['type'] = \PhpSpreadsheet\Style\Fill::FILL_PATTERN_DARKHORIZONTAL; + $styleArray['fill']['type'] = \PhpOffice\PhpSpreadsheet\Style\Fill::FILL_PATTERN_DARKHORIZONTAL; break; case '8': - $styleArray['fill']['type'] = \PhpSpreadsheet\Style\Fill::FILL_PATTERN_DARKTRELLIS; + $styleArray['fill']['type'] = \PhpOffice\PhpSpreadsheet\Style\Fill::FILL_PATTERN_DARKTRELLIS; break; case '9': - $styleArray['fill']['type'] = \PhpSpreadsheet\Style\Fill::FILL_PATTERN_DARKUP; + $styleArray['fill']['type'] = \PhpOffice\PhpSpreadsheet\Style\Fill::FILL_PATTERN_DARKUP; break; case '10': - $styleArray['fill']['type'] = \PhpSpreadsheet\Style\Fill::FILL_PATTERN_DARKVERTICAL; + $styleArray['fill']['type'] = \PhpOffice\PhpSpreadsheet\Style\Fill::FILL_PATTERN_DARKVERTICAL; break; case '11': - $styleArray['fill']['type'] = \PhpSpreadsheet\Style\Fill::FILL_PATTERN_GRAY0625; + $styleArray['fill']['type'] = \PhpOffice\PhpSpreadsheet\Style\Fill::FILL_PATTERN_GRAY0625; break; case '12': - $styleArray['fill']['type'] = \PhpSpreadsheet\Style\Fill::FILL_PATTERN_GRAY125; + $styleArray['fill']['type'] = \PhpOffice\PhpSpreadsheet\Style\Fill::FILL_PATTERN_GRAY125; break; case '13': - $styleArray['fill']['type'] = \PhpSpreadsheet\Style\Fill::FILL_PATTERN_LIGHTDOWN; + $styleArray['fill']['type'] = \PhpOffice\PhpSpreadsheet\Style\Fill::FILL_PATTERN_LIGHTDOWN; break; case '14': - $styleArray['fill']['type'] = \PhpSpreadsheet\Style\Fill::FILL_PATTERN_LIGHTGRAY; + $styleArray['fill']['type'] = \PhpOffice\PhpSpreadsheet\Style\Fill::FILL_PATTERN_LIGHTGRAY; break; case '15': - $styleArray['fill']['type'] = \PhpSpreadsheet\Style\Fill::FILL_PATTERN_LIGHTGRID; + $styleArray['fill']['type'] = \PhpOffice\PhpSpreadsheet\Style\Fill::FILL_PATTERN_LIGHTGRID; break; case '16': - $styleArray['fill']['type'] = \PhpSpreadsheet\Style\Fill::FILL_PATTERN_LIGHTHORIZONTAL; + $styleArray['fill']['type'] = \PhpOffice\PhpSpreadsheet\Style\Fill::FILL_PATTERN_LIGHTHORIZONTAL; break; case '17': - $styleArray['fill']['type'] = \PhpSpreadsheet\Style\Fill::FILL_PATTERN_LIGHTTRELLIS; + $styleArray['fill']['type'] = \PhpOffice\PhpSpreadsheet\Style\Fill::FILL_PATTERN_LIGHTTRELLIS; break; case '18': - $styleArray['fill']['type'] = \PhpSpreadsheet\Style\Fill::FILL_PATTERN_LIGHTUP; + $styleArray['fill']['type'] = \PhpOffice\PhpSpreadsheet\Style\Fill::FILL_PATTERN_LIGHTUP; break; case '19': - $styleArray['fill']['type'] = \PhpSpreadsheet\Style\Fill::FILL_PATTERN_LIGHTVERTICAL; + $styleArray['fill']['type'] = \PhpOffice\PhpSpreadsheet\Style\Fill::FILL_PATTERN_LIGHTVERTICAL; break; case '20': - $styleArray['fill']['type'] = \PhpSpreadsheet\Style\Fill::FILL_PATTERN_MEDIUMGRAY; + $styleArray['fill']['type'] = \PhpOffice\PhpSpreadsheet\Style\Fill::FILL_PATTERN_MEDIUMGRAY; break; } } @@ -601,19 +601,19 @@ class Gnumeric extends BaseReader implements IReader $styleArray['font']['strike'] = ($fontAttributes['StrikeThrough'] == '1') ? true : false; switch ($fontAttributes['Underline']) { case '1': - $styleArray['font']['underline'] = \PhpSpreadsheet\Style\Font::UNDERLINE_SINGLE; + $styleArray['font']['underline'] = \PhpOffice\PhpSpreadsheet\Style\Font::UNDERLINE_SINGLE; break; case '2': - $styleArray['font']['underline'] = \PhpSpreadsheet\Style\Font::UNDERLINE_DOUBLE; + $styleArray['font']['underline'] = \PhpOffice\PhpSpreadsheet\Style\Font::UNDERLINE_DOUBLE; break; case '3': - $styleArray['font']['underline'] = \PhpSpreadsheet\Style\Font::UNDERLINE_SINGLEACCOUNTING; + $styleArray['font']['underline'] = \PhpOffice\PhpSpreadsheet\Style\Font::UNDERLINE_SINGLEACCOUNTING; break; case '4': - $styleArray['font']['underline'] = \PhpSpreadsheet\Style\Font::UNDERLINE_DOUBLEACCOUNTING; + $styleArray['font']['underline'] = \PhpOffice\PhpSpreadsheet\Style\Font::UNDERLINE_DOUBLEACCOUNTING; break; default: - $styleArray['font']['underline'] = \PhpSpreadsheet\Style\Font::UNDERLINE_NONE; + $styleArray['font']['underline'] = \PhpOffice\PhpSpreadsheet\Style\Font::UNDERLINE_NONE; break; } switch ($fontAttributes['Script']) { @@ -640,13 +640,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'] = \PhpSpreadsheet\Style\Borders::DIAGONAL_BOTH; + $styleArray['borders']['diagonaldirection'] = \PhpOffice\PhpSpreadsheet\Style\Borders::DIAGONAL_BOTH; } elseif (isset($styleRegion->Style->StyleBorder->Diagonal)) { $styleArray['borders']['diagonal'] = self::parseBorderAttributes($styleRegion->Style->StyleBorder->Diagonal->attributes()); - $styleArray['borders']['diagonaldirection'] = \PhpSpreadsheet\Style\Borders::DIAGONAL_UP; + $styleArray['borders']['diagonaldirection'] = \PhpOffice\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'] = \PhpSpreadsheet\Style\Borders::DIAGONAL_DOWN; + $styleArray['borders']['diagonaldirection'] = \PhpOffice\PhpSpreadsheet\Style\Borders::DIAGONAL_DOWN; } } if (isset($styleRegion->Style->HyperLink)) { @@ -671,19 +671,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) { - $spreadsheet->getActiveSheet()->getColumnDimension(\PhpSpreadsheet\Cell::stringFromColumnIndex($c))->setWidth($defaultWidth); + $spreadsheet->getActiveSheet()->getColumnDimension(\PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($c))->setWidth($defaultWidth); ++$c; } while (($c < ($column + $columnCount)) && ($c <= $maxCol)) { - $spreadsheet->getActiveSheet()->getColumnDimension(\PhpSpreadsheet\Cell::stringFromColumnIndex($c))->setWidth($columnWidth); + $spreadsheet->getActiveSheet()->getColumnDimension(\PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($c))->setWidth($columnWidth); if ($hidden) { - $spreadsheet->getActiveSheet()->getColumnDimension(\PhpSpreadsheet\Cell::stringFromColumnIndex($c))->setVisible(false); + $spreadsheet->getActiveSheet()->getColumnDimension(\PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($c))->setVisible(false); } ++$c; } } while ($c <= $maxCol) { - $spreadsheet->getActiveSheet()->getColumnDimension(\PhpSpreadsheet\Cell::stringFromColumnIndex($c))->setWidth($defaultWidth); + $spreadsheet->getActiveSheet()->getColumnDimension(\PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($c))->setWidth($defaultWidth); ++$c; } } @@ -743,7 +743,7 @@ class Gnumeric extends BaseReader implements IReader $range[0] = trim($range[0], "'"); if ($worksheet = $spreadsheet->getSheetByName($range[0])) { $extractedRange = str_replace('$', '', $range[1]); - $spreadsheet->addNamedRange(new \PhpSpreadsheet\NamedRange($name, $worksheet, $extractedRange)); + $spreadsheet->addNamedRange(new \PhpOffice\PhpSpreadsheet\NamedRange($name, $worksheet, $extractedRange)); } } } @@ -761,46 +761,46 @@ class Gnumeric extends BaseReader implements IReader switch ($borderAttributes['Style']) { case '0': - $styleArray['style'] = \PhpSpreadsheet\Style\Border::BORDER_NONE; + $styleArray['style'] = \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_NONE; break; case '1': - $styleArray['style'] = \PhpSpreadsheet\Style\Border::BORDER_THIN; + $styleArray['style'] = \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_THIN; break; case '2': - $styleArray['style'] = \PhpSpreadsheet\Style\Border::BORDER_MEDIUM; + $styleArray['style'] = \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_MEDIUM; break; case '3': - $styleArray['style'] = \PhpSpreadsheet\Style\Border::BORDER_SLANTDASHDOT; + $styleArray['style'] = \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_SLANTDASHDOT; break; case '4': - $styleArray['style'] = \PhpSpreadsheet\Style\Border::BORDER_DASHED; + $styleArray['style'] = \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_DASHED; break; case '5': - $styleArray['style'] = \PhpSpreadsheet\Style\Border::BORDER_THICK; + $styleArray['style'] = \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_THICK; break; case '6': - $styleArray['style'] = \PhpSpreadsheet\Style\Border::BORDER_DOUBLE; + $styleArray['style'] = \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_DOUBLE; break; case '7': - $styleArray['style'] = \PhpSpreadsheet\Style\Border::BORDER_DOTTED; + $styleArray['style'] = \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_DOTTED; break; case '8': - $styleArray['style'] = \PhpSpreadsheet\Style\Border::BORDER_MEDIUMDASHED; + $styleArray['style'] = \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_MEDIUMDASHED; break; case '9': - $styleArray['style'] = \PhpSpreadsheet\Style\Border::BORDER_DASHDOT; + $styleArray['style'] = \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_DASHDOT; break; case '10': - $styleArray['style'] = \PhpSpreadsheet\Style\Border::BORDER_MEDIUMDASHDOT; + $styleArray['style'] = \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_MEDIUMDASHDOT; break; case '11': - $styleArray['style'] = \PhpSpreadsheet\Style\Border::BORDER_DASHDOTDOT; + $styleArray['style'] = \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_DASHDOTDOT; break; case '12': - $styleArray['style'] = \PhpSpreadsheet\Style\Border::BORDER_MEDIUMDASHDOTDOT; + $styleArray['style'] = \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_MEDIUMDASHDOTDOT; break; case '13': - $styleArray['style'] = \PhpSpreadsheet\Style\Border::BORDER_MEDIUMDASHDOTDOT; + $styleArray['style'] = \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_MEDIUMDASHDOTDOT; break; } @@ -809,7 +809,7 @@ class Gnumeric extends BaseReader implements IReader private function parseRichText($is = '') { - $value = new \PhpSpreadsheet\RichText(); + $value = new \PhpOffice\PhpSpreadsheet\RichText(); $value->createText($is); return $value; diff --git a/src/PhpSpreadsheet/Reader/HTML.php b/src/PhpSpreadsheet/Reader/HTML.php index 77920722..178d110a 100644 --- a/src/PhpSpreadsheet/Reader/HTML.php +++ b/src/PhpSpreadsheet/Reader/HTML.php @@ -1,12 +1,12 @@ [ 'underline' => true, 'color' => [ - 'argb' => \PhpSpreadsheet\Style\Color::COLOR_BLUE, + 'argb' => \PhpOffice\PhpSpreadsheet\Style\Color::COLOR_BLUE, ], ], ], // Blue underlined 'hr' => [ 'borders' => [ 'bottom' => [ - 'style' => \PhpSpreadsheet\Style\Border::BORDER_THIN, + 'style' => \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_THIN, 'color' => [ - \PhpSpreadsheet\Style\Color::COLOR_BLACK, + \PhpOffice\PhpSpreadsheet\Style\Color::COLOR_BLACK, ], ], ], @@ -223,12 +223,12 @@ class HTML extends BaseReader implements IReader /** * @param DOMNode $element - * @param \PhpSpreadsheet\Worksheet $sheet + * @param \PhpOffice\PhpSpreadsheet\Worksheet $sheet * @param int $row * @param string $column * @param string $cellContent */ - protected function processDomElement(DOMNode $element, \PhpSpreadsheet\Worksheet $sheet, &$row, &$column, &$cellContent) + protected function processDomElement(DOMNode $element, \PhpOffice\PhpSpreadsheet\Worksheet $sheet, &$row, &$column, &$cellContent) { foreach ($element->childNodes as $child) { if ($child instanceof DOMText) { @@ -398,7 +398,7 @@ class HTML extends BaseReader implements IReader ++$columnTo; } $range = $column . $row . ':' . $columnTo . ($row + $attributeArray['rowspan'] - 1); - foreach (\PhpSpreadsheet\Cell::extractAllCellReferencesInRange($range) as $value) { + foreach (\PhpOffice\PhpSpreadsheet\Cell::extractAllCellReferencesInRange($range) as $value) { $this->rowspan[$value] = true; } $sheet->mergeCells($range); @@ -406,7 +406,7 @@ class HTML extends BaseReader implements IReader } elseif (isset($attributeArray['rowspan'])) { //create merging rowspan $range = $column . $row . ':' . $column . ($row + $attributeArray['rowspan'] - 1); - foreach (\PhpSpreadsheet\Cell::extractAllCellReferencesInRange($range) as $value) { + foreach (\PhpOffice\PhpSpreadsheet\Cell::extractAllCellReferencesInRange($range) as $value) { $this->rowspan[$value] = true; } $sheet->mergeCells($range); diff --git a/src/PhpSpreadsheet/Reader/IReadFilter.php b/src/PhpSpreadsheet/Reader/IReadFilter.php index 4c8de5f5..2be7a878 100644 --- a/src/PhpSpreadsheet/Reader/IReadFilter.php +++ b/src/PhpSpreadsheet/Reader/IReadFilter.php @@ -1,6 +1,6 @@ securityScan($zip->getFromName('META-INF/manifest.xml')), 'SimpleXMLElement', - \PhpSpreadsheet\Settings::getLibXmlLoaderOptions() + \PhpOffice\PhpSpreadsheet\Settings::getLibXmlLoaderOptions() ); $namespacesContent = $xml->getNamespaces(true); if (isset($namespacesContent['manifest'])) { @@ -113,7 +113,7 @@ class OOCalc extends BaseReader implements IReader throw new Exception('Could not open ' . $pFilename . ' for reading! File does not exist.'); } - $zipClass = \PhpSpreadsheet\Settings::getZipClass(); + $zipClass = \PhpOffice\PhpSpreadsheet\Settings::getZipClass(); $zip = new $zipClass(); if (!$zip->open($pFilename)) { @@ -126,7 +126,7 @@ class OOCalc extends BaseReader implements IReader $res = $xml->xml( $this->securityScanFile('zip://' . realpath($pFilename) . '#content.xml'), null, - \PhpSpreadsheet\Settings::getLibXmlLoaderOptions() + \PhpOffice\PhpSpreadsheet\Settings::getLibXmlLoaderOptions() ); $xml->setParserProperty(2, true); @@ -171,7 +171,7 @@ class OOCalc extends BaseReader implements IReader $worksheetInfo = []; - $zipClass = \PhpSpreadsheet\Settings::getZipClass(); + $zipClass = \PhpOffice\PhpSpreadsheet\Settings::getZipClass(); $zip = new $zipClass(); if (!$zip->open($pFilename)) { @@ -182,7 +182,7 @@ class OOCalc extends BaseReader implements IReader $res = $xml->xml( $this->securityScanFile('zip://' . realpath($pFilename) . '#content.xml'), null, - \PhpSpreadsheet\Settings::getLibXmlLoaderOptions() + \PhpOffice\PhpSpreadsheet\Settings::getLibXmlLoaderOptions() ); $xml->setParserProperty(2, true); @@ -241,7 +241,7 @@ class OOCalc extends BaseReader implements IReader $tmpInfo['totalColumns'] = max($tmpInfo['totalColumns'], $currCells); $tmpInfo['lastColumnIndex'] = $tmpInfo['totalColumns'] - 1; - $tmpInfo['lastColumnLetter'] = \PhpSpreadsheet\Cell::stringFromColumnIndex($tmpInfo['lastColumnIndex']); + $tmpInfo['lastColumnLetter'] = \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($tmpInfo['lastColumnIndex']); $worksheetInfo[] = $tmpInfo; } } @@ -255,12 +255,12 @@ class OOCalc extends BaseReader implements IReader * * @param string $pFilename * @throws Exception - * @return \PhpSpreadsheet\Spreadsheet + * @return \PhpOffice\PhpSpreadsheet\Spreadsheet */ public function load($pFilename) { // Create new Spreadsheet - $spreadsheet = new \PhpSpreadsheet\Spreadsheet(); + $spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet(); // Load into this instance return $this->loadIntoExisting($pFilename, $spreadsheet); @@ -284,11 +284,11 @@ class OOCalc extends BaseReader implements IReader * Loads PhpSpreadsheet from file into PhpSpreadsheet instance * * @param string $pFilename - * @param \PhpSpreadsheet\Spreadsheet $spreadsheet + * @param \PhpOffice\PhpSpreadsheet\Spreadsheet $spreadsheet * @throws Exception - * @return \PhpSpreadsheet\Spreadsheet + * @return \PhpOffice\PhpSpreadsheet\Spreadsheet */ - public function loadIntoExisting($pFilename, \PhpSpreadsheet\Spreadsheet $spreadsheet) + public function loadIntoExisting($pFilename, \PhpOffice\PhpSpreadsheet\Spreadsheet $spreadsheet) { // Check if file exists if (!file_exists($pFilename)) { @@ -298,7 +298,7 @@ class OOCalc extends BaseReader implements IReader $timezoneObj = new DateTimeZone('Europe/London'); $GMT = new \DateTimeZone('UTC'); - $zipClass = \PhpSpreadsheet\Settings::getZipClass(); + $zipClass = \PhpOffice\PhpSpreadsheet\Settings::getZipClass(); $zip = new $zipClass(); if (!$zip->open($pFilename)) { @@ -308,7 +308,7 @@ class OOCalc extends BaseReader implements IReader $xml = simplexml_load_string( $this->securityScan($zip->getFromName('meta.xml')), 'SimpleXMLElement', - \PhpSpreadsheet\Settings::getLibXmlLoaderOptions() + \PhpOffice\PhpSpreadsheet\Settings::getLibXmlLoaderOptions() ); $namespacesMeta = $xml->getNamespaces(true); @@ -361,26 +361,26 @@ class OOCalc extends BaseReader implements IReader $docProps->setCreated($creationDate); break; case 'user-defined': - $propertyValueType = \PhpSpreadsheet\Document\Properties::PROPERTY_TYPE_STRING; + $propertyValueType = \PhpOffice\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 = \PhpSpreadsheet\Document\Properties::convertProperty($propertyValue, 'date'); - $propertyValueType = \PhpSpreadsheet\Document\Properties::PROPERTY_TYPE_DATE; + $propertyValue = \PhpOffice\PhpSpreadsheet\Document\Properties::convertProperty($propertyValue, 'date'); + $propertyValueType = \PhpOffice\PhpSpreadsheet\Document\Properties::PROPERTY_TYPE_DATE; break; case 'boolean': - $propertyValue = \PhpSpreadsheet\Document\Properties::convertProperty($propertyValue, 'bool'); - $propertyValueType = \PhpSpreadsheet\Document\Properties::PROPERTY_TYPE_BOOLEAN; + $propertyValue = \PhpOffice\PhpSpreadsheet\Document\Properties::convertProperty($propertyValue, 'bool'); + $propertyValueType = \PhpOffice\PhpSpreadsheet\Document\Properties::PROPERTY_TYPE_BOOLEAN; break; case 'float': - $propertyValue = \PhpSpreadsheet\Document\Properties::convertProperty($propertyValue, 'r4'); - $propertyValueType = \PhpSpreadsheet\Document\Properties::PROPERTY_TYPE_FLOAT; + $propertyValue = \PhpOffice\PhpSpreadsheet\Document\Properties::convertProperty($propertyValue, 'r4'); + $propertyValueType = \PhpOffice\PhpSpreadsheet\Document\Properties::PROPERTY_TYPE_FLOAT; break; default: - $propertyValueType = \PhpSpreadsheet\Document\Properties::PROPERTY_TYPE_STRING; + $propertyValueType = \PhpOffice\PhpSpreadsheet\Document\Properties::PROPERTY_TYPE_STRING; } } } @@ -393,7 +393,7 @@ class OOCalc extends BaseReader implements IReader $xml = simplexml_load_string( $this->securityScan($zip->getFromName('content.xml')), 'SimpleXMLElement', - \PhpSpreadsheet\Settings::getLibXmlLoaderOptions() + \PhpOffice\PhpSpreadsheet\Settings::getLibXmlLoaderOptions() ); $namespacesContent = $xml->getNamespaces(true); @@ -493,7 +493,7 @@ class OOCalc extends BaseReader implements IReader switch ($cellDataOfficeAttributes['value-type']) { case 'string': - $type = \PhpSpreadsheet\Cell\DataType::TYPE_STRING; + $type = \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING; $dataValue = $allCellDataText; if (isset($dataValue->a)) { $dataValue = $dataValue->a; @@ -502,27 +502,27 @@ class OOCalc extends BaseReader implements IReader } break; case 'boolean': - $type = \PhpSpreadsheet\Cell\DataType::TYPE_BOOL; + $type = \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_BOOL; $dataValue = ($allCellDataText == 'TRUE') ? true : false; break; case 'percentage': - $type = \PhpSpreadsheet\Cell\DataType::TYPE_NUMERIC; + $type = \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_NUMERIC; $dataValue = (float) $cellDataOfficeAttributes['value']; if (floor($dataValue) == $dataValue) { $dataValue = (integer) $dataValue; } - $formatting = \PhpSpreadsheet\Style\NumberFormat::FORMAT_PERCENTAGE_00; + $formatting = \PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_PERCENTAGE_00; break; case 'currency': - $type = \PhpSpreadsheet\Cell\DataType::TYPE_NUMERIC; + $type = \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_NUMERIC; $dataValue = (float) $cellDataOfficeAttributes['value']; if (floor($dataValue) == $dataValue) { $dataValue = (integer) $dataValue; } - $formatting = \PhpSpreadsheet\Style\NumberFormat::FORMAT_CURRENCY_USD_SIMPLE; + $formatting = \PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_CURRENCY_USD_SIMPLE; break; case 'float': - $type = \PhpSpreadsheet\Cell\DataType::TYPE_NUMERIC; + $type = \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_NUMERIC; $dataValue = (float) $cellDataOfficeAttributes['value']; if (floor($dataValue) == $dataValue) { if ($dataValue == (integer) $dataValue) { @@ -533,30 +533,30 @@ class OOCalc extends BaseReader implements IReader } break; case 'date': - $type = \PhpSpreadsheet\Cell\DataType::TYPE_NUMERIC; + $type = \PhpOffice\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 = \PhpSpreadsheet\Shared\Date::formattedPHPToExcel($year, $month, $day, $hour, $minute, $second); + $dataValue = \PhpOffice\PhpSpreadsheet\Shared\Date::formattedPHPToExcel($year, $month, $day, $hour, $minute, $second); if ($dataValue != floor($dataValue)) { - $formatting = \PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_XLSX15 . ' ' . \PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_TIME4; + $formatting = \PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_XLSX15 . ' ' . \PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_TIME4; } else { - $formatting = \PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_XLSX15; + $formatting = \PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_XLSX15; } break; case 'time': - $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; + $type = \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_NUMERIC; + $dataValue = \PhpOffice\PhpSpreadsheet\Shared\Date::PHPToExcel(strtotime('01-01-1970 ' . implode(':', sscanf($cellDataOfficeAttributes['time-value'], 'PT%dH%dM%dS')))); + $formatting = \PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_TIME4; break; } } else { - $type = \PhpSpreadsheet\Cell\DataType::TYPE_NULL; + $type = \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_NULL; $dataValue = null; } if ($hasCalculatedValue) { - $type = \PhpSpreadsheet\Cell\DataType::TYPE_FORMULA; + $type = \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_FORMULA; $cellDataFormula = substr($cellDataFormula, strpos($cellDataFormula, ':=') + 1); $temp = explode('"', $cellDataFormula); $tKey = false; @@ -567,7 +567,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 = \PhpSpreadsheet\Calculation::translateSeparator(';', ',', $value, $inBraces); + $value = \PhpOffice\PhpSpreadsheet\Calculation::translateSeparator(';', ',', $value, $inBraces); } } unset($value); @@ -581,7 +581,7 @@ class OOCalc extends BaseReader implements IReader if ($i > 0) { ++$columnID; } - if ($type !== \PhpSpreadsheet\Cell\DataType::TYPE_NULL) { + if ($type !== \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_NULL) { for ($rowAdjust = 0; $rowAdjust < $rowRepeats; ++$rowAdjust) { $rID = $rowID + $rowAdjust; $spreadsheet->getActiveSheet()->getCell($columnID . $rID)->setValueExplicit((($hasCalculatedValue) ? $cellDataFormula : $dataValue), $type); @@ -591,7 +591,7 @@ class OOCalc extends BaseReader implements IReader if ($formatting !== null) { $spreadsheet->getActiveSheet()->getStyle($columnID . $rID)->getNumberFormat()->setFormatCode($formatting); } else { - $spreadsheet->getActiveSheet()->getStyle($columnID . $rID)->getNumberFormat()->setFormatCode(\PhpSpreadsheet\Style\NumberFormat::FORMAT_GENERAL); + $spreadsheet->getActiveSheet()->getStyle($columnID . $rID)->getNumberFormat()->setFormatCode(\PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_GENERAL); } if ($hyperlink !== null) { $spreadsheet->getActiveSheet()->getCell($columnID . $rID)->getHyperlink()->setUrl($hyperlink); @@ -603,10 +603,10 @@ class OOCalc extends BaseReader implements IReader // Merged cells if ((isset($cellDataTableAttributes['number-columns-spanned'])) || (isset($cellDataTableAttributes['number-rows-spanned']))) { - if (($type !== \PhpSpreadsheet\Cell\DataType::TYPE_NULL) || (!$this->readDataOnly)) { + if (($type !== \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_NULL) || (!$this->readDataOnly)) { $columnTo = $columnID; if (isset($cellDataTableAttributes['number-columns-spanned'])) { - $columnTo = \PhpSpreadsheet\Cell::stringFromColumnIndex(\PhpSpreadsheet\Cell::columnIndexFromString($columnID) + $cellDataTableAttributes['number-columns-spanned'] - 2); + $columnTo = \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex(\PhpOffice\PhpSpreadsheet\Cell::columnIndexFromString($columnID) + $cellDataTableAttributes['number-columns-spanned'] - 2); } $rowTo = $rowID; if (isset($cellDataTableAttributes['number-rows-spanned'])) { @@ -633,7 +633,7 @@ class OOCalc extends BaseReader implements IReader private function parseRichText($is = '') { - $value = new \PhpSpreadsheet\RichText(); + $value = new \PhpOffice\PhpSpreadsheet\RichText(); $value->createText($is); diff --git a/src/PhpSpreadsheet/Reader/SYLK.php b/src/PhpSpreadsheet/Reader/SYLK.php index 4c68249f..4832e892 100644 --- a/src/PhpSpreadsheet/Reader/SYLK.php +++ b/src/PhpSpreadsheet/Reader/SYLK.php @@ -1,6 +1,6 @@ loadIntoExisting($pFilename, $spreadsheet); @@ -198,11 +198,11 @@ class SYLK extends BaseReader implements IReader * Loads PhpSpreadsheet from file into PhpSpreadsheet instance * * @param string $pFilename - * @param \PhpSpreadsheet\Spreadsheet $spreadsheet + * @param \PhpOffice\PhpSpreadsheet\Spreadsheet $spreadsheet * @throws Exception - * @return \PhpSpreadsheet\Spreadsheet + * @return \PhpOffice\PhpSpreadsheet\Spreadsheet */ - public function loadIntoExisting($pFilename, \PhpSpreadsheet\Spreadsheet $spreadsheet) + public function loadIntoExisting($pFilename, \PhpOffice\PhpSpreadsheet\Spreadsheet $spreadsheet) { // Open file $this->openFile($pFilename); @@ -229,7 +229,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 = \PhpSpreadsheet\Shared\StringHelper::SYLKtoUTF8($rowData); + $rowData = \PhpOffice\PhpSpreadsheet\Shared\StringHelper::SYLKtoUTF8($rowData); // explode each row at semicolons while taking into account that literal semicolon (;) // is escaped like this (;;) @@ -262,16 +262,16 @@ class SYLK extends BaseReader implements IReader $formatArray['font']['bold'] = true; break; case 'T': - $formatArray['borders']['top']['style'] = \PhpSpreadsheet\Style\Border::BORDER_THIN; + $formatArray['borders']['top']['style'] = \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_THIN; break; case 'B': - $formatArray['borders']['bottom']['style'] = \PhpSpreadsheet\Style\Border::BORDER_THIN; + $formatArray['borders']['bottom']['style'] = \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_THIN; break; case 'L': - $formatArray['borders']['left']['style'] = \PhpSpreadsheet\Style\Border::BORDER_THIN; + $formatArray['borders']['left']['style'] = \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_THIN; break; case 'R': - $formatArray['borders']['right']['style'] = \PhpSpreadsheet\Style\Border::BORDER_THIN; + $formatArray['borders']['right']['style'] = \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_THIN; break; } } @@ -330,7 +330,7 @@ class SYLK extends BaseReader implements IReader if ($columnReference{0} == '[') { $columnReference = $column + trim($columnReference, '[]'); } - $A1CellReference = \PhpSpreadsheet\Cell::stringFromColumnIndex($columnReference - 1) . $rowReference; + $A1CellReference = \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($columnReference - 1) . $rowReference; $value = substr_replace($value, $A1CellReference, $cellReference[0][1], strlen($cellReference[0][0])); } @@ -343,13 +343,13 @@ class SYLK extends BaseReader implements IReader break; } } - $columnLetter = \PhpSpreadsheet\Cell::stringFromColumnIndex($column - 1); - $cellData = \PhpSpreadsheet\Calculation::unwrapResult($cellData); + $columnLetter = \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($column - 1); + $cellData = \PhpOffice\PhpSpreadsheet\Calculation::unwrapResult($cellData); // Set cell value $spreadsheet->getActiveSheet()->getCell($columnLetter . $row)->setValue(($hasCalculatedValue) ? $cellDataFormula : $cellData); if ($hasCalculatedValue) { - $cellData = \PhpSpreadsheet\Calculation::unwrapResult($cellData); + $cellData = \PhpOffice\PhpSpreadsheet\Calculation::unwrapResult($cellData); $spreadsheet->getActiveSheet()->getCell($columnLetter . $row)->setCalculatedValue($cellData); } // Read cell formatting @@ -383,16 +383,16 @@ class SYLK extends BaseReader implements IReader $styleData['font']['bold'] = true; break; case 'T': - $styleData['borders']['top']['style'] = \PhpSpreadsheet\Style\Border::BORDER_THIN; + $styleData['borders']['top']['style'] = \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_THIN; break; case 'B': - $styleData['borders']['bottom']['style'] = \PhpSpreadsheet\Style\Border::BORDER_THIN; + $styleData['borders']['bottom']['style'] = \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_THIN; break; case 'L': - $styleData['borders']['left']['style'] = \PhpSpreadsheet\Style\Border::BORDER_THIN; + $styleData['borders']['left']['style'] = \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_THIN; break; case 'R': - $styleData['borders']['right']['style'] = \PhpSpreadsheet\Style\Border::BORDER_THIN; + $styleData['borders']['right']['style'] = \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_THIN; break; } } @@ -400,22 +400,22 @@ class SYLK extends BaseReader implements IReader } } if (($formatStyle > '') && ($column > '') && ($row > '')) { - $columnLetter = \PhpSpreadsheet\Cell::stringFromColumnIndex($column - 1); + $columnLetter = \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($column - 1); if (isset($this->formats[$formatStyle])) { $spreadsheet->getActiveSheet()->getStyle($columnLetter . $row)->applyFromArray($this->formats[$formatStyle]); } } if ((!empty($styleData)) && ($column > '') && ($row > '')) { - $columnLetter = \PhpSpreadsheet\Cell::stringFromColumnIndex($column - 1); + $columnLetter = \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($column - 1); $spreadsheet->getActiveSheet()->getStyle($columnLetter . $row)->applyFromArray($styleData); } if ($columnWidth > '') { if ($startCol == $endCol) { - $startCol = \PhpSpreadsheet\Cell::stringFromColumnIndex($startCol - 1); + $startCol = \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($startCol - 1); $spreadsheet->getActiveSheet()->getColumnDimension($startCol)->setWidth($columnWidth); } else { - $startCol = \PhpSpreadsheet\Cell::stringFromColumnIndex($startCol - 1); - $endCol = \PhpSpreadsheet\Cell::stringFromColumnIndex($endCol - 1); + $startCol = \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($startCol - 1); + $endCol = \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($endCol - 1); $spreadsheet->getActiveSheet()->getColumnDimension($startCol)->setWidth($columnWidth); do { $spreadsheet->getActiveSheet()->getColumnDimension(++$startCol)->setWidth($columnWidth); diff --git a/src/PhpSpreadsheet/ReferenceHelper.php b/src/PhpSpreadsheet/ReferenceHelper.php index 16bfca8b..03a945f3 100644 --- a/src/PhpSpreadsheet/ReferenceHelper.php +++ b/src/PhpSpreadsheet/ReferenceHelper.php @@ -1,6 +1,6 @@ richTextElements = $pElements; } else { - throw new Exception("Invalid \PhpSpreadsheet\RichText\ITextElement[] array passed."); + throw new Exception("Invalid \PhpOffice\PhpSpreadsheet\RichText\ITextElement[] array passed."); } return $this; diff --git a/src/PhpSpreadsheet/RichText/ITextElement.php b/src/PhpSpreadsheet/RichText/ITextElement.php index 749c2567..c2d36825 100644 --- a/src/PhpSpreadsheet/RichText/ITextElement.php +++ b/src/PhpSpreadsheet/RichText/ITextElement.php @@ -1,6 +1,6 @@ setText($pText); - $this->font = new \PhpSpreadsheet\Style\Font(); + $this->font = new \PhpOffice\PhpSpreadsheet\Style\Font(); } /** * Get font * - * @return \PhpSpreadsheet\Style\Font + * @return \PhpOffice\PhpSpreadsheet\Style\Font */ public function getFont() { @@ -56,11 +56,11 @@ class Run extends TextElement implements ITextElement /** * Set font * - * @param \PhpSpreadsheet\Style\Font $pFont Font - * @throws \PhpSpreadsheet\Exception + * @param \PhpOffice\PhpSpreadsheet\Style\Font $pFont Font + * @throws \PhpOffice\PhpSpreadsheet\Exception * @return ITextElement */ - public function setFont(\PhpSpreadsheet\Style\Font $pFont = null) + public function setFont(\PhpOffice\PhpSpreadsheet\Style\Font $pFont = null) { $this->font = $pFont; diff --git a/src/PhpSpreadsheet/RichText/TextElement.php b/src/PhpSpreadsheet/RichText/TextElement.php index f7789930..761ee273 100644 --- a/src/PhpSpreadsheet/RichText/TextElement.php +++ b/src/PhpSpreadsheet/RichText/TextElement.php @@ -1,6 +1,6 @@ getWorksheet()->getStyle( @@ -331,10 +331,10 @@ class Date /** * Is a given number format a date/time? * - * @param \PhpSpreadsheet\Style\NumberFormat $pFormat + * @param \PhpOffice\PhpSpreadsheet\Style\NumberFormat $pFormat * @return bool */ - public static function isDateTimeFormat(\PhpSpreadsheet\Style\NumberFormat $pFormat) + public static function isDateTimeFormat(\PhpOffice\PhpSpreadsheet\Style\NumberFormat $pFormat) { return self::isDateTimeFormatCode($pFormat->getFormatCode()); } @@ -349,7 +349,7 @@ class Date */ public static function isDateTimeFormatCode($pFormatCode = '') { - if (strtolower($pFormatCode) === strtolower(\PhpSpreadsheet\Style\NumberFormat::FORMAT_GENERAL)) { + if (strtolower($pFormatCode) === strtolower(\PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_GENERAL)) { // "General" contains an epoch letter 'e', so we trap for it explicitly here (case-insensitive check) return false; } @@ -361,28 +361,28 @@ class Date // Switch on formatcode switch ($pFormatCode) { // Explicitly defined date formats - 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: + case \PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_YYYYMMDD: + case \PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_YYYYMMDD2: + case \PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_DDMMYYYY: + case \PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_DMYSLASH: + case \PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_DMYMINUS: + case \PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_DMMINUS: + case \PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_MYMINUS: + case \PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_DATETIME: + case \PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_TIME1: + case \PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_TIME2: + case \PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_TIME3: + case \PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_TIME4: + case \PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_TIME5: + case \PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_TIME6: + case \PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_TIME7: + case \PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_TIME8: + case \PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_YYYYMMDDSLASH: + case \PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_XLSX14: + case \PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_XLSX15: + case \PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_XLSX16: + case \PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_XLSX17: + case \PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_XLSX22: return true; } @@ -429,15 +429,15 @@ class Date return false; } - $dateValueNew = \PhpSpreadsheet\Calculation\DateTime::DATEVALUE($dateValue); + $dateValueNew = \PhpOffice\PhpSpreadsheet\Calculation\DateTime::DATEVALUE($dateValue); - if ($dateValueNew === \PhpSpreadsheet\Calculation\Functions::VALUE()) { + if ($dateValueNew === \PhpOffice\PhpSpreadsheet\Calculation\Functions::VALUE()) { return false; } if (strpos($dateValue, ':') !== false) { - $timeValue = \PhpSpreadsheet\Calculation\DateTime::TIMEVALUE($dateValue); - if ($timeValue === \PhpSpreadsheet\Calculation\Functions::VALUE()) { + $timeValue = \PhpOffice\PhpSpreadsheet\Calculation\DateTime::TIMEVALUE($dateValue); + if ($timeValue === \PhpOffice\PhpSpreadsheet\Calculation\Functions::VALUE()) { return false; } $dateValueNew += $timeValue; diff --git a/src/PhpSpreadsheet/Shared/Drawing.php b/src/PhpSpreadsheet/Shared/Drawing.php index 6afbdf89..b8b60a41 100644 --- a/src/PhpSpreadsheet/Shared/Drawing.php +++ b/src/PhpSpreadsheet/Shared/Drawing.php @@ -1,6 +1,6 @@ getName(); $size = $pDefaultFont->getSize(); - if (isset(\PhpSpreadsheet\Shared\Font::$defaultColumnWidths[$name][$size])) { + if (isset(\PhpOffice\PhpSpreadsheet\Shared\Font::$defaultColumnWidths[$name][$size])) { // Exact width can be determined - $colWidth = $pValue * \PhpSpreadsheet\Shared\Font::$defaultColumnWidths[$name][$size]['width'] / \PhpSpreadsheet\Shared\Font::$defaultColumnWidths[$name][$size]['px']; + $colWidth = $pValue * \PhpOffice\PhpSpreadsheet\Shared\Font::$defaultColumnWidths[$name][$size]['width'] / \PhpOffice\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 * \PhpSpreadsheet\Shared\Font::$defaultColumnWidths['Calibri'][11]['width'] / \PhpSpreadsheet\Shared\Font::$defaultColumnWidths['Calibri'][11]['px'] / $size; + $colWidth = $pValue * 11 * \PhpOffice\PhpSpreadsheet\Shared\Font::$defaultColumnWidths['Calibri'][11]['width'] / \PhpOffice\PhpSpreadsheet\Shared\Font::$defaultColumnWidths['Calibri'][11]['px'] / $size; } return $colWidth; @@ -83,22 +83,22 @@ class Drawing * Convert column width from (intrinsic) Excel units to pixels * * @param float $pValue Value in cell dimension - * @param \PhpSpreadsheet\Style\Font $pDefaultFont Default font of the workbook + * @param \PhpOffice\PhpSpreadsheet\Style\Font $pDefaultFont Default font of the workbook * @return int Value in pixels */ - public static function cellDimensionToPixels($pValue, \PhpSpreadsheet\Style\Font $pDefaultFont) + public static function cellDimensionToPixels($pValue, \PhpOffice\PhpSpreadsheet\Style\Font $pDefaultFont) { // Font name and size $name = $pDefaultFont->getName(); $size = $pDefaultFont->getSize(); - if (isset(\PhpSpreadsheet\Shared\Font::$defaultColumnWidths[$name][$size])) { + if (isset(\PhpOffice\PhpSpreadsheet\Shared\Font::$defaultColumnWidths[$name][$size])) { // Exact width can be determined - $colWidth = $pValue * \PhpSpreadsheet\Shared\Font::$defaultColumnWidths[$name][$size]['px'] / \PhpSpreadsheet\Shared\Font::$defaultColumnWidths[$name][$size]['width']; + $colWidth = $pValue * \PhpOffice\PhpSpreadsheet\Shared\Font::$defaultColumnWidths[$name][$size]['px'] / \PhpOffice\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 * \PhpSpreadsheet\Shared\Font::$defaultColumnWidths['Calibri'][11]['px'] / \PhpSpreadsheet\Shared\Font::$defaultColumnWidths['Calibri'][11]['width'] / 11; + $colWidth = $pValue * $size * \PhpOffice\PhpSpreadsheet\Shared\Font::$defaultColumnWidths['Calibri'][11]['px'] / \PhpOffice\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 3a233905..35a01387 100644 --- a/src/PhpSpreadsheet/Shared/Escher.php +++ b/src/PhpSpreadsheet/Shared/Escher.php @@ -1,6 +1,6 @@ getParent(); - while ($parent instanceof \PhpSpreadsheet\Shared\Escher\DgContainer\SpgrContainer) { + while ($parent instanceof \PhpOffice\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 3b573661..e0397233 100644 --- a/src/PhpSpreadsheet/Shared/Escher/DggContainer.php +++ b/src/PhpSpreadsheet/Shared/Escher/DggContainer.php @@ -1,6 +1,6 @@ getWidth(); - $pixelWidth = \PhpSpreadsheet\Shared\Drawing::cellDimensionToPixels($width, $font); + $pixelWidth = \PhpOffice\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 = \PhpSpreadsheet\Shared\Drawing::cellDimensionToPixels($width, $font); + $pixelWidth = \PhpOffice\PhpSpreadsheet\Shared\Drawing::cellDimensionToPixels($width, $font); } else { // we don't even have any default column dimension. Width depends on default font - $pixelWidth = \PhpSpreadsheet\Shared\Font::getDefaultColumnWidthByFont($font, true); + $pixelWidth = \PhpOffice\PhpSpreadsheet\Shared\Font::getDefaultColumnWidthByFont($font, true); } // now find the effective column width in pixels @@ -73,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 \PhpSpreadsheet\Worksheet $sheet The sheet + * @param \PhpOffice\PhpSpreadsheet\Worksheet $sheet The sheet * @param int $row The row index (1-based) * @return int The width in pixels */ @@ -94,11 +94,11 @@ class Excel5 // then we have a default row dimension with explicit height $defaultRowDimension = $sheet->getDefaultRowDimension(); $rowHeight = $defaultRowDimension->getRowHeight(); - $pixelRowHeight = \PhpSpreadsheet\Shared\Drawing::pointsToPixels($rowHeight); + $pixelRowHeight = \PhpOffice\PhpSpreadsheet\Shared\Drawing::pointsToPixels($rowHeight); } else { // we don't even have any default row dimension. Height depends on default font - $pointRowHeight = \PhpSpreadsheet\Shared\Font::getDefaultRowHeightByFont($font); - $pixelRowHeight = \PhpSpreadsheet\Shared\Font::fontSizeToPixels($pointRowHeight); + $pointRowHeight = \PhpOffice\PhpSpreadsheet\Shared\Font::getDefaultRowHeightByFont($font); + $pixelRowHeight = \PhpOffice\PhpSpreadsheet\Shared\Font::fontSizeToPixels($pointRowHeight); } // now find the effective row height in pixels @@ -115,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 \PhpSpreadsheet\Worksheet $sheet + * @param \PhpOffice\PhpSpreadsheet\Worksheet $sheet * @param string $startColumn * @param int $startOffsetX Offset within start cell measured in 1/1024 of the cell width * @param string $endColumn * @param int $endOffsetX Offset within end cell measured in 1/1024 of the cell width * @return int Horizontal measured in pixels */ - public static function getDistanceX(\PhpSpreadsheet\Worksheet $sheet, $startColumn = 'A', $startOffsetX = 0, $endColumn = 'A', $endOffsetX = 0) + public static function getDistanceX(\PhpOffice\PhpSpreadsheet\Worksheet $sheet, $startColumn = 'A', $startOffsetX = 0, $endColumn = 'A', $endOffsetX = 0) { $distanceX = 0; // add the widths of the spanning columns - $startColumnIndex = \PhpSpreadsheet\Cell::columnIndexFromString($startColumn) - 1; // 1-based - $endColumnIndex = \PhpSpreadsheet\Cell::columnIndexFromString($endColumn) - 1; // 1-based + $startColumnIndex = \PhpOffice\PhpSpreadsheet\Cell::columnIndexFromString($startColumn) - 1; // 1-based + $endColumnIndex = \PhpOffice\PhpSpreadsheet\Cell::columnIndexFromString($endColumn) - 1; // 1-based for ($i = $startColumnIndex; $i <= $endColumnIndex; ++$i) { - $distanceX += self::sizeCol($sheet, \PhpSpreadsheet\Cell::stringFromColumnIndex($i)); + $distanceX += self::sizeCol($sheet, \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($i)); } // correct for offsetX in startcell @@ -146,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 \PhpSpreadsheet\Worksheet $sheet + * @param \PhpOffice\PhpSpreadsheet\Worksheet $sheet * @param int $startRow (1-based) * @param int $startOffsetY Offset within start cell measured in 1/256 of the cell height * @param int $endRow (1-based) * @param int $endOffsetY Offset within end cell measured in 1/256 of the cell height * @return int Vertical distance measured in pixels */ - public static function getDistanceY(\PhpSpreadsheet\Worksheet $sheet, $startRow = 1, $startOffsetY = 0, $endRow = 1, $endOffsetY = 0) + public static function getDistanceY(\PhpOffice\PhpSpreadsheet\Worksheet $sheet, $startRow = 1, $startOffsetY = 0, $endRow = 1, $endOffsetY = 0) { $distanceY = 0; @@ -215,7 +215,7 @@ class Excel5 * W is the width of the cell * H is the height of the cell * - * @param \PhpSpreadsheet\Worksheet $sheet + * @param \PhpOffice\PhpSpreadsheet\Worksheet $sheet * @param string $coordinates E.g. 'A1' * @param int $offsetX Horizontal offset in pixels * @param int $offsetY Vertical offset in pixels @@ -225,8 +225,8 @@ class Excel5 */ public static function oneAnchor2twoAnchor($sheet, $coordinates, $offsetX, $offsetY, $width, $height) { - list($column, $row) = \PhpSpreadsheet\Cell::coordinateFromString($coordinates); - $col_start = \PhpSpreadsheet\Cell::columnIndexFromString($column) - 1; + list($column, $row) = \PhpOffice\PhpSpreadsheet\Cell::coordinateFromString($coordinates); + $col_start = \PhpOffice\PhpSpreadsheet\Cell::columnIndexFromString($column) - 1; $row_start = $row - 1; $x1 = $offsetX; @@ -237,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, \PhpSpreadsheet\Cell::stringFromColumnIndex($col_start))) { + if ($x1 >= self::sizeCol($sheet, \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($col_start))) { $x1 = 0; } if ($y1 >= self::sizeRow($sheet, $row_start + 1)) { @@ -248,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, \PhpSpreadsheet\Cell::stringFromColumnIndex($col_end))) { - $width -= self::sizeCol($sheet, \PhpSpreadsheet\Cell::stringFromColumnIndex($col_end)); + while ($width >= self::sizeCol($sheet, \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($col_end))) { + $width -= self::sizeCol($sheet, \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($col_end)); ++$col_end; } @@ -261,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, \PhpSpreadsheet\Cell::stringFromColumnIndex($col_start)) == 0) { + if (self::sizeCol($sheet, \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($col_start)) == 0) { return; } - if (self::sizeCol($sheet, \PhpSpreadsheet\Cell::stringFromColumnIndex($col_end)) == 0) { + if (self::sizeCol($sheet, \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($col_end)) == 0) { return; } if (self::sizeRow($sheet, $row_start + 1) == 0) { @@ -275,13 +275,13 @@ class Excel5 } // Convert the pixel values to the percentage value expected by Excel - $x1 = $x1 / self::sizeCol($sheet, \PhpSpreadsheet\Cell::stringFromColumnIndex($col_start)) * 1024; + $x1 = $x1 / self::sizeCol($sheet, \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($col_start)) * 1024; $y1 = $y1 / self::sizeRow($sheet, $row_start + 1) * 256; - $x2 = ($width + 1) / self::sizeCol($sheet, \PhpSpreadsheet\Cell::stringFromColumnIndex($col_end)) * 1024; // Distance to right side of object + $x2 = ($width + 1) / self::sizeCol($sheet, \PhpOffice\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 = \PhpSpreadsheet\Cell::stringFromColumnIndex($col_start) . ($row_start + 1); - $endCoordinates = \PhpSpreadsheet\Cell::stringFromColumnIndex($col_end) . ($row_end + 1); + $startCoordinates = \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($col_start) . ($row_start + 1); + $endCoordinates = \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($col_end) . ($row_end + 1); $twoAnchor = [ 'startCoordinates' => $startCoordinates, diff --git a/src/PhpSpreadsheet/Shared/File.php b/src/PhpSpreadsheet/Shared/File.php index ebb0e7f3..9e6047a2 100644 --- a/src/PhpSpreadsheet/Shared/File.php +++ b/src/PhpSpreadsheet/Shared/File.php @@ -1,6 +1,6 @@ open($zipFile) === true) { $returnValue = ($zip->getFromName($archiveFile) !== false); diff --git a/src/PhpSpreadsheet/Shared/Font.php b/src/PhpSpreadsheet/Shared/Font.php index 3c029ac0..2b399818 100644 --- a/src/PhpSpreadsheet/Shared/Font.php +++ b/src/PhpSpreadsheet/Shared/Font.php @@ -1,6 +1,6 @@ getPlainText(); } @@ -266,7 +266,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 (\PhpSpreadsheet\Exception $e) { + } catch (\PhpOffice\PhpSpreadsheet\Exception $e) { $approximate = true; } } @@ -289,15 +289,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 \PhpSpreadsheet\Style\Font + * @param \PhpOffice\PhpSpreadsheet\Style\Font * @param int $rotation - * @throws \PhpSpreadsheet\Exception + * @throws \PhpOffice\PhpSpreadsheet\Exception * @return int */ - public static function getTextWidthPixelsExact($text, \PhpSpreadsheet\Style\Font $font, $rotation = 0) + public static function getTextWidthPixelsExact($text, \PhpOffice\PhpSpreadsheet\Style\Font $font, $rotation = 0) { if (!function_exists('imagettfbbox')) { - throw new \PhpSpreadsheet\Exception('GD library needs to be enabled'); + throw new \PhpOffice\PhpSpreadsheet\Exception('GD library needs to be enabled'); } // font size should really be supplied in pixels in GD2, @@ -321,11 +321,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 \PhpSpreadsheet\Style\Font $font + * @param \PhpOffice\PhpSpreadsheet\Style\Font $font * @param int $rotation * @return int Text width in pixels (no padding added) */ - public static function getTextWidthPixelsApprox($columnText, \PhpSpreadsheet\Style\Font $font = null, $rotation = 0) + public static function getTextWidthPixelsApprox($columnText, \PhpOffice\PhpSpreadsheet\Style\Font $font = null, $rotation = 0) { $fontName = $font->getName(); $fontSize = $font->getSize(); @@ -409,13 +409,13 @@ class Font /** * Returns the font path given the font * - * @param \PhpSpreadsheet\Style\Font $font + * @param \PhpOffice\PhpSpreadsheet\Style\Font $font * @return string Path to TrueType font file */ public static function getTrueTypeFontFileFromFont($font) { if (!file_exists(self::$trueTypeFontPath) || !is_dir(self::$trueTypeFontPath)) { - throw new \PhpSpreadsheet\Exception('Valid directory to TrueType Font files not specified'); + throw new \PhpOffice\PhpSpreadsheet\Exception('Valid directory to TrueType Font files not specified'); } $name = $font->getName(); @@ -504,7 +504,7 @@ class Font ); break; default: - throw new \PhpSpreadsheet\Exception('Unknown font name "' . $name . '". Cannot map to TrueType font file'); + throw new \PhpOffice\PhpSpreadsheet\Exception('Unknown font name "' . $name . '". Cannot map to TrueType font file'); break; } @@ -512,7 +512,7 @@ class Font // Check if file actually exists if (!file_exists($fontFile)) { - throw new \PhpSpreadsheet\Exception('TrueType Font file not found'); + throw new \PhpOffice\PhpSpreadsheet\Exception('TrueType Font file not found'); } return $fontFile; @@ -545,11 +545,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 \PhpSpreadsheet\Style\Font $font The workbooks default font + * @param \PhpOffice\PhpSpreadsheet\Style\Font $font The workbooks default font * @param bool $pPixels true = return column width in pixels, false = return in OOXML units * @return mixed Column width */ - public static function getDefaultColumnWidthByFont(\PhpSpreadsheet\Style\Font $font, $pPixels = false) + public static function getDefaultColumnWidthByFont(\PhpOffice\PhpSpreadsheet\Style\Font $font, $pPixels = false) { if (isset(self::$defaultColumnWidths[$font->getName()][$font->getSize()])) { // Exact width can be determined @@ -577,10 +577,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 \PhpSpreadsheet\Style\Font $font The workbooks default font + * @param \PhpOffice\PhpSpreadsheet\Style\Font $font The workbooks default font * @return float Row height in points */ - public static function getDefaultRowHeightByFont(\PhpSpreadsheet\Style\Font $font) + public static function getDefaultRowHeightByFont(\PhpOffice\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 2f1d1579..65152a57 100644 --- a/src/PhpSpreadsheet/Shared/JAMA/CholeskyDecomposition.php +++ b/src/PhpSpreadsheet/Shared/JAMA/CholeskyDecomposition.php @@ -1,6 +1,6 @@ m, $nx); } else { - throw new \PhpSpreadsheet\Calculation\Exception(JAMAError(MatrixSPDException)); + throw new \PhpOffice\PhpSpreadsheet\Calculation\Exception(JAMAError(MatrixSPDException)); } } else { - throw new \PhpSpreadsheet\Calculation\Exception(JAMAError(MATRIX_DIMENSION_EXCEPTION)); + throw new \PhpOffice\PhpSpreadsheet\Calculation\Exception(JAMAError(MATRIX_DIMENSION_EXCEPTION)); } } else { - throw new \PhpSpreadsheet\Calculation\Exception(JAMAError(ARGUMENT_TYPE_EXCEPTION)); + throw new \PhpOffice\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 932c66cb..ad69ec48 100644 --- a/src/PhpSpreadsheet/Shared/JAMA/EigenvalueDecomposition.php +++ b/src/PhpSpreadsheet/Shared/JAMA/EigenvalueDecomposition.php @@ -1,6 +1,6 @@ = n, the LU decomposition is an m-by-n @@ -116,7 +116,7 @@ class LUDecomposition } } } else { - throw new \PhpSpreadsheet\Calculation\Exception(Matrix::ARGUMENT_TYPE_EXCEPTION); + throw new \PhpOffice\PhpSpreadsheet\Calculation\Exception(Matrix::ARGUMENT_TYPE_EXCEPTION); } } // function __construct() @@ -213,7 +213,7 @@ class LUDecomposition return $d; } else { - throw new \PhpSpreadsheet\Calculation\Exception(Matrix::MATRIX_DIMENSION_EXCEPTION); + throw new \PhpOffice\PhpSpreadsheet\Calculation\Exception(Matrix::MATRIX_DIMENSION_EXCEPTION); } } // function det() @@ -221,9 +221,9 @@ class LUDecomposition * Solve A*X = B * * @param $B A Matrix with as many rows as A and any number of columns. + * @throws \PhpOffice\PhpSpreadsheet\Calculation\Exception IllegalArgumentException Matrix row dimensions must agree. + * @throws \PhpOffice\PhpSpreadsheet\Calculation\Exception RuntimeException Matrix is singular. * @return X so that L*U*X = B(piv,:) - * @\PhpSpreadsheet\Calculation\Exception IllegalArgumentException Matrix row dimensions must agree. - * @\PhpSpreadsheet\Calculation\Exception RuntimeException Matrix is singular. */ public function solve($B) { @@ -254,10 +254,10 @@ class LUDecomposition return $X; } else { - throw new \PhpSpreadsheet\Calculation\Exception(self::MATRIX_SINGULAR_EXCEPTION); + throw new \PhpOffice\PhpSpreadsheet\Calculation\Exception(self::MATRIX_SINGULAR_EXCEPTION); } } else { - throw new \PhpSpreadsheet\Calculation\Exception(self::MATRIX_SQUARE_EXCEPTION); + throw new \PhpOffice\PhpSpreadsheet\Calculation\Exception(self::MATRIX_SQUARE_EXCEPTION); } } } diff --git a/src/PhpSpreadsheet/Shared/JAMA/Matrix.php b/src/PhpSpreadsheet/Shared/JAMA/Matrix.php index ab1c5157..2c2687a6 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 \PhpSpreadsheet\Calculation\Exception(self::ARGUMENT_BOUNDS_EXCEPTION); + throw new \PhpOffice\PhpSpreadsheet\Calculation\Exception(self::ARGUMENT_BOUNDS_EXCEPTION); } if ($j0 >= 0) { $n = $this->n - $j0; } else { - throw new \PhpSpreadsheet\Calculation\Exception(self::ARGUMENT_BOUNDS_EXCEPTION); + throw new \PhpOffice\PhpSpreadsheet\Calculation\Exception(self::ARGUMENT_BOUNDS_EXCEPTION); } $R = new self($m, $n); for ($i = $i0; $i < $this->m; ++$i) { @@ -187,12 +187,12 @@ class Matrix if (($iF > $i0) && ($this->m >= $iF) && ($i0 >= 0)) { $m = $iF - $i0; } else { - throw new \PhpSpreadsheet\Calculation\Exception(self::ARGUMENT_BOUNDS_EXCEPTION); + throw new \PhpOffice\PhpSpreadsheet\Calculation\Exception(self::ARGUMENT_BOUNDS_EXCEPTION); } if (($jF > $j0) && ($this->n >= $jF) && ($j0 >= 0)) { $n = $jF - $j0; } else { - throw new \PhpSpreadsheet\Calculation\Exception(self::ARGUMENT_BOUNDS_EXCEPTION); + throw new \PhpOffice\PhpSpreadsheet\Calculation\Exception(self::ARGUMENT_BOUNDS_EXCEPTION); } $R = new self($m + 1, $n + 1); for ($i = $i0; $i <= $iF; ++$i) { @@ -209,12 +209,12 @@ class Matrix if (count($RL) > 0) { $m = count($RL); } else { - throw new \PhpSpreadsheet\Calculation\Exception(self::ARGUMENT_BOUNDS_EXCEPTION); + throw new \PhpOffice\PhpSpreadsheet\Calculation\Exception(self::ARGUMENT_BOUNDS_EXCEPTION); } if (count($CL) > 0) { $n = count($CL); } else { - throw new \PhpSpreadsheet\Calculation\Exception(self::ARGUMENT_BOUNDS_EXCEPTION); + throw new \PhpOffice\PhpSpreadsheet\Calculation\Exception(self::ARGUMENT_BOUNDS_EXCEPTION); } $R = new self($m, $n); for ($i = 0; $i < $m; ++$i) { @@ -231,12 +231,12 @@ class Matrix if (count($RL) > 0) { $m = count($RL); } else { - throw new \PhpSpreadsheet\Calculation\Exception(self::ARGUMENT_BOUNDS_EXCEPTION); + throw new \PhpOffice\PhpSpreadsheet\Calculation\Exception(self::ARGUMENT_BOUNDS_EXCEPTION); } if (count($CL) > 0) { $n = count($CL); } else { - throw new \PhpSpreadsheet\Calculation\Exception(self::ARGUMENT_BOUNDS_EXCEPTION); + throw new \PhpOffice\PhpSpreadsheet\Calculation\Exception(self::ARGUMENT_BOUNDS_EXCEPTION); } $R = new self($m, $n); for ($i = 0; $i < $m; ++$i) { @@ -253,12 +253,12 @@ class Matrix if (($iF > $i0) && ($this->m >= $iF) && ($i0 >= 0)) { $m = $iF - $i0; } else { - throw new \PhpSpreadsheet\Calculation\Exception(self::ARGUMENT_BOUNDS_EXCEPTION); + throw new \PhpOffice\PhpSpreadsheet\Calculation\Exception(self::ARGUMENT_BOUNDS_EXCEPTION); } if (count($CL) > 0) { $n = count($CL); } else { - throw new \PhpSpreadsheet\Calculation\Exception(self::ARGUMENT_BOUNDS_EXCEPTION); + throw new \PhpOffice\PhpSpreadsheet\Calculation\Exception(self::ARGUMENT_BOUNDS_EXCEPTION); } $R = new self($m, $n); for ($i = $i0; $i < $iF; ++$i) { @@ -275,12 +275,12 @@ class Matrix if (count($RL) > 0) { $m = count($RL); } else { - throw new \PhpSpreadsheet\Calculation\Exception(self::ARGUMENT_BOUNDS_EXCEPTION); + throw new \PhpOffice\PhpSpreadsheet\Calculation\Exception(self::ARGUMENT_BOUNDS_EXCEPTION); } if (($jF >= $j0) && ($this->n >= $jF) && ($j0 >= 0)) { $n = $jF - $j0; } else { - throw new \PhpSpreadsheet\Calculation\Exception(self::ARGUMENT_BOUNDS_EXCEPTION); + throw new \PhpOffice\PhpSpreadsheet\Calculation\Exception(self::ARGUMENT_BOUNDS_EXCEPTION); } $R = new self($m, $n + 1); for ($i = 0; $i < $m; ++$i) { @@ -292,11 +292,11 @@ class Matrix return $R; break; default: - throw new \PhpSpreadsheet\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + throw new \PhpOffice\PhpSpreadsheet\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); break; } } else { - throw new \PhpSpreadsheet\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + throw new \PhpOffice\PhpSpreadsheet\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); } } @@ -313,10 +313,10 @@ class Matrix if (($this->m == $B->getRowDimension()) && ($this->n == $B->getColumnDimension())) { return true; } else { - throw new \PhpSpreadsheet\Calculation\Exception(self::MATRIX_DIMENSION_EXCEPTION); + throw new \PhpOffice\PhpSpreadsheet\Calculation\Exception(self::MATRIX_DIMENSION_EXCEPTION); } } else { - throw new \PhpSpreadsheet\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION); + throw new \PhpOffice\PhpSpreadsheet\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION); } } // function checkMatrixDimensions() @@ -384,7 +384,7 @@ class Matrix return $this->getMatrix($i0, 0, $i0 + 1, $this->n); } } else { - throw new \PhpSpreadsheet\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION); + throw new \PhpOffice\PhpSpreadsheet\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION); } } @@ -405,7 +405,7 @@ class Matrix return $this->getMatrix(0, $j0, $this->m, $j0 + 1); } } else { - throw new \PhpSpreadsheet\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION); + throw new \PhpOffice\PhpSpreadsheet\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION); } } @@ -472,14 +472,14 @@ class Matrix if ($args[0] instanceof self) { $M = $args[0]; } else { - throw new \PhpSpreadsheet\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION); + throw new \PhpOffice\PhpSpreadsheet\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION); } break; case 'array': $M = new self($args[0]); break; default: - throw new \PhpSpreadsheet\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + throw new \PhpOffice\PhpSpreadsheet\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); break; } $this->checkMatrixDimensions($M); @@ -491,7 +491,7 @@ class Matrix return $M; } else { - throw new \PhpSpreadsheet\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + throw new \PhpOffice\PhpSpreadsheet\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); } } @@ -513,14 +513,14 @@ class Matrix if ($args[0] instanceof self) { $M = $args[0]; } else { - throw new \PhpSpreadsheet\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION); + throw new \PhpOffice\PhpSpreadsheet\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION); } break; case 'array': $M = new self($args[0]); break; default: - throw new \PhpSpreadsheet\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + throw new \PhpOffice\PhpSpreadsheet\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); break; } $this->checkMatrixDimensions($M); @@ -530,23 +530,23 @@ 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 &= \PhpSpreadsheet\Shared\StringHelper::convertToNumberIfFraction($this->A[$i][$j]); + $validValues &= \PhpOffice\PhpSpreadsheet\Shared\StringHelper::convertToNumberIfFraction($this->A[$i][$j]); } if ((is_string($value)) && (strlen($value) > 0) && (!is_numeric($value))) { $value = trim($value, '"'); - $validValues &= \PhpSpreadsheet\Shared\StringHelper::convertToNumberIfFraction($value); + $validValues &= \PhpOffice\PhpSpreadsheet\Shared\StringHelper::convertToNumberIfFraction($value); } if ($validValues) { $this->A[$i][$j] += $value; } else { - $this->A[$i][$j] = \PhpSpreadsheet\Calculation\Functions::NAN(); + $this->A[$i][$j] = \PhpOffice\PhpSpreadsheet\Calculation\Functions::NAN(); } } } return $this; } else { - throw new \PhpSpreadsheet\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + throw new \PhpOffice\PhpSpreadsheet\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); } } @@ -568,14 +568,14 @@ class Matrix if ($args[0] instanceof self) { $M = $args[0]; } else { - throw new \PhpSpreadsheet\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION); + throw new \PhpOffice\PhpSpreadsheet\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION); } break; case 'array': $M = new self($args[0]); break; default: - throw new \PhpSpreadsheet\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + throw new \PhpOffice\PhpSpreadsheet\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); break; } $this->checkMatrixDimensions($M); @@ -587,7 +587,7 @@ class Matrix return $M; } else { - throw new \PhpSpreadsheet\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + throw new \PhpOffice\PhpSpreadsheet\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); } } @@ -609,14 +609,14 @@ class Matrix if ($args[0] instanceof self) { $M = $args[0]; } else { - throw new \PhpSpreadsheet\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION); + throw new \PhpOffice\PhpSpreadsheet\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION); } break; case 'array': $M = new self($args[0]); break; default: - throw new \PhpSpreadsheet\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + throw new \PhpOffice\PhpSpreadsheet\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); break; } $this->checkMatrixDimensions($M); @@ -626,23 +626,23 @@ 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 &= \PhpSpreadsheet\Shared\StringHelper::convertToNumberIfFraction($this->A[$i][$j]); + $validValues &= \PhpOffice\PhpSpreadsheet\Shared\StringHelper::convertToNumberIfFraction($this->A[$i][$j]); } if ((is_string($value)) && (strlen($value) > 0) && (!is_numeric($value))) { $value = trim($value, '"'); - $validValues &= \PhpSpreadsheet\Shared\StringHelper::convertToNumberIfFraction($value); + $validValues &= \PhpOffice\PhpSpreadsheet\Shared\StringHelper::convertToNumberIfFraction($value); } if ($validValues) { $this->A[$i][$j] -= $value; } else { - $this->A[$i][$j] = \PhpSpreadsheet\Calculation\Functions::NAN(); + $this->A[$i][$j] = \PhpOffice\PhpSpreadsheet\Calculation\Functions::NAN(); } } } return $this; } else { - throw new \PhpSpreadsheet\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + throw new \PhpOffice\PhpSpreadsheet\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); } } @@ -665,14 +665,14 @@ class Matrix if ($args[0] instanceof self) { $M = $args[0]; } else { - throw new \PhpSpreadsheet\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION); + throw new \PhpOffice\PhpSpreadsheet\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION); } break; case 'array': $M = new self($args[0]); break; default: - throw new \PhpSpreadsheet\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + throw new \PhpOffice\PhpSpreadsheet\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); break; } $this->checkMatrixDimensions($M); @@ -684,7 +684,7 @@ class Matrix return $M; } else { - throw new \PhpSpreadsheet\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + throw new \PhpOffice\PhpSpreadsheet\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); } } @@ -707,14 +707,14 @@ class Matrix if ($args[0] instanceof self) { $M = $args[0]; } else { - throw new \PhpSpreadsheet\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION); + throw new \PhpOffice\PhpSpreadsheet\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION); } break; case 'array': $M = new self($args[0]); break; default: - throw new \PhpSpreadsheet\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + throw new \PhpOffice\PhpSpreadsheet\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); break; } $this->checkMatrixDimensions($M); @@ -724,23 +724,23 @@ 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 &= \PhpSpreadsheet\Shared\StringHelper::convertToNumberIfFraction($this->A[$i][$j]); + $validValues &= \PhpOffice\PhpSpreadsheet\Shared\StringHelper::convertToNumberIfFraction($this->A[$i][$j]); } if ((is_string($value)) && (strlen($value) > 0) && (!is_numeric($value))) { $value = trim($value, '"'); - $validValues &= \PhpSpreadsheet\Shared\StringHelper::convertToNumberIfFraction($value); + $validValues &= \PhpOffice\PhpSpreadsheet\Shared\StringHelper::convertToNumberIfFraction($value); } if ($validValues) { $this->A[$i][$j] *= $value; } else { - $this->A[$i][$j] = \PhpSpreadsheet\Calculation\Functions::NAN(); + $this->A[$i][$j] = \PhpOffice\PhpSpreadsheet\Calculation\Functions::NAN(); } } } return $this; } else { - throw new \PhpSpreadsheet\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + throw new \PhpOffice\PhpSpreadsheet\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); } } @@ -763,14 +763,14 @@ class Matrix if ($args[0] instanceof self) { $M = $args[0]; } else { - throw new \PhpSpreadsheet\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION); + throw new \PhpOffice\PhpSpreadsheet\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION); } break; case 'array': $M = new self($args[0]); break; default: - throw new \PhpSpreadsheet\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + throw new \PhpOffice\PhpSpreadsheet\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); break; } $this->checkMatrixDimensions($M); @@ -780,11 +780,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 &= \PhpSpreadsheet\Shared\StringHelper::convertToNumberIfFraction($this->A[$i][$j]); + $validValues &= \PhpOffice\PhpSpreadsheet\Shared\StringHelper::convertToNumberIfFraction($this->A[$i][$j]); } if ((is_string($value)) && (strlen($value) > 0) && (!is_numeric($value))) { $value = trim($value, '"'); - $validValues &= \PhpSpreadsheet\Shared\StringHelper::convertToNumberIfFraction($value); + $validValues &= \PhpOffice\PhpSpreadsheet\Shared\StringHelper::convertToNumberIfFraction($value); } if ($validValues) { if ($value == 0) { @@ -794,14 +794,14 @@ class Matrix $M->set($i, $j, $this->A[$i][$j] / $value); } } else { - $M->set($i, $j, \PhpSpreadsheet\Calculation\Functions::NAN()); + $M->set($i, $j, \PhpOffice\PhpSpreadsheet\Calculation\Functions::NAN()); } } } return $M; } else { - throw new \PhpSpreadsheet\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + throw new \PhpOffice\PhpSpreadsheet\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); } } @@ -824,14 +824,14 @@ class Matrix if ($args[0] instanceof self) { $M = $args[0]; } else { - throw new \PhpSpreadsheet\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION); + throw new \PhpOffice\PhpSpreadsheet\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION); } break; case 'array': $M = new self($args[0]); break; default: - throw new \PhpSpreadsheet\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + throw new \PhpOffice\PhpSpreadsheet\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); break; } $this->checkMatrixDimensions($M); @@ -843,7 +843,7 @@ class Matrix return $M; } else { - throw new \PhpSpreadsheet\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + throw new \PhpOffice\PhpSpreadsheet\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); } } @@ -866,14 +866,14 @@ class Matrix if ($args[0] instanceof self) { $M = $args[0]; } else { - throw new \PhpSpreadsheet\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION); + throw new \PhpOffice\PhpSpreadsheet\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION); } break; case 'array': $M = new self($args[0]); break; default: - throw new \PhpSpreadsheet\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + throw new \PhpOffice\PhpSpreadsheet\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); break; } $this->checkMatrixDimensions($M); @@ -885,7 +885,7 @@ class Matrix return $M; } else { - throw new \PhpSpreadsheet\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + throw new \PhpOffice\PhpSpreadsheet\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); } } @@ -908,14 +908,14 @@ class Matrix if ($args[0] instanceof self) { $M = $args[0]; } else { - throw new \PhpSpreadsheet\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION); + throw new \PhpOffice\PhpSpreadsheet\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION); } break; case 'array': $M = new self($args[0]); break; default: - throw new \PhpSpreadsheet\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + throw new \PhpOffice\PhpSpreadsheet\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); break; } $this->checkMatrixDimensions($M); @@ -927,7 +927,7 @@ class Matrix return $M; } else { - throw new \PhpSpreadsheet\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + throw new \PhpOffice\PhpSpreadsheet\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); } } @@ -949,7 +949,7 @@ class Matrix if ($args[0] instanceof self) { $B = $args[0]; } else { - throw new \PhpSpreadsheet\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION); + throw new \PhpOffice\PhpSpreadsheet\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION); } if ($this->n == $B->m) { $C = new self($this->m, $B->n); @@ -969,7 +969,7 @@ class Matrix return $C; } else { - throw new \PhpSpreadsheet\Calculation\Exception(JAMAError(MatrixDimensionMismatch)); + throw new \PhpOffice\PhpSpreadsheet\Calculation\Exception(JAMAError(MatrixDimensionMismatch)); } break; case 'array': @@ -988,7 +988,7 @@ class Matrix return $C; } else { - throw new \PhpSpreadsheet\Calculation\Exception(JAMAError(MatrixDimensionMismatch)); + throw new \PhpOffice\PhpSpreadsheet\Calculation\Exception(JAMAError(MatrixDimensionMismatch)); } return $M; @@ -1024,11 +1024,11 @@ class Matrix return $C; break; default: - throw new \PhpSpreadsheet\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + throw new \PhpOffice\PhpSpreadsheet\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); break; } } else { - throw new \PhpSpreadsheet\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + throw new \PhpOffice\PhpSpreadsheet\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); } } @@ -1050,14 +1050,14 @@ class Matrix if ($args[0] instanceof self) { $M = $args[0]; } else { - throw new \PhpSpreadsheet\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION); + throw new \PhpOffice\PhpSpreadsheet\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION); } break; case 'array': $M = new self($args[0]); break; default: - throw new \PhpSpreadsheet\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + throw new \PhpOffice\PhpSpreadsheet\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); break; } $this->checkMatrixDimensions($M); @@ -1067,23 +1067,23 @@ 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 &= \PhpSpreadsheet\Shared\StringHelper::convertToNumberIfFraction($this->A[$i][$j]); + $validValues &= \PhpOffice\PhpSpreadsheet\Shared\StringHelper::convertToNumberIfFraction($this->A[$i][$j]); } if ((is_string($value)) && (strlen($value) > 0) && (!is_numeric($value))) { $value = trim($value, '"'); - $validValues &= \PhpSpreadsheet\Shared\StringHelper::convertToNumberIfFraction($value); + $validValues &= \PhpOffice\PhpSpreadsheet\Shared\StringHelper::convertToNumberIfFraction($value); } if ($validValues) { $this->A[$i][$j] = pow($this->A[$i][$j], $value); } else { - $this->A[$i][$j] = \PhpSpreadsheet\Calculation\Functions::NAN(); + $this->A[$i][$j] = \PhpOffice\PhpSpreadsheet\Calculation\Functions::NAN(); } } } return $this; } else { - throw new \PhpSpreadsheet\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + throw new \PhpOffice\PhpSpreadsheet\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); } } @@ -1105,14 +1105,14 @@ class Matrix if ($args[0] instanceof self) { $M = $args[0]; } else { - throw new \PhpSpreadsheet\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION); + throw new \PhpOffice\PhpSpreadsheet\Calculation\Exception(self::ARGUMENT_TYPE_EXCEPTION); } break; case 'array': $M = new self($args[0]); break; default: - throw new \PhpSpreadsheet\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + throw new \PhpOffice\PhpSpreadsheet\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); break; } $this->checkMatrixDimensions($M); @@ -1124,7 +1124,7 @@ class Matrix return $this; } else { - throw new \PhpSpreadsheet\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); + throw new \PhpOffice\PhpSpreadsheet\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION); } } diff --git a/src/PhpSpreadsheet/Shared/JAMA/QRDecomposition.php b/src/PhpSpreadsheet/Shared/JAMA/QRDecomposition.php index f22904b9..b2447040 100644 --- a/src/PhpSpreadsheet/Shared/JAMA/QRDecomposition.php +++ b/src/PhpSpreadsheet/Shared/JAMA/QRDecomposition.php @@ -1,6 +1,6 @@ = n, the QR decomposition is an m-by-n @@ -89,7 +89,7 @@ class QRDecomposition $this->Rdiag[$k] = -$nrm; } } else { - throw new \PhpSpreadsheet\Calculation\Exception(Matrix::ARGUMENT_TYPE_EXCEPTION); + throw new \PhpOffice\PhpSpreadsheet\Calculation\Exception(Matrix::ARGUMENT_TYPE_EXCEPTION); } } // function __construct() @@ -229,10 +229,10 @@ class QRDecomposition return $X->getMatrix(0, $this->n - 1, 0, $nx); } else { - throw new \PhpSpreadsheet\Calculation\Exception(self::MATRIX_RANK_EXCEPTION); + throw new \PhpOffice\PhpSpreadsheet\Calculation\Exception(self::MATRIX_RANK_EXCEPTION); } } else { - throw new \PhpSpreadsheet\Calculation\Exception(Matrix::MATRIX_DIMENSION_EXCEPTION); + throw new \PhpOffice\PhpSpreadsheet\Calculation\Exception(Matrix::MATRIX_DIMENSION_EXCEPTION); } } } diff --git a/src/PhpSpreadsheet/Shared/JAMA/SingularValueDecomposition.php b/src/PhpSpreadsheet/Shared/JAMA/SingularValueDecomposition.php index 55fb249e..3c53cd14 100644 --- a/src/PhpSpreadsheet/Shared/JAMA/SingularValueDecomposition.php +++ b/src/PhpSpreadsheet/Shared/JAMA/SingularValueDecomposition.php @@ -1,6 +1,6 @@ = n, the singular value decomposition is diff --git a/src/PhpSpreadsheet/Shared/JAMA/utils/Maths.php b/src/PhpSpreadsheet/Shared/JAMA/utils/Maths.php index e92ee22c..f46c2e0b 100644 --- a/src/PhpSpreadsheet/Shared/JAMA/utils/Maths.php +++ b/src/PhpSpreadsheet/Shared/JAMA/utils/Maths.php @@ -34,7 +34,7 @@ function hypot() { if (is_numeric($d)) { $s += pow($d, 2); } else { - throw new \PhpSpreadsheet\Calculation\Exception(JAMAError(ARGUMENT_TYPE_EXCEPTION)); + throw new \PhpOffice\PhpSpreadsheet\Calculation\Exception(JAMAError(ARGUMENT_TYPE_EXCEPTION)); } } return sqrt($s); diff --git a/src/PhpSpreadsheet/Shared/OLE.php b/src/PhpSpreadsheet/Shared/OLE.php index 8c159b52..927ffdf7 100644 --- a/src/PhpSpreadsheet/Shared/OLE.php +++ b/src/PhpSpreadsheet/Shared/OLE.php @@ -1,6 +1,6 @@ _file_handle = $fh; $signature = fread($fh, 8); if ("\xD0\xCF\x11\xE0\xA1\xB1\x1A\xE1" != $signature) { - throw new \PhpSpreadsheet\Reader\Exception("File doesn't seem to be an OLE container."); + throw new \PhpOffice\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 \PhpSpreadsheet\Reader\Exception('Only Little-Endian encoding is supported.'); + throw new \PhpOffice\PhpSpreadsheet\Reader\Exception('Only Little-Endian encoding is supported.'); } // Size of blocks and short blocks in bytes $this->bigBlockSize = pow(2, self::_readInt2($fh)); @@ -189,7 +189,7 @@ class OLE /** * Returns a stream for use with fread() etc. External callers should - * use \PhpSpreadsheet\Shared\OLE\PPS\File::getStream(). + * use \PhpOffice\PhpSpreadsheet\Shared\OLE\PPS\File::getStream(). * @param int|PPS block id or PPS * @return resource read-only stream */ @@ -197,7 +197,7 @@ class OLE { static $isRegistered = false; if (!$isRegistered) { - stream_wrapper_register('ole-chainedblockstream', '\\PhpSpreadsheet\\Shared\\OLE\\ChainedBlockStream'); + stream_wrapper_register('ole-chainedblockstream', '\\PhpOffice\\PhpSpreadsheet\\Shared\\OLE\\ChainedBlockStream'); $isRegistered = true; } diff --git a/src/PhpSpreadsheet/Shared/OLE/ChainedBlockStream.php b/src/PhpSpreadsheet/Shared/OLE/ChainedBlockStream.php index 444203b7..37eb5c8f 100644 --- a/src/PhpSpreadsheet/Shared/OLE/ChainedBlockStream.php +++ b/src/PhpSpreadsheet/Shared/OLE/ChainedBlockStream.php @@ -1,6 +1,6 @@ Time1st) // 108 - . \PhpSpreadsheet\Shared\OLE::localDateToOLE($this->Time2nd) // 116 + . \PhpOffice\PhpSpreadsheet\Shared\OLE::localDateToOLE($this->Time1st) // 108 + . \PhpOffice\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 2b7f77c4..6e674904 100644 --- a/src/PhpSpreadsheet/Shared/OLE/PPS/File.php +++ b/src/PhpSpreadsheet/Shared/OLE/PPS/File.php @@ -1,6 +1,6 @@ * @category PhpSpreadsheet */ -class File extends \PhpSpreadsheet\Shared\OLE\PPS +class File extends \PhpOffice\PhpSpreadsheet\Shared\OLE\PPS { /** * The constructor @@ -37,7 +37,7 @@ class File extends \PhpSpreadsheet\Shared\OLE\PPS */ public function __construct($name) { - parent::__construct(null, $name, \PhpSpreadsheet\Shared\OLE::OLE_PPS_TYPE_FILE, null, null, null, null, null, '', []); + parent::__construct(null, $name, \PhpOffice\PhpSpreadsheet\Shared\OLE::OLE_PPS_TYPE_FILE, null, null, null, null, null, '', []); } /** diff --git a/src/PhpSpreadsheet/Shared/OLE/PPS/Root.php b/src/PhpSpreadsheet/Shared/OLE/PPS/Root.php index c82f4089..052554c6 100644 --- a/src/PhpSpreadsheet/Shared/OLE/PPS/Root.php +++ b/src/PhpSpreadsheet/Shared/OLE/PPS/Root.php @@ -1,6 +1,6 @@ * @category PhpSpreadsheet */ -class Root extends \PhpSpreadsheet\Shared\OLE\PPS +class Root extends \PhpOffice\PhpSpreadsheet\Shared\OLE\PPS { /** * Directory for temporary files @@ -42,9 +42,9 @@ class Root extends \PhpSpreadsheet\Shared\OLE\PPS */ public function __construct($time_1st, $time_2nd, $raChild) { - $this->_tempDir = \PhpSpreadsheet\Shared\File::sysGetTempDir(); + $this->_tempDir = \PhpOffice\PhpSpreadsheet\Shared\File::sysGetTempDir(); - 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); + parent::__construct(null, \PhpOffice\PhpSpreadsheet\Shared\OLE::ascToUcs('Root Entry'), \PhpOffice\PhpSpreadsheet\Shared\OLE::OLE_PPS_TYPE_ROOT, null, null, null, $time_1st, $time_2nd, null, $raChild); } /** @@ -55,7 +55,7 @@ class Root extends \PhpSpreadsheet\Shared\OLE\PPS * it will be used, but you have to close such stream by yourself. * * @param string|resource $filename The name of the file or stream where to save the OLE container. - * @throws \PhpSpreadsheet\Writer\Exception + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception * @return bool true on success */ public function save($filename) @@ -74,22 +74,22 @@ class Root extends \PhpSpreadsheet\Shared\OLE\PPS $this->_FILEH_ = $filename; } elseif ($filename == '-' || $filename == '') { if ($this->tempDirectory === null) { - $this->tempDirectory = \PhpSpreadsheet\Shared\File::sysGetTempDir(); + $this->tempDirectory = \PhpOffice\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 \PhpSpreadsheet\Writer\Exception("Can't create temporary file."); + throw new \PhpOffice\PhpSpreadsheet\Writer\Exception("Can't create temporary file."); } } else { $this->_FILEH_ = fopen($filename, 'wb'); } if ($this->_FILEH_ == false) { - throw new \PhpSpreadsheet\Writer\Exception("Can't open $filename. It may be in use or protected."); + throw new \PhpOffice\PhpSpreadsheet\Writer\Exception("Can't open $filename. It may be in use or protected."); } // Make an array of PPS's (for Save) $aList = []; - \PhpSpreadsheet\Shared\OLE\PPS::_savePpsSetPnt($aList, [$this]); + \PhpOffice\PhpSpreadsheet\Shared\OLE\PPS::_savePpsSetPnt($aList, [$this]); // calculate values for header list($iSBDcnt, $iBBcnt, $iPPScnt) = $this->_calcSize($aList); //, $rhInfo); // Save Header @@ -126,9 +126,9 @@ class Root extends \PhpSpreadsheet\Shared\OLE\PPS $iSBcnt = 0; $iCount = count($raList); for ($i = 0; $i < $iCount; ++$i) { - if ($raList[$i]->Type == \PhpSpreadsheet\Shared\OLE::OLE_PPS_TYPE_FILE) { + if ($raList[$i]->Type == \PhpOffice\PhpSpreadsheet\Shared\OLE::OLE_PPS_TYPE_FILE) { $raList[$i]->Size = $raList[$i]->getDataLen(); - if ($raList[$i]->Size < \PhpSpreadsheet\Shared\OLE::OLE_DATA_SIZE_SMALL) { + if ($raList[$i]->Size < \PhpOffice\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 { @@ -138,12 +138,12 @@ class Root extends \PhpSpreadsheet\Shared\OLE\PPS } } $iSmallLen = $iSBcnt * $this->_SMALL_BLOCK_SIZE; - $iSlCnt = floor($this->_BIG_BLOCK_SIZE / \PhpSpreadsheet\Shared\OLE::OLE_LONG_INT_SIZE); + $iSlCnt = floor($this->_BIG_BLOCK_SIZE / \PhpOffice\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 / \PhpSpreadsheet\Shared\OLE::OLE_PPS_SIZE; + $iBdCnt = $this->_BIG_BLOCK_SIZE / \PhpOffice\PhpSpreadsheet\Shared\OLE::OLE_PPS_SIZE; $iPPScnt = (floor($iCnt / $iBdCnt) + (($iCnt % $iBdCnt) ? 1 : 0)); return [$iSBDcnt, $iBBcnt, $iPPScnt]; @@ -175,8 +175,8 @@ class Root extends \PhpSpreadsheet\Shared\OLE\PPS $FILE = $this->_FILEH_; // Calculate Basic Setting - $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; + $iBlCnt = $this->_BIG_BLOCK_SIZE / \PhpOffice\PhpSpreadsheet\Shared\OLE::OLE_LONG_INT_SIZE; + $i1stBdL = ($this->_BIG_BLOCK_SIZE - 0x4C) / \PhpOffice\PhpSpreadsheet\Shared\OLE::OLE_LONG_INT_SIZE; $iBdExL = 0; $iAll = $iBBcnt + $iPPScnt + $iSBDcnt; @@ -244,7 +244,7 @@ class Root extends \PhpSpreadsheet\Shared\OLE\PPS } /** - * Saving big data (PPS's with data bigger than \PhpSpreadsheet\Shared\OLE::OLE_DATA_SIZE_SMALL) + * Saving big data (PPS's with data bigger than \PhpOffice\PhpSpreadsheet\Shared\OLE::OLE_DATA_SIZE_SMALL) * * @param int $iStBlk * @param array &$raList Reference to array of PPS's @@ -256,9 +256,9 @@ class Root extends \PhpSpreadsheet\Shared\OLE\PPS // cycle through PPS's $iCount = count($raList); for ($i = 0; $i < $iCount; ++$i) { - if ($raList[$i]->Type != \PhpSpreadsheet\Shared\OLE::OLE_PPS_TYPE_DIR) { + if ($raList[$i]->Type != \PhpOffice\PhpSpreadsheet\Shared\OLE::OLE_PPS_TYPE_DIR) { $raList[$i]->Size = $raList[$i]->getDataLen(); - 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))) { + if (($raList[$i]->Size >= \PhpOffice\PhpSpreadsheet\Shared\OLE::OLE_DATA_SIZE_SMALL) || (($raList[$i]->Type == \PhpOffice\PhpSpreadsheet\Shared\OLE::OLE_PPS_TYPE_ROOT) && isset($raList[$i]->_data))) { fwrite($FILE, $raList[$i]->_data); if ($raList[$i]->Size % $this->_BIG_BLOCK_SIZE) { @@ -275,7 +275,7 @@ class Root extends \PhpSpreadsheet\Shared\OLE\PPS } /** - * get small data (PPS's with data smaller than \PhpSpreadsheet\Shared\OLE::OLE_DATA_SIZE_SMALL) + * get small data (PPS's with data smaller than \PhpOffice\PhpSpreadsheet\Shared\OLE::OLE_DATA_SIZE_SMALL) * * @param array &$raList Reference to array of PPS's */ @@ -288,11 +288,11 @@ class Root extends \PhpSpreadsheet\Shared\OLE\PPS $iCount = count($raList); for ($i = 0; $i < $iCount; ++$i) { // Make SBD, small data string - if ($raList[$i]->Type == \PhpSpreadsheet\Shared\OLE::OLE_PPS_TYPE_FILE) { + if ($raList[$i]->Type == \PhpOffice\PhpSpreadsheet\Shared\OLE::OLE_PPS_TYPE_FILE) { if ($raList[$i]->Size <= 0) { continue; } - if ($raList[$i]->Size < \PhpSpreadsheet\Shared\OLE::OLE_DATA_SIZE_SMALL) { + if ($raList[$i]->Size < \PhpOffice\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 @@ -313,7 +313,7 @@ class Root extends \PhpSpreadsheet\Shared\OLE\PPS } } } - $iSbCnt = floor($this->_BIG_BLOCK_SIZE / \PhpSpreadsheet\Shared\OLE::OLE_LONG_INT_SIZE); + $iSbCnt = floor($this->_BIG_BLOCK_SIZE / \PhpOffice\PhpSpreadsheet\Shared\OLE::OLE_LONG_INT_SIZE); if ($iSmBlk % $iSbCnt) { $iB = $iSbCnt - ($iSmBlk % $iSbCnt); for ($i = 0; $i < $iB; ++$i) { @@ -338,9 +338,9 @@ class Root extends \PhpSpreadsheet\Shared\OLE\PPS } // Adjust for Block $iCnt = count($raList); - $iBCnt = $this->_BIG_BLOCK_SIZE / \PhpSpreadsheet\Shared\OLE::OLE_PPS_SIZE; + $iBCnt = $this->_BIG_BLOCK_SIZE / \PhpOffice\PhpSpreadsheet\Shared\OLE::OLE_PPS_SIZE; if ($iCnt % $iBCnt) { - fwrite($this->_FILEH_, str_repeat("\x00", ($iBCnt - ($iCnt % $iBCnt)) * \PhpSpreadsheet\Shared\OLE::OLE_PPS_SIZE)); + fwrite($this->_FILEH_, str_repeat("\x00", ($iBCnt - ($iCnt % $iBCnt)) * \PhpOffice\PhpSpreadsheet\Shared\OLE::OLE_PPS_SIZE)); } } @@ -355,8 +355,8 @@ class Root extends \PhpSpreadsheet\Shared\OLE\PPS { $FILE = $this->_FILEH_; // Calculate Basic Setting - $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; + $iBbCnt = $this->_BIG_BLOCK_SIZE / \PhpOffice\PhpSpreadsheet\Shared\OLE::OLE_LONG_INT_SIZE; + $i1stBdL = ($this->_BIG_BLOCK_SIZE - 0x4C) / \PhpOffice\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 37c852b0..2d0a7986 100644 --- a/src/PhpSpreadsheet/Shared/OLERead.php +++ b/src/PhpSpreadsheet/Shared/OLERead.php @@ -1,6 +1,6 @@ data != self::IDENTIFIER_OLE) { - throw new \PhpSpreadsheet\Reader\Exception('The filename ' . $sFileName . ' is not recognised as an OLE file'); + throw new \PhpOffice\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 5621c249..4f80f459 100644 --- a/src/PhpSpreadsheet/Shared/PCLZip/PclZip.php +++ b/src/PhpSpreadsheet/Shared/PCLZip/PclZip.php @@ -1,6 +1,6 @@ _calculateFormulaValue($fractionFormula); + $operand = \PhpOffice\PhpSpreadsheet\Calculation::getInstance()->_calculateFormulaValue($fractionFormula); return true; } @@ -723,8 +723,8 @@ class StringHelper } /** - * Set the decimal separator. Only used by \PhpSpreadsheet\Style\NumberFormat::toFormattedString() - * to format output by \PhpSpreadsheet\Writer\HTML and \PhpSpreadsheet\Writer\PDF + * Set the decimal separator. Only used by \PhpOffice\PhpSpreadsheet\Style\NumberFormat::toFormattedString() + * to format output by \PhpOffice\PhpSpreadsheet\Writer\HTML and \PhpOffice\PhpSpreadsheet\Writer\PDF * * @param string $pValue Character for decimal separator */ @@ -756,8 +756,8 @@ class StringHelper } /** - * Set the thousands separator. Only used by \PhpSpreadsheet\Style\NumberFormat::toFormattedString() - * to format output by \PhpSpreadsheet\Writer\HTML and \PhpSpreadsheet\Writer\PDF + * Set the thousands separator. Only used by \PhpOffice\PhpSpreadsheet\Style\NumberFormat::toFormattedString() + * to format output by \PhpOffice\PhpSpreadsheet\Writer\HTML and \PhpOffice\PhpSpreadsheet\Writer\PDF * * @param string $pValue Character for thousands separator */ @@ -794,8 +794,8 @@ class StringHelper } /** - * Set the currency code. Only used by \PhpSpreadsheet\Style\NumberFormat::toFormattedString() - * to format output by \PhpSpreadsheet\Writer\HTML and \PhpSpreadsheet\Writer\PDF + * Set the currency code. Only used by \PhpOffice\PhpSpreadsheet\Style\NumberFormat::toFormattedString() + * to format output by \PhpOffice\PhpSpreadsheet\Writer\HTML and \PhpOffice\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 50253776..23a83cf2 100644 --- a/src/PhpSpreadsheet/Shared/TimeZone.php +++ b/src/PhpSpreadsheet/Shared/TimeZone.php @@ -1,6 +1,6 @@ getGoodnessOfFit(); } diff --git a/src/PhpSpreadsheet/Shared/XMLWriter.php b/src/PhpSpreadsheet/Shared/XMLWriter.php index bf3ee5df..80fbc1c2 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 \PhpSpreadsheet\Writer\Exception('Error zipping files : ' . $this->zip->errorInfo(true)); + throw new \PhpOffice\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 b20412a7..ade3c6ee 100644 --- a/src/PhpSpreadsheet/Shared/ZipStreamWrapper.php +++ b/src/PhpSpreadsheet/Shared/ZipStreamWrapper.php @@ -1,6 +1,6 @@ archive = new $zipClass(); $this->archive->open($url['host']); diff --git a/src/PhpSpreadsheet/Spreadsheet.php b/src/PhpSpreadsheet/Spreadsheet.php index 583be0c5..a8477804 100644 --- a/src/PhpSpreadsheet/Spreadsheet.php +++ b/src/PhpSpreadsheet/Spreadsheet.php @@ -1,6 +1,6 @@ 'Arial', * 'bold' => true, * 'italic' => false, - * 'underline' => \PhpSpreadsheet\Style\Font::UNDERLINE_DOUBLE, + * 'underline' => \PhpOffice\PhpSpreadsheet\Style\Font::UNDERLINE_DOUBLE, * 'strike' => false, * 'color' => array( * 'rgb' => '808080' @@ -183,13 +183,13 @@ class Style extends Style\Supervisor implements IComparable * ), * 'borders' => array( * 'bottom' => array( - * 'style' => \PhpSpreadsheet\Style\Border::BORDER_DASHDOT, + * 'style' => \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_DASHDOT, * 'color' => array( * 'rgb' => '808080' * ) * ), * 'top' => array( - * 'style' => \PhpSpreadsheet\Style\Border::BORDER_DASHDOT, + * 'style' => \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_DASHDOT, * 'color' => array( * 'rgb' => '808080' * ) diff --git a/src/PhpSpreadsheet/Style/Alignment.php b/src/PhpSpreadsheet/Style/Alignment.php index be294843..19b469c2 100644 --- a/src/PhpSpreadsheet/Style/Alignment.php +++ b/src/PhpSpreadsheet/Style/Alignment.php @@ -1,6 +1,6 @@ * $spreadsheet->getActiveSheet()->getStyle('B2')->getAlignment()->applyFromArray( * array( - * 'horizontal' => \PhpSpreadsheet\Style\Alignment::HORIZONTAL_CENTER, - * 'vertical' => \PhpSpreadsheet\Style\Alignment::VERTICAL_CENTER, + * 'horizontal' => \PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_CENTER, + * 'vertical' => \PhpOffice\PhpSpreadsheet\Style\Alignment::VERTICAL_CENTER, * 'rotation' => 0, * 'wrap' => TRUE * ) @@ -156,7 +156,7 @@ class Alignment extends Supervisor implements \PhpSpreadsheet\IComparable * * * @param array $pStyles Array containing style information - * @throws \PhpSpreadsheet\Exception + * @throws \PhpOffice\PhpSpreadsheet\Exception * @return Alignment */ public function applyFromArray($pStyles = null) @@ -189,7 +189,7 @@ class Alignment extends Supervisor implements \PhpSpreadsheet\IComparable } } } else { - throw new \PhpSpreadsheet\Exception('Invalid style array passed.'); + throw new \PhpOffice\PhpSpreadsheet\Exception('Invalid style array passed.'); } return $this; @@ -285,7 +285,7 @@ class Alignment extends Supervisor implements \PhpSpreadsheet\IComparable * Set TextRotation * * @param int $pValue - * @throws \PhpSpreadsheet\Exception + * @throws \PhpOffice\PhpSpreadsheet\Exception * @return Alignment */ public function setTextRotation($pValue = 0) @@ -304,7 +304,7 @@ class Alignment extends Supervisor implements \PhpSpreadsheet\IComparable $this->textRotation = $pValue; } } else { - throw new \PhpSpreadsheet\Exception('Text rotation should be a value between -90 and 90.'); + throw new \PhpOffice\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 9108b65a..d06357e5 100644 --- a/src/PhpSpreadsheet/Style/Border.php +++ b/src/PhpSpreadsheet/Style/Border.php @@ -1,6 +1,6 @@ parent->getSharedComponent()->getBottom(); @@ -164,7 +164,7 @@ class Border extends Supervisor implements \PhpSpreadsheet\IComparable * * $spreadsheet->getActiveSheet()->getStyle('B2')->getBorders()->getTop()->applyFromArray( * array( - * 'style' => \PhpSpreadsheet\Style\Border::BORDER_DASHDOT, + * 'style' => \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_DASHDOT, * 'color' => array( * 'rgb' => '808080' * ) @@ -173,7 +173,7 @@ class Border extends Supervisor implements \PhpSpreadsheet\IComparable * * * @param array $pStyles Array containing style information - * @throws \PhpSpreadsheet\Exception + * @throws \PhpOffice\PhpSpreadsheet\Exception * @return Border */ public function applyFromArray($pStyles = null) @@ -190,7 +190,7 @@ class Border extends Supervisor implements \PhpSpreadsheet\IComparable } } } else { - throw new \PhpSpreadsheet\Exception('Invalid style array passed.'); + throw new \PhpOffice\PhpSpreadsheet\Exception('Invalid style array passed.'); } return $this; @@ -249,7 +249,7 @@ class Border extends Supervisor implements \PhpSpreadsheet\IComparable * Set Border Color * * @param Color $pValue - * @throws \PhpSpreadsheet\Exception + * @throws \PhpOffice\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 6594cbb5..9a8b483d 100644 --- a/src/PhpSpreadsheet/Style/Borders.php +++ b/src/PhpSpreadsheet/Style/Borders.php @@ -1,6 +1,6 @@ getActiveSheet()->getStyle('B2')->getBorders()->applyFromArray( * array( * 'bottom' => array( - * 'style' => \PhpSpreadsheet\Style\Border::BORDER_DASHDOT, + * 'style' => \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_DASHDOT, * 'color' => array( * 'rgb' => '808080' * ) * ), * 'top' => array( - * 'style' => \PhpSpreadsheet\Style\Border::BORDER_DASHDOT, + * 'style' => \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_DASHDOT, * 'color' => array( * 'rgb' => '808080' * ) @@ -202,7 +202,7 @@ class Borders extends Supervisor implements \PhpSpreadsheet\IComparable * $spreadsheet->getActiveSheet()->getStyle('B2')->getBorders()->applyFromArray( * array( * 'allborders' => array( - * 'style' => \PhpSpreadsheet\Style\Border::BORDER_DASHDOT, + * 'style' => \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_DASHDOT, * 'color' => array( * 'rgb' => '808080' * ) @@ -212,7 +212,7 @@ class Borders extends Supervisor implements \PhpSpreadsheet\IComparable * * * @param array $pStyles Array containing style information - * @throws \PhpSpreadsheet\Exception + * @throws \PhpOffice\PhpSpreadsheet\Exception * @return Borders */ public function applyFromArray($pStyles = null) @@ -247,7 +247,7 @@ class Borders extends Supervisor implements \PhpSpreadsheet\IComparable } } } else { - throw new \PhpSpreadsheet\Exception('Invalid style array passed.'); + throw new \PhpOffice\PhpSpreadsheet\Exception('Invalid style array passed.'); } return $this; @@ -306,13 +306,13 @@ class Borders extends Supervisor implements \PhpSpreadsheet\IComparable /** * Get AllBorders (pseudo-border). Only applies to supervisor. * - * @throws \PhpSpreadsheet\Exception + * @throws \PhpOffice\PhpSpreadsheet\Exception * @return Border */ public function getAllBorders() { if (!$this->isSupervisor) { - throw new \PhpSpreadsheet\Exception('Can only get pseudo-border for supervisor.'); + throw new \PhpOffice\PhpSpreadsheet\Exception('Can only get pseudo-border for supervisor.'); } return $this->allBorders; @@ -321,13 +321,13 @@ class Borders extends Supervisor implements \PhpSpreadsheet\IComparable /** * Get Outline (pseudo-border). Only applies to supervisor. * - * @throws \PhpSpreadsheet\Exception + * @throws \PhpOffice\PhpSpreadsheet\Exception * @return bool */ public function getOutline() { if (!$this->isSupervisor) { - throw new \PhpSpreadsheet\Exception('Can only get pseudo-border for supervisor.'); + throw new \PhpOffice\PhpSpreadsheet\Exception('Can only get pseudo-border for supervisor.'); } return $this->outline; @@ -336,13 +336,13 @@ class Borders extends Supervisor implements \PhpSpreadsheet\IComparable /** * Get Inside (pseudo-border). Only applies to supervisor. * - * @throws \PhpSpreadsheet\Exception + * @throws \PhpOffice\PhpSpreadsheet\Exception * @return bool */ public function getInside() { if (!$this->isSupervisor) { - throw new \PhpSpreadsheet\Exception('Can only get pseudo-border for supervisor.'); + throw new \PhpOffice\PhpSpreadsheet\Exception('Can only get pseudo-border for supervisor.'); } return $this->inside; @@ -351,13 +351,13 @@ class Borders extends Supervisor implements \PhpSpreadsheet\IComparable /** * Get Vertical (pseudo-border). Only applies to supervisor. * - * @throws \PhpSpreadsheet\Exception + * @throws \PhpOffice\PhpSpreadsheet\Exception * @return Border */ public function getVertical() { if (!$this->isSupervisor) { - throw new \PhpSpreadsheet\Exception('Can only get pseudo-border for supervisor.'); + throw new \PhpOffice\PhpSpreadsheet\Exception('Can only get pseudo-border for supervisor.'); } return $this->vertical; @@ -366,13 +366,13 @@ class Borders extends Supervisor implements \PhpSpreadsheet\IComparable /** * Get Horizontal (pseudo-border). Only applies to supervisor. * - * @throws \PhpSpreadsheet\Exception + * @throws \PhpOffice\PhpSpreadsheet\Exception * @return Border */ public function getHorizontal() { if (!$this->isSupervisor) { - throw new \PhpSpreadsheet\Exception('Can only get pseudo-border for supervisor.'); + throw new \PhpOffice\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 f042b1b5..7d487692 100644 --- a/src/PhpSpreadsheet/Style/Color.php +++ b/src/PhpSpreadsheet/Style/Color.php @@ -1,6 +1,6 @@ * * @param array $pStyles Array containing style information - * @throws \PhpSpreadsheet\Exception + * @throws \PhpOffice\PhpSpreadsheet\Exception * @return Color */ public function applyFromArray($pStyles = null) @@ -162,7 +162,7 @@ class Color extends Supervisor implements \PhpSpreadsheet\IComparable } } } else { - throw new \PhpSpreadsheet\Exception('Invalid style array passed.'); + throw new \PhpOffice\PhpSpreadsheet\Exception('Invalid style array passed.'); } return $this; diff --git a/src/PhpSpreadsheet/Style/Conditional.php b/src/PhpSpreadsheet/Style/Conditional.php index 03c213e7..4531979e 100644 --- a/src/PhpSpreadsheet/Style/Conditional.php +++ b/src/PhpSpreadsheet/Style/Conditional.php @@ -1,6 +1,6 @@ operatorType = self::OPERATOR_NONE; $this->text = null; $this->condition = []; - $this->style = new \PhpSpreadsheet\Style(false, true); + $this->style = new \PhpOffice\PhpSpreadsheet\Style(false, true); } /** @@ -236,7 +236,7 @@ class Conditional implements \PhpSpreadsheet\IComparable /** * Get Style * - * @return \PhpSpreadsheet\Style + * @return \PhpOffice\PhpSpreadsheet\Style */ public function getStyle() { @@ -246,11 +246,11 @@ class Conditional implements \PhpSpreadsheet\IComparable /** * Set Style * - * @param \PhpSpreadsheet\Style $pValue - * @throws \PhpSpreadsheet\Exception + * @param \PhpOffice\PhpSpreadsheet\Style $pValue + * @throws \PhpOffice\PhpSpreadsheet\Exception * @return Conditional */ - public function setStyle(\PhpSpreadsheet\Style $pValue = null) + public function setStyle(\PhpOffice\PhpSpreadsheet\Style $pValue = null) { $this->style = $pValue; diff --git a/src/PhpSpreadsheet/Style/Fill.php b/src/PhpSpreadsheet/Style/Fill.php index 507f5554..7330ff9e 100644 --- a/src/PhpSpreadsheet/Style/Fill.php +++ b/src/PhpSpreadsheet/Style/Fill.php @@ -1,6 +1,6 @@ * $spreadsheet->getActiveSheet()->getStyle('B2')->getFill()->applyFromArray( * array( - * 'type' => \PhpSpreadsheet\Style\Fill::FILL_GRADIENT_LINEAR, + * 'type' => \PhpOffice\PhpSpreadsheet\Style\Fill::FILL_GRADIENT_LINEAR, * 'rotation' => 0, * 'startcolor' => array( * 'rgb' => '000000' @@ -147,7 +147,7 @@ class Fill extends Supervisor implements \PhpSpreadsheet\IComparable * * * @param array $pStyles Array containing style information - * @throws \PhpSpreadsheet\Exception + * @throws \PhpOffice\PhpSpreadsheet\Exception * @return Fill */ public function applyFromArray($pStyles = null) @@ -173,7 +173,7 @@ class Fill extends Supervisor implements \PhpSpreadsheet\IComparable } } } else { - throw new \PhpSpreadsheet\Exception('Invalid style array passed.'); + throw new \PhpOffice\PhpSpreadsheet\Exception('Invalid style array passed.'); } return $this; @@ -257,7 +257,7 @@ class Fill extends Supervisor implements \PhpSpreadsheet\IComparable * Set Start Color * * @param Color $pValue - * @throws \PhpSpreadsheet\Exception + * @throws \PhpOffice\PhpSpreadsheet\Exception * @return Fill */ public function setStartColor(Color $pValue = null) @@ -289,7 +289,7 @@ class Fill extends Supervisor implements \PhpSpreadsheet\IComparable * Set End Color * * @param Color $pValue - * @throws \PhpSpreadsheet\Exception + * @throws \PhpOffice\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 4f9e706e..af7d40ce 100644 --- a/src/PhpSpreadsheet/Style/Font.php +++ b/src/PhpSpreadsheet/Style/Font.php @@ -1,6 +1,6 @@ 'Arial', * 'bold' => TRUE, * 'italic' => FALSE, - * 'underline' => \PhpSpreadsheet\Style\Font::UNDERLINE_DOUBLE, + * 'underline' => \PhpOffice\PhpSpreadsheet\Style\Font::UNDERLINE_DOUBLE, * 'strike' => FALSE, * 'color' => array( * 'rgb' => '808080' @@ -172,7 +172,7 @@ class Font extends Supervisor implements \PhpSpreadsheet\IComparable * * * @param array $pStyles Array containing style information - * @throws \PhpSpreadsheet\Exception + * @throws \PhpOffice\PhpSpreadsheet\Exception * @return Font */ public function applyFromArray($pStyles = null) @@ -210,7 +210,7 @@ class Font extends Supervisor implements \PhpSpreadsheet\IComparable } } } else { - throw new \PhpSpreadsheet\Exception('Invalid style array passed.'); + throw new \PhpOffice\PhpSpreadsheet\Exception('Invalid style array passed.'); } return $this; @@ -445,7 +445,7 @@ class Font extends Supervisor implements \PhpSpreadsheet\IComparable /** * Set Underline * - * @param string|bool $pValue \PhpSpreadsheet\Style\Font underline type + * @param string|bool $pValue \PhpOffice\PhpSpreadsheet\Style\Font underline type * If a boolean is passed, then TRUE equates to UNDERLINE_SINGLE, * false equates to UNDERLINE_NONE * @return Font @@ -516,7 +516,7 @@ class Font extends Supervisor implements \PhpSpreadsheet\IComparable * Set Color * * @param Color $pValue - * @throws \PhpSpreadsheet\Exception + * @throws \PhpOffice\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 ea853446..77c06f5f 100644 --- a/src/PhpSpreadsheet/Style/NumberFormat.php +++ b/src/PhpSpreadsheet/Style/NumberFormat.php @@ -1,6 +1,6 @@ * $spreadsheet->getActiveSheet()->getStyle('B2')->getNumberFormat()->applyFromArray( * array( - * 'code' => \PhpSpreadsheet\Style\NumberFormat::FORMAT_CURRENCY_EUR_SIMPLE + * 'code' => \PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_CURRENCY_EUR_SIMPLE * ) * ); * * * @param array $pStyles Array containing style information - * @throws \PhpSpreadsheet\Exception + * @throws \PhpOffice\PhpSpreadsheet\Exception * @return NumberFormat */ public function applyFromArray($pStyles = null) @@ -163,7 +163,7 @@ class NumberFormat extends Supervisor implements \PhpSpreadsheet\IComparable } } } else { - throw new \PhpSpreadsheet\Exception('Invalid style array passed.'); + throw new \PhpOffice\PhpSpreadsheet\Exception('Invalid style array passed.'); } return $this; @@ -489,7 +489,7 @@ class NumberFormat extends Supervisor implements \PhpSpreadsheet\IComparable // escape any quoted characters so that DateTime format() will render them correctly $format = preg_replace_callback('/"(.*)"/U', ['self', 'escapeQuotesCallback'], $format); - $dateObj = \PhpSpreadsheet\Shared\Date::excelToDateTimeObject($value); + $dateObj = \PhpOffice\PhpSpreadsheet\Shared\Date::excelToDateTimeObject($value); $value = $dateObj->format($format); } @@ -520,7 +520,7 @@ class NumberFormat extends Supervisor implements \PhpSpreadsheet\IComparable $decimalLength = strlen($decimalPart); $decimalDivisor = pow(10, $decimalLength); - $GCD = \PhpSpreadsheet\Calculation\MathTrig::GCD($decimalPart, $decimalDivisor); + $GCD = \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::GCD($decimalPart, $decimalDivisor); $adjustedDecimalPart = $decimalPart / $GCD; $adjustedDecimalDivisor = $decimalDivisor / $GCD; @@ -712,8 +712,8 @@ class NumberFormat extends Supervisor implements \PhpSpreadsheet\IComparable $value = number_format( $value, strlen($right), - \PhpSpreadsheet\Shared\StringHelper::getDecimalSeparator(), - \PhpSpreadsheet\Shared\StringHelper::getThousandsSeparator() + \PhpOffice\PhpSpreadsheet\Shared\StringHelper::getDecimalSeparator(), + \PhpOffice\PhpSpreadsheet\Shared\StringHelper::getThousandsSeparator() ); $value = preg_replace($number_regex, $value, $format); } else { @@ -736,7 +736,7 @@ class NumberFormat extends Supervisor implements \PhpSpreadsheet\IComparable $currencyCode = $m[1]; list($currencyCode) = explode('-', $currencyCode); if ($currencyCode == '') { - $currencyCode = \PhpSpreadsheet\Shared\StringHelper::getCurrencyCode(); + $currencyCode = \PhpOffice\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 44a9f51c..eeef236a 100644 --- a/src/PhpSpreadsheet/Style/Protection.php +++ b/src/PhpSpreadsheet/Style/Protection.php @@ -1,6 +1,6 @@ * * @param array $pStyles Array containing style information - * @throws \PhpSpreadsheet\Exception + * @throws \PhpOffice\PhpSpreadsheet\Exception * @return Protection */ public function applyFromArray($pStyles = null) @@ -119,7 +119,7 @@ class Protection extends Supervisor implements \PhpSpreadsheet\IComparable } } } else { - throw new \PhpSpreadsheet\Exception('Invalid style array passed.'); + throw new \PhpOffice\PhpSpreadsheet\Exception('Invalid style array passed.'); } return $this; diff --git a/src/PhpSpreadsheet/Style/Supervisor.php b/src/PhpSpreadsheet/Style/Supervisor.php index c924b5b9..6833799a 100644 --- a/src/PhpSpreadsheet/Style/Supervisor.php +++ b/src/PhpSpreadsheet/Style/Supervisor.php @@ -1,6 +1,6 @@ range = $pRange; $this->workSheet = $pSheet; @@ -62,7 +62,7 @@ class AutoFilter /** * Get AutoFilter Parent Worksheet * - * @return \PhpSpreadsheet\Worksheet + * @return \PhpOffice\PhpSpreadsheet\Worksheet */ public function getParent() { @@ -72,10 +72,10 @@ class AutoFilter /** * Set AutoFilter Parent Worksheet * - * @param \PhpSpreadsheet\Worksheet $pSheet + * @param \PhpOffice\PhpSpreadsheet\Worksheet $pSheet * @return AutoFilter */ - public function setParent(\PhpSpreadsheet\Worksheet $pSheet = null) + public function setParent(\PhpOffice\PhpSpreadsheet\Worksheet $pSheet = null) { $this->workSheet = $pSheet; @@ -96,7 +96,7 @@ class AutoFilter * Set AutoFilter Range * * @param string $pRange Cell range (i.e. A1:E10) - * @throws \PhpSpreadsheet\Exception + * @throws \PhpOffice\PhpSpreadsheet\Exception * @return AutoFilter */ public function setRange($pRange = '') @@ -112,7 +112,7 @@ class AutoFilter } elseif (empty($pRange)) { $this->range = ''; } else { - throw new \PhpSpreadsheet\Exception('Autofilter must be set on a range of cells.'); + throw new \PhpOffice\PhpSpreadsheet\Exception('Autofilter must be set on a range of cells.'); } if (empty($pRange)) { @@ -120,9 +120,9 @@ class AutoFilter $this->columns = []; } else { // Discard any column rules that are no longer valid within this range - list($rangeStart, $rangeEnd) = \PhpSpreadsheet\Cell::rangeBoundaries($this->range); + list($rangeStart, $rangeEnd) = \PhpOffice\PhpSpreadsheet\Cell::rangeBoundaries($this->range); foreach ($this->columns as $key => $value) { - $colIndex = \PhpSpreadsheet\Cell::columnIndexFromString($key); + $colIndex = \PhpOffice\PhpSpreadsheet\Cell::columnIndexFromString($key); if (($rangeStart[0] > $colIndex) || ($rangeEnd[0] < $colIndex)) { unset($this->columns[$key]); } @@ -135,7 +135,7 @@ class AutoFilter /** * Get all AutoFilter Columns * - * @throws \PhpSpreadsheet\Exception + * @throws \PhpOffice\PhpSpreadsheet\Exception * @return AutoFilter\Column[] */ public function getColumns() @@ -147,19 +147,19 @@ class AutoFilter * Validate that the specified column is in the AutoFilter range * * @param string $column Column name (e.g. A) - * @throws \PhpSpreadsheet\Exception + * @throws \PhpOffice\PhpSpreadsheet\Exception * @return int The column offset within the autofilter range */ public function testColumnInRange($column) { if (empty($this->range)) { - throw new \PhpSpreadsheet\Exception('No autofilter range is defined.'); + throw new \PhpOffice\PhpSpreadsheet\Exception('No autofilter range is defined.'); } - $columnIndex = \PhpSpreadsheet\Cell::columnIndexFromString($column); - list($rangeStart, $rangeEnd) = \PhpSpreadsheet\Cell::rangeBoundaries($this->range); + $columnIndex = \PhpOffice\PhpSpreadsheet\Cell::columnIndexFromString($column); + list($rangeStart, $rangeEnd) = \PhpOffice\PhpSpreadsheet\Cell::rangeBoundaries($this->range); if (($rangeStart[0] > $columnIndex) || ($rangeEnd[0] < $columnIndex)) { - throw new \PhpSpreadsheet\Exception('Column is outside of current autofilter range.'); + throw new \PhpOffice\PhpSpreadsheet\Exception('Column is outside of current autofilter range.'); } return $columnIndex - $rangeStart[0]; @@ -169,7 +169,7 @@ class AutoFilter * Get a specified AutoFilter Column Offset within the defined AutoFilter range * * @param string $pColumn Column name (e.g. A) - * @throws \PhpSpreadsheet\Exception + * @throws \PhpOffice\PhpSpreadsheet\Exception * @return int The offset of the specified column within the autofilter range */ public function getColumnOffset($pColumn) @@ -181,7 +181,7 @@ class AutoFilter * Get a specified AutoFilter Column * * @param string $pColumn Column name (e.g. A) - * @throws \PhpSpreadsheet\Exception + * @throws \PhpOffice\PhpSpreadsheet\Exception * @return AutoFilter\Column */ public function getColumn($pColumn) @@ -199,13 +199,13 @@ class AutoFilter * Get a specified AutoFilter Column by it's offset * * @param int $pColumnOffset Column offset within range (starting from 0) - * @throws \PhpSpreadsheet\Exception + * @throws \PhpOffice\PhpSpreadsheet\Exception * @return AutoFilter\Column */ public function getColumnByOffset($pColumnOffset = 0) { - list($rangeStart, $rangeEnd) = \PhpSpreadsheet\Cell::rangeBoundaries($this->range); - $pColumn = \PhpSpreadsheet\Cell::stringFromColumnIndex($rangeStart[0] + $pColumnOffset - 1); + list($rangeStart, $rangeEnd) = \PhpOffice\PhpSpreadsheet\Cell::rangeBoundaries($this->range); + $pColumn = \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($rangeStart[0] + $pColumnOffset - 1); return $this->getColumn($pColumn); } @@ -215,7 +215,7 @@ class AutoFilter * * @param AutoFilter\Column|string $pColumn * A simple string containing a Column ID like 'A' is permitted - * @throws \PhpSpreadsheet\Exception + * @throws \PhpOffice\PhpSpreadsheet\Exception * @return AutoFilter */ public function setColumn($pColumn) @@ -225,7 +225,7 @@ class AutoFilter } elseif (is_object($pColumn) && ($pColumn instanceof AutoFilter\Column)) { $column = $pColumn->getColumnIndex(); } else { - throw new \PhpSpreadsheet\Exception('Column is not within the autofilter range.'); + throw new \PhpOffice\PhpSpreadsheet\Exception('Column is not within the autofilter range.'); } $this->testColumnInRange($column); @@ -244,7 +244,7 @@ class AutoFilter * Clear a specified AutoFilter Column * * @param string $pColumn Column name (e.g. A) - * @throws \PhpSpreadsheet\Exception + * @throws \PhpOffice\PhpSpreadsheet\Exception * @return AutoFilter */ public function clearColumn($pColumn) @@ -321,7 +321,7 @@ class AutoFilter } if (is_numeric($cellValue)) { - $dateValue = \PhpSpreadsheet\Shared\Date::excelToTimestamp($cellValue); + $dateValue = \PhpOffice\PhpSpreadsheet\Shared\Date::excelToTimestamp($cellValue); if ($cellValue < 1) { // Just the time part $dtVal = date('His', $dateValue); @@ -439,7 +439,7 @@ class AutoFilter } if (is_numeric($cellValue)) { - $dateValue = date('m', \PhpSpreadsheet\Shared\Date::excelToTimestamp($cellValue)); + $dateValue = date('m', \PhpOffice\PhpSpreadsheet\Shared\Date::excelToTimestamp($cellValue)); if (in_array($dateValue, $monthSet)) { return true; } @@ -465,12 +465,12 @@ class AutoFilter */ private function dynamicFilterDateRange($dynamicRuleType, &$filterColumn) { - $rDateType = \PhpSpreadsheet\Calculation\Functions::getReturnDateType(); - \PhpSpreadsheet\Calculation\Functions::setReturnDateType(\PhpSpreadsheet\Calculation\Functions::RETURNDATE_PHP_NUMERIC); + $rDateType = \PhpOffice\PhpSpreadsheet\Calculation\Functions::getReturnDateType(); + \PhpOffice\PhpSpreadsheet\Calculation\Functions::setReturnDateType(\PhpOffice\PhpSpreadsheet\Calculation\Functions::RETURNDATE_PHP_NUMERIC); $val = $maxVal = null; $ruleValues = []; - $baseDate = \PhpSpreadsheet\Calculation\DateTime::DATENOW(); + $baseDate = \PhpOffice\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: @@ -503,41 +503,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) \PhpSpreadsheet\Shared\Date::PHPtoExcel(strtotime('+1 day', $baseDate)); - $val = (int) \PhpSpreadsheet\Shared\Date::PHPToExcel($baseDate); + $maxVal = (int) \PhpOffice\PhpSpreadsheet\Shared\Date::PHPtoExcel(strtotime('+1 day', $baseDate)); + $val = (int) \PhpOffice\PhpSpreadsheet\Shared\Date::PHPToExcel($baseDate); break; case AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_YEARTODATE: - $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))); + $maxVal = (int) \PhpOffice\PhpSpreadsheet\Shared\Date::PHPtoExcel(strtotime('+1 day', $baseDate)); + $val = (int) \PhpOffice\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) \PhpSpreadsheet\Shared\Date::PHPToExcel(gmmktime(0, 0, 0, 31, 12, date('Y', $baseDate))); + $maxVal = (int) \PhpOffice\PhpSpreadsheet\Shared\Date::PHPToExcel(gmmktime(0, 0, 0, 31, 12, date('Y', $baseDate))); ++$maxVal; - $val = (int) \PhpSpreadsheet\Shared\Date::PHPToExcel(gmmktime(0, 0, 0, 1, 1, date('Y', $baseDate))); + $val = (int) \PhpOffice\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) \PhpSpreadsheet\Shared\Date::PHPtoExcel(gmmktime(0, 0, 0, date('t', $baseDate), (1 + $thisQuarter) * 3, date('Y', $baseDate))); + $maxVal = (int) \PhpOffice\PhpSpreadsheet\Shared\Date::PHPtoExcel(gmmktime(0, 0, 0, date('t', $baseDate), (1 + $thisQuarter) * 3, date('Y', $baseDate))); ++$maxVal; - $val = (int) \PhpSpreadsheet\Shared\Date::PHPToExcel(gmmktime(0, 0, 0, 1, 1 + $thisQuarter * 3, date('Y', $baseDate))); + $val = (int) \PhpOffice\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) \PhpSpreadsheet\Shared\Date::PHPtoExcel(gmmktime(0, 0, 0, date('t', $baseDate), date('m', $baseDate), date('Y', $baseDate))); + $maxVal = (int) \PhpOffice\PhpSpreadsheet\Shared\Date::PHPtoExcel(gmmktime(0, 0, 0, date('t', $baseDate), date('m', $baseDate), date('Y', $baseDate))); ++$maxVal; - $val = (int) \PhpSpreadsheet\Shared\Date::PHPToExcel(gmmktime(0, 0, 0, 1, date('m', $baseDate), date('Y', $baseDate))); + $val = (int) \PhpOffice\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) \PhpSpreadsheet\Shared\Date::PHPToExcel($baseDate) - $dayOfWeek; + $val = (int) \PhpOffice\PhpSpreadsheet\Shared\Date::PHPToExcel($baseDate) - $dayOfWeek; $maxVal = $val + 7; break; } @@ -560,7 +560,7 @@ class AutoFilter // Set the rules for identifying rows for hide/show $ruleValues[] = ['operator' => AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_GREATERTHANOREQUAL, 'value' => $val]; $ruleValues[] = ['operator' => AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_LESSTHAN, 'value' => $maxVal]; - \PhpSpreadsheet\Calculation\Functions::setReturnDateType($rDateType); + \PhpOffice\PhpSpreadsheet\Calculation\Functions::setReturnDateType($rDateType); return ['method' => 'filterTestInCustomDataSet', 'arguments' => ['filterRules' => $ruleValues, 'join' => AutoFilter\Column::AUTOFILTER_COLUMN_JOIN_AND]]; } @@ -568,7 +568,7 @@ class AutoFilter private function calculateTopTenValue($columnID, $startRow, $endRow, $ruleType, $ruleValue) { $range = $columnID . $startRow . ':' . $columnID . $endRow; - $dataValues = \PhpSpreadsheet\Calculation\Functions::flattenArray($this->workSheet->rangeToArray($range, null, true, false)); + $dataValues = \PhpOffice\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) { @@ -583,12 +583,12 @@ class AutoFilter /** * Apply the AutoFilter rules to the AutoFilter Range * - * @throws \PhpSpreadsheet\Exception + * @throws \PhpOffice\PhpSpreadsheet\Exception * @return AutoFilter */ public function showHideRows() { - list($rangeStart, $rangeEnd) = \PhpSpreadsheet\Cell::rangeBoundaries($this->range); + list($rangeStart, $rangeEnd) = \PhpOffice\PhpSpreadsheet\Cell::rangeBoundaries($this->range); // The heading row should always be visible $this->workSheet->getRowDimension($rangeStart[1])->setVisible(true); @@ -698,7 +698,7 @@ class AutoFilter // Number (Average) based // Calculate the average $averageFormula = '=AVERAGE(' . $columnID . ($rangeStart[1] + 1) . ':' . $columnID . $rangeEnd[1] . ')'; - $average = \PhpSpreadsheet\Calculation::getInstance()->calculateFormula($averageFormula, null, $this->workSheet->getCell('A1')); + $average = \PhpOffice\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 @@ -779,7 +779,7 @@ class AutoFilter // Execute the filter test $result = $result && call_user_func_array( - ['\\PhpSpreadsheet\\Worksheet\\AutoFilter', $columnFilterTest['method']], + ['\\PhpOffice\\PhpSpreadsheet\\Worksheet\\AutoFilter', $columnFilterTest['method']], [$cellValue, $columnFilterTest['arguments']] ); // If filter test has resulted in FALSE, exit the loop straightaway rather than running any more tests @@ -809,7 +809,7 @@ class AutoFilter $this->{$key} = clone $value; } } elseif ((is_array($value)) && ($key == 'columns')) { - // The columns array of \PhpSpreadsheet\Worksheet\AutoFilter objects + // The columns array of \PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter objects $this->{$key} = []; 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 3d889629..92dd046f 100644 --- a/src/PhpSpreadsheet/Worksheet/AutoFilter/Column.php +++ b/src/PhpSpreadsheet/Worksheet/AutoFilter/Column.php @@ -1,6 +1,6 @@ columnIndex = $pColumn; $this->parent = $pParent; @@ -133,7 +133,7 @@ class Column * Set AutoFilter Column Index * * @param string $pColumn Column (e.g. A) - * @throws \PhpSpreadsheet\Exception + * @throws \PhpOffice\PhpSpreadsheet\Exception * @return Column */ public function setColumnIndex($pColumn) @@ -152,7 +152,7 @@ class Column /** * Get this Column's AutoFilter Parent * - * @return \PhpSpreadsheet\Worksheet\AutoFilter + * @return \PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter */ public function getParent() { @@ -162,10 +162,10 @@ class Column /** * Set this Column's AutoFilter Parent * - * @param \PhpSpreadsheet\Worksheet\AutoFilter + * @param \PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter * @return Column */ - public function setParent(\PhpSpreadsheet\Worksheet\AutoFilter $pParent = null) + public function setParent(\PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter $pParent = null) { $this->parent = $pParent; @@ -186,13 +186,13 @@ class Column * Set AutoFilter Type * * @param string $pFilterType - * @throws \PhpSpreadsheet\Exception + * @throws \PhpOffice\PhpSpreadsheet\Exception * @return Column */ public function setFilterType($pFilterType = self::AUTOFILTER_FILTERTYPE_FILTER) { if (!in_array($pFilterType, self::$filterTypes)) { - throw new \PhpSpreadsheet\Exception('Invalid filter type for column AutoFilter.'); + throw new \PhpOffice\PhpSpreadsheet\Exception('Invalid filter type for column AutoFilter.'); } $this->filterType = $pFilterType; @@ -214,7 +214,7 @@ class Column * Set AutoFilter Multiple Rules And/Or * * @param string $pJoin And/Or - * @throws \PhpSpreadsheet\Exception + * @throws \PhpOffice\PhpSpreadsheet\Exception * @return Column */ public function setJoin($pJoin = self::AUTOFILTER_COLUMN_JOIN_OR) @@ -222,7 +222,7 @@ class Column // Lowercase And/Or $pJoin = strtolower($pJoin); if (!in_array($pJoin, self::$ruleJoins)) { - throw new \PhpSpreadsheet\Exception('Invalid rule connection for column AutoFilter.'); + throw new \PhpOffice\PhpSpreadsheet\Exception('Invalid rule connection for column AutoFilter.'); } $this->join = $pJoin; @@ -234,7 +234,7 @@ class Column * Set AutoFilter Attributes * * @param string[] $pAttributes - * @throws \PhpSpreadsheet\Exception + * @throws \PhpOffice\PhpSpreadsheet\Exception * @return Column */ public function setAttributes($pAttributes = []) @@ -249,7 +249,7 @@ class Column * * @param string $pName Attribute Name * @param string $pValue Attribute Value - * @throws \PhpSpreadsheet\Exception + * @throws \PhpOffice\PhpSpreadsheet\Exception * @return Column */ public function setAttribute($pName, $pValue) @@ -287,7 +287,7 @@ class Column /** * Get all AutoFilter Column Rules * - * @throws \PhpSpreadsheet\Exception + * @throws \PhpOffice\PhpSpreadsheet\Exception * @return Column\Rule[] */ public function getRules() @@ -385,7 +385,7 @@ class Column $this->$key = clone $value; } } elseif ((is_array($value)) && ($key == 'ruleset')) { - // The columns array of \PhpSpreadsheet\Worksheet\AutoFilter objects + // The columns array of \PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter objects $this->$key = []; 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 92abb78e..b248ba9a 100644 --- a/src/PhpSpreadsheet/Worksheet/AutoFilter/Column/Rule.php +++ b/src/PhpSpreadsheet/Worksheet/AutoFilter/Column/Rule.php @@ -1,6 +1,6 @@ parent = $pParent; } @@ -278,13 +278,13 @@ class Rule * Set AutoFilter Rule Type * * @param string $pRuleType - * @throws \PhpSpreadsheet\Exception + * @throws \PhpOffice\PhpSpreadsheet\Exception * @return Rule */ public function setRuleType($pRuleType = self::AUTOFILTER_RULETYPE_FILTER) { if (!in_array($pRuleType, self::$ruleTypes)) { - throw new \PhpSpreadsheet\Exception('Invalid rule type for column AutoFilter Rule.'); + throw new \PhpOffice\PhpSpreadsheet\Exception('Invalid rule type for column AutoFilter Rule.'); } $this->ruleType = $pRuleType; @@ -306,7 +306,7 @@ class Rule * Set AutoFilter Rule Value * * @param string|string[] $pValue - * @throws \PhpSpreadsheet\Exception + * @throws \PhpOffice\PhpSpreadsheet\Exception * @return Rule */ public function setValue($pValue = '') @@ -324,7 +324,7 @@ class Rule } } if (count($pValue) == 0) { - throw new \PhpSpreadsheet\Exception('Invalid rule value for column AutoFilter Rule.'); + throw new \PhpOffice\PhpSpreadsheet\Exception('Invalid rule value for column AutoFilter Rule.'); } // Set the dateTime grouping that we've anticipated $this->setGrouping(self::$dateTimeGroups[$grouping]); @@ -348,7 +348,7 @@ class Rule * Set AutoFilter Rule Operator * * @param string $pOperator - * @throws \PhpSpreadsheet\Exception + * @throws \PhpOffice\PhpSpreadsheet\Exception * @return Rule */ public function setOperator($pOperator = self::AUTOFILTER_COLUMN_RULE_EQUAL) @@ -358,7 +358,7 @@ class Rule } if ((!in_array($pOperator, self::$operators)) && (!in_array($pOperator, self::$topTenValue))) { - throw new \PhpSpreadsheet\Exception('Invalid operator for column AutoFilter Rule.'); + throw new \PhpOffice\PhpSpreadsheet\Exception('Invalid operator for column AutoFilter Rule.'); } $this->operator = $pOperator; @@ -379,7 +379,7 @@ class Rule * Set AutoFilter Rule Grouping * * @param string $pGrouping - * @throws \PhpSpreadsheet\Exception + * @throws \PhpOffice\PhpSpreadsheet\Exception * @return Rule */ public function setGrouping($pGrouping = null) @@ -388,7 +388,7 @@ class Rule (!in_array($pGrouping, self::$dateTimeGroups)) && (!in_array($pGrouping, self::$dynamicTypes)) && (!in_array($pGrouping, self::$topTenType))) { - throw new \PhpSpreadsheet\Exception('Invalid rule type for column AutoFilter Rule.'); + throw new \PhpOffice\PhpSpreadsheet\Exception('Invalid rule type for column AutoFilter Rule.'); } $this->grouping = $pGrouping; @@ -401,7 +401,7 @@ class Rule * @param string $pOperator * @param string|string[] $pValue * @param string $pGrouping - * @throws \PhpSpreadsheet\Exception + * @throws \PhpOffice\PhpSpreadsheet\Exception * @return Rule */ public function setRule($pOperator = self::AUTOFILTER_COLUMN_RULE_EQUAL, $pValue = '', $pGrouping = null) @@ -421,7 +421,7 @@ class Rule /** * Get this Rule's AutoFilter Column Parent * - * @return \PhpSpreadsheet\Worksheet\AutoFilter\Column + * @return \PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column */ public function getParent() { @@ -431,10 +431,10 @@ class Rule /** * Set this Rule's AutoFilter Column Parent * - * @param \PhpSpreadsheet\Worksheet\AutoFilter\Column + * @param \PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column * @return Rule */ - public function setParent(\PhpSpreadsheet\Worksheet\AutoFilter\Column $pParent = null) + public function setParent(\PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column $pParent = null) { $this->parent = $pParent; diff --git a/src/PhpSpreadsheet/Worksheet/BaseDrawing.php b/src/PhpSpreadsheet/Worksheet/BaseDrawing.php index 324deb80..4f8b8c11 100644 --- a/src/PhpSpreadsheet/Worksheet/BaseDrawing.php +++ b/src/PhpSpreadsheet/Worksheet/BaseDrawing.php @@ -1,6 +1,6 @@ worksheet)) { - // Add drawing to \PhpSpreadsheet\Worksheet + // Add drawing to \PhpOffice\PhpSpreadsheet\Worksheet $this->worksheet = $pValue; $this->worksheet->getCell($this->coordinates); $this->worksheet->getDrawingCollection()->append($this); } else { if ($pOverrideOld) { - // Remove drawing from old \PhpSpreadsheet\Worksheet + // Remove drawing from old \PhpOffice\PhpSpreadsheet\Worksheet $iterator = $this->worksheet->getDrawingCollection()->getIterator(); while ($iterator->valid()) { @@ -233,10 +233,10 @@ class BaseDrawing implements \PhpSpreadsheet\IComparable } } - // Set new \PhpSpreadsheet\Worksheet + // Set new \PhpOffice\PhpSpreadsheet\Worksheet $this->setWorksheet($pValue); } else { - throw new \PhpSpreadsheet\Exception("A \PhpSpreadsheet\Worksheet has already been assigned. Drawings can only exist on one \PhpSpreadsheet\Worksheet."); + throw new \PhpOffice\PhpSpreadsheet\Exception("A \PhpOffice\PhpSpreadsheet\Worksheet has already been assigned. Drawings can only exist on one \PhpOffice\PhpSpreadsheet\Worksheet."); } } @@ -465,7 +465,7 @@ class BaseDrawing implements \PhpSpreadsheet\IComparable * Set Shadow * * @param Drawing\Shadow $pValue - * @throws \PhpSpreadsheet\Exception + * @throws \PhpOffice\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 cbca32ca..57410766 100644 --- a/src/PhpSpreadsheet/Worksheet/CellIterator.php +++ b/src/PhpSpreadsheet/Worksheet/CellIterator.php @@ -1,6 +1,6 @@ parent = $parent; diff --git a/src/PhpSpreadsheet/Worksheet/ColumnCellIterator.php b/src/PhpSpreadsheet/Worksheet/ColumnCellIterator.php index 7cd71d35..ba52271b 100644 --- a/src/PhpSpreadsheet/Worksheet/ColumnCellIterator.php +++ b/src/PhpSpreadsheet/Worksheet/ColumnCellIterator.php @@ -1,6 +1,6 @@ subject = $subject; - $this->columnIndex = \PhpSpreadsheet\Cell::columnIndexFromString($columnIndex) - 1; + $this->columnIndex = \PhpOffice\PhpSpreadsheet\Cell::columnIndexFromString($columnIndex) - 1; $this->resetEnd($endRow); $this->resetStart($startRow); } @@ -76,7 +76,7 @@ class ColumnCellIterator extends CellIterator implements \Iterator * (Re)Set the start row and the current row pointer * * @param int $startRow The row number at which to start iterating - * @throws \PhpSpreadsheet\Exception + * @throws \PhpOffice\PhpSpreadsheet\Exception * @return ColumnCellIterator */ public function resetStart($startRow = 1) @@ -92,7 +92,7 @@ class ColumnCellIterator extends CellIterator implements \Iterator * (Re)Set the end row * * @param int $endRow The row number at which to stop iterating - * @throws \PhpSpreadsheet\Exception + * @throws \PhpOffice\PhpSpreadsheet\Exception * @return ColumnCellIterator */ public function resetEnd($endRow = null) @@ -107,15 +107,15 @@ class ColumnCellIterator extends CellIterator implements \Iterator * Set the row pointer to the selected row * * @param int $row The row number to set the current pointer at - * @throws \PhpSpreadsheet\Exception + * @throws \PhpOffice\PhpSpreadsheet\Exception * @return ColumnCellIterator */ public function seek($row = 1) { if (($row < $this->startRow) || ($row > $this->endRow)) { - throw new \PhpSpreadsheet\Exception("Row $row is out of range ({$this->startRow} - {$this->endRow})"); + throw new \PhpOffice\PhpSpreadsheet\Exception("Row $row is out of range ({$this->startRow} - {$this->endRow})"); } elseif ($this->onlyExistingCells && !($this->subject->cellExistsByColumnAndRow($this->columnIndex, $row))) { - throw new \PhpSpreadsheet\Exception('In "IterateOnlyExistingCells" mode and Cell does not exist'); + throw new \PhpOffice\PhpSpreadsheet\Exception('In "IterateOnlyExistingCells" mode and Cell does not exist'); } $this->position = $row; @@ -133,7 +133,7 @@ class ColumnCellIterator extends CellIterator implements \Iterator /** * Return the current cell in this worksheet column * - * @return null|\PhpSpreadsheet\Cell + * @return null|\PhpOffice\PhpSpreadsheet\Cell */ public function current() { @@ -168,7 +168,7 @@ class ColumnCellIterator extends CellIterator implements \Iterator public function prev() { if ($this->position <= $this->startRow) { - throw new \PhpSpreadsheet\Exception("Row is already at the beginning of range ({$this->startRow} - {$this->endRow})"); + throw new \PhpOffice\PhpSpreadsheet\Exception("Row is already at the beginning of range ({$this->startRow} - {$this->endRow})"); } do { @@ -191,7 +191,7 @@ class ColumnCellIterator extends CellIterator implements \Iterator /** * Validate start/end values for "IterateOnlyExistingCells" mode, and adjust if necessary * - * @throws \PhpSpreadsheet\Exception + * @throws \PhpOffice\PhpSpreadsheet\Exception */ protected function adjustForExistingOnlyRange() { @@ -201,14 +201,14 @@ class ColumnCellIterator extends CellIterator implements \Iterator ++$this->startRow; } if ($this->startRow > $this->endRow) { - throw new \PhpSpreadsheet\Exception('No cells exist within the specified range'); + throw new \PhpOffice\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 \PhpSpreadsheet\Exception('No cells exist within the specified range'); + throw new \PhpOffice\PhpSpreadsheet\Exception('No cells exist within the specified range'); } } } diff --git a/src/PhpSpreadsheet/Worksheet/ColumnDimension.php b/src/PhpSpreadsheet/Worksheet/ColumnDimension.php index 5381c8b5..b8b0294e 100644 --- a/src/PhpSpreadsheet/Worksheet/ColumnDimension.php +++ b/src/PhpSpreadsheet/Worksheet/ColumnDimension.php @@ -1,6 +1,6 @@ subject = $subject; @@ -89,7 +89,7 @@ class ColumnIterator implements \Iterator */ public function resetStart($startColumn = 'A') { - $startColumnIndex = \PhpSpreadsheet\Cell::columnIndexFromString($startColumn) - 1; + $startColumnIndex = \PhpOffice\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()})"); } @@ -112,7 +112,7 @@ class ColumnIterator implements \Iterator public function resetEnd($endColumn = null) { $endColumn = ($endColumn) ? $endColumn : $this->subject->getHighestColumn(); - $this->endColumn = \PhpSpreadsheet\Cell::columnIndexFromString($endColumn) - 1; + $this->endColumn = \PhpOffice\PhpSpreadsheet\Cell::columnIndexFromString($endColumn) - 1; return $this; } @@ -121,14 +121,14 @@ class ColumnIterator implements \Iterator * Set the column pointer to the selected column * * @param string $column The column address to set the current pointer at - * @throws \PhpSpreadsheet\Exception + * @throws \PhpOffice\PhpSpreadsheet\Exception * @return ColumnIterator */ public function seek($column = 'A') { - $column = \PhpSpreadsheet\Cell::columnIndexFromString($column) - 1; + $column = \PhpOffice\PhpSpreadsheet\Cell::columnIndexFromString($column) - 1; if (($column < $this->startColumn) || ($column > $this->endColumn)) { - throw new \PhpSpreadsheet\Exception("Column $column is out of range ({$this->startColumn} - {$this->endColumn})"); + throw new \PhpOffice\PhpSpreadsheet\Exception("Column $column is out of range ({$this->startColumn} - {$this->endColumn})"); } $this->position = $column; @@ -150,7 +150,7 @@ class ColumnIterator implements \Iterator */ public function current() { - return new Column($this->subject, \PhpSpreadsheet\Cell::stringFromColumnIndex($this->position)); + return new Column($this->subject, \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($this->position)); } /** @@ -160,7 +160,7 @@ class ColumnIterator implements \Iterator */ public function key() { - return \PhpSpreadsheet\Cell::stringFromColumnIndex($this->position); + return \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($this->position); } /** @@ -174,15 +174,15 @@ class ColumnIterator implements \Iterator /** * Set the iterator to its previous value * - * @throws \PhpSpreadsheet\Exception + * @throws \PhpOffice\PhpSpreadsheet\Exception */ public function prev() { if ($this->position <= $this->startColumn) { - throw new \PhpSpreadsheet\Exception( + throw new \PhpOffice\PhpSpreadsheet\Exception( 'Column is already at the beginning of range (' . - \PhpSpreadsheet\Cell::stringFromColumnIndex($this->endColumn) . ' - ' . - \PhpSpreadsheet\Cell::stringFromColumnIndex($this->endColumn) . ')' + \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($this->endColumn) . ' - ' . + \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($this->endColumn) . ')' ); } diff --git a/src/PhpSpreadsheet/Worksheet/Dimension.php b/src/PhpSpreadsheet/Worksheet/Dimension.php index 72477f95..de14d317 100644 --- a/src/PhpSpreadsheet/Worksheet/Dimension.php +++ b/src/PhpSpreadsheet/Worksheet/Dimension.php @@ -1,6 +1,6 @@ 7) { - throw new \PhpSpreadsheet\Exception('Outline level must range between 0 and 7.'); + throw new \PhpOffice\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 1f716311..10da155e 100644 --- a/src/PhpSpreadsheet/Worksheet/Drawing.php +++ b/src/PhpSpreadsheet/Worksheet/Drawing.php @@ -1,6 +1,6 @@ width, $this->height) = getimagesize($pValue); } } else { - throw new \PhpSpreadsheet\Exception("File $pValue not found!"); + throw new \PhpOffice\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 b4d6cb93..82d9bd89 100644 --- a/src/PhpSpreadsheet/Worksheet/Drawing/Shadow.php +++ b/src/PhpSpreadsheet/Worksheet/Drawing/Shadow.php @@ -1,6 +1,6 @@ distance = 2; $this->direction = 0; $this->alignment = self::SHADOW_BOTTOM_RIGHT; - $this->color = new \PhpSpreadsheet\Style\Color(\PhpSpreadsheet\Style\Color::COLOR_BLACK); + $this->color = new \PhpOffice\PhpSpreadsheet\Style\Color(\PhpOffice\PhpSpreadsheet\Style\Color::COLOR_BLACK); $this->alpha = 50; } @@ -222,7 +222,7 @@ class Shadow implements \PhpSpreadsheet\IComparable /** * Get Color * - * @return \PhpSpreadsheet\Style\Color + * @return \PhpOffice\PhpSpreadsheet\Style\Color */ public function getColor() { @@ -232,11 +232,11 @@ class Shadow implements \PhpSpreadsheet\IComparable /** * Set Color * - * @param \PhpSpreadsheet\Style\Color $pValue - * @throws \PhpSpreadsheet\Exception + * @param \PhpOffice\PhpSpreadsheet\Style\Color $pValue + * @throws \PhpOffice\PhpSpreadsheet\Exception * @return Shadow */ - public function setColor(\PhpSpreadsheet\Style\Color $pValue = null) + public function setColor(\PhpOffice\PhpSpreadsheet\Style\Color $pValue = null) { $this->color = $pValue; diff --git a/src/PhpSpreadsheet/Worksheet/HeaderFooter.php b/src/PhpSpreadsheet/Worksheet/HeaderFooter.php index 8dd777cd..17dcae1e 100644 --- a/src/PhpSpreadsheet/Worksheet/HeaderFooter.php +++ b/src/PhpSpreadsheet/Worksheet/HeaderFooter.php @@ -1,6 +1,6 @@ headerFooterImages = $images; diff --git a/src/PhpSpreadsheet/Worksheet/HeaderFooterDrawing.php b/src/PhpSpreadsheet/Worksheet/HeaderFooterDrawing.php index 70767072..f10a995a 100644 --- a/src/PhpSpreadsheet/Worksheet/HeaderFooterDrawing.php +++ b/src/PhpSpreadsheet/Worksheet/HeaderFooterDrawing.php @@ -1,6 +1,6 @@ width, $this->height) = getimagesize($pValue); } } else { - throw new \PhpSpreadsheet\Exception("File $pValue not found!"); + throw new \PhpOffice\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 1a6ab714..f5ace74f 100644 --- a/src/PhpSpreadsheet/Worksheet/Iterator.php +++ b/src/PhpSpreadsheet/Worksheet/Iterator.php @@ -1,10 +1,8 @@ subject = $subject; @@ -72,7 +70,7 @@ class Iterator implements \Iterator /** * Current Worksheet * - * @return \PhpSpreadsheet\Worksheet + * @return \PhpOffice\PhpSpreadsheet\Worksheet */ public function current() { diff --git a/src/PhpSpreadsheet/Worksheet/MemoryDrawing.php b/src/PhpSpreadsheet/Worksheet/MemoryDrawing.php index ae6957c1..b880b4fd 100644 --- a/src/PhpSpreadsheet/Worksheet/MemoryDrawing.php +++ b/src/PhpSpreadsheet/Worksheet/MemoryDrawing.php @@ -1,6 +1,6 @@ fitToPage = false; } } else { - throw new \PhpSpreadsheet\Exception('Scale must not be negative'); + throw new \PhpOffice\PhpSpreadsheet\Exception('Scale must not be negative'); } return $this; @@ -597,7 +597,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 \PhpSpreadsheet\Exception + * @throws \PhpOffice\PhpSpreadsheet\Exception * @return string */ public function getPrintArea($index = 0) @@ -609,7 +609,7 @@ class PageSetup if (isset($printAreas[$index - 1])) { return $printAreas[$index - 1]; } - throw new \PhpSpreadsheet\Exception('Requested Print Area does not exist'); + throw new \PhpOffice\PhpSpreadsheet\Exception('Requested Print Area does not exist'); } /** @@ -672,17 +672,17 @@ class PageSetup * @param string $method Determines the method used when setting multiple print areas * Default behaviour, or the "O" method, overwrites existing print area * The "I" method, inserts the new print area before any specified index, or at the end of the list - * @throws \PhpSpreadsheet\Exception + * @throws \PhpOffice\PhpSpreadsheet\Exception * @return PageSetup */ public function setPrintArea($value, $index = 0, $method = self::SETPRINTRANGE_OVERWRITE) { if (strpos($value, '!') !== false) { - throw new \PhpSpreadsheet\Exception('Cell coordinate must not specify a worksheet.'); + throw new \PhpOffice\PhpSpreadsheet\Exception('Cell coordinate must not specify a worksheet.'); } elseif (strpos($value, ':') === false) { - throw new \PhpSpreadsheet\Exception('Cell coordinate must be a range of cells.'); + throw new \PhpOffice\PhpSpreadsheet\Exception('Cell coordinate must be a range of cells.'); } elseif (strpos($value, '$') !== false) { - throw new \PhpSpreadsheet\Exception('Cell coordinate must not be absolute.'); + throw new \PhpOffice\PhpSpreadsheet\Exception('Cell coordinate must not be absolute.'); } $value = strtoupper($value); @@ -695,7 +695,7 @@ class PageSetup $index = count($printAreas) - abs($index) + 1; } if (($index <= 0) || ($index > count($printAreas))) { - throw new \PhpSpreadsheet\Exception('Invalid index for setting print range.'); + throw new \PhpOffice\PhpSpreadsheet\Exception('Invalid index for setting print range.'); } $printAreas[$index - 1] = $value; $this->printArea = implode(',', $printAreas); @@ -709,13 +709,13 @@ class PageSetup $index = abs($index) - 1; } if ($index > count($printAreas)) { - throw new \PhpSpreadsheet\Exception('Invalid index for setting print range.'); + throw new \PhpOffice\PhpSpreadsheet\Exception('Invalid index for setting print range.'); } $printAreas = array_merge(array_slice($printAreas, 0, $index), [$value], array_slice($printAreas, $index)); $this->printArea = implode(',', $printAreas); } } else { - throw new \PhpSpreadsheet\Exception('Invalid method for setting print range.'); + throw new \PhpOffice\PhpSpreadsheet\Exception('Invalid method for setting print range.'); } return $this; @@ -731,7 +731,7 @@ class PageSetup * Specifying an index value of 0, will always append the new print range at the end of the * list. * Print areas are numbered from 1 - * @throws \PhpSpreadsheet\Exception + * @throws \PhpOffice\PhpSpreadsheet\Exception * @return PageSetup */ public function addPrintArea($value, $index = -1) @@ -759,13 +759,13 @@ class PageSetup * @param string $method Determines the method used when setting multiple print areas * Default behaviour, or the "O" method, overwrites existing print area * The "I" method, inserts the new print area before any specified index, or at the end of the list - * @throws \PhpSpreadsheet\Exception + * @throws \PhpOffice\PhpSpreadsheet\Exception * @return PageSetup */ public function setPrintAreaByColumnAndRow($column1, $row1, $column2, $row2, $index = 0, $method = self::SETPRINTRANGE_OVERWRITE) { return $this->setPrintArea( - \PhpSpreadsheet\Cell::stringFromColumnIndex($column1) . $row1 . ':' . \PhpSpreadsheet\Cell::stringFromColumnIndex($column2) . $row2, + \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($column1) . $row1 . ':' . \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($column2) . $row2, $index, $method ); @@ -784,13 +784,13 @@ class PageSetup * Specifying an index value of 0, will always append the new print range at the end of the * list. * Print areas are numbered from 1 - * @throws \PhpSpreadsheet\Exception + * @throws \PhpOffice\PhpSpreadsheet\Exception * @return PageSetup */ public function addPrintAreaByColumnAndRow($column1, $row1, $column2, $row2, $index = -1) { return $this->setPrintArea( - \PhpSpreadsheet\Cell::stringFromColumnIndex($column1) . $row1 . ':' . \PhpSpreadsheet\Cell::stringFromColumnIndex($column2) . $row2, + \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($column1) . $row1 . ':' . \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($column2) . $row2, $index, self::SETPRINTRANGE_INSERT ); diff --git a/src/PhpSpreadsheet/Worksheet/Protection.php b/src/PhpSpreadsheet/Worksheet/Protection.php index fe8821a1..40d6f5e2 100644 --- a/src/PhpSpreadsheet/Worksheet/Protection.php +++ b/src/PhpSpreadsheet/Worksheet/Protection.php @@ -1,6 +1,6 @@ password = $pValue; diff --git a/src/PhpSpreadsheet/Worksheet/Row.php b/src/PhpSpreadsheet/Worksheet/Row.php index 54f18704..3806a645 100644 --- a/src/PhpSpreadsheet/Worksheet/Row.php +++ b/src/PhpSpreadsheet/Worksheet/Row.php @@ -1,6 +1,6 @@ parent = $parent; diff --git a/src/PhpSpreadsheet/Worksheet/RowCellIterator.php b/src/PhpSpreadsheet/Worksheet/RowCellIterator.php index e935d2f5..41456350 100644 --- a/src/PhpSpreadsheet/Worksheet/RowCellIterator.php +++ b/src/PhpSpreadsheet/Worksheet/RowCellIterator.php @@ -1,6 +1,6 @@ subject = $subject; @@ -76,15 +76,15 @@ class RowCellIterator extends CellIterator implements \Iterator * (Re)Set the start column and the current column pointer * * @param int $startColumn The column address at which to start iterating - * @throws \PhpSpreadsheet\Exception + * @throws \PhpOffice\PhpSpreadsheet\Exception * @return RowCellIterator */ public function resetStart($startColumn = 'A') { - $startColumnIndex = \PhpSpreadsheet\Cell::columnIndexFromString($startColumn) - 1; + $startColumnIndex = \PhpOffice\PhpSpreadsheet\Cell::columnIndexFromString($startColumn) - 1; $this->startColumn = $startColumnIndex; $this->adjustForExistingOnlyRange(); - $this->seek(\PhpSpreadsheet\Cell::stringFromColumnIndex($this->startColumn)); + $this->seek(\PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($this->startColumn)); return $this; } @@ -93,13 +93,13 @@ class RowCellIterator extends CellIterator implements \Iterator * (Re)Set the end column * * @param string $endColumn The column address at which to stop iterating - * @throws \PhpSpreadsheet\Exception + * @throws \PhpOffice\PhpSpreadsheet\Exception * @return RowCellIterator */ public function resetEnd($endColumn = null) { $endColumn = ($endColumn) ? $endColumn : $this->subject->getHighestColumn(); - $this->endColumn = \PhpSpreadsheet\Cell::columnIndexFromString($endColumn) - 1; + $this->endColumn = \PhpOffice\PhpSpreadsheet\Cell::columnIndexFromString($endColumn) - 1; $this->adjustForExistingOnlyRange(); return $this; @@ -109,16 +109,16 @@ class RowCellIterator extends CellIterator implements \Iterator * Set the column pointer to the selected column * * @param string $column The column address to set the current pointer at - * @throws \PhpSpreadsheet\Exception + * @throws \PhpOffice\PhpSpreadsheet\Exception * @return RowCellIterator */ public function seek($column = 'A') { - $column = \PhpSpreadsheet\Cell::columnIndexFromString($column) - 1; + $column = \PhpOffice\PhpSpreadsheet\Cell::columnIndexFromString($column) - 1; if (($column < $this->startColumn) || ($column > $this->endColumn)) { - throw new \PhpSpreadsheet\Exception("Column $column is out of range ({$this->startColumn} - {$this->endColumn})"); + throw new \PhpOffice\PhpSpreadsheet\Exception("Column $column is out of range ({$this->startColumn} - {$this->endColumn})"); } elseif ($this->onlyExistingCells && !($this->subject->cellExistsByColumnAndRow($column, $this->rowIndex))) { - throw new \PhpSpreadsheet\Exception('In "IterateOnlyExistingCells" mode and Cell does not exist'); + throw new \PhpOffice\PhpSpreadsheet\Exception('In "IterateOnlyExistingCells" mode and Cell does not exist'); } $this->position = $column; @@ -136,7 +136,7 @@ class RowCellIterator extends CellIterator implements \Iterator /** * Return the current cell in this worksheet row * - * @return \PhpSpreadsheet\Cell + * @return \PhpOffice\PhpSpreadsheet\Cell */ public function current() { @@ -150,7 +150,7 @@ class RowCellIterator extends CellIterator implements \Iterator */ public function key() { - return \PhpSpreadsheet\Cell::stringFromColumnIndex($this->position); + return \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($this->position); } /** @@ -168,15 +168,15 @@ class RowCellIterator extends CellIterator implements \Iterator /** * Set the iterator to its previous value * - * @throws \PhpSpreadsheet\Exception + * @throws \PhpOffice\PhpSpreadsheet\Exception */ public function prev() { if ($this->position <= $this->startColumn) { - throw new \PhpSpreadsheet\Exception( + throw new \PhpOffice\PhpSpreadsheet\Exception( 'Column is already at the beginning of range (' . - \PhpSpreadsheet\Cell::stringFromColumnIndex($this->endColumn) . ' - ' . - \PhpSpreadsheet\Cell::stringFromColumnIndex($this->endColumn) . ')' + \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($this->endColumn) . ' - ' . + \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($this->endColumn) . ')' ); } @@ -200,7 +200,7 @@ class RowCellIterator extends CellIterator implements \Iterator /** * Validate start/end values for "IterateOnlyExistingCells" mode, and adjust if necessary * - * @throws \PhpSpreadsheet\Exception + * @throws \PhpOffice\PhpSpreadsheet\Exception */ protected function adjustForExistingOnlyRange() { @@ -210,14 +210,14 @@ class RowCellIterator extends CellIterator implements \Iterator ++$this->startColumn; } if ($this->startColumn > $this->endColumn) { - throw new \PhpSpreadsheet\Exception('No cells exist within the specified range'); + throw new \PhpOffice\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 \PhpSpreadsheet\Exception('No cells exist within the specified range'); + throw new \PhpOffice\PhpSpreadsheet\Exception('No cells exist within the specified range'); } } } diff --git a/src/PhpSpreadsheet/Worksheet/RowDimension.php b/src/PhpSpreadsheet/Worksheet/RowDimension.php index 34850847..15587e6c 100644 --- a/src/PhpSpreadsheet/Worksheet/RowDimension.php +++ b/src/PhpSpreadsheet/Worksheet/RowDimension.php @@ -1,6 +1,6 @@ subject = $subject; @@ -81,13 +81,13 @@ class RowIterator implements \Iterator * (Re)Set the start row and the current row pointer * * @param int $startRow The row number at which to start iterating - * @throws \PhpSpreadsheet\Exception + * @throws \PhpOffice\PhpSpreadsheet\Exception * @return RowIterator */ public function resetStart($startRow = 1) { if ($startRow > $this->subject->getHighestRow()) { - throw new \PhpSpreadsheet\Exception("Start row ({$startRow}) is beyond highest row ({$this->subject->getHighestRow()})"); + throw new \PhpOffice\PhpSpreadsheet\Exception("Start row ({$startRow}) is beyond highest row ({$this->subject->getHighestRow()})"); } $this->startRow = $startRow; @@ -116,13 +116,13 @@ class RowIterator implements \Iterator * Set the row pointer to the selected row * * @param int $row The row number to set the current pointer at - * @throws \PhpSpreadsheet\Exception + * @throws \PhpOffice\PhpSpreadsheet\Exception * @return RowIterator */ public function seek($row = 1) { if (($row < $this->startRow) || ($row > $this->endRow)) { - throw new \PhpSpreadsheet\Exception("Row $row is out of range ({$this->startRow} - {$this->endRow})"); + throw new \PhpOffice\PhpSpreadsheet\Exception("Row $row is out of range ({$this->startRow} - {$this->endRow})"); } $this->position = $row; @@ -168,12 +168,12 @@ class RowIterator implements \Iterator /** * Set the iterator to its previous value * - * @throws \PhpSpreadsheet\Exception + * @throws \PhpOffice\PhpSpreadsheet\Exception */ public function prev() { if ($this->position <= $this->startRow) { - throw new \PhpSpreadsheet\Exception("Row is already at the beginning of range ({$this->startRow} - {$this->endRow})"); + throw new \PhpOffice\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 a5130296..f8be8833 100644 --- a/src/PhpSpreadsheet/Worksheet/SheetView.php +++ b/src/PhpSpreadsheet/Worksheet/SheetView.php @@ -1,6 +1,6 @@ = 1) || is_null($pValue)) { $this->zoomScale = $pValue; } else { - throw new \PhpSpreadsheet\Exception('Scale must be greater than or equal to 1.'); + throw new \PhpOffice\PhpSpreadsheet\Exception('Scale must be greater than or equal to 1.'); } return $this; @@ -119,7 +119,7 @@ class SheetView * Valid values range from 10 to 400. * * @param int $pValue - * @throws \PhpSpreadsheet\Exception + * @throws \PhpOffice\PhpSpreadsheet\Exception * @return SheetView */ public function setZoomScaleNormal($pValue = 100) @@ -127,7 +127,7 @@ class SheetView if (($pValue >= 1) || is_null($pValue)) { $this->zoomScaleNormal = $pValue; } else { - throw new \PhpSpreadsheet\Exception('Scale must be greater than or equal to 1.'); + throw new \PhpOffice\PhpSpreadsheet\Exception('Scale must be greater than or equal to 1.'); } return $this; @@ -152,7 +152,7 @@ class SheetView * 'pageBreakPreview' self::SHEETVIEW_PAGE_BREAK_PREVIEW * * @param string $pValue - * @throws \PhpSpreadsheet\Exception + * @throws \PhpOffice\PhpSpreadsheet\Exception * @return SheetView */ public function setView($pValue = null) @@ -164,7 +164,7 @@ class SheetView if (in_array($pValue, self::$sheetViewTypes)) { $this->sheetviewType = $pValue; } else { - throw new \PhpSpreadsheet\Exception('Invalid sheetview layout type.'); + throw new \PhpOffice\PhpSpreadsheet\Exception('Invalid sheetview layout type.'); } return $this; diff --git a/src/PhpSpreadsheet/Writer/BaseWriter.php b/src/PhpSpreadsheet/Writer/BaseWriter.php index 9e6836e4..4008a09a 100644 --- a/src/PhpSpreadsheet/Writer/BaseWriter.php +++ b/src/PhpSpreadsheet/Writer/BaseWriter.php @@ -1,6 +1,6 @@ spreadsheet = $spreadsheet; } @@ -104,10 +104,10 @@ class CSV extends BaseWriter implements IWriter // Fetch sheet $sheet = $this->spreadsheet->getSheet($this->sheetIndex); - $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); + $saveDebugLog = \PhpOffice\PhpSpreadsheet\Calculation::getInstance($this->spreadsheet)->getDebugLog()->getWriteDebugLog(); + \PhpOffice\PhpSpreadsheet\Calculation::getInstance($this->spreadsheet)->getDebugLog()->setWriteDebugLog(false); + $saveArrayReturnType = \PhpOffice\PhpSpreadsheet\Calculation::getArrayReturnType(); + \PhpOffice\PhpSpreadsheet\Calculation::setArrayReturnType(\PhpOffice\PhpSpreadsheet\Calculation::RETURN_ARRAY_AS_VALUE); // Open file $fileHandle = fopen($pFilename, 'wb+'); @@ -146,8 +146,8 @@ class CSV extends BaseWriter implements IWriter // Close file fclose($fileHandle); - \PhpSpreadsheet\Calculation::setArrayReturnType($saveArrayReturnType); - \PhpSpreadsheet\Calculation::getInstance($this->spreadsheet)->getDebugLog()->setWriteDebugLog($saveDebugLog); + \PhpOffice\PhpSpreadsheet\Calculation::setArrayReturnType($saveArrayReturnType); + \PhpOffice\PhpSpreadsheet\Calculation::getInstance($this->spreadsheet)->getDebugLog()->setWriteDebugLog($saveDebugLog); } /** diff --git a/src/PhpSpreadsheet/Writer/Excel2007.php b/src/PhpSpreadsheet/Writer/Excel2007.php index 1008cf09..48243b56 100644 --- a/src/PhpSpreadsheet/Writer/Excel2007.php +++ b/src/PhpSpreadsheet/Writer/Excel2007.php @@ -1,12 +1,10 @@ setSpreadsheet($spreadsheet); $writerPartsArray = [ - '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', + 'stringtable' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\Excel2007\\StringTable', + 'contenttypes' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\Excel2007\\ContentTypes', + 'docprops' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\Excel2007\\DocProps', + 'rels' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\Excel2007\\Rels', + 'theme' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\Excel2007\\Theme', + 'style' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\Excel2007\\Style', + 'workbook' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\Excel2007\\Workbook', + 'worksheet' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\Excel2007\\Worksheet', + 'drawing' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\Excel2007\\Drawing', + 'comments' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\Excel2007\\Comments', + 'chart' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\Excel2007\\Chart', + 'relsvba' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\Excel2007\\RelsVBA', + 'relsribbonobjects' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\Excel2007\\RelsRibbon', ]; // Initialise writer parts @@ -146,7 +144,7 @@ class Excel2007 extends BaseWriter implements IWriter // Set HashTable variables foreach ($hashTablesArray as $tableName) { - $this->$tableName = new \PhpSpreadsheet\HashTable(); + $this->$tableName = new \PhpOffice\PhpSpreadsheet\HashTable(); } } @@ -154,7 +152,7 @@ class Excel2007 extends BaseWriter implements IWriter * Get writer part * * @param string $pPartName Writer part name - * @return \PhpSpreadsheet\Writer\Excel2007\WriterPart + * @return \PhpOffice\PhpSpreadsheet\Writer\Excel2007\WriterPart */ public function getWriterPart($pPartName = '') { @@ -169,7 +167,7 @@ class Excel2007 extends BaseWriter implements IWriter * Save PhpSpreadsheet to file * * @param string $pFilename - * @throws \PhpSpreadsheet\Writer\Exception + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception */ public function save($pFilename = null) { @@ -180,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(\PhpSpreadsheet\Shared\File::sysGetTempDir(), 'phpxltmp'); + $pFilename = @tempnam(\PhpOffice\PhpSpreadsheet\Shared\File::sysGetTempDir(), 'phpxltmp'); if ($pFilename == '') { $pFilename = $originalFilename; } } - $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); + $saveDebugLog = \PhpOffice\PhpSpreadsheet\Calculation::getInstance($this->spreadSheet)->getDebugLog()->getWriteDebugLog(); + \PhpOffice\PhpSpreadsheet\Calculation::getInstance($this->spreadSheet)->getDebugLog()->setWriteDebugLog(false); + $saveDateReturnType = \PhpOffice\PhpSpreadsheet\Calculation\Functions::getReturnDateType(); + \PhpOffice\PhpSpreadsheet\Calculation\Functions::setReturnDateType(\PhpOffice\PhpSpreadsheet\Calculation\Functions::RETURNDATE_EXCEL); // Create string lookup table $this->stringTable = []; @@ -209,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 = \PhpSpreadsheet\Settings::getZipClass(); + $zipClass = \PhpOffice\PhpSpreadsheet\Settings::getZipClass(); /** @var \ZipArchive $objZip */ $objZip = new $zipClass(); @@ -225,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 \PhpSpreadsheet\Writer\Exception('Could not open ' . $pFilename . ' for writing.'); + throw new \PhpOffice\PhpSpreadsheet\Writer\Exception('Could not open ' . $pFilename . ' for writing.'); } } @@ -347,14 +345,14 @@ class Excel2007 extends BaseWriter implements IWriter // Add media for ($i = 0; $i < $this->getDrawingHashTable()->count(); ++$i) { - if ($this->getDrawingHashTable()->getByIndex($i) instanceof \PhpSpreadsheet\Worksheet\Drawing) { + if ($this->getDrawingHashTable()->getByIndex($i) instanceof \PhpOffice\PhpSpreadsheet\Worksheet\Drawing) { $imageContents = null; $imagePath = $this->getDrawingHashTable()->getByIndex($i)->getPath(); if (strpos($imagePath, 'zip://') !== false) { $imagePath = substr($imagePath, 6); $imagePathSplitted = explode('#', $imagePath); - $zipClass = \PhpSpreadsheet\Settings::getZipClass(); + $zipClass = \PhpOffice\PhpSpreadsheet\Settings::getZipClass(); $imageZip = new $zipClass(); $imageZip->open($imagePathSplitted[0]); $imageContents = $imageZip->getFromName($imagePathSplitted[1]); @@ -365,7 +363,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 \PhpSpreadsheet\Worksheet\MemoryDrawing) { + } elseif ($this->getDrawingHashTable()->getByIndex($i) instanceof \PhpOffice\PhpSpreadsheet\Worksheet\MemoryDrawing) { ob_start(); call_user_func( $this->getDrawingHashTable()->getByIndex($i)->getRenderingFunction(), @@ -378,30 +376,30 @@ class Excel2007 extends BaseWriter implements IWriter } } - \PhpSpreadsheet\Calculation\Functions::setReturnDateType($saveDateReturnType); - \PhpSpreadsheet\Calculation::getInstance($this->spreadSheet)->getDebugLog()->setWriteDebugLog($saveDebugLog); + \PhpOffice\PhpSpreadsheet\Calculation\Functions::setReturnDateType($saveDateReturnType); + \PhpOffice\PhpSpreadsheet\Calculation::getInstance($this->spreadSheet)->getDebugLog()->setWriteDebugLog($saveDebugLog); // Close file if ($objZip->close() === false) { - throw new \PhpSpreadsheet\Writer\Exception("Could not close zip file $pFilename."); + throw new \PhpOffice\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 \PhpSpreadsheet\Writer\Exception("Could not copy temporary zip file $pFilename to $originalFilename."); + throw new \PhpOffice\PhpSpreadsheet\Writer\Exception("Could not copy temporary zip file $pFilename to $originalFilename."); } @unlink($pFilename); } } else { - throw new \PhpSpreadsheet\Writer\Exception('PhpSpreadsheet object unassigned.'); + throw new \PhpOffice\PhpSpreadsheet\Writer\Exception('PhpSpreadsheet object unassigned.'); } } /** * Get Spreadsheet object * - * @throws \PhpSpreadsheet\Writer\Exception + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception * @return Spreadsheet */ public function getSpreadsheet() @@ -409,14 +407,14 @@ class Excel2007 extends BaseWriter implements IWriter if ($this->spreadSheet !== null) { return $this->spreadSheet; } else { - throw new \PhpSpreadsheet\Writer\Exception('No Spreadsheet object assigned.'); + throw new \PhpOffice\PhpSpreadsheet\Writer\Exception('No Spreadsheet object assigned.'); } } /** * Set Spreadsheet object * - * @param \PhpSpreadsheet\Spreadsheet $spreadsheet PhpSpreadsheet object + * @param \PhpOffice\PhpSpreadsheet\Spreadsheet $spreadsheet PhpSpreadsheet object * @throws Exception * @return Excel2007 */ @@ -438,9 +436,9 @@ class Excel2007 extends BaseWriter implements IWriter } /** - * Get \PhpSpreadsheet\Style HashTable + * Get \PhpOffice\PhpSpreadsheet\Style HashTable * - * @return \PhpSpreadsheet\HashTable + * @return \PhpOffice\PhpSpreadsheet\HashTable */ public function getStyleHashTable() { @@ -448,9 +446,9 @@ class Excel2007 extends BaseWriter implements IWriter } /** - * Get \PhpSpreadsheet\Style\Conditional HashTable + * Get \PhpOffice\PhpSpreadsheet\Style\Conditional HashTable * - * @return \PhpSpreadsheet\HashTable + * @return \PhpOffice\PhpSpreadsheet\HashTable */ public function getStylesConditionalHashTable() { @@ -458,9 +456,9 @@ class Excel2007 extends BaseWriter implements IWriter } /** - * Get \PhpSpreadsheet\Style\Fill HashTable + * Get \PhpOffice\PhpSpreadsheet\Style\Fill HashTable * - * @return \PhpSpreadsheet\HashTable + * @return \PhpOffice\PhpSpreadsheet\HashTable */ public function getFillHashTable() { @@ -468,9 +466,9 @@ class Excel2007 extends BaseWriter implements IWriter } /** - * Get \PhpSpreadsheet\Style\Font HashTable + * Get \PhpOffice\PhpSpreadsheet\Style\Font HashTable * - * @return \PhpSpreadsheet\HashTable + * @return \PhpOffice\PhpSpreadsheet\HashTable */ public function getFontHashTable() { @@ -478,9 +476,9 @@ class Excel2007 extends BaseWriter implements IWriter } /** - * Get \PhpSpreadsheet\Style\Borders HashTable + * Get \PhpOffice\PhpSpreadsheet\Style\Borders HashTable * - * @return \PhpSpreadsheet\HashTable + * @return \PhpOffice\PhpSpreadsheet\HashTable */ public function getBordersHashTable() { @@ -488,9 +486,9 @@ class Excel2007 extends BaseWriter implements IWriter } /** - * Get \PhpSpreadsheet\Style\NumberFormat HashTable + * Get \PhpOffice\PhpSpreadsheet\Style\NumberFormat HashTable * - * @return \PhpSpreadsheet\HashTable + * @return \PhpOffice\PhpSpreadsheet\HashTable */ public function getNumFmtHashTable() { @@ -498,9 +496,9 @@ class Excel2007 extends BaseWriter implements IWriter } /** - * Get \PhpSpreadsheet\Worksheet\BaseDrawing HashTable + * Get \PhpOffice\PhpSpreadsheet\Worksheet\BaseDrawing HashTable * - * @return \PhpSpreadsheet\HashTable + * @return \PhpOffice\PhpSpreadsheet\HashTable */ public function getDrawingHashTable() { diff --git a/src/PhpSpreadsheet/Writer/Excel2007/Chart.php b/src/PhpSpreadsheet/Writer/Excel2007/Chart.php index 86d6babb..90915669 100644 --- a/src/PhpSpreadsheet/Writer/Excel2007/Chart.php +++ b/src/PhpSpreadsheet/Writer/Excel2007/Chart.php @@ -1,15 +1,15 @@ calculateCellValues = $calculateCellValues; // Create XML writer $objWriter = null; if ($this->getParentWriter()->getUseDiskCaching()) { - $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); + $objWriter = new \PhpOffice\PhpSpreadsheet\Shared\XMLWriter(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); } else { - $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_MEMORY); + $objWriter = new \PhpOffice\PhpSpreadsheet\Shared\XMLWriter(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter::STORAGE_MEMORY); } // Ensure that data series values are up-to-date before we save if ($this->calculateCellValues) { @@ -119,12 +119,12 @@ class Chart extends WriterPart /** * Write Chart Title * - * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer * @param Title $title * - * @throws \PhpSpreadsheet\Writer\Exception + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception */ - private function writeTitle(\PhpSpreadsheet\Shared\XMLWriter $objWriter, Title $title = null) + private function writeTitle(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter, Title $title = null) { if (is_null($title)) { return; @@ -164,12 +164,12 @@ class Chart extends WriterPart /** * Write Chart Legend * - * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer * @param Legend $legend * - * @throws \PhpSpreadsheet\Writer\Exception + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception */ - private function writeLegend(\PhpSpreadsheet\Shared\XMLWriter $objWriter, Legend $legend = null) + private function writeLegend(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter, Legend $legend = null) { if (is_null($legend)) { return; @@ -215,17 +215,17 @@ class Chart extends WriterPart /** * Write Chart Plot Area * - * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer - * @param \PhpSpreadsheet\Worksheet $pSheet + * @param \PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpOffice\PhpSpreadsheet\Worksheet $pSheet * @param PlotArea $plotArea * @param Title $xAxisLabel * @param Title $yAxisLabel * @param Axis $xAxis * @param Axis $yAxis * - * @throws \PhpSpreadsheet\Writer\Exception + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception */ - 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) + private function writePlotArea(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter, \PhpOffice\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; @@ -351,10 +351,10 @@ class Chart extends WriterPart /** * Write Data Labels * - * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer - * @param \PhpSpreadsheet\Chart\Layout $chartLayout Chart layout + * @param \PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpOffice\PhpSpreadsheet\Chart\Layout $chartLayout Chart layout * - * @throws \PhpSpreadsheet\Writer\Exception + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception */ private function writeDataLabels($objWriter, Layout $chartLayout = null) { @@ -401,7 +401,7 @@ class Chart extends WriterPart /** * Write Category Axis * - * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer * @param PlotArea $plotArea * @param Title $xAxisLabel * @param string $groupType Chart type @@ -409,7 +409,7 @@ class Chart extends WriterPart * @param string $id2 * @param bool $isMultiLevelSeries * - * @throws \PhpSpreadsheet\Writer\Exception + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception */ private function writeCategoryAxis($objWriter, PlotArea $plotArea, $xAxisLabel, $groupType, $id1, $id2, $isMultiLevelSeries, $xAxis, $yAxis) { @@ -454,7 +454,7 @@ class Chart extends WriterPart $caption = $caption[0]; } $objWriter->startElement('a:t'); - $objWriter->writeRawData(\PhpSpreadsheet\Shared\StringHelper::controlCharacterPHP2OOXML($caption)); + $objWriter->writeRawData(\PhpOffice\PhpSpreadsheet\Shared\StringHelper::controlCharacterPHP2OOXML($caption)); $objWriter->endElement(); $objWriter->endElement(); @@ -522,7 +522,7 @@ class Chart extends WriterPart /** * Write Value Axis * - * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer * @param PlotArea $plotArea * @param Title $yAxisLabel * @param string $groupType Chart type @@ -530,7 +530,7 @@ class Chart extends WriterPart * @param string $id2 * @param bool $isMultiLevelSeries * - * @throws \PhpSpreadsheet\Writer\Exception + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception */ private function writeValueAxis($objWriter, PlotArea $plotArea, $yAxisLabel, $groupType, $id1, $id2, $isMultiLevelSeries, $xAxis, $yAxis, $majorGridlines, $minorGridlines) { @@ -803,7 +803,7 @@ class Chart extends WriterPart } $objWriter->startElement('a:t'); - $objWriter->writeRawData(\PhpSpreadsheet\Shared\StringHelper::controlCharacterPHP2OOXML($caption)); + $objWriter->writeRawData(\PhpOffice\PhpSpreadsheet\Shared\StringHelper::controlCharacterPHP2OOXML($caption)); $objWriter->endElement(); $objWriter->endElement(); @@ -1010,7 +1010,7 @@ class Chart extends WriterPart * * @param PlotArea $plotArea * - * @throws \PhpSpreadsheet\Writer\Exception + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception * @return string|array */ private static function getChartType($plotArea) @@ -1026,7 +1026,7 @@ class Chart extends WriterPart } $chartType = array_unique($chartTypes); if (count($chartTypes) == 0) { - throw new \PhpSpreadsheet\Writer\Exception('Chart is not yet implemented'); + throw new \PhpOffice\PhpSpreadsheet\Writer\Exception('Chart is not yet implemented'); } } @@ -1038,15 +1038,15 @@ class Chart extends WriterPart * * @param DataSeries $plotGroup * @param string $groupType Type of plot for dataseries - * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer * @param bool &$catIsMultiLevelSeries Is category a multi-series category * @param bool &$valIsMultiLevelSeries Is value set a multi-series set * @param string &$plotGroupingType Type of grouping for multi-series values - * @param \PhpSpreadsheet\Worksheet $pSheet + * @param \PhpOffice\PhpSpreadsheet\Worksheet $pSheet * - * @throws \PhpSpreadsheet\Writer\Exception + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception */ - private function writePlotGroup($plotGroup, $groupType, $objWriter, &$catIsMultiLevelSeries, &$valIsMultiLevelSeries, &$plotGroupingType, \PhpSpreadsheet\Worksheet $pSheet) + private function writePlotGroup($plotGroup, $groupType, $objWriter, &$catIsMultiLevelSeries, &$valIsMultiLevelSeries, &$plotGroupingType, \PhpOffice\PhpSpreadsheet\Worksheet $pSheet) { if (is_null($plotGroup)) { return; @@ -1216,9 +1216,9 @@ class Chart extends WriterPart * Write Plot Series Label * * @param DataSeriesValues $plotSeriesLabel - * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer * - * @throws \PhpSpreadsheet\Writer\Exception + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception */ private function writePlotSeriesLabel($plotSeriesLabel, $objWriter) { @@ -1251,13 +1251,13 @@ class Chart extends WriterPart * Write Plot Series Values * * @param DataSeriesValues $plotSeriesValues - * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer * @param string $groupType Type of plot for dataseries * @param string $dataType Datatype of series values * - * @throws \PhpSpreadsheet\Writer\Exception + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception */ - private function writePlotSeriesValues($plotSeriesValues, \PhpSpreadsheet\Shared\XMLWriter $objWriter, $groupType, $dataType = 'str') + private function writePlotSeriesValues($plotSeriesValues, \PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter, $groupType, $dataType = 'str') { if (is_null($plotSeriesValues)) { return; @@ -1345,9 +1345,9 @@ class Chart extends WriterPart * Write Bubble Chart Details * * @param DataSeriesValues $plotSeriesValues - * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer * - * @throws \PhpSpreadsheet\Writer\Exception + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception */ private function writeBubbles($plotSeriesValues, $objWriter) { @@ -1391,12 +1391,12 @@ class Chart extends WriterPart /** * Write Layout * - * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer * @param Layout $layout * - * @throws \PhpSpreadsheet\Writer\Exception + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception */ - private function writeLayout(\PhpSpreadsheet\Shared\XMLWriter $objWriter, Layout $layout = null) + private function writeLayout(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter, Layout $layout = null) { $objWriter->startElement('c:layout'); @@ -1461,9 +1461,9 @@ class Chart extends WriterPart /** * Write Alternate Content block * - * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer * - * @throws \PhpSpreadsheet\Writer\Exception + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception */ private function writeAlternateContent($objWriter) { @@ -1491,9 +1491,9 @@ class Chart extends WriterPart /** * Write Printer Settings * - * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer * - * @throws \PhpSpreadsheet\Writer\Exception + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception */ private function writePrintSettings($objWriter) { diff --git a/src/PhpSpreadsheet/Writer/Excel2007/Comments.php b/src/PhpSpreadsheet/Writer/Excel2007/Comments.php index 7a19964a..db14b4d5 100644 --- a/src/PhpSpreadsheet/Writer/Excel2007/Comments.php +++ b/src/PhpSpreadsheet/Writer/Excel2007/Comments.php @@ -1,6 +1,6 @@ getParentWriter()->getUseDiskCaching()) { - $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); + $objWriter = new \PhpOffice\PhpSpreadsheet\Shared\XMLWriter(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); } else { - $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_MEMORY); + $objWriter = new \PhpOffice\PhpSpreadsheet\Shared\XMLWriter(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter::STORAGE_MEMORY); } // XML header @@ -85,13 +85,13 @@ class Comments extends WriterPart /** * Write comment to XML format * - * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer * @param string $pCellReference Cell reference - * @param \PhpSpreadsheet\Comment $pComment Comment + * @param \PhpOffice\PhpSpreadsheet\Comment $pComment Comment * @param array $pAuthors Array of authors - * @throws \PhpSpreadsheet\Writer\Exception + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception */ - private function writeComment(\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, $pCellReference = 'A1', \PhpSpreadsheet\Comment $pComment = null, $pAuthors = null) + private function writeComment(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, $pCellReference = 'A1', \PhpOffice\PhpSpreadsheet\Comment $pComment = null, $pAuthors = null) { // comment $objWriter->startElement('comment'); @@ -109,18 +109,18 @@ class Comments extends WriterPart /** * Write VML comments to XML format * - * @param \PhpSpreadsheet\Worksheet $pWorksheet - * @throws \PhpSpreadsheet\Writer\Exception + * @param \PhpOffice\PhpSpreadsheet\Worksheet $pWorksheet + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception * @return string XML Output */ - public function writeVMLComments(\PhpSpreadsheet\Worksheet $pWorksheet = null) + public function writeVMLComments(\PhpOffice\PhpSpreadsheet\Worksheet $pWorksheet = null) { // Create XML writer $objWriter = null; if ($this->getParentWriter()->getUseDiskCaching()) { - $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); + $objWriter = new \PhpOffice\PhpSpreadsheet\Shared\XMLWriter(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); } else { - $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_MEMORY); + $objWriter = new \PhpOffice\PhpSpreadsheet\Shared\XMLWriter(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter::STORAGE_MEMORY); } // XML header @@ -181,16 +181,16 @@ class Comments extends WriterPart /** * Write VML comment to XML format * - * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer * @param string $pCellReference Cell reference - * @param \PhpSpreadsheet\Comment $pComment Comment - * @throws \PhpSpreadsheet\Writer\Exception + * @param \PhpOffice\PhpSpreadsheet\Comment $pComment Comment + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception */ - private function writeVMLComment(\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, $pCellReference = 'A1', \PhpSpreadsheet\Comment $pComment = null) + private function writeVMLComment(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, $pCellReference = 'A1', \PhpOffice\PhpSpreadsheet\Comment $pComment = null) { // Metadata - list($column, $row) = \PhpSpreadsheet\Cell::coordinateFromString($pCellReference); - $column = \PhpSpreadsheet\Cell::columnIndexFromString($column); + list($column, $row) = \PhpOffice\PhpSpreadsheet\Cell::coordinateFromString($pCellReference); + $column = \PhpOffice\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 9b34cdc6..fc743857 100644 --- a/src/PhpSpreadsheet/Writer/Excel2007/ContentTypes.php +++ b/src/PhpSpreadsheet/Writer/Excel2007/ContentTypes.php @@ -1,6 +1,6 @@ getParentWriter()->getUseDiskCaching()) { - $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); + $objWriter = new \PhpOffice\PhpSpreadsheet\Shared\XMLWriter(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); } else { - $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_MEMORY); + $objWriter = new \PhpOffice\PhpSpreadsheet\Shared\XMLWriter(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter::STORAGE_MEMORY); } // XML header @@ -135,10 +135,10 @@ class ContentTypes extends WriterPart $extension = ''; $mimeType = ''; - if ($this->getParentWriter()->getDrawingHashTable()->getByIndex($i) instanceof \PhpSpreadsheet\Worksheet\Drawing) { + if ($this->getParentWriter()->getDrawingHashTable()->getByIndex($i) instanceof \PhpOffice\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 \PhpSpreadsheet\Worksheet\MemoryDrawing) { + } elseif ($this->getParentWriter()->getDrawingHashTable()->getByIndex($i) instanceof \PhpOffice\PhpSpreadsheet\Worksheet\MemoryDrawing) { $extension = strtolower($this->getParentWriter()->getDrawingHashTable()->getByIndex($i)->getMimeType()); $extension = explode('/', $extension); $extension = $extension[1]; @@ -184,29 +184,29 @@ class ContentTypes extends WriterPart * Get image mime type * * @param string $pFile Filename - * @throws \PhpSpreadsheet\Writer\Exception + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception * @return string Mime Type */ private function getImageMimeType($pFile = '') { - if (\PhpSpreadsheet\Shared\File::fileExists($pFile)) { + if (\PhpOffice\PhpSpreadsheet\Shared\File::fileExists($pFile)) { $image = getimagesize($pFile); return image_type_to_mime_type($image[2]); } else { - throw new \PhpSpreadsheet\Writer\Exception("File $pFile does not exist"); + throw new \PhpOffice\PhpSpreadsheet\Writer\Exception("File $pFile does not exist"); } } /** * Write Default content type * - * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer * @param string $pPartname Part name * @param string $pContentType Content type - * @throws \PhpSpreadsheet\Writer\Exception + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception */ - private function writeDefaultContentType(\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, $pPartname = '', $pContentType = '') + private function writeDefaultContentType(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, $pPartname = '', $pContentType = '') { if ($pPartname != '' && $pContentType != '') { // Write content type @@ -215,19 +215,19 @@ class ContentTypes extends WriterPart $objWriter->writeAttribute('ContentType', $pContentType); $objWriter->endElement(); } else { - throw new \PhpSpreadsheet\Writer\Exception('Invalid parameters passed.'); + throw new \PhpOffice\PhpSpreadsheet\Writer\Exception('Invalid parameters passed.'); } } /** * Write Override content type * - * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer * @param string $pPartname Part name * @param string $pContentType Content type - * @throws \PhpSpreadsheet\Writer\Exception + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception */ - private function writeOverrideContentType(\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, $pPartname = '', $pContentType = '') + private function writeOverrideContentType(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, $pPartname = '', $pContentType = '') { if ($pPartname != '' && $pContentType != '') { // Write content type @@ -236,7 +236,7 @@ class ContentTypes extends WriterPart $objWriter->writeAttribute('ContentType', $pContentType); $objWriter->endElement(); } else { - throw new \PhpSpreadsheet\Writer\Exception('Invalid parameters passed.'); + throw new \PhpOffice\PhpSpreadsheet\Writer\Exception('Invalid parameters passed.'); } } } diff --git a/src/PhpSpreadsheet/Writer/Excel2007/DocProps.php b/src/PhpSpreadsheet/Writer/Excel2007/DocProps.php index 0a0f46c5..b2eda30c 100644 --- a/src/PhpSpreadsheet/Writer/Excel2007/DocProps.php +++ b/src/PhpSpreadsheet/Writer/Excel2007/DocProps.php @@ -1,6 +1,6 @@ getParentWriter()->getUseDiskCaching()) { - $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); + $objWriter = new \PhpOffice\PhpSpreadsheet\Shared\XMLWriter(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); } else { - $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_MEMORY); + $objWriter = new \PhpOffice\PhpSpreadsheet\Shared\XMLWriter(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter::STORAGE_MEMORY); } // XML header @@ -126,18 +126,18 @@ class DocProps extends WriterPart /** * Write docProps/core.xml to XML format * - * @param \PhpSpreadsheet\SpreadSheet $spreadsheet - * @throws \PhpSpreadsheet\Writer\Exception + * @param \PhpOffice\PhpSpreadsheet\SpreadSheet $spreadsheet + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception * @return string XML Output */ - public function writeDocPropsCore(\PhpSpreadsheet\SpreadSheet $spreadsheet = null) + public function writeDocPropsCore(\PhpOffice\PhpSpreadsheet\SpreadSheet $spreadsheet = null) { // Create XML writer $objWriter = null; if ($this->getParentWriter()->getUseDiskCaching()) { - $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); + $objWriter = new \PhpOffice\PhpSpreadsheet\Shared\XMLWriter(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); } else { - $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_MEMORY); + $objWriter = new \PhpOffice\PhpSpreadsheet\Shared\XMLWriter(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter::STORAGE_MEMORY); } // XML header @@ -193,11 +193,11 @@ class DocProps extends WriterPart /** * Write docProps/custom.xml to XML format * - * @param \PhpSpreadsheet\SpreadSheet $spreadsheet - * @throws \PhpSpreadsheet\Writer\Exception + * @param \PhpOffice\PhpSpreadsheet\SpreadSheet $spreadsheet + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception * @return string XML Output */ - public function writeDocPropsCustom(\PhpSpreadsheet\SpreadSheet $spreadsheet = null) + public function writeDocPropsCustom(\PhpOffice\PhpSpreadsheet\SpreadSheet $spreadsheet = null) { $customPropertyList = $spreadsheet->getProperties()->getCustomProperties(); if (empty($customPropertyList)) { @@ -207,9 +207,9 @@ class DocProps extends WriterPart // Create XML writer $objWriter = null; if ($this->getParentWriter()->getUseDiskCaching()) { - $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); + $objWriter = new \PhpOffice\PhpSpreadsheet\Shared\XMLWriter(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); } else { - $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_MEMORY); + $objWriter = new \PhpOffice\PhpSpreadsheet\Shared\XMLWriter(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter::STORAGE_MEMORY); } // XML header diff --git a/src/PhpSpreadsheet/Writer/Excel2007/Drawing.php b/src/PhpSpreadsheet/Writer/Excel2007/Drawing.php index b96aebc0..a904342c 100644 --- a/src/PhpSpreadsheet/Writer/Excel2007/Drawing.php +++ b/src/PhpSpreadsheet/Writer/Excel2007/Drawing.php @@ -1,8 +1,8 @@ getParentWriter()->getUseDiskCaching()) { - $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); + $objWriter = new \PhpOffice\PhpSpreadsheet\Shared\XMLWriter(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); } else { - $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_MEMORY); + $objWriter = new \PhpOffice\PhpSpreadsheet\Shared\XMLWriter(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter::STORAGE_MEMORY); } // XML header @@ -84,31 +84,31 @@ class Drawing extends WriterPart /** * Write drawings to XML format * - * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer * @param Chart $pChart * @param int $pRelationId - * @throws \PhpSpreadsheet\Writer\Exception + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception */ - public function writeChart(\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, Chart $pChart = null, $pRelationId = -1) + public function writeChart(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, Chart $pChart = null, $pRelationId = -1) { $tl = $pChart->getTopLeftPosition(); - $tl['colRow'] = \PhpSpreadsheet\Cell::coordinateFromString($tl['cell']); + $tl['colRow'] = \PhpOffice\PhpSpreadsheet\Cell::coordinateFromString($tl['cell']); $br = $pChart->getBottomRightPosition(); - $br['colRow'] = \PhpSpreadsheet\Cell::coordinateFromString($br['cell']); + $br['colRow'] = \PhpOffice\PhpSpreadsheet\Cell::coordinateFromString($br['cell']); $objWriter->startElement('xdr:twoCellAnchor'); $objWriter->startElement('xdr:from'); - $objWriter->writeElement('xdr:col', \PhpSpreadsheet\Cell::columnIndexFromString($tl['colRow'][0]) - 1); - $objWriter->writeElement('xdr:colOff', \PhpSpreadsheet\Shared\Drawing::pixelsToEMU($tl['xOffset'])); + $objWriter->writeElement('xdr:col', \PhpOffice\PhpSpreadsheet\Cell::columnIndexFromString($tl['colRow'][0]) - 1); + $objWriter->writeElement('xdr:colOff', \PhpOffice\PhpSpreadsheet\Shared\Drawing::pixelsToEMU($tl['xOffset'])); $objWriter->writeElement('xdr:row', $tl['colRow'][1] - 1); - $objWriter->writeElement('xdr:rowOff', \PhpSpreadsheet\Shared\Drawing::pixelsToEMU($tl['yOffset'])); + $objWriter->writeElement('xdr:rowOff', \PhpOffice\PhpSpreadsheet\Shared\Drawing::pixelsToEMU($tl['yOffset'])); $objWriter->endElement(); $objWriter->startElement('xdr:to'); - $objWriter->writeElement('xdr:col', \PhpSpreadsheet\Cell::columnIndexFromString($br['colRow'][0]) - 1); - $objWriter->writeElement('xdr:colOff', \PhpSpreadsheet\Shared\Drawing::pixelsToEMU($br['xOffset'])); + $objWriter->writeElement('xdr:col', \PhpOffice\PhpSpreadsheet\Cell::columnIndexFromString($br['colRow'][0]) - 1); + $objWriter->writeElement('xdr:colOff', \PhpOffice\PhpSpreadsheet\Shared\Drawing::pixelsToEMU($br['xOffset'])); $objWriter->writeElement('xdr:row', $br['colRow'][1] - 1); - $objWriter->writeElement('xdr:rowOff', \PhpSpreadsheet\Shared\Drawing::pixelsToEMU($br['yOffset'])); + $objWriter->writeElement('xdr:rowOff', \PhpOffice\PhpSpreadsheet\Shared\Drawing::pixelsToEMU($br['yOffset'])); $objWriter->endElement(); $objWriter->startElement('xdr:graphicFrame'); @@ -156,32 +156,32 @@ class Drawing extends WriterPart /** * Write drawings to XML format * - * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer - * @param \PhpSpreadsheet\Worksheet\BaseDrawing $pDrawing + * @param \PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpOffice\PhpSpreadsheet\Worksheet\BaseDrawing $pDrawing * @param int $pRelationId - * @throws \PhpSpreadsheet\Writer\Exception + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception */ - public function writeDrawing(\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpSpreadsheet\Worksheet\BaseDrawing $pDrawing = null, $pRelationId = -1) + public function writeDrawing(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpOffice\PhpSpreadsheet\Worksheet\BaseDrawing $pDrawing = null, $pRelationId = -1) { if ($pRelationId >= 0) { // xdr:oneCellAnchor $objWriter->startElement('xdr:oneCellAnchor'); // Image location - $aCoordinates = \PhpSpreadsheet\Cell::coordinateFromString($pDrawing->getCoordinates()); - $aCoordinates[0] = \PhpSpreadsheet\Cell::columnIndexFromString($aCoordinates[0]); + $aCoordinates = \PhpOffice\PhpSpreadsheet\Cell::coordinateFromString($pDrawing->getCoordinates()); + $aCoordinates[0] = \PhpOffice\PhpSpreadsheet\Cell::columnIndexFromString($aCoordinates[0]); // xdr:from $objWriter->startElement('xdr:from'); $objWriter->writeElement('xdr:col', $aCoordinates[0] - 1); - $objWriter->writeElement('xdr:colOff', \PhpSpreadsheet\Shared\Drawing::pixelsToEMU($pDrawing->getOffsetX())); + $objWriter->writeElement('xdr:colOff', \PhpOffice\PhpSpreadsheet\Shared\Drawing::pixelsToEMU($pDrawing->getOffsetX())); $objWriter->writeElement('xdr:row', $aCoordinates[1] - 1); - $objWriter->writeElement('xdr:rowOff', \PhpSpreadsheet\Shared\Drawing::pixelsToEMU($pDrawing->getOffsetY())); + $objWriter->writeElement('xdr:rowOff', \PhpOffice\PhpSpreadsheet\Shared\Drawing::pixelsToEMU($pDrawing->getOffsetY())); $objWriter->endElement(); // xdr:ext $objWriter->startElement('xdr:ext'); - $objWriter->writeAttribute('cx', \PhpSpreadsheet\Shared\Drawing::pixelsToEMU($pDrawing->getWidth())); - $objWriter->writeAttribute('cy', \PhpSpreadsheet\Shared\Drawing::pixelsToEMU($pDrawing->getHeight())); + $objWriter->writeAttribute('cx', \PhpOffice\PhpSpreadsheet\Shared\Drawing::pixelsToEMU($pDrawing->getWidth())); + $objWriter->writeAttribute('cy', \PhpOffice\PhpSpreadsheet\Shared\Drawing::pixelsToEMU($pDrawing->getHeight())); $objWriter->endElement(); // xdr:pic @@ -230,7 +230,7 @@ class Drawing extends WriterPart // a:xfrm $objWriter->startElement('a:xfrm'); - $objWriter->writeAttribute('rot', \PhpSpreadsheet\Shared\Drawing::degreesToAngle($pDrawing->getRotation())); + $objWriter->writeAttribute('rot', \PhpOffice\PhpSpreadsheet\Shared\Drawing::degreesToAngle($pDrawing->getRotation())); $objWriter->endElement(); // a:prstGeom @@ -248,9 +248,9 @@ class Drawing extends WriterPart // a:outerShdw $objWriter->startElement('a:outerShdw'); - $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('blurRad', \PhpOffice\PhpSpreadsheet\Shared\Drawing::pixelsToEMU($pDrawing->getShadow()->getBlurRadius())); + $objWriter->writeAttribute('dist', \PhpOffice\PhpSpreadsheet\Shared\Drawing::pixelsToEMU($pDrawing->getShadow()->getDistance())); + $objWriter->writeAttribute('dir', \PhpOffice\PhpSpreadsheet\Shared\Drawing::degreesToAngle($pDrawing->getShadow()->getDirection())); $objWriter->writeAttribute('algn', $pDrawing->getShadow()->getAlignment()); $objWriter->writeAttribute('rotWithShape', '0'); @@ -326,25 +326,25 @@ class Drawing extends WriterPart $objWriter->endElement(); } else { - throw new \PhpSpreadsheet\Writer\Exception('Invalid parameters passed.'); + throw new \PhpOffice\PhpSpreadsheet\Writer\Exception('Invalid parameters passed.'); } } /** * Write VML header/footer images to XML format * - * @param \PhpSpreadsheet\Worksheet $pWorksheet - * @throws \PhpSpreadsheet\Writer\Exception + * @param \PhpOffice\PhpSpreadsheet\Worksheet $pWorksheet + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception * @return string XML Output */ - public function writeVMLHeaderFooterImages(\PhpSpreadsheet\Worksheet $pWorksheet = null) + public function writeVMLHeaderFooterImages(\PhpOffice\PhpSpreadsheet\Worksheet $pWorksheet = null) { // Create XML writer $objWriter = null; if ($this->getParentWriter()->getUseDiskCaching()) { - $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); + $objWriter = new \PhpOffice\PhpSpreadsheet\Shared\XMLWriter(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); } else { - $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_MEMORY); + $objWriter = new \PhpOffice\PhpSpreadsheet\Shared\XMLWriter(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter::STORAGE_MEMORY); } // XML header @@ -480,12 +480,12 @@ class Drawing extends WriterPart /** * Write VML comment to XML format * - * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer * @param string $pReference Reference - * @param \PhpSpreadsheet\Worksheet\HeaderFooterDrawing $pImage Image - * @throws \PhpSpreadsheet\Writer\Exception + * @param \PhpOffice\PhpSpreadsheet\Worksheet\HeaderFooterDrawing $pImage Image + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception */ - private function writeVMLHeaderFooterImage(\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, $pReference = '', \PhpSpreadsheet\Worksheet\HeaderFooterDrawing $pImage = null) + private function writeVMLHeaderFooterImage(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, $pReference = '', \PhpOffice\PhpSpreadsheet\Worksheet\HeaderFooterDrawing $pImage = null) { // Calculate object id preg_match('{(\d+)}', md5($pReference), $m); @@ -522,11 +522,11 @@ class Drawing extends WriterPart /** * Get an array of all drawings * - * @param \PhpSpreadsheet\SpreadSheet $spreadsheet - * @throws \PhpSpreadsheet\Writer\Exception - * @return \PhpSpreadsheet\Worksheet\Drawing[] All drawings in PhpSpreadsheet + * @param \PhpOffice\PhpSpreadsheet\SpreadSheet $spreadsheet + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception + * @return \PhpOffice\PhpSpreadsheet\Worksheet\Drawing[] All drawings in PhpSpreadsheet */ - public function allDrawings(\PhpSpreadsheet\SpreadSheet $spreadsheet = null) + public function allDrawings(\PhpOffice\PhpSpreadsheet\SpreadSheet $spreadsheet = null) { // Get an array of all drawings $aDrawings = []; diff --git a/src/PhpSpreadsheet/Writer/Excel2007/Rels.php b/src/PhpSpreadsheet/Writer/Excel2007/Rels.php index d2100313..5adb8950 100644 --- a/src/PhpSpreadsheet/Writer/Excel2007/Rels.php +++ b/src/PhpSpreadsheet/Writer/Excel2007/Rels.php @@ -1,6 +1,6 @@ getParentWriter()->getUseDiskCaching()) { - $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); + $objWriter = new \PhpOffice\PhpSpreadsheet\Shared\XMLWriter(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); } else { - $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_MEMORY); + $objWriter = new \PhpOffice\PhpSpreadsheet\Shared\XMLWriter(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter::STORAGE_MEMORY); } // XML header @@ -102,18 +102,18 @@ class Rels extends WriterPart /** * Write workbook relationships to XML format * - * @param \PhpSpreadsheet\SpreadSheet $spreadsheet - * @throws \PhpSpreadsheet\Writer\Exception + * @param \PhpOffice\PhpSpreadsheet\SpreadSheet $spreadsheet + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception * @return string XML Output */ - public function writeWorkbookRelationships(\PhpSpreadsheet\SpreadSheet $spreadsheet = null) + public function writeWorkbookRelationships(\PhpOffice\PhpSpreadsheet\SpreadSheet $spreadsheet = null) { // Create XML writer $objWriter = null; if ($this->getParentWriter()->getUseDiskCaching()) { - $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); + $objWriter = new \PhpOffice\PhpSpreadsheet\Shared\XMLWriter(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); } else { - $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_MEMORY); + $objWriter = new \PhpOffice\PhpSpreadsheet\Shared\XMLWriter(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter::STORAGE_MEMORY); } // XML header @@ -181,20 +181,20 @@ class Rels extends WriterPart * rId1 - Drawings * rId_hyperlink_x - Hyperlinks * - * @param \PhpSpreadsheet\Worksheet $pWorksheet + * @param \PhpOffice\PhpSpreadsheet\Worksheet $pWorksheet * @param int $pWorksheetId * @param bool $includeCharts Flag indicating if we should write charts - * @throws \PhpSpreadsheet\Writer\Exception + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception * @return string XML Output */ - public function writeWorksheetRelationships(\PhpSpreadsheet\Worksheet $pWorksheet = null, $pWorksheetId = 1, $includeCharts = false) + public function writeWorksheetRelationships(\PhpOffice\PhpSpreadsheet\Worksheet $pWorksheet = null, $pWorksheetId = 1, $includeCharts = false) { // Create XML writer $objWriter = null; if ($this->getParentWriter()->getUseDiskCaching()) { - $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); + $objWriter = new \PhpOffice\PhpSpreadsheet\Shared\XMLWriter(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); } else { - $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_MEMORY); + $objWriter = new \PhpOffice\PhpSpreadsheet\Shared\XMLWriter(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter::STORAGE_MEMORY); } // XML header @@ -274,20 +274,20 @@ class Rels extends WriterPart /** * Write drawing relationships to XML format * - * @param \PhpSpreadsheet\Worksheet $pWorksheet + * @param \PhpOffice\PhpSpreadsheet\Worksheet $pWorksheet * @param int &$chartRef Chart ID * @param bool $includeCharts Flag indicating if we should write charts - * @throws \PhpSpreadsheet\Writer\Exception + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception * @return string XML Output */ - public function writeDrawingRelationships(\PhpSpreadsheet\Worksheet $pWorksheet, &$chartRef, $includeCharts = false) + public function writeDrawingRelationships(\PhpOffice\PhpSpreadsheet\Worksheet $pWorksheet, &$chartRef, $includeCharts = false) { // Create XML writer $objWriter = null; if ($this->getParentWriter()->getUseDiskCaching()) { - $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); + $objWriter = new \PhpOffice\PhpSpreadsheet\Shared\XMLWriter(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); } else { - $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_MEMORY); + $objWriter = new \PhpOffice\PhpSpreadsheet\Shared\XMLWriter(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter::STORAGE_MEMORY); } // XML header @@ -301,8 +301,8 @@ class Rels extends WriterPart $i = 1; $iterator = $pWorksheet->getDrawingCollection()->getIterator(); while ($iterator->valid()) { - if ($iterator->current() instanceof \PhpSpreadsheet\Worksheet\Drawing - || $iterator->current() instanceof \PhpSpreadsheet\Worksheet\MemoryDrawing) { + if ($iterator->current() instanceof \PhpOffice\PhpSpreadsheet\Worksheet\Drawing + || $iterator->current() instanceof \PhpOffice\PhpSpreadsheet\Worksheet\MemoryDrawing) { // Write relationship for image drawing $this->writeRelationship( $objWriter, @@ -339,18 +339,18 @@ class Rels extends WriterPart /** * Write header/footer drawing relationships to XML format * - * @param \PhpSpreadsheet\Worksheet $pWorksheet - * @throws \PhpSpreadsheet\Writer\Exception + * @param \PhpOffice\PhpSpreadsheet\Worksheet $pWorksheet + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception * @return string XML Output */ - public function writeHeaderFooterDrawingRelationships(\PhpSpreadsheet\Worksheet $pWorksheet = null) + public function writeHeaderFooterDrawingRelationships(\PhpOffice\PhpSpreadsheet\Worksheet $pWorksheet = null) { // Create XML writer $objWriter = null; if ($this->getParentWriter()->getUseDiskCaching()) { - $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); + $objWriter = new \PhpOffice\PhpSpreadsheet\Shared\XMLWriter(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); } else { - $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_MEMORY); + $objWriter = new \PhpOffice\PhpSpreadsheet\Shared\XMLWriter(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter::STORAGE_MEMORY); } // XML header @@ -379,14 +379,14 @@ class Rels extends WriterPart /** * Write Override content type * - * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpOffice\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 \PhpSpreadsheet\Writer\Exception + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception */ - private function writeRelationship(\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, $pId = 1, $pType = '', $pTarget = '', $pTargetMode = '') + private function writeRelationship(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, $pId = 1, $pType = '', $pTarget = '', $pTargetMode = '') { if ($pType != '' && $pTarget != '') { // Write relationship @@ -401,7 +401,7 @@ class Rels extends WriterPart $objWriter->endElement(); } else { - throw new \PhpSpreadsheet\Writer\Exception('Invalid parameters passed.'); + throw new \PhpOffice\PhpSpreadsheet\Writer\Exception('Invalid parameters passed.'); } } } diff --git a/src/PhpSpreadsheet/Writer/Excel2007/RelsRibbon.php b/src/PhpSpreadsheet/Writer/Excel2007/RelsRibbon.php index 649ccdc8..3ad109bb 100644 --- a/src/PhpSpreadsheet/Writer/Excel2007/RelsRibbon.php +++ b/src/PhpSpreadsheet/Writer/Excel2007/RelsRibbon.php @@ -1,6 +1,6 @@ getParentWriter()->getUseDiskCaching()) { - $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); + $objWriter = new \PhpOffice\PhpSpreadsheet\Shared\XMLWriter(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); } else { - $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_MEMORY); + $objWriter = new \PhpOffice\PhpSpreadsheet\Shared\XMLWriter(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter::STORAGE_MEMORY); } // XML header diff --git a/src/PhpSpreadsheet/Writer/Excel2007/RelsVBA.php b/src/PhpSpreadsheet/Writer/Excel2007/RelsVBA.php index 8c594303..32bdc0ca 100644 --- a/src/PhpSpreadsheet/Writer/Excel2007/RelsVBA.php +++ b/src/PhpSpreadsheet/Writer/Excel2007/RelsVBA.php @@ -1,6 +1,6 @@ getParentWriter()->getUseDiskCaching()) { - $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); + $objWriter = new \PhpOffice\PhpSpreadsheet\Shared\XMLWriter(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); } else { - $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_MEMORY); + $objWriter = new \PhpOffice\PhpSpreadsheet\Shared\XMLWriter(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter::STORAGE_MEMORY); } // XML header diff --git a/src/PhpSpreadsheet/Writer/Excel2007/StringTable.php b/src/PhpSpreadsheet/Writer/Excel2007/StringTable.php index ee50d089..b09b7a39 100644 --- a/src/PhpSpreadsheet/Writer/Excel2007/StringTable.php +++ b/src/PhpSpreadsheet/Writer/Excel2007/StringTable.php @@ -1,6 +1,6 @@ getDataType() == \PhpSpreadsheet\Cell\DataType::TYPE_STRING || $cell->getDataType() == \PhpSpreadsheet\Cell\DataType::TYPE_STRING2 || $cell->getDataType() == \PhpSpreadsheet\Cell\DataType::TYPE_NULL)) { + ($cell->getDataType() == \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING || $cell->getDataType() == \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING2 || $cell->getDataType() == \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_NULL)) { $aStringTable[] = $cellValue; $aFlippedStringTable[$cellValue] = true; - } elseif ($cellValue instanceof \PhpSpreadsheet\RichText && + } elseif ($cellValue instanceof \PhpOffice\PhpSpreadsheet\RichText && ($cellValue !== null) && !isset($aFlippedStringTable[$cellValue->getHashCode()])) { $aStringTable[] = $cellValue; @@ -71,7 +71,7 @@ class StringTable extends WriterPart return $aStringTable; } else { - throw new \PhpSpreadsheet\Writer\Exception("Invalid \PhpSpreadsheet\Worksheet object passed."); + throw new \PhpOffice\PhpSpreadsheet\Writer\Exception("Invalid \PhpOffice\PhpSpreadsheet\Worksheet object passed."); } } @@ -79,7 +79,7 @@ class StringTable extends WriterPart * Write string table to XML format * * @param string[] $pStringTable - * @throws \PhpSpreadsheet\Writer\Exception + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception * @return string XML Output */ public function writeStringTable($pStringTable = null) @@ -88,9 +88,9 @@ class StringTable extends WriterPart // Create XML writer $objWriter = null; if ($this->getParentWriter()->getUseDiskCaching()) { - $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); + $objWriter = new \PhpOffice\PhpSpreadsheet\Shared\XMLWriter(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); } else { - $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_MEMORY); + $objWriter = new \PhpOffice\PhpSpreadsheet\Shared\XMLWriter(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter::STORAGE_MEMORY); } // XML header @@ -105,15 +105,15 @@ class StringTable extends WriterPart foreach ($pStringTable as $textElement) { $objWriter->startElement('si'); - if (!$textElement instanceof \PhpSpreadsheet\RichText) { - $textToWrite = \PhpSpreadsheet\Shared\StringHelper::controlCharacterPHP2OOXML($textElement); + if (!$textElement instanceof \PhpOffice\PhpSpreadsheet\RichText) { + $textToWrite = \PhpOffice\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 \PhpSpreadsheet\RichText) { + } elseif ($textElement instanceof \PhpOffice\PhpSpreadsheet\RichText) { $this->writeRichText($objWriter, $textElement); } @@ -124,19 +124,19 @@ class StringTable extends WriterPart return $objWriter->getData(); } else { - throw new \PhpSpreadsheet\Writer\Exception('Invalid string table array passed.'); + throw new \PhpOffice\PhpSpreadsheet\Writer\Exception('Invalid string table array passed.'); } } /** * Write Rich Text * - * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer - * @param \PhpSpreadsheet\RichText $pRichText Rich text + * @param \PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpOffice\PhpSpreadsheet\RichText $pRichText Rich text * @param string $prefix Optional Namespace prefix - * @throws \PhpSpreadsheet\Writer\Exception + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception */ - public function writeRichText(\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpSpreadsheet\RichText $pRichText = null, $prefix = null) + public function writeRichText(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpOffice\PhpSpreadsheet\RichText $pRichText = null, $prefix = null) { if ($prefix !== null) { $prefix .= ':'; @@ -149,7 +149,7 @@ class StringTable extends WriterPart $objWriter->startElement($prefix . 'r'); // rPr - if ($element instanceof \PhpSpreadsheet\RichText\Run) { + if ($element instanceof \PhpOffice\PhpSpreadsheet\RichText\Run) { // rPr $objWriter->startElement($prefix . 'rPr'); @@ -205,7 +205,7 @@ class StringTable extends WriterPart // t $objWriter->startElement($prefix . 't'); $objWriter->writeAttribute('xml:space', 'preserve'); - $objWriter->writeRawData(\PhpSpreadsheet\Shared\StringHelper::controlCharacterPHP2OOXML($element->getText())); + $objWriter->writeRawData(\PhpOffice\PhpSpreadsheet\Shared\StringHelper::controlCharacterPHP2OOXML($element->getText())); $objWriter->endElement(); $objWriter->endElement(); @@ -215,16 +215,16 @@ class StringTable extends WriterPart /** * Write Rich Text * - * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer - * @param string|\PhpSpreadsheet\RichText $pRichText text string or Rich text + * @param \PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param string|\PhpOffice\PhpSpreadsheet\RichText $pRichText text string or Rich text * @param string $prefix Optional Namespace prefix - * @throws \PhpSpreadsheet\Writer\Exception + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception */ - public function writeRichTextForCharts(\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, $pRichText = null, $prefix = null) + public function writeRichTextForCharts(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, $pRichText = null, $prefix = null) { - if (!$pRichText instanceof \PhpSpreadsheet\RichText) { + if (!$pRichText instanceof \PhpOffice\PhpSpreadsheet\RichText) { $textRun = $pRichText; - $pRichText = new \PhpSpreadsheet\RichText(); + $pRichText = new \PhpOffice\PhpSpreadsheet\RichText(); $pRichText->createTextRun($textRun); } @@ -268,7 +268,7 @@ class StringTable extends WriterPart // t $objWriter->startElement($prefix . 't'); - $objWriter->writeRawData(\PhpSpreadsheet\Shared\StringHelper::controlCharacterPHP2OOXML($element->getText())); + $objWriter->writeRawData(\PhpOffice\PhpSpreadsheet\Shared\StringHelper::controlCharacterPHP2OOXML($element->getText())); $objWriter->endElement(); $objWriter->endElement(); @@ -288,9 +288,9 @@ class StringTable extends WriterPart // Loop through stringtable and add flipped items to $returnValue foreach ($stringTable as $key => $value) { - if (!$value instanceof \PhpSpreadsheet\RichText) { + if (!$value instanceof \PhpOffice\PhpSpreadsheet\RichText) { $returnValue[$value] = $key; - } elseif ($value instanceof \PhpSpreadsheet\RichText) { + } elseif ($value instanceof \PhpOffice\PhpSpreadsheet\RichText) { $returnValue[$value->getHashCode()] = $key; } } diff --git a/src/PhpSpreadsheet/Writer/Excel2007/Style.php b/src/PhpSpreadsheet/Writer/Excel2007/Style.php index 9db42e6f..0a03e43f 100644 --- a/src/PhpSpreadsheet/Writer/Excel2007/Style.php +++ b/src/PhpSpreadsheet/Writer/Excel2007/Style.php @@ -1,6 +1,6 @@ getParentWriter()->getUseDiskCaching()) { - $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); + $objWriter = new \PhpOffice\PhpSpreadsheet\Shared\XMLWriter(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); } else { - $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_MEMORY); + $objWriter = new \PhpOffice\PhpSpreadsheet\Shared\XMLWriter(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter::STORAGE_MEMORY); } // XML header @@ -159,15 +159,15 @@ class Style extends WriterPart /** * Write Fill * - * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer - * @param \PhpSpreadsheet\Style\Fill $pFill Fill style - * @throws \PhpSpreadsheet\Writer\Exception + * @param \PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpOffice\PhpSpreadsheet\Style\Fill $pFill Fill style + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception */ - private function writeFill(\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpSpreadsheet\Style\Fill $pFill = null) + private function writeFill(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpOffice\PhpSpreadsheet\Style\Fill $pFill = null) { // Check if this is a pattern type or gradient type - if ($pFill->getFillType() === \PhpSpreadsheet\Style\Fill::FILL_GRADIENT_LINEAR || - $pFill->getFillType() === \PhpSpreadsheet\Style\Fill::FILL_GRADIENT_PATH) { + if ($pFill->getFillType() === \PhpOffice\PhpSpreadsheet\Style\Fill::FILL_GRADIENT_LINEAR || + $pFill->getFillType() === \PhpOffice\PhpSpreadsheet\Style\Fill::FILL_GRADIENT_PATH) { // Gradient fill $this->writeGradientFill($objWriter, $pFill); } elseif ($pFill->getFillType() !== null) { @@ -179,11 +179,11 @@ class Style extends WriterPart /** * Write Gradient Fill * - * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer - * @param \PhpSpreadsheet\Style\Fill $pFill Fill style - * @throws \PhpSpreadsheet\Writer\Exception + * @param \PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpOffice\PhpSpreadsheet\Style\Fill $pFill Fill style + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception */ - private function writeGradientFill(\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpSpreadsheet\Style\Fill $pFill = null) + private function writeGradientFill(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpOffice\PhpSpreadsheet\Style\Fill $pFill = null) { // fill $objWriter->startElement('fill'); @@ -223,11 +223,11 @@ class Style extends WriterPart /** * Write Pattern Fill * - * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer - * @param \PhpSpreadsheet\Style\Fill $pFill Fill style - * @throws \PhpSpreadsheet\Writer\Exception + * @param \PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpOffice\PhpSpreadsheet\Style\Fill $pFill Fill style + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception */ - private function writePatternFill(\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpSpreadsheet\Style\Fill $pFill = null) + private function writePatternFill(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpOffice\PhpSpreadsheet\Style\Fill $pFill = null) { // fill $objWriter->startElement('fill'); @@ -236,7 +236,7 @@ class Style extends WriterPart $objWriter->startElement('patternFill'); $objWriter->writeAttribute('patternType', $pFill->getFillType()); - if ($pFill->getFillType() !== \PhpSpreadsheet\Style\Fill::FILL_NONE) { + if ($pFill->getFillType() !== \PhpOffice\PhpSpreadsheet\Style\Fill::FILL_NONE) { // fgColor if ($pFill->getStartColor()->getARGB()) { $objWriter->startElement('fgColor'); @@ -244,7 +244,7 @@ class Style extends WriterPart $objWriter->endElement(); } } - if ($pFill->getFillType() !== \PhpSpreadsheet\Style\Fill::FILL_NONE) { + if ($pFill->getFillType() !== \PhpOffice\PhpSpreadsheet\Style\Fill::FILL_NONE) { // bgColor if ($pFill->getEndColor()->getARGB()) { $objWriter->startElement('bgColor'); @@ -261,11 +261,11 @@ class Style extends WriterPart /** * Write Font * - * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer - * @param \PhpSpreadsheet\Style\Font $pFont Font style - * @throws \PhpSpreadsheet\Writer\Exception + * @param \PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpOffice\PhpSpreadsheet\Style\Font $pFont Font style + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception */ - private function writeFont(\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpSpreadsheet\Style\Font $pFont = null) + private function writeFont(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpOffice\PhpSpreadsheet\Style\Font $pFont = null) { // font $objWriter->startElement('font'); @@ -341,25 +341,25 @@ class Style extends WriterPart /** * Write Border * - * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer - * @param \PhpSpreadsheet\Style\Borders $pBorders Borders style - * @throws \PhpSpreadsheet\Writer\Exception + * @param \PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpOffice\PhpSpreadsheet\Style\Borders $pBorders Borders style + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception */ - private function writeBorder(\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpSpreadsheet\Style\Borders $pBorders = null) + private function writeBorder(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpOffice\PhpSpreadsheet\Style\Borders $pBorders = null) { // Write border $objWriter->startElement('border'); // Diagonal? switch ($pBorders->getDiagonalDirection()) { - case \PhpSpreadsheet\Style\Borders::DIAGONAL_UP: + case \PhpOffice\PhpSpreadsheet\Style\Borders::DIAGONAL_UP: $objWriter->writeAttribute('diagonalUp', 'true'); $objWriter->writeAttribute('diagonalDown', 'false'); break; - case \PhpSpreadsheet\Style\Borders::DIAGONAL_DOWN: + case \PhpOffice\PhpSpreadsheet\Style\Borders::DIAGONAL_DOWN: $objWriter->writeAttribute('diagonalUp', 'false'); $objWriter->writeAttribute('diagonalDown', 'true'); break; - case \PhpSpreadsheet\Style\Borders::DIAGONAL_BOTH: + case \PhpOffice\PhpSpreadsheet\Style\Borders::DIAGONAL_BOTH: $objWriter->writeAttribute('diagonalUp', 'true'); $objWriter->writeAttribute('diagonalDown', 'true'); break; @@ -377,12 +377,12 @@ class Style extends WriterPart /** * Write Cell Style Xf * - * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer - * @param \PhpSpreadsheet\Style $pStyle Style - * @param \PhpSpreadsheet\SpreadSheet $spreadsheet Workbook - * @throws \PhpSpreadsheet\Writer\Exception + * @param \PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpOffice\PhpSpreadsheet\Style $pStyle Style + * @param \PhpOffice\PhpSpreadsheet\SpreadSheet $spreadsheet Workbook + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception */ - private function writeCellStyleXf(\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpSpreadsheet\Style $pStyle = null, \PhpSpreadsheet\SpreadSheet $spreadsheet = null) + private function writeCellStyleXf(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpOffice\PhpSpreadsheet\Style $pStyle = null, \PhpOffice\PhpSpreadsheet\SpreadSheet $spreadsheet = null) { // xf $objWriter->startElement('xf'); @@ -407,7 +407,7 @@ class Style extends WriterPart $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) { + if ($pStyle->getProtection()->getLocked() != \PhpOffice\PhpSpreadsheet\Style\Protection::PROTECTION_INHERIT || $pStyle->getProtection()->getHidden() != \PhpOffice\PhpSpreadsheet\Style\Protection::PROTECTION_INHERIT) { $objWriter->writeAttribute('applyProtection', 'true'); } @@ -436,13 +436,13 @@ class Style extends WriterPart $objWriter->endElement(); // protection - if ($pStyle->getProtection()->getLocked() != \PhpSpreadsheet\Style\Protection::PROTECTION_INHERIT || $pStyle->getProtection()->getHidden() != \PhpSpreadsheet\Style\Protection::PROTECTION_INHERIT) { + if ($pStyle->getProtection()->getLocked() != \PhpOffice\PhpSpreadsheet\Style\Protection::PROTECTION_INHERIT || $pStyle->getProtection()->getHidden() != \PhpOffice\PhpSpreadsheet\Style\Protection::PROTECTION_INHERIT) { $objWriter->startElement('protection'); - 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()->getLocked() != \PhpOffice\PhpSpreadsheet\Style\Protection::PROTECTION_INHERIT) { + $objWriter->writeAttribute('locked', ($pStyle->getProtection()->getLocked() == \PhpOffice\PhpSpreadsheet\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')); + if ($pStyle->getProtection()->getHidden() != \PhpOffice\PhpSpreadsheet\Style\Protection::PROTECTION_INHERIT) { + $objWriter->writeAttribute('hidden', ($pStyle->getProtection()->getHidden() == \PhpOffice\PhpSpreadsheet\Style\Protection::PROTECTION_PROTECTED ? 'true' : 'false')); } $objWriter->endElement(); } @@ -453,11 +453,11 @@ class Style extends WriterPart /** * Write Cell Style Dxf * - * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer - * @param \PhpSpreadsheet\Style $pStyle Style - * @throws \PhpSpreadsheet\Writer\Exception + * @param \PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpOffice\PhpSpreadsheet\Style $pStyle Style + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception */ - private function writeCellStyleDxf(\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpSpreadsheet\Style $pStyle = null) + private function writeCellStyleDxf(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpOffice\PhpSpreadsheet\Style $pStyle = null) { // dxf $objWriter->startElement('dxf'); @@ -496,16 +496,16 @@ class Style extends WriterPart // protection if (($pStyle->getProtection()->getLocked() !== null) || ($pStyle->getProtection()->getHidden() !== null)) { - if ($pStyle->getProtection()->getLocked() !== \PhpSpreadsheet\Style\Protection::PROTECTION_INHERIT || - $pStyle->getProtection()->getHidden() !== \PhpSpreadsheet\Style\Protection::PROTECTION_INHERIT) { + if ($pStyle->getProtection()->getLocked() !== \PhpOffice\PhpSpreadsheet\Style\Protection::PROTECTION_INHERIT || + $pStyle->getProtection()->getHidden() !== \PhpOffice\PhpSpreadsheet\Style\Protection::PROTECTION_INHERIT) { $objWriter->startElement('protection'); if (($pStyle->getProtection()->getLocked() !== null) && - ($pStyle->getProtection()->getLocked() !== \PhpSpreadsheet\Style\Protection::PROTECTION_INHERIT)) { - $objWriter->writeAttribute('locked', ($pStyle->getProtection()->getLocked() == \PhpSpreadsheet\Style\Protection::PROTECTION_PROTECTED ? 'true' : 'false')); + ($pStyle->getProtection()->getLocked() !== \PhpOffice\PhpSpreadsheet\Style\Protection::PROTECTION_INHERIT)) { + $objWriter->writeAttribute('locked', ($pStyle->getProtection()->getLocked() == \PhpOffice\PhpSpreadsheet\Style\Protection::PROTECTION_PROTECTED ? 'true' : 'false')); } if (($pStyle->getProtection()->getHidden() !== null) && - ($pStyle->getProtection()->getHidden() !== \PhpSpreadsheet\Style\Protection::PROTECTION_INHERIT)) { - $objWriter->writeAttribute('hidden', ($pStyle->getProtection()->getHidden() == \PhpSpreadsheet\Style\Protection::PROTECTION_PROTECTED ? 'true' : 'false')); + ($pStyle->getProtection()->getHidden() !== \PhpOffice\PhpSpreadsheet\Style\Protection::PROTECTION_INHERIT)) { + $objWriter->writeAttribute('hidden', ($pStyle->getProtection()->getHidden() == \PhpOffice\PhpSpreadsheet\Style\Protection::PROTECTION_PROTECTED ? 'true' : 'false')); } $objWriter->endElement(); } @@ -517,15 +517,15 @@ class Style extends WriterPart /** * Write BorderPr * - * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer * @param string $pName Element name - * @param \PhpSpreadsheet\Style\Border $pBorder Border style - * @throws \PhpSpreadsheet\Writer\Exception + * @param \PhpOffice\PhpSpreadsheet\Style\Border $pBorder Border style + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception */ - private function writeBorderPr(\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, $pName = 'left', \PhpSpreadsheet\Style\Border $pBorder = null) + private function writeBorderPr(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, $pName = 'left', \PhpOffice\PhpSpreadsheet\Style\Border $pBorder = null) { // Write BorderPr - if ($pBorder->getBorderStyle() != \PhpSpreadsheet\Style\Border::BORDER_NONE) { + if ($pBorder->getBorderStyle() != \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_NONE) { $objWriter->startElement($pName); $objWriter->writeAttribute('style', $pBorder->getBorderStyle()); @@ -541,12 +541,12 @@ class Style extends WriterPart /** * Write NumberFormat * - * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer - * @param \PhpSpreadsheet\Style\NumberFormat $pNumberFormat Number Format + * @param \PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpOffice\PhpSpreadsheet\Style\NumberFormat $pNumberFormat Number Format * @param int $pId Number Format identifier - * @throws \PhpSpreadsheet\Writer\Exception + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception */ - private function writeNumFmt(\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpSpreadsheet\Style\NumberFormat $pNumberFormat = null, $pId = 0) + private function writeNumFmt(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpOffice\PhpSpreadsheet\Style\NumberFormat $pNumberFormat = null, $pId = 0) { // Translate formatcode $formatCode = $pNumberFormat->getFormatCode(); @@ -563,11 +563,11 @@ class Style extends WriterPart /** * Get an array of all styles * - * @param \PhpSpreadsheet\Spreadsheet $spreadsheet - * @throws \PhpSpreadsheet\Writer\Exception - * @return \PhpSpreadsheet\Style[] All styles in PhpSpreadsheet + * @param \PhpOffice\PhpSpreadsheet\Spreadsheet $spreadsheet + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception + * @return \PhpOffice\PhpSpreadsheet\Style[] All styles in PhpSpreadsheet */ - public function allStyles(\PhpSpreadsheet\SpreadSheet $spreadsheet = null) + public function allStyles(\PhpOffice\PhpSpreadsheet\SpreadSheet $spreadsheet = null) { return $spreadsheet->getCellXfCollection(); } @@ -575,11 +575,11 @@ class Style extends WriterPart /** * Get an array of all conditional styles * - * @param \PhpSpreadsheet\SpreadSheet $spreadsheet - * @throws \PhpSpreadsheet\Writer\Exception - * @return \PhpSpreadsheet\Style\Conditional[] All conditional styles in PhpSpreadsheet + * @param \PhpOffice\PhpSpreadsheet\SpreadSheet $spreadsheet + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception + * @return \PhpOffice\PhpSpreadsheet\Style\Conditional[] All conditional styles in PhpSpreadsheet */ - public function allConditionalStyles(\PhpSpreadsheet\SpreadSheet $spreadsheet = null) + public function allConditionalStyles(\PhpOffice\PhpSpreadsheet\SpreadSheet $spreadsheet = null) { // Get an array of all styles $aStyles = []; @@ -599,26 +599,26 @@ class Style extends WriterPart /** * Get an array of all fills * - * @param \PhpSpreadsheet\SpreadSheet $spreadsheet - * @throws \PhpSpreadsheet\Writer\Exception - * @return \PhpSpreadsheet\Style\Fill[] All fills in PhpSpreadsheet + * @param \PhpOffice\PhpSpreadsheet\SpreadSheet $spreadsheet + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception + * @return \PhpOffice\PhpSpreadsheet\Style\Fill[] All fills in PhpSpreadsheet */ - public function allFills(\PhpSpreadsheet\SpreadSheet $spreadsheet = null) + public function allFills(\PhpOffice\PhpSpreadsheet\SpreadSheet $spreadsheet = null) { // Get an array of unique fills $aFills = []; // Two first fills are predefined - $fill0 = new \PhpSpreadsheet\Style\Fill(); - $fill0->setFillType(\PhpSpreadsheet\Style\Fill::FILL_NONE); + $fill0 = new \PhpOffice\PhpSpreadsheet\Style\Fill(); + $fill0->setFillType(\PhpOffice\PhpSpreadsheet\Style\Fill::FILL_NONE); $aFills[] = $fill0; - $fill1 = new \PhpSpreadsheet\Style\Fill(); - $fill1->setFillType(\PhpSpreadsheet\Style\Fill::FILL_PATTERN_GRAY125); + $fill1 = new \PhpOffice\PhpSpreadsheet\Style\Fill(); + $fill1->setFillType(\PhpOffice\PhpSpreadsheet\Style\Fill::FILL_PATTERN_GRAY125); $aFills[] = $fill1; // The remaining fills $aStyles = $this->allStyles($spreadsheet); - /** @var \PhpSpreadsheet\Style $style */ + /** @var \PhpOffice\PhpSpreadsheet\Style $style */ foreach ($aStyles as $style) { if (!array_key_exists($style->getFill()->getHashCode(), $aFills)) { $aFills[$style->getFill()->getHashCode()] = $style->getFill(); @@ -631,17 +631,17 @@ class Style extends WriterPart /** * Get an array of all fonts * - * @param \PhpSpreadsheet\SpreadSheet $spreadsheet - * @throws \PhpSpreadsheet\Writer\Exception - * @return \PhpSpreadsheet\Style\Font[] All fonts in PhpSpreadsheet + * @param \PhpOffice\PhpSpreadsheet\SpreadSheet $spreadsheet + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception + * @return \PhpOffice\PhpSpreadsheet\Style\Font[] All fonts in PhpSpreadsheet */ - public function allFonts(\PhpSpreadsheet\SpreadSheet $spreadsheet = null) + public function allFonts(\PhpOffice\PhpSpreadsheet\SpreadSheet $spreadsheet = null) { // Get an array of unique fonts $aFonts = []; $aStyles = $this->allStyles($spreadsheet); - /** @var \PhpSpreadsheet\Style $style */ + /** @var \PhpOffice\PhpSpreadsheet\Style $style */ foreach ($aStyles as $style) { if (!array_key_exists($style->getFont()->getHashCode(), $aFonts)) { $aFonts[$style->getFont()->getHashCode()] = $style->getFont(); @@ -654,17 +654,17 @@ class Style extends WriterPart /** * Get an array of all borders * - * @param \PhpSpreadsheet\SpreadSheet $spreadsheet - * @throws \PhpSpreadsheet\Writer\Exception - * @return \PhpSpreadsheet\Style\Borders[] All borders in PhpSpreadsheet + * @param \PhpOffice\PhpSpreadsheet\SpreadSheet $spreadsheet + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception + * @return \PhpOffice\PhpSpreadsheet\Style\Borders[] All borders in PhpSpreadsheet */ - public function allBorders(\PhpSpreadsheet\SpreadSheet $spreadsheet = null) + public function allBorders(\PhpOffice\PhpSpreadsheet\SpreadSheet $spreadsheet = null) { // Get an array of unique borders $aBorders = []; $aStyles = $this->allStyles($spreadsheet); - /** @var \PhpSpreadsheet\Style $style */ + /** @var \PhpOffice\PhpSpreadsheet\Style $style */ foreach ($aStyles as $style) { if (!array_key_exists($style->getBorders()->getHashCode(), $aBorders)) { $aBorders[$style->getBorders()->getHashCode()] = $style->getBorders(); @@ -677,17 +677,17 @@ class Style extends WriterPart /** * Get an array of all number formats * - * @param \PhpSpreadsheet\SpreadSheet $spreadsheet - * @throws \PhpSpreadsheet\Writer\Exception - * @return \PhpSpreadsheet\Style\NumberFormat[] All number formats in PhpSpreadsheet + * @param \PhpOffice\PhpSpreadsheet\SpreadSheet $spreadsheet + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception + * @return \PhpOffice\PhpSpreadsheet\Style\NumberFormat[] All number formats in PhpSpreadsheet */ - public function allNumberFormats(\PhpSpreadsheet\SpreadSheet $spreadsheet = null) + public function allNumberFormats(\PhpOffice\PhpSpreadsheet\SpreadSheet $spreadsheet = null) { // Get an array of unique number formats $aNumFmts = []; $aStyles = $this->allStyles($spreadsheet); - /** @var \PhpSpreadsheet\Style $style */ + /** @var \PhpOffice\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 b72a05b9..3f4413ea 100644 --- a/src/PhpSpreadsheet/Writer/Excel2007/Theme.php +++ b/src/PhpSpreadsheet/Writer/Excel2007/Theme.php @@ -1,6 +1,6 @@ getParentWriter()->getUseDiskCaching()) { - $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); + $objWriter = new \PhpOffice\PhpSpreadsheet\Shared\XMLWriter(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); } else { - $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_MEMORY); + $objWriter = new \PhpOffice\PhpSpreadsheet\Shared\XMLWriter(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter::STORAGE_MEMORY); } // XML header @@ -809,10 +809,10 @@ class Theme extends WriterPart /** * Write fonts to XML format * - * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter + * @param \PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter * @param string $latinFont * @param array of string $fontSet - * @throws \PhpSpreadsheet\Writer\Exception + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception * @return string XML Output */ private function writeFonts($objWriter, $latinFont, $fontSet) @@ -843,8 +843,8 @@ class Theme extends WriterPart /** * Write colour scheme to XML format * - * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter - * @throws \PhpSpreadsheet\Writer\Exception + * @param \PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception * @return string XML Output */ private function writeColourScheme($objWriter) diff --git a/src/PhpSpreadsheet/Writer/Excel2007/Workbook.php b/src/PhpSpreadsheet/Writer/Excel2007/Workbook.php index f05238de..a073fe56 100644 --- a/src/PhpSpreadsheet/Writer/Excel2007/Workbook.php +++ b/src/PhpSpreadsheet/Writer/Excel2007/Workbook.php @@ -1,6 +1,6 @@ getParentWriter()->getUseDiskCaching()) { - $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); + $objWriter = new \PhpOffice\PhpSpreadsheet\Shared\XMLWriter(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); } else { - $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_MEMORY); + $objWriter = new \PhpOffice\PhpSpreadsheet\Shared\XMLWriter(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter::STORAGE_MEMORY); } // XML header @@ -84,10 +84,10 @@ class Workbook extends WriterPart /** * Write file version * - * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer - * @throws \PhpSpreadsheet\Writer\Exception + * @param \PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception */ - private function writeFileVersion(\PhpSpreadsheet\Shared\XMLWriter $objWriter) + private function writeFileVersion(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter) { $objWriter->startElement('fileVersion'); $objWriter->writeAttribute('appName', 'xl'); @@ -100,14 +100,14 @@ class Workbook extends WriterPart /** * Write WorkbookPr * - * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer - * @throws \PhpSpreadsheet\Writer\Exception + * @param \PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception */ - private function writeWorkbookPr(\PhpSpreadsheet\Shared\XMLWriter $objWriter) + private function writeWorkbookPr(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter) { $objWriter->startElement('workbookPr'); - if (\PhpSpreadsheet\Shared\Date::getExcelCalendar() == \PhpSpreadsheet\Shared\Date::CALENDAR_MAC_1904) { + if (\PhpOffice\PhpSpreadsheet\Shared\Date::getExcelCalendar() == \PhpOffice\PhpSpreadsheet\Shared\Date::CALENDAR_MAC_1904) { $objWriter->writeAttribute('date1904', '1'); } @@ -119,11 +119,11 @@ class Workbook extends WriterPart /** * Write BookViews * - * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer - * @param \PhpSpreadsheet\Spreadsheet $spreadsheet - * @throws \PhpSpreadsheet\Writer\Exception + * @param \PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpOffice\PhpSpreadsheet\Spreadsheet $spreadsheet + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception */ - private function writeBookViews(\PhpSpreadsheet\Shared\XMLWriter $objWriter, \PhpSpreadsheet\SpreadSheet $spreadsheet = null) + private function writeBookViews(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter, \PhpOffice\PhpSpreadsheet\SpreadSheet $spreadsheet = null) { // bookViews $objWriter->startElement('bookViews'); @@ -149,11 +149,11 @@ class Workbook extends WriterPart /** * Write WorkbookProtection * - * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer - * @param \PhpSpreadsheet\Spreadsheet $spreadsheet - * @throws \PhpSpreadsheet\Writer\Exception + * @param \PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpOffice\PhpSpreadsheet\Spreadsheet $spreadsheet + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception */ - private function writeWorkbookProtection(\PhpSpreadsheet\Shared\XMLWriter $objWriter, \PhpSpreadsheet\SpreadSheet $spreadsheet = null) + private function writeWorkbookProtection(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter, \PhpOffice\PhpSpreadsheet\SpreadSheet $spreadsheet = null) { if ($spreadsheet->getSecurity()->isSecurityEnabled()) { $objWriter->startElement('workbookProtection'); @@ -176,11 +176,11 @@ class Workbook extends WriterPart /** * Write calcPr * - * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer * @param bool $recalcRequired Indicate whether formulas should be recalculated before writing - * @throws \PhpSpreadsheet\Writer\Exception + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception */ - private function writeCalcPr(\PhpSpreadsheet\Shared\XMLWriter $objWriter, $recalcRequired = true) + private function writeCalcPr(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter, $recalcRequired = true) { $objWriter->startElement('calcPr'); @@ -199,11 +199,11 @@ class Workbook extends WriterPart /** * Write sheets * - * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer - * @param \PhpSpreadsheet\Spreadsheet $spreadsheet - * @throws \PhpSpreadsheet\Writer\Exception + * @param \PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpOffice\PhpSpreadsheet\Spreadsheet $spreadsheet + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception */ - private function writeSheets(\PhpSpreadsheet\Shared\XMLWriter $objWriter, \PhpSpreadsheet\SpreadSheet $spreadsheet = null) + private function writeSheets(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter, \PhpOffice\PhpSpreadsheet\SpreadSheet $spreadsheet = null) { // Write sheets $objWriter->startElement('sheets'); @@ -225,14 +225,14 @@ class Workbook extends WriterPart /** * Write sheet * - * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpOffice\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 \PhpSpreadsheet\Writer\Exception + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception */ - private function writeSheet(\PhpSpreadsheet\Shared\XMLWriter $objWriter, $pSheetname = '', $pSheetId = 1, $pRelId = 1, $sheetState = 'visible') + private function writeSheet(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter, $pSheetname = '', $pSheetId = 1, $pRelId = 1, $sheetState = 'visible') { if ($pSheetname != '') { // Write sheet @@ -245,18 +245,18 @@ class Workbook extends WriterPart $objWriter->writeAttribute('r:id', 'rId' . $pRelId); $objWriter->endElement(); } else { - throw new \PhpSpreadsheet\Writer\Exception('Invalid parameters passed.'); + throw new \PhpOffice\PhpSpreadsheet\Writer\Exception('Invalid parameters passed.'); } } /** * Write Defined Names * - * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer - * @param \PhpSpreadsheet\Spreadsheet $spreadsheet - * @throws \PhpSpreadsheet\Writer\Exception + * @param \PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpOffice\PhpSpreadsheet\Spreadsheet $spreadsheet + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception */ - private function writeDefinedNames(\PhpSpreadsheet\Shared\XMLWriter $objWriter, \PhpSpreadsheet\SpreadSheet $spreadsheet = null) + private function writeDefinedNames(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter, \PhpOffice\PhpSpreadsheet\SpreadSheet $spreadsheet = null) { // Write defined names $objWriter->startElement('definedNames'); @@ -286,11 +286,11 @@ class Workbook extends WriterPart /** * Write named ranges * - * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer - * @param \PhpSpreadsheet\SpreadSheet $spreadsheet - * @throws \PhpSpreadsheet\Writer\Exception + * @param \PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpOffice\PhpSpreadsheet\SpreadSheet $spreadsheet + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception */ - private function writeNamedRanges(\PhpSpreadsheet\Shared\XMLWriter $objWriter, \PhpSpreadsheet\SpreadSheet $spreadsheet) + private function writeNamedRanges(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter, \PhpOffice\PhpSpreadsheet\SpreadSheet $spreadsheet) { // Loop named ranges $namedRanges = $spreadsheet->getNamedRanges(); @@ -302,11 +302,11 @@ class Workbook extends WriterPart /** * Write Defined Name for named range * - * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer - * @param \PhpSpreadsheet\NamedRange $pNamedRange - * @throws \PhpSpreadsheet\Writer\Exception + * @param \PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpOffice\PhpSpreadsheet\NamedRange $pNamedRange + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception */ - private function writeDefinedNameForNamedRange(\PhpSpreadsheet\Shared\XMLWriter $objWriter, \PhpSpreadsheet\NamedRange $pNamedRange) + private function writeDefinedNameForNamedRange(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter, \PhpOffice\PhpSpreadsheet\NamedRange $pNamedRange) { // definedName for named range $objWriter->startElement('definedName'); @@ -316,14 +316,14 @@ class Workbook extends WriterPart } // Create absolute coordinate and write as raw text - $range = \PhpSpreadsheet\Cell::splitRange($pNamedRange->getRange()); + $range = \PhpOffice\PhpSpreadsheet\Cell::splitRange($pNamedRange->getRange()); for ($i = 0; $i < count($range); ++$i) { - $range[$i][0] = '\'' . str_replace("'", "''", $pNamedRange->getWorksheet()->getTitle()) . '\'!' . \PhpSpreadsheet\Cell::absoluteReference($range[$i][0]); + $range[$i][0] = '\'' . str_replace("'", "''", $pNamedRange->getWorksheet()->getTitle()) . '\'!' . \PhpOffice\PhpSpreadsheet\Cell::absoluteReference($range[$i][0]); if (isset($range[$i][1])) { - $range[$i][1] = \PhpSpreadsheet\Cell::absoluteReference($range[$i][1]); + $range[$i][1] = \PhpOffice\PhpSpreadsheet\Cell::absoluteReference($range[$i][1]); } } - $range = \PhpSpreadsheet\Cell::buildRange($range); + $range = \PhpOffice\PhpSpreadsheet\Cell::buildRange($range); $objWriter->writeRawData($range); @@ -333,12 +333,12 @@ class Workbook extends WriterPart /** * Write Defined Name for autoFilter * - * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer - * @param \PhpSpreadsheet\Worksheet $pSheet + * @param \PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpOffice\PhpSpreadsheet\Worksheet $pSheet * @param int $pSheetId - * @throws \PhpSpreadsheet\Writer\Exception + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception */ - private function writeDefinedNameForAutofilter(\PhpSpreadsheet\Shared\XMLWriter $objWriter, \PhpSpreadsheet\Worksheet $pSheet = null, $pSheetId = 0) + private function writeDefinedNameForAutofilter(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter, \PhpOffice\PhpSpreadsheet\Worksheet $pSheet = null, $pSheetId = 0) { // definedName for autoFilter $autoFilterRange = $pSheet->getAutoFilter()->getRange(); @@ -349,15 +349,15 @@ class Workbook extends WriterPart $objWriter->writeAttribute('hidden', '1'); // Create absolute coordinate and write as raw text - $range = \PhpSpreadsheet\Cell::splitRange($autoFilterRange); + $range = \PhpOffice\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] = \PhpSpreadsheet\Cell::absoluteCoordinate($range[0]); - $range[1] = \PhpSpreadsheet\Cell::absoluteCoordinate($range[1]); + $range[0] = \PhpOffice\PhpSpreadsheet\Cell::absoluteCoordinate($range[0]); + $range[1] = \PhpOffice\PhpSpreadsheet\Cell::absoluteCoordinate($range[1]); $range = implode(':', $range); $objWriter->writeRawData('\'' . str_replace("'", "''", $pSheet->getTitle()) . '\'!' . $range); @@ -369,12 +369,12 @@ class Workbook extends WriterPart /** * Write Defined Name for PrintTitles * - * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer - * @param \PhpSpreadsheet\Worksheet $pSheet + * @param \PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpOffice\PhpSpreadsheet\Worksheet $pSheet * @param int $pSheetId - * @throws \PhpSpreadsheet\Writer\Exception + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception */ - private function writeDefinedNameForPrintTitles(\PhpSpreadsheet\Shared\XMLWriter $objWriter, \PhpSpreadsheet\Worksheet $pSheet = null, $pSheetId = 0) + private function writeDefinedNameForPrintTitles(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter, \PhpOffice\PhpSpreadsheet\Worksheet $pSheet = null, $pSheetId = 0) { // definedName for PrintTitles if ($pSheet->getPageSetup()->isColumnsToRepeatAtLeftSet() || $pSheet->getPageSetup()->isRowsToRepeatAtTopSet()) { @@ -412,12 +412,12 @@ class Workbook extends WriterPart /** * Write Defined Name for PrintTitles * - * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer - * @param \PhpSpreadsheet\Worksheet $pSheet + * @param \PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpOffice\PhpSpreadsheet\Worksheet $pSheet * @param int $pSheetId - * @throws \PhpSpreadsheet\Writer\Exception + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception */ - private function writeDefinedNameForPrintArea(\PhpSpreadsheet\Shared\XMLWriter $objWriter, \PhpSpreadsheet\Worksheet $pSheet = null, $pSheetId = 0) + private function writeDefinedNameForPrintArea(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter, \PhpOffice\PhpSpreadsheet\Worksheet $pSheet = null, $pSheetId = 0) { // definedName for PrintArea if ($pSheet->getPageSetup()->isPrintAreaSet()) { @@ -429,12 +429,12 @@ class Workbook extends WriterPart $settingString = ''; // Print area - $printArea = \PhpSpreadsheet\Cell::splitRange($pSheet->getPageSetup()->getPrintArea()); + $printArea = \PhpOffice\PhpSpreadsheet\Cell::splitRange($pSheet->getPageSetup()->getPrintArea()); $chunks = []; foreach ($printArea as $printAreaRect) { - $printAreaRect[0] = \PhpSpreadsheet\Cell::absoluteReference($printAreaRect[0]); - $printAreaRect[1] = \PhpSpreadsheet\Cell::absoluteReference($printAreaRect[1]); + $printAreaRect[0] = \PhpOffice\PhpSpreadsheet\Cell::absoluteReference($printAreaRect[0]); + $printAreaRect[1] = \PhpOffice\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 9e9d7643..4bb99b4e 100644 --- a/src/PhpSpreadsheet/Writer/Excel2007/Worksheet.php +++ b/src/PhpSpreadsheet/Writer/Excel2007/Worksheet.php @@ -1,6 +1,6 @@ getParentWriter()->getUseDiskCaching()) { - $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); + $objWriter = new \PhpOffice\PhpSpreadsheet\Shared\XMLWriter(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); } else { - $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_MEMORY); + $objWriter = new \PhpOffice\PhpSpreadsheet\Shared\XMLWriter(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter::STORAGE_MEMORY); } // XML header @@ -130,18 +130,18 @@ class Worksheet extends WriterPart // Return return $objWriter->getData(); } else { - throw new \PhpSpreadsheet\Writer\Exception('Invalid \\PhpSpreadsheet\\Worksheet object passed.'); + throw new \PhpOffice\PhpSpreadsheet\Writer\Exception('Invalid \\PhpOffice\\PhpSpreadsheet\\Worksheet object passed.'); } } /** * Write SheetPr * - * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer - * @param \PhpSpreadsheet\Worksheet $pSheet Worksheet - * @throws \PhpSpreadsheet\Writer\Exception + * @param \PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpOffice\PhpSpreadsheet\Worksheet $pSheet Worksheet + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception */ - private function writeSheetPr(\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpSpreadsheet\Worksheet $pSheet = null) + private function writeSheetPr(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpOffice\PhpSpreadsheet\Worksheet $pSheet = null) { // sheetPr $objWriter->startElement('sheetPr'); @@ -184,11 +184,11 @@ class Worksheet extends WriterPart /** * Write Dimension * - * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer - * @param \PhpSpreadsheet\Worksheet $pSheet Worksheet - * @throws \PhpSpreadsheet\Writer\Exception + * @param \PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpOffice\PhpSpreadsheet\Worksheet $pSheet Worksheet + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception */ - private function writeDimension(\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpSpreadsheet\Worksheet $pSheet = null) + private function writeDimension(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpOffice\PhpSpreadsheet\Worksheet $pSheet = null) { // dimension $objWriter->startElement('dimension'); @@ -199,11 +199,11 @@ class Worksheet extends WriterPart /** * Write SheetViews * - * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer - * @param \PhpSpreadsheet\Worksheet $pSheet Worksheet - * @throws \PhpSpreadsheet\Writer\Exception + * @param \PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpOffice\PhpSpreadsheet\Worksheet $pSheet Worksheet + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception */ - private function writeSheetViews(\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpSpreadsheet\Worksheet $pSheet = null) + private function writeSheetViews(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpOffice\PhpSpreadsheet\Worksheet $pSheet = null) { // sheetViews $objWriter->startElement('sheetViews'); @@ -228,7 +228,7 @@ class Worksheet extends WriterPart } // View Layout Type - if ($pSheet->getSheetView()->getView() !== \PhpSpreadsheet\Worksheet\SheetView::SHEETVIEW_NORMAL) { + if ($pSheet->getSheetView()->getView() !== \PhpOffice\PhpSpreadsheet\Worksheet\SheetView::SHEETVIEW_NORMAL) { $objWriter->writeAttribute('view', $pSheet->getSheetView()->getView()); } @@ -261,8 +261,8 @@ class Worksheet extends WriterPart // Calculate freeze coordinates $xSplit = $ySplit = 0; - list($xSplit, $ySplit) = \PhpSpreadsheet\Cell::coordinateFromString($topLeftCell); - $xSplit = \PhpSpreadsheet\Cell::columnIndexFromString($xSplit); + list($xSplit, $ySplit) = \PhpOffice\PhpSpreadsheet\Cell::coordinateFromString($topLeftCell); + $xSplit = \PhpOffice\PhpSpreadsheet\Cell::columnIndexFromString($xSplit); // pane $pane = 'topRight'; @@ -311,11 +311,11 @@ class Worksheet extends WriterPart /** * Write SheetFormatPr * - * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer - * @param \PhpSpreadsheet\Worksheet $pSheet Worksheet - * @throws \PhpSpreadsheet\Writer\Exception + * @param \PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpOffice\PhpSpreadsheet\Worksheet $pSheet Worksheet + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception */ - private function writeSheetFormatPr(\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpSpreadsheet\Worksheet $pSheet = null) + private function writeSheetFormatPr(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpOffice\PhpSpreadsheet\Worksheet $pSheet = null) { // sheetFormatPr $objWriter->startElement('sheetFormatPr'); @@ -323,7 +323,7 @@ class Worksheet extends WriterPart // Default row height if ($pSheet->getDefaultRowDimension()->getRowHeight() >= 0) { $objWriter->writeAttribute('customHeight', 'true'); - $objWriter->writeAttribute('defaultRowHeight', \PhpSpreadsheet\Shared\StringHelper::formatNumber($pSheet->getDefaultRowDimension()->getRowHeight())); + $objWriter->writeAttribute('defaultRowHeight', \PhpOffice\PhpSpreadsheet\Shared\StringHelper::formatNumber($pSheet->getDefaultRowDimension()->getRowHeight())); } else { $objWriter->writeAttribute('defaultRowHeight', '14.4'); } @@ -336,7 +336,7 @@ class Worksheet extends WriterPart // Default column width if ($pSheet->getDefaultColumnDimension()->getWidth() >= 0) { - $objWriter->writeAttribute('defaultColWidth', \PhpSpreadsheet\Shared\StringHelper::formatNumber($pSheet->getDefaultColumnDimension()->getWidth())); + $objWriter->writeAttribute('defaultColWidth', \PhpOffice\PhpSpreadsheet\Shared\StringHelper::formatNumber($pSheet->getDefaultColumnDimension()->getWidth())); } // Outline level - row @@ -363,11 +363,11 @@ class Worksheet extends WriterPart /** * Write Cols * - * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer - * @param \PhpSpreadsheet\Worksheet $pSheet Worksheet - * @throws \PhpSpreadsheet\Writer\Exception + * @param \PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpOffice\PhpSpreadsheet\Worksheet $pSheet Worksheet + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception */ - private function writeCols(\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpSpreadsheet\Worksheet $pSheet = null) + private function writeCols(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpOffice\PhpSpreadsheet\Worksheet $pSheet = null) { // cols if (count($pSheet->getColumnDimensions()) > 0) { @@ -379,15 +379,15 @@ class Worksheet extends WriterPart foreach ($pSheet->getColumnDimensions() as $colDimension) { // col $objWriter->startElement('col'); - $objWriter->writeAttribute('min', \PhpSpreadsheet\Cell::columnIndexFromString($colDimension->getColumnIndex())); - $objWriter->writeAttribute('max', \PhpSpreadsheet\Cell::columnIndexFromString($colDimension->getColumnIndex())); + $objWriter->writeAttribute('min', \PhpOffice\PhpSpreadsheet\Cell::columnIndexFromString($colDimension->getColumnIndex())); + $objWriter->writeAttribute('max', \PhpOffice\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', \PhpSpreadsheet\Shared\StringHelper::formatNumber($colDimension->getWidth())); + $objWriter->writeAttribute('width', \PhpOffice\PhpSpreadsheet\Shared\StringHelper::formatNumber($colDimension->getWidth())); } // Column visibility @@ -428,11 +428,11 @@ class Worksheet extends WriterPart /** * Write SheetProtection * - * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer - * @param \PhpSpreadsheet\Worksheet $pSheet Worksheet - * @throws \PhpSpreadsheet\Writer\Exception + * @param \PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpOffice\PhpSpreadsheet\Worksheet $pSheet Worksheet + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception */ - private function writeSheetProtection(\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpSpreadsheet\Worksheet $pSheet = null) + private function writeSheetProtection(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpOffice\PhpSpreadsheet\Worksheet $pSheet = null) { // sheetProtection $objWriter->startElement('sheetProtection'); @@ -463,11 +463,11 @@ class Worksheet extends WriterPart /** * Write ConditionalFormatting * - * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer - * @param \PhpSpreadsheet\Worksheet $pSheet Worksheet - * @throws \PhpSpreadsheet\Writer\Exception + * @param \PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpOffice\PhpSpreadsheet\Worksheet $pSheet Worksheet + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception */ - private function writeConditionalFormatting(\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpSpreadsheet\Worksheet $pSheet = null) + private function writeConditionalFormatting(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpOffice\PhpSpreadsheet\Worksheet $pSheet = null) { // Conditional id $id = 1; @@ -479,7 +479,7 @@ class Worksheet extends WriterPart // if ($this->getParentWriter()->getStylesConditionalHashTable()->getIndexForHashCode($conditional->getHashCode()) == '') { // continue; // } - if ($conditional->getConditionType() != \PhpSpreadsheet\Style\Conditional::CONDITION_NONE) { + if ($conditional->getConditionType() != \PhpOffice\PhpSpreadsheet\Style\Conditional::CONDITION_NONE) { // conditionalFormatting $objWriter->startElement('conditionalFormatting'); $objWriter->writeAttribute('sqref', $cellCoordinate); @@ -490,35 +490,35 @@ class Worksheet extends WriterPart $objWriter->writeAttribute('dxfId', $this->getParentWriter()->getStylesConditionalHashTable()->getIndexForHashCode($conditional->getHashCode())); $objWriter->writeAttribute('priority', $id++); - if (($conditional->getConditionType() == \PhpSpreadsheet\Style\Conditional::CONDITION_CELLIS || $conditional->getConditionType() == \PhpSpreadsheet\Style\Conditional::CONDITION_CONTAINSTEXT) - && $conditional->getOperatorType() != \PhpSpreadsheet\Style\Conditional::OPERATOR_NONE) { + if (($conditional->getConditionType() == \PhpOffice\PhpSpreadsheet\Style\Conditional::CONDITION_CELLIS || $conditional->getConditionType() == \PhpOffice\PhpSpreadsheet\Style\Conditional::CONDITION_CONTAINSTEXT) + && $conditional->getOperatorType() != \PhpOffice\PhpSpreadsheet\Style\Conditional::OPERATOR_NONE) { $objWriter->writeAttribute('operator', $conditional->getOperatorType()); } - if ($conditional->getConditionType() == \PhpSpreadsheet\Style\Conditional::CONDITION_CONTAINSTEXT + if ($conditional->getConditionType() == \PhpOffice\PhpSpreadsheet\Style\Conditional::CONDITION_CONTAINSTEXT && !is_null($conditional->getText())) { $objWriter->writeAttribute('text', $conditional->getText()); } - if ($conditional->getConditionType() == \PhpSpreadsheet\Style\Conditional::CONDITION_CONTAINSTEXT - && $conditional->getOperatorType() == \PhpSpreadsheet\Style\Conditional::OPERATOR_CONTAINSTEXT + if ($conditional->getConditionType() == \PhpOffice\PhpSpreadsheet\Style\Conditional::CONDITION_CONTAINSTEXT + && $conditional->getOperatorType() == \PhpOffice\PhpSpreadsheet\Style\Conditional::OPERATOR_CONTAINSTEXT && !is_null($conditional->getText())) { $objWriter->writeElement('formula', 'NOT(ISERROR(SEARCH("' . $conditional->getText() . '",' . $cellCoordinate . ')))'); - } elseif ($conditional->getConditionType() == \PhpSpreadsheet\Style\Conditional::CONDITION_CONTAINSTEXT - && $conditional->getOperatorType() == \PhpSpreadsheet\Style\Conditional::OPERATOR_BEGINSWITH + } elseif ($conditional->getConditionType() == \PhpOffice\PhpSpreadsheet\Style\Conditional::CONDITION_CONTAINSTEXT + && $conditional->getOperatorType() == \PhpOffice\PhpSpreadsheet\Style\Conditional::OPERATOR_BEGINSWITH && !is_null($conditional->getText())) { $objWriter->writeElement('formula', 'LEFT(' . $cellCoordinate . ',' . strlen($conditional->getText()) . ')="' . $conditional->getText() . '"'); - } elseif ($conditional->getConditionType() == \PhpSpreadsheet\Style\Conditional::CONDITION_CONTAINSTEXT - && $conditional->getOperatorType() == \PhpSpreadsheet\Style\Conditional::OPERATOR_ENDSWITH + } elseif ($conditional->getConditionType() == \PhpOffice\PhpSpreadsheet\Style\Conditional::CONDITION_CONTAINSTEXT + && $conditional->getOperatorType() == \PhpOffice\PhpSpreadsheet\Style\Conditional::OPERATOR_ENDSWITH && !is_null($conditional->getText())) { $objWriter->writeElement('formula', 'RIGHT(' . $cellCoordinate . ',' . strlen($conditional->getText()) . ')="' . $conditional->getText() . '"'); - } elseif ($conditional->getConditionType() == \PhpSpreadsheet\Style\Conditional::CONDITION_CONTAINSTEXT - && $conditional->getOperatorType() == \PhpSpreadsheet\Style\Conditional::OPERATOR_NOTCONTAINS + } elseif ($conditional->getConditionType() == \PhpOffice\PhpSpreadsheet\Style\Conditional::CONDITION_CONTAINSTEXT + && $conditional->getOperatorType() == \PhpOffice\PhpSpreadsheet\Style\Conditional::OPERATOR_NOTCONTAINS && !is_null($conditional->getText())) { $objWriter->writeElement('formula', 'ISERROR(SEARCH("' . $conditional->getText() . '",' . $cellCoordinate . '))'); - } elseif ($conditional->getConditionType() == \PhpSpreadsheet\Style\Conditional::CONDITION_CELLIS - || $conditional->getConditionType() == \PhpSpreadsheet\Style\Conditional::CONDITION_CONTAINSTEXT - || $conditional->getConditionType() == \PhpSpreadsheet\Style\Conditional::CONDITION_EXPRESSION) { + } elseif ($conditional->getConditionType() == \PhpOffice\PhpSpreadsheet\Style\Conditional::CONDITION_CELLIS + || $conditional->getConditionType() == \PhpOffice\PhpSpreadsheet\Style\Conditional::CONDITION_CONTAINSTEXT + || $conditional->getConditionType() == \PhpOffice\PhpSpreadsheet\Style\Conditional::CONDITION_EXPRESSION) { foreach ($conditional->getConditions() as $formula) { // Formula $objWriter->writeElement('formula', $formula); @@ -536,11 +536,11 @@ class Worksheet extends WriterPart /** * Write DataValidations * - * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer - * @param \PhpSpreadsheet\Worksheet $pSheet Worksheet - * @throws \PhpSpreadsheet\Writer\Exception + * @param \PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpOffice\PhpSpreadsheet\Worksheet $pSheet Worksheet + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception */ - private function writeDataValidations(\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpSpreadsheet\Worksheet $pSheet = null) + private function writeDataValidations(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpOffice\PhpSpreadsheet\Worksheet $pSheet = null) { // Datavalidation collection $dataValidationCollection = $pSheet->getDataValidationCollection(); @@ -602,11 +602,11 @@ class Worksheet extends WriterPart /** * Write Hyperlinks * - * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer - * @param \PhpSpreadsheet\Worksheet $pSheet Worksheet - * @throws \PhpSpreadsheet\Writer\Exception + * @param \PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpOffice\PhpSpreadsheet\Worksheet $pSheet Worksheet + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception */ - private function writeHyperlinks(\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpSpreadsheet\Worksheet $pSheet = null) + private function writeHyperlinks(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpOffice\PhpSpreadsheet\Worksheet $pSheet = null) { // Hyperlink collection $hyperlinkCollection = $pSheet->getHyperlinkCollection(); @@ -643,11 +643,11 @@ class Worksheet extends WriterPart /** * Write ProtectedRanges * - * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer - * @param \PhpSpreadsheet\Worksheet $pSheet Worksheet - * @throws \PhpSpreadsheet\Writer\Exception + * @param \PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpOffice\PhpSpreadsheet\Worksheet $pSheet Worksheet + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception */ - private function writeProtectedRanges(\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpSpreadsheet\Worksheet $pSheet = null) + private function writeProtectedRanges(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpOffice\PhpSpreadsheet\Worksheet $pSheet = null) { if (count($pSheet->getProtectedCells()) > 0) { // protectedRanges @@ -672,11 +672,11 @@ class Worksheet extends WriterPart /** * Write MergeCells * - * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer - * @param \PhpSpreadsheet\Worksheet $pSheet Worksheet - * @throws \PhpSpreadsheet\Writer\Exception + * @param \PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpOffice\PhpSpreadsheet\Worksheet $pSheet Worksheet + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception */ - private function writeMergeCells(\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpSpreadsheet\Worksheet $pSheet = null) + private function writeMergeCells(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpOffice\PhpSpreadsheet\Worksheet $pSheet = null) { if (count($pSheet->getMergeCells()) > 0) { // mergeCells @@ -697,11 +697,11 @@ class Worksheet extends WriterPart /** * Write PrintOptions * - * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer - * @param \PhpSpreadsheet\Worksheet $pSheet Worksheet - * @throws \PhpSpreadsheet\Writer\Exception + * @param \PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpOffice\PhpSpreadsheet\Worksheet $pSheet Worksheet + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception */ - private function writePrintOptions(\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpSpreadsheet\Worksheet $pSheet = null) + private function writePrintOptions(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpOffice\PhpSpreadsheet\Worksheet $pSheet = null) { // printOptions $objWriter->startElement('printOptions'); @@ -723,31 +723,31 @@ class Worksheet extends WriterPart /** * Write PageMargins * - * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer - * @param \PhpSpreadsheet\Worksheet $pSheet Worksheet - * @throws \PhpSpreadsheet\Writer\Exception + * @param \PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpOffice\PhpSpreadsheet\Worksheet $pSheet Worksheet + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception */ - private function writePageMargins(\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpSpreadsheet\Worksheet $pSheet = null) + private function writePageMargins(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpOffice\PhpSpreadsheet\Worksheet $pSheet = null) { // pageMargins $objWriter->startElement('pageMargins'); - $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->writeAttribute('left', \PhpOffice\PhpSpreadsheet\Shared\StringHelper::formatNumber($pSheet->getPageMargins()->getLeft())); + $objWriter->writeAttribute('right', \PhpOffice\PhpSpreadsheet\Shared\StringHelper::formatNumber($pSheet->getPageMargins()->getRight())); + $objWriter->writeAttribute('top', \PhpOffice\PhpSpreadsheet\Shared\StringHelper::formatNumber($pSheet->getPageMargins()->getTop())); + $objWriter->writeAttribute('bottom', \PhpOffice\PhpSpreadsheet\Shared\StringHelper::formatNumber($pSheet->getPageMargins()->getBottom())); + $objWriter->writeAttribute('header', \PhpOffice\PhpSpreadsheet\Shared\StringHelper::formatNumber($pSheet->getPageMargins()->getHeader())); + $objWriter->writeAttribute('footer', \PhpOffice\PhpSpreadsheet\Shared\StringHelper::formatNumber($pSheet->getPageMargins()->getFooter())); $objWriter->endElement(); } /** * Write AutoFilter * - * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer - * @param \PhpSpreadsheet\Worksheet $pSheet Worksheet - * @throws \PhpSpreadsheet\Writer\Exception + * @param \PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpOffice\PhpSpreadsheet\Worksheet $pSheet Worksheet + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception */ - private function writeAutoFilter(\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpSpreadsheet\Worksheet $pSheet = null) + private function writeAutoFilter(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpOffice\PhpSpreadsheet\Worksheet $pSheet = null) { $autoFilterRange = $pSheet->getAutoFilter()->getRange(); if (!empty($autoFilterRange)) { @@ -755,7 +755,7 @@ class Worksheet extends WriterPart $objWriter->startElement('autoFilter'); // Strip any worksheet reference from the filter coordinates - $range = \PhpSpreadsheet\Cell::splitRange($autoFilterRange); + $range = \PhpOffice\PhpSpreadsheet\Cell::splitRange($autoFilterRange); $range = $range[0]; // Strip any worksheet ref if (strpos($range[0], '!') !== false) { @@ -774,17 +774,17 @@ class Worksheet extends WriterPart $objWriter->writeAttribute('colId', $pSheet->getAutoFilter()->getColumnOffset($columnID)); $objWriter->startElement($column->getFilterType()); - if ($column->getJoin() == \PhpSpreadsheet\Worksheet\AutoFilter\Column::AUTOFILTER_COLUMN_JOIN_AND) { + if ($column->getJoin() == \PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column::AUTOFILTER_COLUMN_JOIN_AND) { $objWriter->writeAttribute('and', 1); } foreach ($rules as $rule) { - if (($column->getFilterType() === \PhpSpreadsheet\Worksheet\AutoFilter\Column::AUTOFILTER_FILTERTYPE_FILTER) && - ($rule->getOperator() === \PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_EQUAL) && + if (($column->getFilterType() === \PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column::AUTOFILTER_FILTERTYPE_FILTER) && + ($rule->getOperator() === \PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_EQUAL) && ($rule->getValue() === '')) { // Filter rule for Blanks $objWriter->writeAttribute('blank', 1); - } elseif ($rule->getRuleType() === \PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMICFILTER) { + } elseif ($rule->getRuleType() === \PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMICFILTER) { // Dynamic Filter Rule $objWriter->writeAttribute('type', $rule->getGrouping()); $val = $column->getAttribute('val'); @@ -795,19 +795,19 @@ class Worksheet extends WriterPart if ($maxVal !== null) { $objWriter->writeAttribute('maxVal', $maxVal); } - } elseif ($rule->getRuleType() === \PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_TOPTENFILTER) { + } elseif ($rule->getRuleType() === \PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_TOPTENFILTER) { // Top 10 Filter Rule $objWriter->writeAttribute('val', $rule->getValue()); - $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')); + $objWriter->writeAttribute('percent', (($rule->getOperator() === \PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_PERCENT) ? '1' : '0')); + $objWriter->writeAttribute('top', (($rule->getGrouping() === \PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_TOP) ? '1' : '0')); } else { // Filter, DateGroupItem or CustomFilter $objWriter->startElement($rule->getRuleType()); - if ($rule->getOperator() !== \PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_EQUAL) { + if ($rule->getOperator() !== \PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_EQUAL) { $objWriter->writeAttribute('operator', $rule->getOperator()); } - if ($rule->getRuleType() === \PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DATEGROUP) { + if ($rule->getRuleType() === \PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DATEGROUP) { // Date Group filters foreach ($rule->getValue() as $key => $value) { if ($value > '') { @@ -836,11 +836,11 @@ class Worksheet extends WriterPart /** * Write PageSetup * - * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer - * @param \PhpSpreadsheet\Worksheet $pSheet Worksheet - * @throws \PhpSpreadsheet\Writer\Exception + * @param \PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpOffice\PhpSpreadsheet\Worksheet $pSheet Worksheet + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception */ - private function writePageSetup(\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpSpreadsheet\Worksheet $pSheet = null) + private function writePageSetup(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpOffice\PhpSpreadsheet\Worksheet $pSheet = null) { // pageSetup $objWriter->startElement('pageSetup'); @@ -871,11 +871,11 @@ class Worksheet extends WriterPart /** * Write Header / Footer * - * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer - * @param \PhpSpreadsheet\Worksheet $pSheet Worksheet - * @throws \PhpSpreadsheet\Writer\Exception + * @param \PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpOffice\PhpSpreadsheet\Worksheet $pSheet Worksheet + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception */ - private function writeHeaderFooter(\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpSpreadsheet\Worksheet $pSheet = null) + private function writeHeaderFooter(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpOffice\PhpSpreadsheet\Worksheet $pSheet = null) { // headerFooter $objWriter->startElement('headerFooter'); @@ -896,19 +896,19 @@ class Worksheet extends WriterPart /** * Write Breaks * - * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer - * @param \PhpSpreadsheet\Worksheet $pSheet Worksheet - * @throws \PhpSpreadsheet\Writer\Exception + * @param \PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpOffice\PhpSpreadsheet\Worksheet $pSheet Worksheet + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception */ - private function writeBreaks(\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpSpreadsheet\Worksheet $pSheet = null) + private function writeBreaks(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpOffice\PhpSpreadsheet\Worksheet $pSheet = null) { // Get row and column breaks $aRowBreaks = []; $aColumnBreaks = []; foreach ($pSheet->getBreaks() as $cell => $breakType) { - if ($breakType == \PhpSpreadsheet\Worksheet::BREAK_ROW) { + if ($breakType == \PhpOffice\PhpSpreadsheet\Worksheet::BREAK_ROW) { $aRowBreaks[] = $cell; - } elseif ($breakType == \PhpSpreadsheet\Worksheet::BREAK_COLUMN) { + } elseif ($breakType == \PhpOffice\PhpSpreadsheet\Worksheet::BREAK_COLUMN) { $aColumnBreaks[] = $cell; } } @@ -920,7 +920,7 @@ class Worksheet extends WriterPart $objWriter->writeAttribute('manualBreakCount', count($aRowBreaks)); foreach ($aRowBreaks as $cell) { - $coords = \PhpSpreadsheet\Cell::coordinateFromString($cell); + $coords = \PhpOffice\PhpSpreadsheet\Cell::coordinateFromString($cell); $objWriter->startElement('brk'); $objWriter->writeAttribute('id', $coords[1]); @@ -938,10 +938,10 @@ class Worksheet extends WriterPart $objWriter->writeAttribute('manualBreakCount', count($aColumnBreaks)); foreach ($aColumnBreaks as $cell) { - $coords = \PhpSpreadsheet\Cell::coordinateFromString($cell); + $coords = \PhpOffice\PhpSpreadsheet\Cell::coordinateFromString($cell); $objWriter->startElement('brk'); - $objWriter->writeAttribute('id', \PhpSpreadsheet\Cell::columnIndexFromString($coords[0]) - 1); + $objWriter->writeAttribute('id', \PhpOffice\PhpSpreadsheet\Cell::columnIndexFromString($coords[0]) - 1); $objWriter->writeAttribute('man', '1'); $objWriter->endElement(); } @@ -953,12 +953,12 @@ class Worksheet extends WriterPart /** * Write SheetData * - * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer - * @param \PhpSpreadsheet\Worksheet $pSheet Worksheet + * @param \PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpOffice\PhpSpreadsheet\Worksheet $pSheet Worksheet * @param string[] $pStringTable String table - * @throws \PhpSpreadsheet\Writer\Exception + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception */ - private function writeSheetData(\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpSpreadsheet\Worksheet $pSheet = null, $pStringTable = null) + private function writeSheetData(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpOffice\PhpSpreadsheet\Worksheet $pSheet = null, $pStringTable = null) { if (is_array($pStringTable)) { // Flipped stringtable, for faster index searching @@ -968,7 +968,7 @@ class Worksheet extends WriterPart $objWriter->startElement('sheetData'); // Get column count - $colCount = \PhpSpreadsheet\Cell::columnIndexFromString($pSheet->getHighestColumn()); + $colCount = \PhpOffice\PhpSpreadsheet\Cell::columnIndexFromString($pSheet->getHighestColumn()); // Highest row number $highestRow = $pSheet->getHighestRow(); @@ -976,7 +976,7 @@ class Worksheet extends WriterPart // Loop through cells $cellsByRow = []; foreach ($pSheet->getCellCollection() as $cellID) { - $cellAddress = \PhpSpreadsheet\Cell::coordinateFromString($cellID); + $cellAddress = \PhpOffice\PhpSpreadsheet\Cell::coordinateFromString($cellID); $cellsByRow[$cellAddress[1]][] = $cellID; } @@ -997,7 +997,7 @@ class Worksheet extends WriterPart // Row dimensions if ($rowDimension->getRowHeight() >= 0) { $objWriter->writeAttribute('customHeight', '1'); - $objWriter->writeAttribute('ht', \PhpSpreadsheet\Shared\StringHelper::formatNumber($rowDimension->getRowHeight())); + $objWriter->writeAttribute('ht', \PhpOffice\PhpSpreadsheet\Shared\StringHelper::formatNumber($rowDimension->getRowHeight())); } // Row visibility @@ -1036,21 +1036,21 @@ class Worksheet extends WriterPart $objWriter->endElement(); } else { - throw new \PhpSpreadsheet\Writer\Exception('Invalid parameters passed.'); + throw new \PhpOffice\PhpSpreadsheet\Writer\Exception('Invalid parameters passed.'); } } /** * Write Cell * - * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer - * @param \PhpSpreadsheet\Worksheet $pSheet Worksheet - * @param \PhpSpreadsheet\Cell $pCellAddress Cell Address + * @param \PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpOffice\PhpSpreadsheet\Worksheet $pSheet Worksheet + * @param \PhpOffice\PhpSpreadsheet\Cell $pCellAddress Cell Address * @param string[] $pStringTable String table * @param string[] $pFlippedStringTable String table (flipped), for faster index searching - * @throws \PhpSpreadsheet\Writer\Exception + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception */ - private function writeCell(\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpSpreadsheet\Worksheet $pSheet = null, $pCellAddress = null, $pStringTable = null, $pFlippedStringTable = null) + private function writeCell(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpOffice\PhpSpreadsheet\Worksheet $pSheet = null, $pCellAddress = null, $pStringTable = null, $pFlippedStringTable = null) { if (is_array($pStringTable) && is_array($pFlippedStringTable)) { // Cell @@ -1090,9 +1090,9 @@ class Worksheet extends WriterPart // Write data depending on its type switch (strtolower($mappedType)) { case 'inlinestr': // Inline string - if (!$cellValue instanceof \PhpSpreadsheet\RichText) { - $objWriter->writeElement('t', \PhpSpreadsheet\Shared\StringHelper::controlCharacterPHP2OOXML(htmlspecialchars($cellValue))); - } elseif ($cellValue instanceof \PhpSpreadsheet\RichText) { + if (!$cellValue instanceof \PhpOffice\PhpSpreadsheet\RichText) { + $objWriter->writeElement('t', \PhpOffice\PhpSpreadsheet\Shared\StringHelper::controlCharacterPHP2OOXML(htmlspecialchars($cellValue))); + } elseif ($cellValue instanceof \PhpOffice\PhpSpreadsheet\RichText) { $objWriter->startElement('is'); $this->getParentWriter()->getWriterPart('stringtable')->writeRichText($objWriter, $cellValue); $objWriter->endElement(); @@ -1100,11 +1100,11 @@ class Worksheet extends WriterPart break; case 's': // String - if (!$cellValue instanceof \PhpSpreadsheet\RichText) { + if (!$cellValue instanceof \PhpOffice\PhpSpreadsheet\RichText) { if (isset($pFlippedStringTable[$cellValue])) { $objWriter->writeElement('v', $pFlippedStringTable[$cellValue]); } - } elseif ($cellValue instanceof \PhpSpreadsheet\RichText) { + } elseif ($cellValue instanceof \PhpOffice\PhpSpreadsheet\RichText) { $objWriter->writeElement('v', $pFlippedStringTable[$cellValue->getHashCode()]); } @@ -1125,7 +1125,7 @@ class Worksheet extends WriterPart if ($this->getParentWriter()->getOffice2003Compatibility() === false) { if ($this->getParentWriter()->getPreCalculateFormulas()) { if (!is_array($calculatedValue) && substr($calculatedValue, 0, 1) != '#') { - $objWriter->writeElement('v', \PhpSpreadsheet\Shared\StringHelper::formatNumber($calculatedValue)); + $objWriter->writeElement('v', \PhpOffice\PhpSpreadsheet\Shared\StringHelper::formatNumber($calculatedValue)); } else { $objWriter->writeElement('v', '0'); } @@ -1155,19 +1155,19 @@ class Worksheet extends WriterPart $objWriter->endElement(); } else { - throw new \PhpSpreadsheet\Writer\Exception('Invalid parameters passed.'); + throw new \PhpOffice\PhpSpreadsheet\Writer\Exception('Invalid parameters passed.'); } } /** * Write Drawings * - * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer - * @param \PhpSpreadsheet\Worksheet $pSheet Worksheet + * @param \PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpOffice\PhpSpreadsheet\Worksheet $pSheet Worksheet * @param bool $includeCharts Flag indicating if we should include drawing details for charts - * @throws \PhpSpreadsheet\Writer\Exception + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception */ - private function writeDrawings(\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpSpreadsheet\Worksheet $pSheet = null, $includeCharts = false) + private function writeDrawings(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpOffice\PhpSpreadsheet\Worksheet $pSheet = null, $includeCharts = false) { $chartCount = ($includeCharts) ? $pSheet->getChartCollection()->count() : 0; // If sheet contains drawings, add the relationships @@ -1182,11 +1182,11 @@ class Worksheet extends WriterPart /** * Write LegacyDrawing * - * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer - * @param \PhpSpreadsheet\Worksheet $pSheet Worksheet - * @throws \PhpSpreadsheet\Writer\Exception + * @param \PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpOffice\PhpSpreadsheet\Worksheet $pSheet Worksheet + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception */ - private function writeLegacyDrawing(\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpSpreadsheet\Worksheet $pSheet = null) + private function writeLegacyDrawing(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpOffice\PhpSpreadsheet\Worksheet $pSheet = null) { // If sheet contains comments, add the relationships if (count($pSheet->getComments()) > 0) { @@ -1199,11 +1199,11 @@ class Worksheet extends WriterPart /** * Write LegacyDrawingHF * - * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer - * @param \PhpSpreadsheet\Worksheet $pSheet Worksheet - * @throws \PhpSpreadsheet\Writer\Exception + * @param \PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer + * @param \PhpOffice\PhpSpreadsheet\Worksheet $pSheet Worksheet + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception */ - private function writeLegacyDrawingHF(\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpSpreadsheet\Worksheet $pSheet = null) + private function writeLegacyDrawingHF(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpOffice\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 e6b352fc..2b8ae06b 100644 --- a/src/PhpSpreadsheet/Writer/Excel2007/WriterPart.php +++ b/src/PhpSpreadsheet/Writer/Excel2007/WriterPart.php @@ -1,6 +1,6 @@ parentWriter = $pWriter; } @@ -47,25 +47,25 @@ abstract class WriterPart /** * Get parent IWriter object * - * @throws \PhpSpreadsheet\Writer\Exception - * @return \PhpSpreadsheet\Writer\IWriter + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception + * @return \PhpOffice\PhpSpreadsheet\Writer\IWriter */ public function getParentWriter() { if (!is_null($this->parentWriter)) { return $this->parentWriter; } else { - throw new \PhpSpreadsheet\Writer\Exception('No parent \\PhpSpreadsheet\\Writer\\IWriter assigned.'); + throw new \PhpOffice\PhpSpreadsheet\Writer\Exception('No parent \\PhpOffice\\PhpSpreadsheet\\Writer\\IWriter assigned.'); } } /** * Set parent IWriter object * - * @param \PhpSpreadsheet\Writer\IWriter $pWriter - * @throws \PhpSpreadsheet\Writer\Exception + * @param \PhpOffice\PhpSpreadsheet\Writer\IWriter $pWriter + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception */ - public function __construct(\PhpSpreadsheet\Writer\IWriter $pWriter = null) + public function __construct(\PhpOffice\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 c81dc2fb..2344e1fe 100644 --- a/src/PhpSpreadsheet/Writer/Excel5.php +++ b/src/PhpSpreadsheet/Writer/Excel5.php @@ -1,6 +1,6 @@ spreadsheet = $spreadsheet; @@ -105,7 +105,7 @@ class Excel5 extends BaseWriter implements IWriter * Save Spreadsheet to file * * @param string $pFilename - * @throws \PhpSpreadsheet\Writer\Exception + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception */ public function save($pFilename = null) { @@ -113,10 +113,10 @@ class Excel5 extends BaseWriter implements IWriter // garbage collect $this->spreadsheet->garbageCollect(); - $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); + $saveDebugLog = \PhpOffice\PhpSpreadsheet\Calculation::getInstance($this->spreadsheet)->getDebugLog()->getWriteDebugLog(); + \PhpOffice\PhpSpreadsheet\Calculation::getInstance($this->spreadsheet)->getDebugLog()->setWriteDebugLog(false); + $saveDateReturnType = \PhpOffice\PhpSpreadsheet\Calculation\Functions::getReturnDateType(); + \PhpOffice\PhpSpreadsheet\Calculation\Functions::setReturnDateType(\PhpOffice\PhpSpreadsheet\Calculation\Functions::RETURNDATE_EXCEL); // initialize colors array $this->colors = []; @@ -151,10 +151,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 \PhpSpreadsheet\RichText) { + if ($cVal instanceof \PhpOffice\PhpSpreadsheet\RichText) { $elements = $cVal->getRichTextElements(); foreach ($elements as $element) { - if ($element instanceof \PhpSpreadsheet\RichText\Run) { + if ($element instanceof \PhpOffice\PhpSpreadsheet\RichText\Run) { $font = $element->getFont(); $this->writerWorksheets[$i]->fontHashIndex[$font->getHashCode()] = $this->writerWorkbook->addFont($font); } @@ -165,7 +165,7 @@ class Excel5 extends BaseWriter implements IWriter // initialize OLE file $workbookStreamName = 'Workbook'; - $OLE = new \PhpSpreadsheet\Shared\OLE\PPS\File(\PhpSpreadsheet\Shared\OLE::ascToUcs($workbookStreamName)); + $OLE = new \PhpOffice\PhpSpreadsheet\Shared\OLE\PPS\File(\PhpOffice\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 @@ -186,14 +186,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 \PhpSpreadsheet\Shared\OLE\PPS\File(\PhpSpreadsheet\Shared\OLE::ascToUcs(chr(5) . 'DocumentSummaryInformation')); + $OLE_DocumentSummaryInformation = new \PhpOffice\PhpSpreadsheet\Shared\OLE\PPS\File(\PhpOffice\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 \PhpSpreadsheet\Shared\OLE\PPS\File(\PhpSpreadsheet\Shared\OLE::ascToUcs(chr(5) . 'SummaryInformation')); + $OLE_SummaryInformation = new \PhpOffice\PhpSpreadsheet\Shared\OLE\PPS\File(\PhpOffice\PhpSpreadsheet\Shared\OLE::ascToUcs(chr(5) . 'SummaryInformation')); $OLE_SummaryInformation->append($this->summaryInformation); } @@ -208,12 +208,12 @@ class Excel5 extends BaseWriter implements IWriter $arrRootData[] = $OLE_DocumentSummaryInformation; } - $root = new \PhpSpreadsheet\Shared\OLE\PPS\Root(time(), time(), $arrRootData); + $root = new \PhpOffice\PhpSpreadsheet\Shared\OLE\PPS\Root(time(), time(), $arrRootData); // save the OLE file $res = $root->save($pFilename); - \PhpSpreadsheet\Calculation\Functions::setReturnDateType($saveDateReturnType); - \PhpSpreadsheet\Calculation::getInstance($this->spreadsheet)->getDebugLog()->setWriteDebugLog($saveDebugLog); + \PhpOffice\PhpSpreadsheet\Calculation\Functions::setReturnDateType($saveDateReturnType); + \PhpOffice\PhpSpreadsheet\Calculation::getInstance($this->spreadsheet)->getDebugLog()->setWriteDebugLog($saveDebugLog); } /** @@ -221,8 +221,8 @@ class Excel5 extends BaseWriter implements IWriter * * @deprecated * @param string $pValue Temporary storage directory - * @throws \PhpSpreadsheet\Writer\Exception when directory does not exist - * @return \PhpSpreadsheet\Writer\Excel5 + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception when directory does not exist + * @return \PhpOffice\PhpSpreadsheet\Writer\Excel5 */ public function setTempDir($pValue = '') { @@ -252,10 +252,10 @@ class Excel5 extends BaseWriter implements IWriter } // create intermediate Escher object - $escher = new \PhpSpreadsheet\Shared\Escher(); + $escher = new \PhpOffice\PhpSpreadsheet\Shared\Escher(); // dgContainer - $dgContainer = new \PhpSpreadsheet\Shared\Escher\DgContainer(); + $dgContainer = new \PhpOffice\PhpSpreadsheet\Shared\Escher\DgContainer(); // set the drawing index (we use sheet index + 1) $dgId = $sheet->getParent()->getIndex($sheet) + 1; @@ -263,11 +263,11 @@ class Excel5 extends BaseWriter implements IWriter $escher->setDgContainer($dgContainer); // spgrContainer - $spgrContainer = new \PhpSpreadsheet\Shared\Escher\DgContainer\SpgrContainer(); + $spgrContainer = new \PhpOffice\PhpSpreadsheet\Shared\Escher\DgContainer\SpgrContainer(); $dgContainer->setSpgrContainer($spgrContainer); // add one shape which is the group shape - $spContainer = new \PhpSpreadsheet\Shared\Escher\DgContainer\SpgrContainer\SpContainer(); + $spContainer = new \PhpOffice\PhpSpreadsheet\Shared\Escher\DgContainer\SpgrContainer\SpContainer(); $spContainer->setSpgr(true); $spContainer->setSpType(0); $spContainer->setSpId(($sheet->getParent()->getIndex($sheet) + 1) << 10); @@ -283,7 +283,7 @@ class Excel5 extends BaseWriter implements IWriter ++$countShapes[$sheetIndex]; // add the shape - $spContainer = new \PhpSpreadsheet\Shared\Escher\DgContainer\SpgrContainer\SpContainer(); + $spContainer = new \PhpOffice\PhpSpreadsheet\Shared\Escher\DgContainer\SpgrContainer\SpContainer(); // set the shape type $spContainer->setSpType(0x004B); @@ -311,7 +311,7 @@ class Excel5 extends BaseWriter implements IWriter $width = $drawing->getWidth(); $height = $drawing->getHeight(); - $twoAnchor = \PhpSpreadsheet\Shared\Excel5::oneAnchor2twoAnchor($sheet, $coordinates, $offsetX, $offsetY, $width, $height); + $twoAnchor = \PhpOffice\PhpSpreadsheet\Shared\Excel5::oneAnchor2twoAnchor($sheet, $coordinates, $offsetX, $offsetY, $width, $height); $spContainer->setStartCoordinates($twoAnchor['startCoordinates']); $spContainer->setStartOffsetX($twoAnchor['startOffsetX']); @@ -325,7 +325,7 @@ class Excel5 extends BaseWriter implements IWriter // AutoFilters if (!empty($filterRange)) { - $rangeBounds = \PhpSpreadsheet\Cell::rangeBoundaries($filterRange); + $rangeBounds = \PhpOffice\PhpSpreadsheet\Cell::rangeBoundaries($filterRange); $iNumColStart = $rangeBounds[0][0]; $iNumColEnd = $rangeBounds[1][0]; @@ -334,14 +334,14 @@ class Excel5 extends BaseWriter implements IWriter ++$countShapes[$sheetIndex]; // create an Drawing Object for the dropdown - $oDrawing = new \PhpSpreadsheet\Worksheet\BaseDrawing(); + $oDrawing = new \PhpOffice\PhpSpreadsheet\Worksheet\BaseDrawing(); // get the coordinates of drawing - $cDrawing = \PhpSpreadsheet\Cell::stringFromColumnIndex($iInc - 1) . $rangeBounds[0][1]; + $cDrawing = \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($iInc - 1) . $rangeBounds[0][1]; $oDrawing->setCoordinates($cDrawing); $oDrawing->setWorksheet($sheet); // add the shape - $spContainer = new \PhpSpreadsheet\Shared\Escher\DgContainer\SpgrContainer\SpContainer(); + $spContainer = new \PhpOffice\PhpSpreadsheet\Shared\Escher\DgContainer\SpgrContainer\SpContainer(); // set the shape type $spContainer->setSpType(0x00C9); // set the shape flag @@ -365,7 +365,7 @@ class Excel5 extends BaseWriter implements IWriter $spContainer->setOPT(0x03BF, 0x000A0000); // Group Shape -> fPrint // set coordinates and offsets, client anchor - $endCoordinates = \PhpSpreadsheet\Cell::stringFromColumnIndex($iInc - 1); + $endCoordinates = \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($iInc - 1); $endCoordinates .= $rangeBounds[0][1] + 1; $spContainer->setStartCoordinates($cDrawing); @@ -413,10 +413,10 @@ class Excel5 extends BaseWriter implements IWriter } // if we reach here, then there are drawings in the workbook - $escher = new \PhpSpreadsheet\Shared\Escher(); + $escher = new \PhpOffice\PhpSpreadsheet\Shared\Escher(); // dggContainer - $dggContainer = new \PhpSpreadsheet\Shared\Escher\DggContainer(); + $dggContainer = new \PhpOffice\PhpSpreadsheet\Shared\Escher\DggContainer(); $escher->setDggContainer($dggContainer); // set IDCLs (identifier clusters) @@ -448,37 +448,37 @@ class Excel5 extends BaseWriter implements IWriter $dggContainer->setCSpSaved($totalCountShapes + $countDrawings); // total number of shapes incl. one group shapes per drawing // bstoreContainer - $bstoreContainer = new \PhpSpreadsheet\Shared\Escher\DggContainer\BstoreContainer(); + $bstoreContainer = new \PhpOffice\PhpSpreadsheet\Shared\Escher\DggContainer\BstoreContainer(); $dggContainer->setBstoreContainer($bstoreContainer); // the BSE's (all the images) foreach ($this->spreadsheet->getAllsheets() as $sheet) { foreach ($sheet->getDrawingCollection() as $drawing) { - if ($drawing instanceof \PhpSpreadsheet\Worksheet\Drawing) { + if ($drawing instanceof \PhpOffice\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 = \PhpSpreadsheet\Shared\Escher\DggContainer\BstoreContainer\BSE::BLIPTYPE_PNG; + $blipType = \PhpOffice\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 = \PhpSpreadsheet\Shared\Escher\DggContainer\BstoreContainer\BSE::BLIPTYPE_JPEG; + $blipType = \PhpOffice\PhpSpreadsheet\Shared\Escher\DggContainer\BstoreContainer\BSE::BLIPTYPE_JPEG; $blipData = file_get_contents($filename); break; case 3: // PNG - $blipType = \PhpSpreadsheet\Shared\Escher\DggContainer\BstoreContainer\BSE::BLIPTYPE_PNG; + $blipType = \PhpOffice\PhpSpreadsheet\Shared\Escher\DggContainer\BstoreContainer\BSE::BLIPTYPE_PNG; $blipData = file_get_contents($filename); break; case 6: // Windows DIB (BMP), we convert to PNG - $blipType = \PhpSpreadsheet\Shared\Escher\DggContainer\BstoreContainer\BSE::BLIPTYPE_PNG; + $blipType = \PhpOffice\PhpSpreadsheet\Shared\Escher\DggContainer\BstoreContainer\BSE::BLIPTYPE_PNG; ob_start(); - imagepng(\PhpSpreadsheet\Shared\Drawing::imagecreatefrombmp($filename)); + imagepng(\PhpOffice\PhpSpreadsheet\Shared\Drawing::imagecreatefrombmp($filename)); $blipData = ob_get_contents(); ob_end_clean(); break; @@ -486,24 +486,24 @@ class Excel5 extends BaseWriter implements IWriter continue 2; } - $blip = new \PhpSpreadsheet\Shared\Escher\DggContainer\BstoreContainer\BSE\Blip(); + $blip = new \PhpOffice\PhpSpreadsheet\Shared\Escher\DggContainer\BstoreContainer\BSE\Blip(); $blip->setData($blipData); - $BSE = new \PhpSpreadsheet\Shared\Escher\DggContainer\BstoreContainer\BSE(); + $BSE = new \PhpOffice\PhpSpreadsheet\Shared\Escher\DggContainer\BstoreContainer\BSE(); $BSE->setBlipType($blipType); $BSE->setBlip($blip); $bstoreContainer->addBSE($BSE); - } elseif ($drawing instanceof \PhpSpreadsheet\Worksheet\MemoryDrawing) { + } elseif ($drawing instanceof \PhpOffice\PhpSpreadsheet\Worksheet\MemoryDrawing) { switch ($drawing->getRenderingFunction()) { - case \PhpSpreadsheet\Worksheet\MemoryDrawing::RENDERING_JPEG: - $blipType = \PhpSpreadsheet\Shared\Escher\DggContainer\BstoreContainer\BSE::BLIPTYPE_JPEG; + case \PhpOffice\PhpSpreadsheet\Worksheet\MemoryDrawing::RENDERING_JPEG: + $blipType = \PhpOffice\PhpSpreadsheet\Shared\Escher\DggContainer\BstoreContainer\BSE::BLIPTYPE_JPEG; $renderingFunction = 'imagejpeg'; break; - 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; + case \PhpOffice\PhpSpreadsheet\Worksheet\MemoryDrawing::RENDERING_GIF: + case \PhpOffice\PhpSpreadsheet\Worksheet\MemoryDrawing::RENDERING_PNG: + case \PhpOffice\PhpSpreadsheet\Worksheet\MemoryDrawing::RENDERING_DEFAULT: + $blipType = \PhpOffice\PhpSpreadsheet\Shared\Escher\DggContainer\BstoreContainer\BSE::BLIPTYPE_PNG; $renderingFunction = 'imagepng'; break; } @@ -513,10 +513,10 @@ class Excel5 extends BaseWriter implements IWriter $blipData = ob_get_contents(); ob_end_clean(); - $blip = new \PhpSpreadsheet\Shared\Escher\DggContainer\BstoreContainer\BSE\Blip(); + $blip = new \PhpOffice\PhpSpreadsheet\Shared\Escher\DggContainer\BstoreContainer\BSE\Blip(); $blip->setData($blipData); - $BSE = new \PhpSpreadsheet\Shared\Escher\DggContainer\BstoreContainer\BSE(); + $BSE = new \PhpOffice\PhpSpreadsheet\Shared\Escher\DggContainer\BstoreContainer\BSE(); $BSE->setBlipType($blipType); $BSE->setBlip($blip); @@ -855,7 +855,7 @@ class Excel5 extends BaseWriter implements IWriter 'summary' => ['pack' => 'V', 'data' => 0x0C], 'offset' => ['pack' => 'V'], 'type' => ['pack' => 'V', 'data' => 0x40], // Filetime (64-bit value representing the number of 100-nanosecond intervals since January 1, 1601) - 'data' => ['data' => \PhpSpreadsheet\Shared\OLE::localDateToOLE($dataProp)], + 'data' => ['data' => \PhpOffice\PhpSpreadsheet\Shared\OLE::localDateToOLE($dataProp)], ]; ++$dataSection_NumProps; } @@ -866,7 +866,7 @@ class Excel5 extends BaseWriter implements IWriter 'summary' => ['pack' => 'V', 'data' => 0x0D], 'offset' => ['pack' => 'V'], 'type' => ['pack' => 'V', 'data' => 0x40], // Filetime (64-bit value representing the number of 100-nanosecond intervals since January 1, 1601) - 'data' => ['data' => \PhpSpreadsheet\Shared\OLE::localDateToOLE($dataProp)], + 'data' => ['data' => \PhpOffice\PhpSpreadsheet\Shared\OLE::localDateToOLE($dataProp)], ]; ++$dataSection_NumProps; } diff --git a/src/PhpSpreadsheet/Writer/Excel5/BIFFwriter.php b/src/PhpSpreadsheet/Writer/Excel5/BIFFwriter.php index d4556053..9cab3be6 100644 --- a/src/PhpSpreadsheet/Writer/Excel5/BIFFwriter.php +++ b/src/PhpSpreadsheet/Writer/Excel5/BIFFwriter.php @@ -1,6 +1,6 @@ data = ''; switch (get_class($this->object)) { - case '\\PhpSpreadsheet\\Shared\\Escher': + case '\\PhpOffice\\PhpSpreadsheet\\Shared\\Escher': if ($dggContainer = $this->object->getDggContainer()) { $writer = new self($dggContainer); $this->data = $writer->close(); @@ -81,7 +81,7 @@ class Escher $this->spTypes = $writer->getSpTypes(); } break; - case '\\PhpSpreadsheet\\Shared\\Escher\\DggContainer': + case '\\PhpOffice\\PhpSpreadsheet\\Shared\\Escher\\DggContainer': // this is a container record // initialize @@ -134,7 +134,7 @@ class Escher $this->data = $header . $innerData; break; - case '\\PhpSpreadsheet\\Shared\\Escher\\DggContainer\\BstoreContainer': + case '\\PhpOffice\\PhpSpreadsheet\\Shared\\Escher\\DggContainer\\BstoreContainer': // this is a container record // initialize @@ -161,7 +161,7 @@ class Escher $this->data = $header . $innerData; break; - case '\\PhpSpreadsheet\\Shared\\Escher\\DggContainer\\BstoreContainer\\BSE': + case '\\PhpOffice\\PhpSpreadsheet\\Shared\\Escher\\DggContainer\\BstoreContainer\\BSE': // this is a semi-container record // initialize @@ -210,12 +210,12 @@ class Escher $this->data .= $data; break; - case '\\PhpSpreadsheet\\Shared\\Escher\\DggContainer\\BstoreContainer\\BSE\\Blip': + case '\\PhpOffice\\PhpSpreadsheet\\Shared\\Escher\\DggContainer\\BstoreContainer\\BSE\\Blip': // this is an atom record // write the record switch ($this->object->getParent()->getBlipType()) { - case \PhpSpreadsheet\Shared\Escher\DggContainer\BstoreContainer\BSE::BLIPTYPE_JPEG: + case \PhpOffice\PhpSpreadsheet\Shared\Escher\DggContainer\BstoreContainer\BSE::BLIPTYPE_JPEG: // initialize $innerData = ''; @@ -242,7 +242,7 @@ class Escher $this->data .= $innerData; break; - case \PhpSpreadsheet\Shared\Escher\DggContainer\BstoreContainer\BSE::BLIPTYPE_PNG: + case \PhpOffice\PhpSpreadsheet\Shared\Escher\DggContainer\BstoreContainer\BSE::BLIPTYPE_PNG: // initialize $innerData = ''; @@ -270,7 +270,7 @@ class Escher break; } break; - case '\\PhpSpreadsheet\\Shared\\Escher\\DgContainer': + case '\\PhpOffice\\PhpSpreadsheet\\Shared\\Escher\\DgContainer': // this is a container record // initialize @@ -322,7 +322,7 @@ class Escher $this->data = $header . $innerData; break; - case '\\PhpSpreadsheet\\Shared\\Escher\\DgContainer\\SpgrContainer': + case '\\PhpOffice\\PhpSpreadsheet\\Shared\\Escher\\DgContainer\\SpgrContainer': // this is a container record // initialize @@ -361,7 +361,7 @@ class Escher $this->spOffsets = $spOffsets; $this->spTypes = $spTypes; break; - case '\\PhpSpreadsheet\\Shared\\Escher\\DgContainer\\SpgrContainer\\SpContainer': + case '\\PhpOffice\\PhpSpreadsheet\\Shared\\Escher\\DgContainer\\SpgrContainer\\SpContainer': // initialize $data = ''; @@ -424,8 +424,8 @@ class Escher $recType = 0xF010; // start coordinates - list($column, $row) = \PhpSpreadsheet\Cell::coordinateFromString($this->object->getStartCoordinates()); - $c1 = \PhpSpreadsheet\Cell::columnIndexFromString($column) - 1; + list($column, $row) = \PhpOffice\PhpSpreadsheet\Cell::coordinateFromString($this->object->getStartCoordinates()); + $c1 = \PhpOffice\PhpSpreadsheet\Cell::columnIndexFromString($column) - 1; $r1 = $row - 1; // start offsetX @@ -435,8 +435,8 @@ class Escher $startOffsetY = $this->object->getStartOffsetY(); // end coordinates - list($column, $row) = \PhpSpreadsheet\Cell::coordinateFromString($this->object->getEndCoordinates()); - $c2 = \PhpSpreadsheet\Cell::columnIndexFromString($column) - 1; + list($column, $row) = \PhpOffice\PhpSpreadsheet\Cell::coordinateFromString($this->object->getEndCoordinates()); + $c2 = \PhpOffice\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 1404af56..4793a471 100644 --- a/src/PhpSpreadsheet/Writer/Excel5/Font.php +++ b/src/PhpSpreadsheet/Writer/Excel5/Font.php @@ -1,6 +1,6 @@ colorIndex = 0x7FFF; $this->font = $font; @@ -80,7 +80,7 @@ class Font $sss = 0; } $bFamily = 0; // Font family - $bCharSet = \PhpSpreadsheet\Shared\Font::getCharsetFromFontName($this->font->getName()); // Character set + $bCharSet = \PhpOffice\PhpSpreadsheet\Shared\Font::getCharsetFromFontName($this->font->getName()); // Character set $record = 0x31; // Record identifier $reserved = 0x00; // Reserved @@ -114,7 +114,7 @@ class Font $bCharSet, $reserved ); - $data .= \PhpSpreadsheet\Shared\StringHelper::UTF8toBIFF8UnicodeShort($this->font->getName()); + $data .= \PhpOffice\PhpSpreadsheet\Shared\StringHelper::UTF8toBIFF8UnicodeShort($this->font->getName()); $length = strlen($data); $header = pack('vv', $record, $length); @@ -142,11 +142,11 @@ class Font * @static array of int */ private static $mapUnderline = [ - \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, + \PhpOffice\PhpSpreadsheet\Style\Font::UNDERLINE_NONE => 0x00, + \PhpOffice\PhpSpreadsheet\Style\Font::UNDERLINE_SINGLE => 0x01, + \PhpOffice\PhpSpreadsheet\Style\Font::UNDERLINE_DOUBLE => 0x02, + \PhpOffice\PhpSpreadsheet\Style\Font::UNDERLINE_SINGLEACCOUNTING => 0x21, + \PhpOffice\PhpSpreadsheet\Style\Font::UNDERLINE_DOUBLEACCOUNTING => 0x22, ]; /** diff --git a/src/PhpSpreadsheet/Writer/Excel5/Parser.php b/src/PhpSpreadsheet/Writer/Excel5/Parser.php index a1629c35..fd8e02fe 100644 --- a/src/PhpSpreadsheet/Writer/Excel5/Parser.php +++ b/src/PhpSpreadsheet/Writer/Excel5/Parser.php @@ -1,6 +1,6 @@ 255) { - throw new \PhpSpreadsheet\Writer\Exception('String is too long'); + throw new \PhpOffice\PhpSpreadsheet\Writer\Exception('String is too long'); } - return pack('C', $this->ptg['ptgStr']) . \PhpSpreadsheet\Shared\StringHelper::UTF8toBIFF8UnicodeShort($string); + return pack('C', $this->ptg['ptgStr']) . \PhpOffice\PhpSpreadsheet\Shared\StringHelper::UTF8toBIFF8UnicodeShort($string); } /** @@ -616,7 +616,7 @@ class Parser list($cell1, $cell2) = explode(':', $range); } else { // TODO: use real error codes - throw new \PhpSpreadsheet\Writer\Exception('Unknown range separator'); + throw new \PhpOffice\PhpSpreadsheet\Writer\Exception('Unknown range separator'); } // Convert the cell references @@ -632,7 +632,7 @@ class Parser $ptgArea = pack('C', $this->ptg['ptgAreaA']); } else { // TODO: use real error codes - throw new \PhpSpreadsheet\Writer\Exception("Unknown class $class"); + throw new \PhpOffice\PhpSpreadsheet\Writer\Exception("Unknown class $class"); } return $ptgArea . $row1 . $row2 . $col1 . $col2; @@ -758,11 +758,11 @@ class Parser $sheet1 = $this->getSheetIndex($sheet_name1); if ($sheet1 == -1) { - throw new \PhpSpreadsheet\Writer\Exception("Unknown sheet name $sheet_name1 in formula"); + throw new \PhpOffice\PhpSpreadsheet\Writer\Exception("Unknown sheet name $sheet_name1 in formula"); } $sheet2 = $this->getSheetIndex($sheet_name2); if ($sheet2 == -1) { - throw new \PhpSpreadsheet\Writer\Exception("Unknown sheet name $sheet_name2 in formula"); + throw new \PhpOffice\PhpSpreadsheet\Writer\Exception("Unknown sheet name $sheet_name2 in formula"); } // Reverse max and min sheet numbers if necessary @@ -772,7 +772,7 @@ class Parser } else { // Single sheet name only. $sheet1 = $this->getSheetIndex($ext_ref); if ($sheet1 == -1) { - throw new \PhpSpreadsheet\Writer\Exception("Unknown sheet name $ext_ref in formula"); + throw new \PhpOffice\PhpSpreadsheet\Writer\Exception("Unknown sheet name $ext_ref in formula"); } $sheet2 = $sheet1; } @@ -803,11 +803,11 @@ class Parser $sheet1 = $this->getSheetIndex($sheet_name1); if ($sheet1 == -1) { - throw new \PhpSpreadsheet\Writer\Exception("Unknown sheet name $sheet_name1 in formula"); + throw new \PhpOffice\PhpSpreadsheet\Writer\Exception("Unknown sheet name $sheet_name1 in formula"); } $sheet2 = $this->getSheetIndex($sheet_name2); if ($sheet2 == -1) { - throw new \PhpSpreadsheet\Writer\Exception("Unknown sheet name $sheet_name2 in formula"); + throw new \PhpOffice\PhpSpreadsheet\Writer\Exception("Unknown sheet name $sheet_name2 in formula"); } // Reverse max and min sheet numbers if necessary @@ -817,7 +817,7 @@ class Parser } else { // Single sheet name only. $sheet1 = $this->getSheetIndex($ext_ref); if ($sheet1 == -1) { - throw new \PhpSpreadsheet\Writer\Exception("Unknown sheet name $ext_ref in formula"); + throw new \PhpOffice\PhpSpreadsheet\Writer\Exception("Unknown sheet name $ext_ref in formula"); } $sheet2 = $sheet1; } @@ -845,7 +845,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 - * \PhpSpreadsheet\Writer\Excel5\Workbook class. + * \PhpOffice\PhpSpreadsheet\Writer\Excel5\Workbook class. * * @param string $sheet_name Sheet name * @return int The sheet index, -1 if the sheet was not found @@ -862,9 +862,9 @@ class Parser /** * This method is used to update the array of sheet names. It is * called by the addWorksheet() method of the - * \PhpSpreadsheet\Writer\Excel5\Workbook class. + * \PhpOffice\PhpSpreadsheet\Writer\Excel5\Workbook class. * - * @see \PhpSpreadsheet\Writer\Excel5\Workbook::addWorksheet() + * @see \PhpOffice\PhpSpreadsheet\Writer\Excel5\Workbook::addWorksheet() * @param string $name The name of the worksheet being added * @param int $index The index of the worksheet being added */ @@ -884,10 +884,10 @@ class Parser $cell = strtoupper($cell); list($row, $col, $row_rel, $col_rel) = $this->cellToRowcol($cell); if ($col >= 256) { - throw new \PhpSpreadsheet\Writer\Exception("Column in: $cell greater than 255"); + throw new \PhpOffice\PhpSpreadsheet\Writer\Exception("Column in: $cell greater than 255"); } if ($row >= 65536) { - throw new \PhpSpreadsheet\Writer\Exception("Row in: $cell greater than 65536 "); + throw new \PhpOffice\PhpSpreadsheet\Writer\Exception("Row in: $cell greater than 65536 "); } // Set the high bits to indicate if row or col are relative. @@ -924,7 +924,7 @@ class Parser // FIXME: this changes for BIFF8 if (($row1 >= 65536) or ($row2 >= 65536)) { - throw new \PhpSpreadsheet\Writer\Exception("Row in: $range greater than 65536 "); + throw new \PhpOffice\PhpSpreadsheet\Writer\Exception("Row in: $range greater than 65536 "); } // Set the high bits to indicate if rows are relative. @@ -1285,7 +1285,7 @@ class Parser $this->advance(); // eat the "(" $result = $this->parenthesizedExpression(); if ($this->currentToken != ')') { - throw new \PhpSpreadsheet\Writer\Exception("')' token expected."); + throw new \PhpOffice\PhpSpreadsheet\Writer\Exception("')' token expected."); } $this->advance(); // eat the ")" return $result; @@ -1347,7 +1347,7 @@ class Parser return $result; } - throw new \PhpSpreadsheet\Writer\Exception('Syntax error: ' . $this->currentToken . ', lookahead: ' . $this->lookAhead . ', current char: ' . $this->currentCharacter); + throw new \PhpOffice\PhpSpreadsheet\Writer\Exception('Syntax error: ' . $this->currentToken . ', lookahead: ' . $this->lookAhead . ', current char: ' . $this->currentCharacter); } /** @@ -1369,7 +1369,7 @@ class Parser if ($this->currentToken == ',' || $this->currentToken == ';') { $this->advance(); // eat the "," or ";" } else { - throw new \PhpSpreadsheet\Writer\Exception("Syntax error: comma expected in function $function, arg #{$num_args}"); + throw new \PhpOffice\PhpSpreadsheet\Writer\Exception("Syntax error: comma expected in function $function, arg #{$num_args}"); } $result2 = $this->condition(); $result = $this->createTree('arg', $result, $result2); @@ -1380,12 +1380,12 @@ class Parser ++$num_args; } if (!isset($this->functions[$function])) { - throw new \PhpSpreadsheet\Writer\Exception("Function $function() doesn't exist"); + throw new \PhpOffice\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 \PhpSpreadsheet\Writer\Exception("Incorrect number of arguments in function $function() "); + throw new \PhpOffice\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 e2a4dac6..1413e9a0 100644 --- a/src/PhpSpreadsheet/Writer/Excel5/Workbook.php +++ b/src/PhpSpreadsheet/Writer/Excel5/Workbook.php @@ -1,6 +1,6 @@ getHashCode(); if (isset($this->addedFonts[$fontHashCode])) { @@ -295,7 +295,7 @@ class Workbook extends BIFFwriter $countFonts = count($this->fontWriters); $fontIndex = ($countFonts < 4) ? $countFonts : $countFonts + 1; - $fontWriter = new \PhpSpreadsheet\Writer\Excel5\Font($font); + $fontWriter = new \PhpOffice\PhpSpreadsheet\Writer\Excel5\Font($font); $fontWriter->setColorIndex($this->addColor($font->getColor()->getRGB())); $this->fontWriters[] = $fontWriter; @@ -471,7 +471,7 @@ class Workbook extends BIFFwriter // add size of Workbook globals part 2, the length of the SHEET records $total_worksheets = count($this->spreadsheet->getAllSheets()); foreach ($this->spreadsheet->getWorksheetIterator() as $sheet) { - $offset += $boundsheet_length + strlen(\PhpSpreadsheet\Shared\StringHelper::UTF8toBIFF8UnicodeShort($sheet->getTitle())); + $offset += $boundsheet_length + strlen(\PhpOffice\PhpSpreadsheet\Shared\StringHelper::UTF8toBIFF8UnicodeShort($sheet->getTitle())); } // add the sizes of each of the Sheet substreams, respectively @@ -550,15 +550,15 @@ class Workbook extends BIFFwriter // Write a Name record if the print area has been defined if ($sheetSetup->isPrintAreaSet()) { // Print area - $printArea = \PhpSpreadsheet\Cell::splitRange($sheetSetup->getPrintArea()); + $printArea = \PhpOffice\PhpSpreadsheet\Cell::splitRange($sheetSetup->getPrintArea()); $printArea = $printArea[0]; - $printArea[0] = \PhpSpreadsheet\Cell::coordinateFromString($printArea[0]); - $printArea[1] = \PhpSpreadsheet\Cell::coordinateFromString($printArea[1]); + $printArea[0] = \PhpOffice\PhpSpreadsheet\Cell::coordinateFromString($printArea[0]); + $printArea[1] = \PhpOffice\PhpSpreadsheet\Cell::coordinateFromString($printArea[1]); $print_rowmin = $printArea[0][1] - 1; $print_rowmax = $printArea[1][1] - 1; - $print_colmin = \PhpSpreadsheet\Cell::columnIndexFromString($printArea[0][0]) - 1; - $print_colmax = \PhpSpreadsheet\Cell::columnIndexFromString($printArea[1][0]) - 1; + $print_colmin = \PhpOffice\PhpSpreadsheet\Cell::columnIndexFromString($printArea[0][0]) - 1; + $print_colmax = \PhpOffice\PhpSpreadsheet\Cell::columnIndexFromString($printArea[1][0]) - 1; $this->writeNameShort( $i, // sheet index @@ -578,8 +578,8 @@ class Workbook extends BIFFwriter // simultaneous repeatColumns repeatRows if ($sheetSetup->isColumnsToRepeatAtLeftSet() && $sheetSetup->isRowsToRepeatAtTopSet()) { $repeat = $sheetSetup->getColumnsToRepeatAtLeft(); - $colmin = \PhpSpreadsheet\Cell::columnIndexFromString($repeat[0]) - 1; - $colmax = \PhpSpreadsheet\Cell::columnIndexFromString($repeat[1]) - 1; + $colmin = \PhpOffice\PhpSpreadsheet\Cell::columnIndexFromString($repeat[0]) - 1; + $colmax = \PhpOffice\PhpSpreadsheet\Cell::columnIndexFromString($repeat[1]) - 1; $repeat = $sheetSetup->getRowsToRepeatAtTop(); $rowmin = $repeat[0] - 1; @@ -599,8 +599,8 @@ class Workbook extends BIFFwriter // Columns to repeat if ($sheetSetup->isColumnsToRepeatAtLeftSet()) { $repeat = $sheetSetup->getColumnsToRepeatAtLeft(); - $colmin = \PhpSpreadsheet\Cell::columnIndexFromString($repeat[0]) - 1; - $colmax = \PhpSpreadsheet\Cell::columnIndexFromString($repeat[1]) - 1; + $colmin = \PhpOffice\PhpSpreadsheet\Cell::columnIndexFromString($repeat[0]) - 1; + $colmax = \PhpOffice\PhpSpreadsheet\Cell::columnIndexFromString($repeat[1]) - 1; } else { $colmin = 0; $colmax = 255; @@ -642,14 +642,14 @@ class Workbook extends BIFFwriter $namedRanges = $this->spreadsheet->getNamedRanges(); foreach ($namedRanges as $namedRange) { // Create absolute coordinate - $range = \PhpSpreadsheet\Cell::splitRange($namedRange->getRange()); + $range = \PhpOffice\PhpSpreadsheet\Cell::splitRange($namedRange->getRange()); for ($i = 0; $i < count($range); ++$i) { - $range[$i][0] = '\'' . str_replace("'", "''", $namedRange->getWorksheet()->getTitle()) . '\'!' . \PhpSpreadsheet\Cell::absoluteCoordinate($range[$i][0]); + $range[$i][0] = '\'' . str_replace("'", "''", $namedRange->getWorksheet()->getTitle()) . '\'!' . \PhpOffice\PhpSpreadsheet\Cell::absoluteCoordinate($range[$i][0]); if (isset($range[$i][1])) { - $range[$i][1] = \PhpSpreadsheet\Cell::absoluteCoordinate($range[$i][1]); + $range[$i][1] = \PhpOffice\PhpSpreadsheet\Cell::absoluteCoordinate($range[$i][1]); } } - $range = \PhpSpreadsheet\Cell::buildRange($range); // e.g. Sheet1!$A$1:$B$2 + $range = \PhpOffice\PhpSpreadsheet\Cell::buildRange($range); // e.g. Sheet1!$A$1:$B$2 // parse formula try { @@ -669,7 +669,7 @@ class Workbook extends BIFFwriter $scope = 0; } $chunk .= $this->writeData($this->writeDefinedNameBiff8($namedRange->getName(), $formulaData, $scope, false)); - } catch (\PhpSpreadsheet\Exception $e) { + } catch (\PhpOffice\PhpSpreadsheet\Exception $e) { // do nothing } } @@ -684,8 +684,8 @@ class Workbook extends BIFFwriter // simultaneous repeatColumns repeatRows if ($sheetSetup->isColumnsToRepeatAtLeftSet() && $sheetSetup->isRowsToRepeatAtTopSet()) { $repeat = $sheetSetup->getColumnsToRepeatAtLeft(); - $colmin = \PhpSpreadsheet\Cell::columnIndexFromString($repeat[0]) - 1; - $colmax = \PhpSpreadsheet\Cell::columnIndexFromString($repeat[1]) - 1; + $colmin = \PhpOffice\PhpSpreadsheet\Cell::columnIndexFromString($repeat[0]) - 1; + $colmax = \PhpOffice\PhpSpreadsheet\Cell::columnIndexFromString($repeat[1]) - 1; $repeat = $sheetSetup->getRowsToRepeatAtTop(); $rowmin = $repeat[0] - 1; @@ -705,8 +705,8 @@ class Workbook extends BIFFwriter // Columns to repeat if ($sheetSetup->isColumnsToRepeatAtLeftSet()) { $repeat = $sheetSetup->getColumnsToRepeatAtLeft(); - $colmin = \PhpSpreadsheet\Cell::columnIndexFromString($repeat[0]) - 1; - $colmax = \PhpSpreadsheet\Cell::columnIndexFromString($repeat[1]) - 1; + $colmin = \PhpOffice\PhpSpreadsheet\Cell::columnIndexFromString($repeat[0]) - 1; + $colmax = \PhpOffice\PhpSpreadsheet\Cell::columnIndexFromString($repeat[1]) - 1; } else { $colmin = 0; $colmax = 255; @@ -734,19 +734,19 @@ class Workbook extends BIFFwriter $sheetSetup = $this->spreadsheet->getSheet($i)->getPageSetup(); if ($sheetSetup->isPrintAreaSet()) { // Print area, e.g. A3:J6,H1:X20 - $printArea = \PhpSpreadsheet\Cell::splitRange($sheetSetup->getPrintArea()); + $printArea = \PhpOffice\PhpSpreadsheet\Cell::splitRange($sheetSetup->getPrintArea()); $countPrintArea = count($printArea); $formulaData = ''; for ($j = 0; $j < $countPrintArea; ++$j) { $printAreaRect = $printArea[$j]; // e.g. A3:J6 - $printAreaRect[0] = \PhpSpreadsheet\Cell::coordinateFromString($printAreaRect[0]); - $printAreaRect[1] = \PhpSpreadsheet\Cell::coordinateFromString($printAreaRect[1]); + $printAreaRect[0] = \PhpOffice\PhpSpreadsheet\Cell::coordinateFromString($printAreaRect[0]); + $printAreaRect[1] = \PhpOffice\PhpSpreadsheet\Cell::coordinateFromString($printAreaRect[1]); $print_rowmin = $printAreaRect[0][1] - 1; $print_rowmax = $printAreaRect[1][1] - 1; - $print_colmin = \PhpSpreadsheet\Cell::columnIndexFromString($printAreaRect[0][0]) - 1; - $print_colmax = \PhpSpreadsheet\Cell::columnIndexFromString($printAreaRect[1][0]) - 1; + $print_colmin = \PhpOffice\PhpSpreadsheet\Cell::columnIndexFromString($printAreaRect[0][0]) - 1; + $print_colmax = \PhpOffice\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); @@ -766,7 +766,7 @@ class Workbook extends BIFFwriter $sheetAutoFilter = $this->spreadsheet->getSheet($i)->getAutoFilter(); $autoFilterRange = $sheetAutoFilter->getRange(); if (!empty($autoFilterRange)) { - $rangeBounds = \PhpSpreadsheet\Cell::rangeBoundaries($autoFilterRange); + $rangeBounds = \PhpOffice\PhpSpreadsheet\Cell::rangeBoundaries($autoFilterRange); //Autofilter built in name $name = pack('C', 0x0D); @@ -795,10 +795,10 @@ class Workbook extends BIFFwriter $options = $isBuiltIn ? 0x20 : 0x00; // length of the name, character count - $nlen = \PhpSpreadsheet\Shared\StringHelper::countCharacters($name); + $nlen = \PhpOffice\PhpSpreadsheet\Shared\StringHelper::countCharacters($name); // name with stripped length field - $name = substr(\PhpSpreadsheet\Shared\StringHelper::UTF8toBIFF8UnicodeLong($name), 2); + $name = substr(\PhpOffice\PhpSpreadsheet\Shared\StringHelper::UTF8toBIFF8UnicodeLong($name), 2); // size of the formula (in bytes) $sz = strlen($formulaData); @@ -899,7 +899,7 @@ class Workbook extends BIFFwriter /** * Writes Excel BIFF BOUNDSHEET record. * - * @param \PhpSpreadsheet\Worksheet $sheet Worksheet name + * @param \PhpOffice\PhpSpreadsheet\Worksheet $sheet Worksheet name * @param int $offset Location of worksheet BOF */ private function writeBoundSheet($sheet, $offset) @@ -909,13 +909,13 @@ class Workbook extends BIFFwriter // sheet state switch ($sheet->getSheetState()) { - case \PhpSpreadsheet\Worksheet::SHEETSTATE_VISIBLE: + case \PhpOffice\PhpSpreadsheet\Worksheet::SHEETSTATE_VISIBLE: $ss = 0x00; break; - case \PhpSpreadsheet\Worksheet::SHEETSTATE_HIDDEN: + case \PhpOffice\PhpSpreadsheet\Worksheet::SHEETSTATE_HIDDEN: $ss = 0x01; break; - case \PhpSpreadsheet\Worksheet::SHEETSTATE_VERYHIDDEN: + case \PhpOffice\PhpSpreadsheet\Worksheet::SHEETSTATE_VERYHIDDEN: $ss = 0x02; break; default: @@ -929,7 +929,7 @@ class Workbook extends BIFFwriter $grbit = 0x0000; // Visibility and sheet type $data = pack('VCC', $offset, $ss, $st); - $data .= \PhpSpreadsheet\Shared\StringHelper::UTF8toBIFF8UnicodeShort($sheetname); + $data .= \PhpOffice\PhpSpreadsheet\Shared\StringHelper::UTF8toBIFF8UnicodeShort($sheetname); $length = strlen($data); $header = pack('vv', $record, $length); @@ -997,7 +997,7 @@ class Workbook extends BIFFwriter { $record = 0x041E; // Record identifier - $numberFormatString = \PhpSpreadsheet\Shared\StringHelper::UTF8toBIFF8UnicodeLong($format); + $numberFormatString = \PhpOffice\PhpSpreadsheet\Shared\StringHelper::UTF8toBIFF8UnicodeLong($format); $length = 2 + strlen($numberFormatString); // Number of bytes to follow $header = pack('vv', $record, $length); @@ -1013,7 +1013,7 @@ class Workbook extends BIFFwriter $record = 0x0022; // Record identifier $length = 0x0002; // Bytes to follow - $f1904 = (\PhpSpreadsheet\Shared\Date::getExcelCalendar() == \PhpSpreadsheet\Shared\Date::CALENDAR_MAC_1904) + $f1904 = (\PhpOffice\PhpSpreadsheet\Shared\Date::getExcelCalendar() == \PhpOffice\PhpSpreadsheet\Shared\Date::CALENDAR_MAC_1904) ? 1 : 0; // Flag for 1904 date system @@ -1401,7 +1401,7 @@ class Workbook extends BIFFwriter { // write the Escher stream if necessary if (isset($this->escher)) { - $writer = new \PhpSpreadsheet\Writer\Excel5\Escher($this->escher); + $writer = new \PhpOffice\PhpSpreadsheet\Writer\Excel5\Escher($this->escher); $data = $writer->close(); $record = 0x00EB; @@ -1417,7 +1417,7 @@ class Workbook extends BIFFwriter /** * Get Escher object * - * @return \PhpSpreadsheet\Shared\Escher + * @return \PhpOffice\PhpSpreadsheet\Shared\Escher */ public function getEscher() { @@ -1427,9 +1427,9 @@ class Workbook extends BIFFwriter /** * Set Escher object * - * @param \PhpSpreadsheet\Shared\Escher $pValue + * @param \PhpOffice\PhpSpreadsheet\Shared\Escher $pValue */ - public function setEscher(\PhpSpreadsheet\Shared\Escher $pValue = null) + public function setEscher(\PhpOffice\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 6d9488ab..b1858a04 100644 --- a/src/PhpSpreadsheet/Writer/Excel5/Worksheet.php +++ b/src/PhpSpreadsheet/Writer/Excel5/Worksheet.php @@ -1,6 +1,6 @@ lastRowIndex = ($maxR > 65535) ? 65535 : $maxR; - $this->firstColumnIndex = \PhpSpreadsheet\Cell::columnIndexFromString($minC); - $this->lastColumnIndex = \PhpSpreadsheet\Cell::columnIndexFromString($maxC); + $this->firstColumnIndex = \PhpOffice\PhpSpreadsheet\Cell::columnIndexFromString($minC); + $this->lastColumnIndex = \PhpOffice\PhpSpreadsheet\Cell::columnIndexFromString($maxC); // if ($this->firstColumnIndex > 255) $this->firstColumnIndex = 255; if ($this->lastColumnIndex > 255) { @@ -255,7 +255,7 @@ class Worksheet extends BIFFwriter * Add data to the beginning of the workbook (note the reverse order) * and to the end of the workbook. * - * @see \PhpSpreadsheet\Writer\Excel5\Workbook::storeWorkbook() + * @see \PhpOffice\PhpSpreadsheet\Writer\Excel5\Workbook::storeWorkbook() */ public function close() { @@ -280,7 +280,7 @@ class Worksheet extends BIFFwriter // Column dimensions if (($defaultWidth = $phpSheet->getDefaultColumnDimension()->getWidth()) < 0) { - $defaultWidth = \PhpSpreadsheet\Shared\Font::getDefaultColumnWidthByFont($phpSheet->getParent()->getDefaultStyle()->getFont()); + $defaultWidth = \PhpOffice\PhpSpreadsheet\Shared\Font::getDefaultColumnWidthByFont($phpSheet->getParent()->getDefaultStyle()->getFont()); } $columnDimensions = $phpSheet->getColumnDimensions(); @@ -292,7 +292,7 @@ class Worksheet extends BIFFwriter $width = $defaultWidth; - $columnLetter = \PhpSpreadsheet\Cell::stringFromColumnIndex($i); + $columnLetter = \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($i); if (isset($columnDimensions[$columnLetter])) { $columnDimension = $columnDimensions[$columnLetter]; if ($columnDimension->getWidth() >= 0) { @@ -377,7 +377,7 @@ class Worksheet extends BIFFwriter foreach ($phpSheet->getCellCollection() as $cellID) { $cell = $phpSheet->getCell($cellID); $row = $cell->getRow() - 1; - $column = \PhpSpreadsheet\Cell::columnIndexFromString($cell->getColumn()) - 1; + $column = \PhpOffice\PhpSpreadsheet\Cell::columnIndexFromString($cell->getColumn()) - 1; // Don't break Excel! // if ($row + 1 > 65536 or $column + 1 > 256) { @@ -389,27 +389,27 @@ class Worksheet extends BIFFwriter $xfIndex = $cell->getXfIndex() + 15; // there are 15 cell style Xfs $cVal = $cell->getValue(); - if ($cVal instanceof \PhpSpreadsheet\RichText) { + if ($cVal instanceof \PhpOffice\PhpSpreadsheet\RichText) { $arrcRun = []; - $str_len = \PhpSpreadsheet\Shared\StringHelper::countCharacters($cVal->getPlainText(), 'UTF-8'); + $str_len = \PhpOffice\PhpSpreadsheet\Shared\StringHelper::countCharacters($cVal->getPlainText(), 'UTF-8'); $str_pos = 0; $elements = $cVal->getRichTextElements(); foreach ($elements as $element) { // FONT Index - if ($element instanceof \PhpSpreadsheet\RichText\Run) { + if ($element instanceof \PhpOffice\PhpSpreadsheet\RichText\Run) { $str_fontidx = $this->fontHashIndex[$element->getFont()->getHashCode()]; } else { $str_fontidx = 0; } $arrcRun[] = ['strlen' => $str_pos, 'fontidx' => $str_fontidx]; // Position FROM - $str_pos += \PhpSpreadsheet\Shared\StringHelper::countCharacters($element->getText(), 'UTF-8'); + $str_pos += \PhpOffice\PhpSpreadsheet\Shared\StringHelper::countCharacters($element->getText(), 'UTF-8'); } $this->writeRichTextString($row, $column, $cVal->getPlainText(), $xfIndex, $arrcRun); } else { switch ($cell->getDatatype()) { - case \PhpSpreadsheet\Cell\DataType::TYPE_STRING: - case \PhpSpreadsheet\Cell\DataType::TYPE_NULL: + case \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING: + case \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_NULL: if ($cVal === '' || $cVal === null) { $this->writeBlank($row, $column, $xfIndex); } else { @@ -417,21 +417,21 @@ class Worksheet extends BIFFwriter } break; - case \PhpSpreadsheet\Cell\DataType::TYPE_NUMERIC: + case \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_NUMERIC: $this->writeNumber($row, $column, $cVal, $xfIndex); break; - case \PhpSpreadsheet\Cell\DataType::TYPE_FORMULA: + case \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_FORMULA: $calculatedValue = $this->_preCalculateFormulas ? $cell->getCalculatedValue() : null; $this->writeFormula($row, $column, $cVal, $xfIndex, $calculatedValue); break; - case \PhpSpreadsheet\Cell\DataType::TYPE_BOOL: + case \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_BOOL: $this->writeBoolErr($row, $column, $cVal, 0, $xfIndex); break; - case \PhpSpreadsheet\Cell\DataType::TYPE_ERROR: + case \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_ERROR: $this->writeBoolErr($row, $column, self::mapErrorCode($cVal), 1, $xfIndex); break; } @@ -461,7 +461,7 @@ class Worksheet extends BIFFwriter // Hyperlinks foreach ($phpSheet->getHyperLinkCollection() as $coordinate => $hyperlink) { - list($column, $row) = \PhpSpreadsheet\Cell::coordinateFromString($coordinate); + list($column, $row) = \PhpOffice\PhpSpreadsheet\Cell::coordinateFromString($coordinate); $url = $hyperlink->getUrl(); @@ -475,7 +475,7 @@ class Worksheet extends BIFFwriter $url = 'external:' . $url; } - $this->writeUrl($row - 1, \PhpSpreadsheet\Cell::columnIndexFromString($column) - 1, $url); + $this->writeUrl($row - 1, \PhpOffice\PhpSpreadsheet\Cell::columnIndexFromString($column) - 1, $url); } $this->writeDataValidity(); @@ -494,8 +494,8 @@ class Worksheet extends BIFFwriter // Write ConditionalFormattingTable records foreach ($arrConditionalStyles as $cellCoordinate => $conditionalStyles) { foreach ($conditionalStyles as $conditional) { - if ($conditional->getConditionType() == \PhpSpreadsheet\Style\Conditional::CONDITION_EXPRESSION - || $conditional->getConditionType() == \PhpSpreadsheet\Style\Conditional::CONDITION_CELLIS) { + if ($conditional->getConditionType() == \PhpOffice\PhpSpreadsheet\Style\Conditional::CONDITION_EXPRESSION + || $conditional->getConditionType() == \PhpOffice\PhpSpreadsheet\Style\Conditional::CONDITION_CELLIS) { if (!in_array($conditional->getHashCode(), $arrConditional)) { $arrConditional[] = $conditional->getHashCode(); // Write CFRULE record @@ -531,10 +531,10 @@ class Worksheet extends BIFFwriter $lastCell = $explodes[1]; } - $firstCellCoordinates = \PhpSpreadsheet\Cell::coordinateFromString($firstCell); // e.g. array(0, 1) - $lastCellCoordinates = \PhpSpreadsheet\Cell::coordinateFromString($lastCell); // e.g. array(1, 6) + $firstCellCoordinates = \PhpOffice\PhpSpreadsheet\Cell::coordinateFromString($firstCell); // e.g. array(0, 1) + $lastCellCoordinates = \PhpOffice\PhpSpreadsheet\Cell::coordinateFromString($lastCell); // e.g. array(1, 6) - return pack('vvvv', $firstCellCoordinates[1] - 1, $lastCellCoordinates[1] - 1, \PhpSpreadsheet\Cell::columnIndexFromString($firstCellCoordinates[0]) - 1, \PhpSpreadsheet\Cell::columnIndexFromString($lastCellCoordinates[0]) - 1); + return pack('vvvv', $firstCellCoordinates[1] - 1, $lastCellCoordinates[1] - 1, \PhpOffice\PhpSpreadsheet\Cell::columnIndexFromString($firstCellCoordinates[0]) - 1, \PhpOffice\PhpSpreadsheet\Cell::columnIndexFromString($lastCellCoordinates[0]) - 1); } /** @@ -647,7 +647,7 @@ class Worksheet extends BIFFwriter { $record = 0x00FD; // Record identifier $length = 0x000A; // Bytes to follow - $str = \PhpSpreadsheet\Shared\StringHelper::UTF8toBIFF8UnicodeShort($str, $arrcRun); + $str = \PhpOffice\PhpSpreadsheet\Shared\StringHelper::UTF8toBIFF8UnicodeShort($str, $arrcRun); /* check if string is already present */ if (!isset($this->stringTable[$str])) { @@ -715,7 +715,7 @@ class Worksheet extends BIFFwriter $record = 0x00FD; // Record identifier $length = 0x000A; // Bytes to follow - $str = \PhpSpreadsheet\Shared\StringHelper::UTF8toBIFF8UnicodeLong($str); + $str = \PhpOffice\PhpSpreadsheet\Shared\StringHelper::UTF8toBIFF8UnicodeLong($str); /* check if string is already present */ if (!isset($this->stringTable[$str])) { @@ -842,7 +842,7 @@ class Worksheet extends BIFFwriter // Numeric value $num = pack('d', $calculatedValue); } elseif (is_string($calculatedValue)) { - if (array_key_exists($calculatedValue, \PhpSpreadsheet\Cell\DataType::getErrorCodes())) { + if (array_key_exists($calculatedValue, \PhpOffice\PhpSpreadsheet\Cell\DataType::getErrorCodes())) { // Error value $num = pack('CCCvCv', 0x02, 0x00, self::mapErrorCode($calculatedValue), 0x00, 0x00, 0xFFFF); } elseif ($calculatedValue === '') { @@ -895,7 +895,7 @@ class Worksheet extends BIFFwriter } return 0; - } catch (\PhpSpreadsheet\Exception $e) { + } catch (\PhpOffice\PhpSpreadsheet\Exception $e) { // do nothing } } @@ -908,7 +908,7 @@ class Worksheet extends BIFFwriter private function writeStringRecord($stringValue) { $record = 0x0207; // Record identifier - $data = \PhpSpreadsheet\Shared\StringHelper::UTF8toBIFF8UnicodeLong($stringValue); + $data = \PhpOffice\PhpSpreadsheet\Shared\StringHelper::UTF8toBIFF8UnicodeLong($stringValue); $length = strlen($data); $header = pack('vv', $record, $length); @@ -1043,10 +1043,10 @@ class Worksheet extends BIFFwriter $url .= "\0"; // character count - $url_len = \PhpSpreadsheet\Shared\StringHelper::countCharacters($url); + $url_len = \PhpOffice\PhpSpreadsheet\Shared\StringHelper::countCharacters($url); $url_len = pack('V', $url_len); - $url = \PhpSpreadsheet\Shared\StringHelper::convertEncoding($url, 'UTF-16LE', 'UTF-8'); + $url = \PhpOffice\PhpSpreadsheet\Shared\StringHelper::convertEncoding($url, 'UTF-16LE', 'UTF-8'); // Calculate the data length $length = 0x24 + strlen($url); @@ -1256,7 +1256,7 @@ class Worksheet extends BIFFwriter // 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() === \PhpSpreadsheet\Worksheet\SheetView::SHEETVIEW_PAGE_BREAK_PREVIEW; + $fPageBreakPreview = $this->phpSheet->getSheetView()->getView() === \PhpOffice\PhpSpreadsheet\Worksheet\SheetView::SHEETVIEW_PAGE_BREAK_PREVIEW; $grbit = $fDspFmla; $grbit |= $fDspGrid << 1; @@ -1386,7 +1386,7 @@ class Worksheet extends BIFFwriter { // look up the selected cell range $selectedCells = $this->phpSheet->getSelectedCells(); - $selectedCells = \PhpSpreadsheet\Cell::splitRange($this->phpSheet->getSelectedCells()); + $selectedCells = \PhpOffice\PhpSpreadsheet\Cell::splitRange($this->phpSheet->getSelectedCells()); $selectedCells = $selectedCells[0]; if (count($selectedCells) == 2) { list($first, $last) = $selectedCells; @@ -1395,12 +1395,12 @@ class Worksheet extends BIFFwriter $last = $selectedCells[0]; } - list($colFirst, $rwFirst) = \PhpSpreadsheet\Cell::coordinateFromString($first); - $colFirst = \PhpSpreadsheet\Cell::columnIndexFromString($colFirst) - 1; // base 0 column index + list($colFirst, $rwFirst) = \PhpOffice\PhpSpreadsheet\Cell::coordinateFromString($first); + $colFirst = \PhpOffice\PhpSpreadsheet\Cell::columnIndexFromString($colFirst) - 1; // base 0 column index --$rwFirst; // base 0 row index - list($colLast, $rwLast) = \PhpSpreadsheet\Cell::coordinateFromString($last); - $colLast = \PhpSpreadsheet\Cell::columnIndexFromString($colLast) - 1; // base 0 column index + list($colLast, $rwLast) = \PhpOffice\PhpSpreadsheet\Cell::coordinateFromString($last); + $colLast = \PhpOffice\PhpSpreadsheet\Cell::columnIndexFromString($colLast) - 1; // base 0 column index --$rwLast; // base 0 row index // make sure we are not out of bounds @@ -1473,12 +1473,12 @@ class Worksheet extends BIFFwriter ++$j; // extract the row and column indexes - $range = \PhpSpreadsheet\Cell::splitRange($mergeCell); + $range = \PhpOffice\PhpSpreadsheet\Cell::splitRange($mergeCell); list($first, $last) = $range[0]; - list($firstColumn, $firstRow) = \PhpSpreadsheet\Cell::coordinateFromString($first); - list($lastColumn, $lastRow) = \PhpSpreadsheet\Cell::coordinateFromString($last); + list($firstColumn, $firstRow) = \PhpOffice\PhpSpreadsheet\Cell::coordinateFromString($first); + list($lastColumn, $lastRow) = \PhpOffice\PhpSpreadsheet\Cell::coordinateFromString($last); - $recordData .= pack('vvvv', $firstRow - 1, $lastRow - 1, \PhpSpreadsheet\Cell::columnIndexFromString($firstColumn) - 1, \PhpSpreadsheet\Cell::columnIndexFromString($lastColumn) - 1); + $recordData .= pack('vvvv', $firstRow - 1, $lastRow - 1, \PhpOffice\PhpSpreadsheet\Cell::columnIndexFromString($firstColumn) - 1, \PhpOffice\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) { @@ -1603,7 +1603,7 @@ class Worksheet extends BIFFwriter hexdec($password) ); - $recordData .= \PhpSpreadsheet\Shared\StringHelper::UTF8toBIFF8UnicodeLong('p' . md5($recordData)); + $recordData .= \PhpOffice\PhpSpreadsheet\Shared\StringHelper::UTF8toBIFF8UnicodeLong('p' . md5($recordData)); $length = strlen($recordData); @@ -1676,9 +1676,9 @@ class Worksheet extends BIFFwriter { $panes = []; if ($freezePane = $this->phpSheet->getFreezePane()) { - list($column, $row) = \PhpSpreadsheet\Cell::coordinateFromString($freezePane); + list($column, $row) = \PhpOffice\PhpSpreadsheet\Cell::coordinateFromString($freezePane); $panes[0] = $row - 1; - $panes[1] = \PhpSpreadsheet\Cell::columnIndexFromString($column) - 1; + $panes[1] = \PhpOffice\PhpSpreadsheet\Cell::columnIndexFromString($column) - 1; } else { // thaw panes return; @@ -1776,7 +1776,7 @@ class Worksheet extends BIFFwriter $fLeftToRight = 0x0; // Print over then down // Page orientation - $fLandscape = ($this->phpSheet->getPageSetup()->getOrientation() == \PhpSpreadsheet\Worksheet\PageSetup::ORIENTATION_LANDSCAPE) ? + $fLandscape = ($this->phpSheet->getPageSetup()->getOrientation() == \PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::ORIENTATION_LANDSCAPE) ? 0x0 : 0x1; $fNoPls = 0x0; // Setup not read from printer @@ -1825,7 +1825,7 @@ class Worksheet extends BIFFwriter } */ - $recordData = \PhpSpreadsheet\Shared\StringHelper::UTF8toBIFF8UnicodeLong($this->phpSheet->getHeaderFooter()->getOddHeader()); + $recordData = \PhpOffice\PhpSpreadsheet\Shared\StringHelper::UTF8toBIFF8UnicodeLong($this->phpSheet->getHeaderFooter()->getOddHeader()); $length = strlen($recordData); $header = pack('vv', $record, $length); @@ -1849,7 +1849,7 @@ class Worksheet extends BIFFwriter } */ - $recordData = \PhpSpreadsheet\Shared\StringHelper::UTF8toBIFF8UnicodeLong($this->phpSheet->getHeaderFooter()->getOddFooter()); + $recordData = \PhpOffice\PhpSpreadsheet\Shared\StringHelper::UTF8toBIFF8UnicodeLong($this->phpSheet->getHeaderFooter()->getOddFooter()); $length = strlen($recordData); $header = pack('vv', $record, $length); @@ -2019,7 +2019,7 @@ class Worksheet extends BIFFwriter $record = 0x009D; // Record identifier $length = 0x0002; // Bytes to follow - $rangeBounds = \PhpSpreadsheet\Cell::rangeBoundaries($this->phpSheet->getAutoFilter()->getRange()); + $rangeBounds = \PhpOffice\PhpSpreadsheet\Cell::rangeBoundaries($this->phpSheet->getAutoFilter()->getRange()); $iNumFilters = 1 + $rangeBounds[1][0] - $rangeBounds[0][0]; $header = pack('vv', $record, $length); @@ -2121,19 +2121,19 @@ class Worksheet extends BIFFwriter foreach ($this->phpSheet->getBreaks() as $cell => $breakType) { // Fetch coordinates - $coordinates = \PhpSpreadsheet\Cell::coordinateFromString($cell); + $coordinates = \PhpOffice\PhpSpreadsheet\Cell::coordinateFromString($cell); // Decide what to do by the type of break switch ($breakType) { - case \PhpSpreadsheet\Worksheet::BREAK_COLUMN: + case \PhpOffice\PhpSpreadsheet\Worksheet::BREAK_COLUMN: // Add to list of vertical breaks - $vbreaks[] = \PhpSpreadsheet\Cell::columnIndexFromString($coordinates[0]) - 1; + $vbreaks[] = \PhpOffice\PhpSpreadsheet\Cell::columnIndexFromString($coordinates[0]) - 1; break; - case \PhpSpreadsheet\Worksheet::BREAK_ROW: + case \PhpOffice\PhpSpreadsheet\Worksheet::BREAK_ROW: // Add to list of horizontal breaks $hbreaks[] = $coordinates[1]; break; - case \PhpSpreadsheet\Worksheet::BREAK_NONE: + case \PhpOffice\PhpSpreadsheet\Worksheet::BREAK_NONE: default: // Nothing to do break; @@ -2372,10 +2372,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 >= \PhpSpreadsheet\Shared\Excel5::sizeCol($this->phpSheet, \PhpSpreadsheet\Cell::stringFromColumnIndex($col_start))) { + if ($x1 >= \PhpOffice\PhpSpreadsheet\Shared\Excel5::sizeCol($this->phpSheet, \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($col_start))) { $x1 = 0; } - if ($y1 >= \PhpSpreadsheet\Shared\Excel5::sizeRow($this->phpSheet, $row_start + 1)) { + if ($y1 >= \PhpOffice\PhpSpreadsheet\Shared\Excel5::sizeRow($this->phpSheet, $row_start + 1)) { $y1 = 0; } @@ -2383,38 +2383,38 @@ class Worksheet extends BIFFwriter $height = $height + $y1 - 1; // Subtract the underlying cell widths to find the end cell of the image - 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)); + while ($width >= \PhpOffice\PhpSpreadsheet\Shared\Excel5::sizeCol($this->phpSheet, \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($col_end))) { + $width -= \PhpOffice\PhpSpreadsheet\Shared\Excel5::sizeCol($this->phpSheet, \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($col_end)); ++$col_end; } // Subtract the underlying cell heights to find the end cell of the image - while ($height >= \PhpSpreadsheet\Shared\Excel5::sizeRow($this->phpSheet, $row_end + 1)) { - $height -= \PhpSpreadsheet\Shared\Excel5::sizeRow($this->phpSheet, $row_end + 1); + while ($height >= \PhpOffice\PhpSpreadsheet\Shared\Excel5::sizeRow($this->phpSheet, $row_end + 1)) { + $height -= \PhpOffice\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 (\PhpSpreadsheet\Shared\Excel5::sizeCol($this->phpSheet, \PhpSpreadsheet\Cell::stringFromColumnIndex($col_start)) == 0) { + if (\PhpOffice\PhpSpreadsheet\Shared\Excel5::sizeCol($this->phpSheet, \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($col_start)) == 0) { return; } - if (\PhpSpreadsheet\Shared\Excel5::sizeCol($this->phpSheet, \PhpSpreadsheet\Cell::stringFromColumnIndex($col_end)) == 0) { + if (\PhpOffice\PhpSpreadsheet\Shared\Excel5::sizeCol($this->phpSheet, \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($col_end)) == 0) { return; } - if (\PhpSpreadsheet\Shared\Excel5::sizeRow($this->phpSheet, $row_start + 1) == 0) { + if (\PhpOffice\PhpSpreadsheet\Shared\Excel5::sizeRow($this->phpSheet, $row_start + 1) == 0) { return; } - if (\PhpSpreadsheet\Shared\Excel5::sizeRow($this->phpSheet, $row_end + 1) == 0) { + if (\PhpOffice\PhpSpreadsheet\Shared\Excel5::sizeRow($this->phpSheet, $row_end + 1) == 0) { return; } // Convert the pixel values to the percentage value expected by Excel - $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 + $x1 = $x1 / \PhpOffice\PhpSpreadsheet\Shared\Excel5::sizeCol($this->phpSheet, \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($col_start)) * 1024; + $y1 = $y1 / \PhpOffice\PhpSpreadsheet\Shared\Excel5::sizeRow($this->phpSheet, $row_start + 1) * 256; + $x2 = $width / \PhpOffice\PhpSpreadsheet\Shared\Excel5::sizeCol($this->phpSheet, \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($col_end)) * 1024; // Distance to right side of object + $y2 = $height / \PhpOffice\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); } @@ -2538,7 +2538,7 @@ class Worksheet extends BIFFwriter // Open file. $bmp_fd = @fopen($bitmap, 'rb'); if (!$bmp_fd) { - throw new \PhpSpreadsheet\Writer\Exception("Couldn't import $bitmap"); + throw new \PhpOffice\PhpSpreadsheet\Writer\Exception("Couldn't import $bitmap"); } // Slurp the file into a string. @@ -2546,13 +2546,13 @@ class Worksheet extends BIFFwriter // Check that the file is big enough to be a bitmap. if (strlen($data) <= 0x36) { - throw new \PhpSpreadsheet\Writer\Exception("$bitmap doesn't contain enough data.\n"); + throw new \PhpOffice\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 \PhpSpreadsheet\Writer\Exception("$bitmap doesn't appear to be a valid bitmap image.\n"); + throw new \PhpOffice\PhpSpreadsheet\Writer\Exception("$bitmap doesn't appear to be a valid bitmap image.\n"); } // Remove bitmap data: ID. @@ -2576,20 +2576,20 @@ class Worksheet extends BIFFwriter $height = $width_and_height[2]; $data = substr($data, 8); if ($width > 0xFFFF) { - throw new \PhpSpreadsheet\Writer\Exception("$bitmap: largest image width supported is 65k.\n"); + throw new \PhpOffice\PhpSpreadsheet\Writer\Exception("$bitmap: largest image width supported is 65k.\n"); } if ($height > 0xFFFF) { - throw new \PhpSpreadsheet\Writer\Exception("$bitmap: largest image height supported is 65k.\n"); + throw new \PhpOffice\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 \PhpSpreadsheet\Writer\Exception("$bitmap isn't a 24bit true color bitmap.\n"); + throw new \PhpOffice\PhpSpreadsheet\Writer\Exception("$bitmap isn't a 24bit true color bitmap.\n"); } if ($planes_and_bitcount[1] != 1) { - throw new \PhpSpreadsheet\Writer\Exception("$bitmap: only 1 plane supported in bitmap image.\n"); + throw new \PhpOffice\PhpSpreadsheet\Writer\Exception("$bitmap: only 1 plane supported in bitmap image.\n"); } // Read and remove the bitmap compression. Verify compression. @@ -2597,7 +2597,7 @@ class Worksheet extends BIFFwriter $data = substr($data, 4); if ($compression['comp'] != 0) { - throw new \PhpSpreadsheet\Writer\Exception("$bitmap: compression not supported in bitmap image.\n"); + throw new \PhpOffice\PhpSpreadsheet\Writer\Exception("$bitmap: compression not supported in bitmap image.\n"); } // Remove bitmap data: data size, hres, vres, colours, imp. colours. @@ -2632,7 +2632,7 @@ class Worksheet extends BIFFwriter /** * Get Escher object * - * @return \PhpSpreadsheet\Shared\Escher + * @return \PhpOffice\PhpSpreadsheet\Shared\Escher */ public function getEscher() { @@ -2642,9 +2642,9 @@ class Worksheet extends BIFFwriter /** * Set Escher object * - * @param \PhpSpreadsheet\Shared\Escher $pValue + * @param \PhpOffice\PhpSpreadsheet\Shared\Escher $pValue */ - public function setEscher(\PhpSpreadsheet\Shared\Escher $pValue = null) + public function setEscher(\PhpOffice\PhpSpreadsheet\Shared\Escher $pValue = null) { $this->escher = $pValue; } @@ -2656,7 +2656,7 @@ class Worksheet extends BIFFwriter { // write the Escher stream if necessary if (isset($this->escher)) { - $writer = new \PhpSpreadsheet\Writer\Excel5\Escher($this->escher); + $writer = new \PhpOffice\PhpSpreadsheet\Writer\Excel5\Escher($this->escher); $data = $writer->close(); $spOffsets = $writer->getSpOffsets(); $spTypes = $writer->getSpTypes(); @@ -2770,28 +2770,28 @@ class Worksheet extends BIFFwriter // data type $type = $dataValidation->getType(); switch ($type) { - case \PhpSpreadsheet\Cell\DataValidation::TYPE_NONE: + case \PhpOffice\PhpSpreadsheet\Cell\DataValidation::TYPE_NONE: $type = 0x00; break; - case \PhpSpreadsheet\Cell\DataValidation::TYPE_WHOLE: + case \PhpOffice\PhpSpreadsheet\Cell\DataValidation::TYPE_WHOLE: $type = 0x01; break; - case \PhpSpreadsheet\Cell\DataValidation::TYPE_DECIMAL: + case \PhpOffice\PhpSpreadsheet\Cell\DataValidation::TYPE_DECIMAL: $type = 0x02; break; - case \PhpSpreadsheet\Cell\DataValidation::TYPE_LIST: + case \PhpOffice\PhpSpreadsheet\Cell\DataValidation::TYPE_LIST: $type = 0x03; break; - case \PhpSpreadsheet\Cell\DataValidation::TYPE_DATE: + case \PhpOffice\PhpSpreadsheet\Cell\DataValidation::TYPE_DATE: $type = 0x04; break; - case \PhpSpreadsheet\Cell\DataValidation::TYPE_TIME: + case \PhpOffice\PhpSpreadsheet\Cell\DataValidation::TYPE_TIME: $type = 0x05; break; - case \PhpSpreadsheet\Cell\DataValidation::TYPE_TEXTLENGTH: + case \PhpOffice\PhpSpreadsheet\Cell\DataValidation::TYPE_TEXTLENGTH: $type = 0x06; break; - case \PhpSpreadsheet\Cell\DataValidation::TYPE_CUSTOM: + case \PhpOffice\PhpSpreadsheet\Cell\DataValidation::TYPE_CUSTOM: $type = 0x07; break; } @@ -2800,13 +2800,13 @@ class Worksheet extends BIFFwriter // error style $errorStyle = $dataValidation->getType(); switch ($errorStyle) { - case \PhpSpreadsheet\Cell\DataValidation::STYLE_STOP: + case \PhpOffice\PhpSpreadsheet\Cell\DataValidation::STYLE_STOP: $errorStyle = 0x00; break; - case \PhpSpreadsheet\Cell\DataValidation::STYLE_WARNING: + case \PhpOffice\PhpSpreadsheet\Cell\DataValidation::STYLE_WARNING: $errorStyle = 0x01; break; - case \PhpSpreadsheet\Cell\DataValidation::STYLE_INFORMATION: + case \PhpOffice\PhpSpreadsheet\Cell\DataValidation::STYLE_INFORMATION: $errorStyle = 0x02; break; } @@ -2832,28 +2832,28 @@ class Worksheet extends BIFFwriter // condition operator $operator = $dataValidation->getOperator(); switch ($operator) { - case \PhpSpreadsheet\Cell\DataValidation::OPERATOR_BETWEEN: + case \PhpOffice\PhpSpreadsheet\Cell\DataValidation::OPERATOR_BETWEEN: $operator = 0x00; break; - case \PhpSpreadsheet\Cell\DataValidation::OPERATOR_NOTBETWEEN: + case \PhpOffice\PhpSpreadsheet\Cell\DataValidation::OPERATOR_NOTBETWEEN: $operator = 0x01; break; - case \PhpSpreadsheet\Cell\DataValidation::OPERATOR_EQUAL: + case \PhpOffice\PhpSpreadsheet\Cell\DataValidation::OPERATOR_EQUAL: $operator = 0x02; break; - case \PhpSpreadsheet\Cell\DataValidation::OPERATOR_NOTEQUAL: + case \PhpOffice\PhpSpreadsheet\Cell\DataValidation::OPERATOR_NOTEQUAL: $operator = 0x03; break; - case \PhpSpreadsheet\Cell\DataValidation::OPERATOR_GREATERTHAN: + case \PhpOffice\PhpSpreadsheet\Cell\DataValidation::OPERATOR_GREATERTHAN: $operator = 0x04; break; - case \PhpSpreadsheet\Cell\DataValidation::OPERATOR_LESSTHAN: + case \PhpOffice\PhpSpreadsheet\Cell\DataValidation::OPERATOR_LESSTHAN: $operator = 0x05; break; - case \PhpSpreadsheet\Cell\DataValidation::OPERATOR_GREATERTHANOREQUAL: + case \PhpOffice\PhpSpreadsheet\Cell\DataValidation::OPERATOR_GREATERTHANOREQUAL: $operator = 0x06; break; - case \PhpSpreadsheet\Cell\DataValidation::OPERATOR_LESSTHANOREQUAL: + case \PhpOffice\PhpSpreadsheet\Cell\DataValidation::OPERATOR_LESSTHANOREQUAL: $operator = 0x07; break; } @@ -2864,22 +2864,22 @@ class Worksheet extends BIFFwriter // prompt title $promptTitle = $dataValidation->getPromptTitle() !== '' ? $dataValidation->getPromptTitle() : chr(0); - $data .= \PhpSpreadsheet\Shared\StringHelper::UTF8toBIFF8UnicodeLong($promptTitle); + $data .= \PhpOffice\PhpSpreadsheet\Shared\StringHelper::UTF8toBIFF8UnicodeLong($promptTitle); // error title $errorTitle = $dataValidation->getErrorTitle() !== '' ? $dataValidation->getErrorTitle() : chr(0); - $data .= \PhpSpreadsheet\Shared\StringHelper::UTF8toBIFF8UnicodeLong($errorTitle); + $data .= \PhpOffice\PhpSpreadsheet\Shared\StringHelper::UTF8toBIFF8UnicodeLong($errorTitle); // prompt text $prompt = $dataValidation->getPrompt() !== '' ? $dataValidation->getPrompt() : chr(0); - $data .= \PhpSpreadsheet\Shared\StringHelper::UTF8toBIFF8UnicodeLong($prompt); + $data .= \PhpOffice\PhpSpreadsheet\Shared\StringHelper::UTF8toBIFF8UnicodeLong($prompt); // error text $error = $dataValidation->getError() !== '' ? $dataValidation->getError() : chr(0); - $data .= \PhpSpreadsheet\Shared\StringHelper::UTF8toBIFF8UnicodeLong($error); + $data .= \PhpOffice\PhpSpreadsheet\Shared\StringHelper::UTF8toBIFF8UnicodeLong($error); // formula 1 try { @@ -2890,7 +2890,7 @@ class Worksheet extends BIFFwriter $this->parser->parse($formula1); $formula1 = $this->parser->toReversePolish(); $sz1 = strlen($formula1); - } catch (\PhpSpreadsheet\Exception $e) { + } catch (\PhpOffice\PhpSpreadsheet\Exception $e) { $sz1 = 0; $formula1 = ''; } @@ -2901,12 +2901,12 @@ class Worksheet extends BIFFwriter try { $formula2 = $dataValidation->getFormula2(); if ($formula2 === '') { - throw new \PhpSpreadsheet\Writer\Exception('No formula2'); + throw new \PhpOffice\PhpSpreadsheet\Writer\Exception('No formula2'); } $this->parser->parse($formula2); $formula2 = $this->parser->toReversePolish(); $sz2 = strlen($formula2); - } catch (\PhpSpreadsheet\Exception $e) { + } catch (\PhpOffice\PhpSpreadsheet\Exception $e) { $sz2 = 0; $formula2 = ''; } @@ -2967,7 +2967,7 @@ class Worksheet extends BIFFwriter $wScalvePLV = $this->phpSheet->getSheetView()->getZoomScale(); // 2 // The options flags that comprise $grbit - if ($this->phpSheet->getSheetView()->getView() == \PhpSpreadsheet\Worksheet\SheetView::SHEETVIEW_PAGE_LAYOUT) { + if ($this->phpSheet->getSheetView()->getView() == \PhpOffice\PhpSpreadsheet\Worksheet\SheetView::SHEETVIEW_PAGE_LAYOUT) { $fPageLayoutView = 1; } else { $fPageLayoutView = 0; @@ -2986,43 +2986,43 @@ class Worksheet extends BIFFwriter /** * Write CFRule Record - * @param \PhpSpreadsheet\Style\Conditional $conditional + * @param \PhpOffice\PhpSpreadsheet\Style\Conditional $conditional */ - private function writeCFRule(\PhpSpreadsheet\Style\Conditional $conditional) + private function writeCFRule(\PhpOffice\PhpSpreadsheet\Style\Conditional $conditional) { $record = 0x01B1; // Record identifier // $type : Type of the CF // $operatorType : Comparison operator - if ($conditional->getConditionType() == \PhpSpreadsheet\Style\Conditional::CONDITION_EXPRESSION) { + if ($conditional->getConditionType() == \PhpOffice\PhpSpreadsheet\Style\Conditional::CONDITION_EXPRESSION) { $type = 0x02; $operatorType = 0x00; - } elseif ($conditional->getConditionType() == \PhpSpreadsheet\Style\Conditional::CONDITION_CELLIS) { + } elseif ($conditional->getConditionType() == \PhpOffice\PhpSpreadsheet\Style\Conditional::CONDITION_CELLIS) { $type = 0x01; switch ($conditional->getOperatorType()) { - case \PhpSpreadsheet\Style\Conditional::OPERATOR_NONE: + case \PhpOffice\PhpSpreadsheet\Style\Conditional::OPERATOR_NONE: $operatorType = 0x00; break; - case \PhpSpreadsheet\Style\Conditional::OPERATOR_EQUAL: + case \PhpOffice\PhpSpreadsheet\Style\Conditional::OPERATOR_EQUAL: $operatorType = 0x03; break; - case \PhpSpreadsheet\Style\Conditional::OPERATOR_GREATERTHAN: + case \PhpOffice\PhpSpreadsheet\Style\Conditional::OPERATOR_GREATERTHAN: $operatorType = 0x05; break; - case \PhpSpreadsheet\Style\Conditional::OPERATOR_GREATERTHANOREQUAL: + case \PhpOffice\PhpSpreadsheet\Style\Conditional::OPERATOR_GREATERTHANOREQUAL: $operatorType = 0x07; break; - case \PhpSpreadsheet\Style\Conditional::OPERATOR_LESSTHAN: + case \PhpOffice\PhpSpreadsheet\Style\Conditional::OPERATOR_LESSTHAN: $operatorType = 0x06; break; - case \PhpSpreadsheet\Style\Conditional::OPERATOR_LESSTHANOREQUAL: + case \PhpOffice\PhpSpreadsheet\Style\Conditional::OPERATOR_LESSTHANOREQUAL: $operatorType = 0x08; break; - case \PhpSpreadsheet\Style\Conditional::OPERATOR_NOTEQUAL: + case \PhpOffice\PhpSpreadsheet\Style\Conditional::OPERATOR_NOTEQUAL: $operatorType = 0x04; break; - case \PhpSpreadsheet\Style\Conditional::OPERATOR_BETWEEN: + case \PhpOffice\PhpSpreadsheet\Style\Conditional::OPERATOR_BETWEEN: $operatorType = 0x01; break; // not OPERATOR_NOTBETWEEN 0x02 @@ -3038,7 +3038,7 @@ class Worksheet extends BIFFwriter $szValue2 = 0x0000; $operand1 = pack('Cv', 0x1E, $arrConditions[0]); $operand2 = null; - } elseif ($numConditions == 2 && ($conditional->getOperatorType() == \PhpSpreadsheet\Style\Conditional::OPERATOR_BETWEEN)) { + } elseif ($numConditions == 2 && ($conditional->getOperatorType() == \PhpOffice\PhpSpreadsheet\Style\Conditional::OPERATOR_BETWEEN)) { $szValue1 = ($arrConditions[0] <= 65535 ? 3 : 0x0000); $szValue2 = ($arrConditions[1] <= 65535 ? 3 : 0x0000); $operand1 = pack('Cv', 0x1E, $arrConditions[0]); @@ -3072,14 +3072,14 @@ class Worksheet extends BIFFwriter $bFormatProt = 0; } // Border - $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); + $bBorderLeft = ($conditional->getStyle()->getBorders()->getLeft()->getColor()->getARGB() == \PhpOffice\PhpSpreadsheet\Style\Color::COLOR_BLACK + && $conditional->getStyle()->getBorders()->getLeft()->getBorderStyle() == \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_NONE ? 1 : 0); + $bBorderRight = ($conditional->getStyle()->getBorders()->getRight()->getColor()->getARGB() == \PhpOffice\PhpSpreadsheet\Style\Color::COLOR_BLACK + && $conditional->getStyle()->getBorders()->getRight()->getBorderStyle() == \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_NONE ? 1 : 0); + $bBorderTop = ($conditional->getStyle()->getBorders()->getTop()->getColor()->getARGB() == \PhpOffice\PhpSpreadsheet\Style\Color::COLOR_BLACK + && $conditional->getStyle()->getBorders()->getTop()->getBorderStyle() == \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_NONE ? 1 : 0); + $bBorderBottom = ($conditional->getStyle()->getBorders()->getBottom()->getColor()->getARGB() == \PhpOffice\PhpSpreadsheet\Style\Color::COLOR_BLACK + && $conditional->getStyle()->getBorders()->getBottom()->getBorderStyle() == \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_NONE ? 1 : 0); if ($bBorderLeft == 0 || $bBorderRight == 0 || $bBorderTop == 0 || $bBorderBottom == 0) { $bFormatBorder = 1; } else { @@ -3155,7 +3155,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 = \PhpSpreadsheet\Shared\StringHelper::UTF8toBIFF8UnicodeLong($conditional->getStyle()->getFont()->getName()); + $dataBlockFont = \PhpOffice\PhpSpreadsheet\Shared\StringHelper::UTF8toBIFF8UnicodeLong($conditional->getStyle()->getFont()->getName()); } // Font Size if ($conditional->getStyle()->getFont()->getSize() == null) { @@ -3184,23 +3184,23 @@ class Worksheet extends BIFFwriter } // Underline type switch ($conditional->getStyle()->getFont()->getUnderline()) { - case \PhpSpreadsheet\Style\Font::UNDERLINE_NONE: + case \PhpOffice\PhpSpreadsheet\Style\Font::UNDERLINE_NONE: $dataBlockFont .= pack('C', 0x00); $fontUnderline = 0; break; - case \PhpSpreadsheet\Style\Font::UNDERLINE_DOUBLE: + case \PhpOffice\PhpSpreadsheet\Style\Font::UNDERLINE_DOUBLE: $dataBlockFont .= pack('C', 0x02); $fontUnderline = 0; break; - case \PhpSpreadsheet\Style\Font::UNDERLINE_DOUBLEACCOUNTING: + case \PhpOffice\PhpSpreadsheet\Style\Font::UNDERLINE_DOUBLEACCOUNTING: $dataBlockFont .= pack('C', 0x22); $fontUnderline = 0; break; - case \PhpSpreadsheet\Style\Font::UNDERLINE_SINGLE: + case \PhpOffice\PhpSpreadsheet\Style\Font::UNDERLINE_SINGLE: $dataBlockFont .= pack('C', 0x01); $fontUnderline = 0; break; - case \PhpSpreadsheet\Style\Font::UNDERLINE_SINGLEACCOUNTING: + case \PhpOffice\PhpSpreadsheet\Style\Font::UNDERLINE_SINGLEACCOUNTING: $dataBlockFont .= pack('C', 0x21); $fontUnderline = 0; break; @@ -3414,22 +3414,22 @@ class Worksheet extends BIFFwriter $blockAlign = 0; // Alignment and text break switch ($conditional->getStyle()->getAlignment()->getHorizontal()) { - case \PhpSpreadsheet\Style\Alignment::HORIZONTAL_GENERAL: + case \PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_GENERAL: $blockAlign = 0; break; - case \PhpSpreadsheet\Style\Alignment::HORIZONTAL_LEFT: + case \PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_LEFT: $blockAlign = 1; break; - case \PhpSpreadsheet\Style\Alignment::HORIZONTAL_RIGHT: + case \PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_RIGHT: $blockAlign = 3; break; - case \PhpSpreadsheet\Style\Alignment::HORIZONTAL_CENTER: + case \PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_CENTER: $blockAlign = 2; break; - case \PhpSpreadsheet\Style\Alignment::HORIZONTAL_CENTER_CONTINUOUS: + case \PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_CENTER_CONTINUOUS: $blockAlign = 6; break; - case \PhpSpreadsheet\Style\Alignment::HORIZONTAL_JUSTIFY: + case \PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_JUSTIFY: $blockAlign = 5; break; } @@ -3439,16 +3439,16 @@ class Worksheet extends BIFFwriter $blockAlign |= 0 << 3; } switch ($conditional->getStyle()->getAlignment()->getVertical()) { - case \PhpSpreadsheet\Style\Alignment::VERTICAL_BOTTOM: + case \PhpOffice\PhpSpreadsheet\Style\Alignment::VERTICAL_BOTTOM: $blockAlign = 2 << 4; break; - case \PhpSpreadsheet\Style\Alignment::VERTICAL_TOP: + case \PhpOffice\PhpSpreadsheet\Style\Alignment::VERTICAL_TOP: $blockAlign = 0 << 4; break; - case \PhpSpreadsheet\Style\Alignment::VERTICAL_CENTER: + case \PhpOffice\PhpSpreadsheet\Style\Alignment::VERTICAL_CENTER: $blockAlign = 1 << 4; break; - case \PhpSpreadsheet\Style\Alignment::VERTICAL_JUSTIFY: + case \PhpOffice\PhpSpreadsheet\Style\Alignment::VERTICAL_JUSTIFY: $blockAlign = 3 << 4; break; } @@ -3474,178 +3474,178 @@ class Worksheet extends BIFFwriter if ($bFormatBorder == 1) { $blockLineStyle = 0; switch ($conditional->getStyle()->getBorders()->getLeft()->getBorderStyle()) { - case \PhpSpreadsheet\Style\Border::BORDER_NONE: + case \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_NONE: $blockLineStyle |= 0x00; break; - case \PhpSpreadsheet\Style\Border::BORDER_THIN: + case \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_THIN: $blockLineStyle |= 0x01; break; - case \PhpSpreadsheet\Style\Border::BORDER_MEDIUM: + case \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_MEDIUM: $blockLineStyle |= 0x02; break; - case \PhpSpreadsheet\Style\Border::BORDER_DASHED: + case \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_DASHED: $blockLineStyle |= 0x03; break; - case \PhpSpreadsheet\Style\Border::BORDER_DOTTED: + case \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_DOTTED: $blockLineStyle |= 0x04; break; - case \PhpSpreadsheet\Style\Border::BORDER_THICK: + case \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_THICK: $blockLineStyle |= 0x05; break; - case \PhpSpreadsheet\Style\Border::BORDER_DOUBLE: + case \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_DOUBLE: $blockLineStyle |= 0x06; break; - case \PhpSpreadsheet\Style\Border::BORDER_HAIR: + case \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_HAIR: $blockLineStyle |= 0x07; break; - case \PhpSpreadsheet\Style\Border::BORDER_MEDIUMDASHED: + case \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_MEDIUMDASHED: $blockLineStyle |= 0x08; break; - case \PhpSpreadsheet\Style\Border::BORDER_DASHDOT: + case \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_DASHDOT: $blockLineStyle |= 0x09; break; - case \PhpSpreadsheet\Style\Border::BORDER_MEDIUMDASHDOT: + case \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_MEDIUMDASHDOT: $blockLineStyle |= 0x0A; break; - case \PhpSpreadsheet\Style\Border::BORDER_DASHDOTDOT: + case \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_DASHDOTDOT: $blockLineStyle |= 0x0B; break; - case \PhpSpreadsheet\Style\Border::BORDER_MEDIUMDASHDOTDOT: + case \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_MEDIUMDASHDOTDOT: $blockLineStyle |= 0x0C; break; - case \PhpSpreadsheet\Style\Border::BORDER_SLANTDASHDOT: + case \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_SLANTDASHDOT: $blockLineStyle |= 0x0D; break; } switch ($conditional->getStyle()->getBorders()->getRight()->getBorderStyle()) { - case \PhpSpreadsheet\Style\Border::BORDER_NONE: + case \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_NONE: $blockLineStyle |= 0x00 << 4; break; - case \PhpSpreadsheet\Style\Border::BORDER_THIN: + case \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_THIN: $blockLineStyle |= 0x01 << 4; break; - case \PhpSpreadsheet\Style\Border::BORDER_MEDIUM: + case \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_MEDIUM: $blockLineStyle |= 0x02 << 4; break; - case \PhpSpreadsheet\Style\Border::BORDER_DASHED: + case \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_DASHED: $blockLineStyle |= 0x03 << 4; break; - case \PhpSpreadsheet\Style\Border::BORDER_DOTTED: + case \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_DOTTED: $blockLineStyle |= 0x04 << 4; break; - case \PhpSpreadsheet\Style\Border::BORDER_THICK: + case \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_THICK: $blockLineStyle |= 0x05 << 4; break; - case \PhpSpreadsheet\Style\Border::BORDER_DOUBLE: + case \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_DOUBLE: $blockLineStyle |= 0x06 << 4; break; - case \PhpSpreadsheet\Style\Border::BORDER_HAIR: + case \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_HAIR: $blockLineStyle |= 0x07 << 4; break; - case \PhpSpreadsheet\Style\Border::BORDER_MEDIUMDASHED: + case \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_MEDIUMDASHED: $blockLineStyle |= 0x08 << 4; break; - case \PhpSpreadsheet\Style\Border::BORDER_DASHDOT: + case \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_DASHDOT: $blockLineStyle |= 0x09 << 4; break; - case \PhpSpreadsheet\Style\Border::BORDER_MEDIUMDASHDOT: + case \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_MEDIUMDASHDOT: $blockLineStyle |= 0x0A << 4; break; - case \PhpSpreadsheet\Style\Border::BORDER_DASHDOTDOT: + case \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_DASHDOTDOT: $blockLineStyle |= 0x0B << 4; break; - case \PhpSpreadsheet\Style\Border::BORDER_MEDIUMDASHDOTDOT: + case \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_MEDIUMDASHDOTDOT: $blockLineStyle |= 0x0C << 4; break; - case \PhpSpreadsheet\Style\Border::BORDER_SLANTDASHDOT: + case \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_SLANTDASHDOT: $blockLineStyle |= 0x0D << 4; break; } switch ($conditional->getStyle()->getBorders()->getTop()->getBorderStyle()) { - case \PhpSpreadsheet\Style\Border::BORDER_NONE: + case \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_NONE: $blockLineStyle |= 0x00 << 8; break; - case \PhpSpreadsheet\Style\Border::BORDER_THIN: + case \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_THIN: $blockLineStyle |= 0x01 << 8; break; - case \PhpSpreadsheet\Style\Border::BORDER_MEDIUM: + case \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_MEDIUM: $blockLineStyle |= 0x02 << 8; break; - case \PhpSpreadsheet\Style\Border::BORDER_DASHED: + case \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_DASHED: $blockLineStyle |= 0x03 << 8; break; - case \PhpSpreadsheet\Style\Border::BORDER_DOTTED: + case \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_DOTTED: $blockLineStyle |= 0x04 << 8; break; - case \PhpSpreadsheet\Style\Border::BORDER_THICK: + case \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_THICK: $blockLineStyle |= 0x05 << 8; break; - case \PhpSpreadsheet\Style\Border::BORDER_DOUBLE: + case \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_DOUBLE: $blockLineStyle |= 0x06 << 8; break; - case \PhpSpreadsheet\Style\Border::BORDER_HAIR: + case \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_HAIR: $blockLineStyle |= 0x07 << 8; break; - case \PhpSpreadsheet\Style\Border::BORDER_MEDIUMDASHED: + case \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_MEDIUMDASHED: $blockLineStyle |= 0x08 << 8; break; - case \PhpSpreadsheet\Style\Border::BORDER_DASHDOT: + case \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_DASHDOT: $blockLineStyle |= 0x09 << 8; break; - case \PhpSpreadsheet\Style\Border::BORDER_MEDIUMDASHDOT: + case \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_MEDIUMDASHDOT: $blockLineStyle |= 0x0A << 8; break; - case \PhpSpreadsheet\Style\Border::BORDER_DASHDOTDOT: + case \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_DASHDOTDOT: $blockLineStyle |= 0x0B << 8; break; - case \PhpSpreadsheet\Style\Border::BORDER_MEDIUMDASHDOTDOT: + case \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_MEDIUMDASHDOTDOT: $blockLineStyle |= 0x0C << 8; break; - case \PhpSpreadsheet\Style\Border::BORDER_SLANTDASHDOT: + case \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_SLANTDASHDOT: $blockLineStyle |= 0x0D << 8; break; } switch ($conditional->getStyle()->getBorders()->getBottom()->getBorderStyle()) { - case \PhpSpreadsheet\Style\Border::BORDER_NONE: + case \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_NONE: $blockLineStyle |= 0x00 << 12; break; - case \PhpSpreadsheet\Style\Border::BORDER_THIN: + case \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_THIN: $blockLineStyle |= 0x01 << 12; break; - case \PhpSpreadsheet\Style\Border::BORDER_MEDIUM: + case \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_MEDIUM: $blockLineStyle |= 0x02 << 12; break; - case \PhpSpreadsheet\Style\Border::BORDER_DASHED: + case \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_DASHED: $blockLineStyle |= 0x03 << 12; break; - case \PhpSpreadsheet\Style\Border::BORDER_DOTTED: + case \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_DOTTED: $blockLineStyle |= 0x04 << 12; break; - case \PhpSpreadsheet\Style\Border::BORDER_THICK: + case \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_THICK: $blockLineStyle |= 0x05 << 12; break; - case \PhpSpreadsheet\Style\Border::BORDER_DOUBLE: + case \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_DOUBLE: $blockLineStyle |= 0x06 << 12; break; - case \PhpSpreadsheet\Style\Border::BORDER_HAIR: + case \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_HAIR: $blockLineStyle |= 0x07 << 12; break; - case \PhpSpreadsheet\Style\Border::BORDER_MEDIUMDASHED: + case \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_MEDIUMDASHED: $blockLineStyle |= 0x08 << 12; break; - case \PhpSpreadsheet\Style\Border::BORDER_DASHDOT: + case \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_DASHDOT: $blockLineStyle |= 0x09 << 12; break; - case \PhpSpreadsheet\Style\Border::BORDER_MEDIUMDASHDOT: + case \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_MEDIUMDASHDOT: $blockLineStyle |= 0x0A << 12; break; - case \PhpSpreadsheet\Style\Border::BORDER_DASHDOTDOT: + case \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_DASHDOTDOT: $blockLineStyle |= 0x0B << 12; break; - case \PhpSpreadsheet\Style\Border::BORDER_MEDIUMDASHDOTDOT: + case \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_MEDIUMDASHDOTDOT: $blockLineStyle |= 0x0C << 12; break; - case \PhpSpreadsheet\Style\Border::BORDER_SLANTDASHDOT: + case \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_SLANTDASHDOT: $blockLineStyle |= 0x0D << 12; break; } @@ -3658,46 +3658,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 \PhpSpreadsheet\Style\Border::BORDER_NONE: + case \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_NONE: $blockColor |= 0x00 << 21; break; - case \PhpSpreadsheet\Style\Border::BORDER_THIN: + case \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_THIN: $blockColor |= 0x01 << 21; break; - case \PhpSpreadsheet\Style\Border::BORDER_MEDIUM: + case \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_MEDIUM: $blockColor |= 0x02 << 21; break; - case \PhpSpreadsheet\Style\Border::BORDER_DASHED: + case \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_DASHED: $blockColor |= 0x03 << 21; break; - case \PhpSpreadsheet\Style\Border::BORDER_DOTTED: + case \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_DOTTED: $blockColor |= 0x04 << 21; break; - case \PhpSpreadsheet\Style\Border::BORDER_THICK: + case \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_THICK: $blockColor |= 0x05 << 21; break; - case \PhpSpreadsheet\Style\Border::BORDER_DOUBLE: + case \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_DOUBLE: $blockColor |= 0x06 << 21; break; - case \PhpSpreadsheet\Style\Border::BORDER_HAIR: + case \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_HAIR: $blockColor |= 0x07 << 21; break; - case \PhpSpreadsheet\Style\Border::BORDER_MEDIUMDASHED: + case \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_MEDIUMDASHED: $blockColor |= 0x08 << 21; break; - case \PhpSpreadsheet\Style\Border::BORDER_DASHDOT: + case \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_DASHDOT: $blockColor |= 0x09 << 21; break; - case \PhpSpreadsheet\Style\Border::BORDER_MEDIUMDASHDOT: + case \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_MEDIUMDASHDOT: $blockColor |= 0x0A << 21; break; - case \PhpSpreadsheet\Style\Border::BORDER_DASHDOTDOT: + case \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_DASHDOTDOT: $blockColor |= 0x0B << 21; break; - case \PhpSpreadsheet\Style\Border::BORDER_MEDIUMDASHDOTDOT: + case \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_MEDIUMDASHDOTDOT: $blockColor |= 0x0C << 21; break; - case \PhpSpreadsheet\Style\Border::BORDER_SLANTDASHDOT: + case \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_SLANTDASHDOT: $blockColor |= 0x0D << 21; break; } @@ -3707,67 +3707,67 @@ class Worksheet extends BIFFwriter // Fill Patern Style $blockFillPatternStyle = 0; switch ($conditional->getStyle()->getFill()->getFillType()) { - case \PhpSpreadsheet\Style\Fill::FILL_NONE: + case \PhpOffice\PhpSpreadsheet\Style\Fill::FILL_NONE: $blockFillPatternStyle = 0x00; break; - case \PhpSpreadsheet\Style\Fill::FILL_SOLID: + case \PhpOffice\PhpSpreadsheet\Style\Fill::FILL_SOLID: $blockFillPatternStyle = 0x01; break; - case \PhpSpreadsheet\Style\Fill::FILL_PATTERN_MEDIUMGRAY: + case \PhpOffice\PhpSpreadsheet\Style\Fill::FILL_PATTERN_MEDIUMGRAY: $blockFillPatternStyle = 0x02; break; - case \PhpSpreadsheet\Style\Fill::FILL_PATTERN_DARKGRAY: + case \PhpOffice\PhpSpreadsheet\Style\Fill::FILL_PATTERN_DARKGRAY: $blockFillPatternStyle = 0x03; break; - case \PhpSpreadsheet\Style\Fill::FILL_PATTERN_LIGHTGRAY: + case \PhpOffice\PhpSpreadsheet\Style\Fill::FILL_PATTERN_LIGHTGRAY: $blockFillPatternStyle = 0x04; break; - case \PhpSpreadsheet\Style\Fill::FILL_PATTERN_DARKHORIZONTAL: + case \PhpOffice\PhpSpreadsheet\Style\Fill::FILL_PATTERN_DARKHORIZONTAL: $blockFillPatternStyle = 0x05; break; - case \PhpSpreadsheet\Style\Fill::FILL_PATTERN_DARKVERTICAL: + case \PhpOffice\PhpSpreadsheet\Style\Fill::FILL_PATTERN_DARKVERTICAL: $blockFillPatternStyle = 0x06; break; - case \PhpSpreadsheet\Style\Fill::FILL_PATTERN_DARKDOWN: + case \PhpOffice\PhpSpreadsheet\Style\Fill::FILL_PATTERN_DARKDOWN: $blockFillPatternStyle = 0x07; break; - case \PhpSpreadsheet\Style\Fill::FILL_PATTERN_DARKUP: + case \PhpOffice\PhpSpreadsheet\Style\Fill::FILL_PATTERN_DARKUP: $blockFillPatternStyle = 0x08; break; - case \PhpSpreadsheet\Style\Fill::FILL_PATTERN_DARKGRID: + case \PhpOffice\PhpSpreadsheet\Style\Fill::FILL_PATTERN_DARKGRID: $blockFillPatternStyle = 0x09; break; - case \PhpSpreadsheet\Style\Fill::FILL_PATTERN_DARKTRELLIS: + case \PhpOffice\PhpSpreadsheet\Style\Fill::FILL_PATTERN_DARKTRELLIS: $blockFillPatternStyle = 0x0A; break; - case \PhpSpreadsheet\Style\Fill::FILL_PATTERN_LIGHTHORIZONTAL: + case \PhpOffice\PhpSpreadsheet\Style\Fill::FILL_PATTERN_LIGHTHORIZONTAL: $blockFillPatternStyle = 0x0B; break; - case \PhpSpreadsheet\Style\Fill::FILL_PATTERN_LIGHTVERTICAL: + case \PhpOffice\PhpSpreadsheet\Style\Fill::FILL_PATTERN_LIGHTVERTICAL: $blockFillPatternStyle = 0x0C; break; - case \PhpSpreadsheet\Style\Fill::FILL_PATTERN_LIGHTDOWN: + case \PhpOffice\PhpSpreadsheet\Style\Fill::FILL_PATTERN_LIGHTDOWN: $blockFillPatternStyle = 0x0D; break; - case \PhpSpreadsheet\Style\Fill::FILL_PATTERN_LIGHTUP: + case \PhpOffice\PhpSpreadsheet\Style\Fill::FILL_PATTERN_LIGHTUP: $blockFillPatternStyle = 0x0E; break; - case \PhpSpreadsheet\Style\Fill::FILL_PATTERN_LIGHTGRID: + case \PhpOffice\PhpSpreadsheet\Style\Fill::FILL_PATTERN_LIGHTGRID: $blockFillPatternStyle = 0x0F; break; - case \PhpSpreadsheet\Style\Fill::FILL_PATTERN_LIGHTTRELLIS: + case \PhpOffice\PhpSpreadsheet\Style\Fill::FILL_PATTERN_LIGHTTRELLIS: $blockFillPatternStyle = 0x10; break; - case \PhpSpreadsheet\Style\Fill::FILL_PATTERN_GRAY125: + case \PhpOffice\PhpSpreadsheet\Style\Fill::FILL_PATTERN_GRAY125: $blockFillPatternStyle = 0x11; break; - case \PhpSpreadsheet\Style\Fill::FILL_PATTERN_GRAY0625: + case \PhpOffice\PhpSpreadsheet\Style\Fill::FILL_PATTERN_GRAY0625: $blockFillPatternStyle = 0x12; break; - case \PhpSpreadsheet\Style\Fill::FILL_GRADIENT_LINEAR: + case \PhpOffice\PhpSpreadsheet\Style\Fill::FILL_GRADIENT_LINEAR: $blockFillPatternStyle = 0x00; break; // does not exist in BIFF8 - case \PhpSpreadsheet\Style\Fill::FILL_GRADIENT_PATH: + case \PhpOffice\PhpSpreadsheet\Style\Fill::FILL_GRADIENT_PATH: $blockFillPatternStyle = 0x00; break; // does not exist in BIFF8 default: @@ -4127,10 +4127,10 @@ class Worksheet extends BIFFwriter } if ($bFormatProt == 1) { $dataBlockProtection = 0; - if ($conditional->getStyle()->getProtection()->getLocked() == \PhpSpreadsheet\Style\Protection::PROTECTION_PROTECTED) { + if ($conditional->getStyle()->getProtection()->getLocked() == \PhpOffice\PhpSpreadsheet\Style\Protection::PROTECTION_PROTECTED) { $dataBlockProtection = 1; } - if ($conditional->getStyle()->getProtection()->getHidden() == \PhpSpreadsheet\Style\Protection::PROTECTION_PROTECTED) { + if ($conditional->getStyle()->getProtection()->getHidden() == \PhpOffice\PhpSpreadsheet\Style\Protection::PROTECTION_PROTECTED) { $dataBlockProtection = 1 << 1; } } @@ -4176,15 +4176,15 @@ class Worksheet extends BIFFwriter $arrConditional = []; foreach ($this->phpSheet->getConditionalStylesCollection() as $cellCoordinate => $conditionalStyles) { foreach ($conditionalStyles as $conditional) { - if ($conditional->getConditionType() == \PhpSpreadsheet\Style\Conditional::CONDITION_EXPRESSION - || $conditional->getConditionType() == \PhpSpreadsheet\Style\Conditional::CONDITION_CELLIS) { + if ($conditional->getConditionType() == \PhpOffice\PhpSpreadsheet\Style\Conditional::CONDITION_EXPRESSION + || $conditional->getConditionType() == \PhpOffice\PhpSpreadsheet\Style\Conditional::CONDITION_CELLIS) { if (!in_array($conditional->getHashCode(), $arrConditional)) { $arrConditional[] = $conditional->getHashCode(); } // Cells - $arrCoord = \PhpSpreadsheet\Cell::coordinateFromString($cellCoordinate); + $arrCoord = \PhpOffice\PhpSpreadsheet\Cell::coordinateFromString($cellCoordinate); if (!is_numeric($arrCoord[0])) { - $arrCoord[0] = \PhpSpreadsheet\Cell::columnIndexFromString($arrCoord[0]); + $arrCoord[0] = \PhpOffice\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 1cf9f37b..54b5b6ad 100644 --- a/src/PhpSpreadsheet/Writer/Excel5/Xf.php +++ b/src/PhpSpreadsheet/Writer/Excel5/Xf.php @@ -1,6 +1,6 @@ isStyleXf = false; $this->fontIndex = 0; @@ -224,10 +224,10 @@ class Xf $border1 |= $this->rightBorderColor << 23; $diagonalDirection = $this->_style->getBorders()->getDiagonalDirection(); - $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; + $diag_tl_to_rb = $diagonalDirection == \PhpOffice\PhpSpreadsheet\Style\Borders::DIAGONAL_BOTH + || $diagonalDirection == \PhpOffice\PhpSpreadsheet\Style\Borders::DIAGONAL_DOWN; + $diag_tr_to_lb = $diagonalDirection == \PhpOffice\PhpSpreadsheet\Style\Borders::DIAGONAL_BOTH + || $diagonalDirection == \PhpOffice\PhpSpreadsheet\Style\Borders::DIAGONAL_UP; $border1 |= $diag_tl_to_rb << 30; $border1 |= $diag_tr_to_lb << 31; @@ -356,20 +356,20 @@ class Xf * @static array of int */ private static $mapBorderStyles = [ - \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, + \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_NONE => 0x00, + \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_THIN => 0x01, + \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_MEDIUM => 0x02, + \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_DASHED => 0x03, + \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_DOTTED => 0x04, + \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_THICK => 0x05, + \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_DOUBLE => 0x06, + \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_HAIR => 0x07, + \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_MEDIUMDASHED => 0x08, + \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_DASHDOT => 0x09, + \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_MEDIUMDASHDOT => 0x0A, + \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_DASHDOTDOT => 0x0B, + \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_MEDIUMDASHDOTDOT => 0x0C, + \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_SLANTDASHDOT => 0x0D, ]; /** @@ -392,27 +392,27 @@ class Xf * @static array of int */ private static $mapFillTypes = [ - \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 + \PhpOffice\PhpSpreadsheet\Style\Fill::FILL_NONE => 0x00, + \PhpOffice\PhpSpreadsheet\Style\Fill::FILL_SOLID => 0x01, + \PhpOffice\PhpSpreadsheet\Style\Fill::FILL_PATTERN_MEDIUMGRAY => 0x02, + \PhpOffice\PhpSpreadsheet\Style\Fill::FILL_PATTERN_DARKGRAY => 0x03, + \PhpOffice\PhpSpreadsheet\Style\Fill::FILL_PATTERN_LIGHTGRAY => 0x04, + \PhpOffice\PhpSpreadsheet\Style\Fill::FILL_PATTERN_DARKHORIZONTAL => 0x05, + \PhpOffice\PhpSpreadsheet\Style\Fill::FILL_PATTERN_DARKVERTICAL => 0x06, + \PhpOffice\PhpSpreadsheet\Style\Fill::FILL_PATTERN_DARKDOWN => 0x07, + \PhpOffice\PhpSpreadsheet\Style\Fill::FILL_PATTERN_DARKUP => 0x08, + \PhpOffice\PhpSpreadsheet\Style\Fill::FILL_PATTERN_DARKGRID => 0x09, + \PhpOffice\PhpSpreadsheet\Style\Fill::FILL_PATTERN_DARKTRELLIS => 0x0A, + \PhpOffice\PhpSpreadsheet\Style\Fill::FILL_PATTERN_LIGHTHORIZONTAL => 0x0B, + \PhpOffice\PhpSpreadsheet\Style\Fill::FILL_PATTERN_LIGHTVERTICAL => 0x0C, + \PhpOffice\PhpSpreadsheet\Style\Fill::FILL_PATTERN_LIGHTDOWN => 0x0D, + \PhpOffice\PhpSpreadsheet\Style\Fill::FILL_PATTERN_LIGHTUP => 0x0E, + \PhpOffice\PhpSpreadsheet\Style\Fill::FILL_PATTERN_LIGHTGRID => 0x0F, + \PhpOffice\PhpSpreadsheet\Style\Fill::FILL_PATTERN_LIGHTTRELLIS => 0x10, + \PhpOffice\PhpSpreadsheet\Style\Fill::FILL_PATTERN_GRAY125 => 0x11, + \PhpOffice\PhpSpreadsheet\Style\Fill::FILL_PATTERN_GRAY0625 => 0x12, + \PhpOffice\PhpSpreadsheet\Style\Fill::FILL_GRADIENT_LINEAR => 0x00, // does not exist in BIFF8 + \PhpOffice\PhpSpreadsheet\Style\Fill::FILL_GRADIENT_PATH => 0x00, // does not exist in BIFF8 ]; /** @@ -435,13 +435,13 @@ class Xf * @static array of int */ private static $mapHAlignments = [ - \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, + \PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_GENERAL => 0, + \PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_LEFT => 1, + \PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_CENTER => 2, + \PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_RIGHT => 3, + \PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_FILL => 4, + \PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_JUSTIFY => 5, + \PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_CENTER_CONTINUOUS => 6, ]; /** @@ -464,10 +464,10 @@ class Xf * @static array of int */ private static $mapVAlignments = [ - \PhpSpreadsheet\Style\Alignment::VERTICAL_TOP => 0, - \PhpSpreadsheet\Style\Alignment::VERTICAL_CENTER => 1, - \PhpSpreadsheet\Style\Alignment::VERTICAL_BOTTOM => 2, - \PhpSpreadsheet\Style\Alignment::VERTICAL_JUSTIFY => 3, + \PhpOffice\PhpSpreadsheet\Style\Alignment::VERTICAL_TOP => 0, + \PhpOffice\PhpSpreadsheet\Style\Alignment::VERTICAL_CENTER => 1, + \PhpOffice\PhpSpreadsheet\Style\Alignment::VERTICAL_BOTTOM => 2, + \PhpOffice\PhpSpreadsheet\Style\Alignment::VERTICAL_JUSTIFY => 3, ]; /** @@ -511,11 +511,11 @@ class Xf private static function mapLocked($locked) { switch ($locked) { - case \PhpSpreadsheet\Style\Protection::PROTECTION_INHERIT: + case \PhpOffice\PhpSpreadsheet\Style\Protection::PROTECTION_INHERIT: return 1; - case \PhpSpreadsheet\Style\Protection::PROTECTION_PROTECTED: + case \PhpOffice\PhpSpreadsheet\Style\Protection::PROTECTION_PROTECTED: return 1; - case \PhpSpreadsheet\Style\Protection::PROTECTION_UNPROTECTED: + case \PhpOffice\PhpSpreadsheet\Style\Protection::PROTECTION_UNPROTECTED: return 0; default: return 1; @@ -531,11 +531,11 @@ class Xf private static function mapHidden($hidden) { switch ($hidden) { - case \PhpSpreadsheet\Style\Protection::PROTECTION_INHERIT: + case \PhpOffice\PhpSpreadsheet\Style\Protection::PROTECTION_INHERIT: return 0; - case \PhpSpreadsheet\Style\Protection::PROTECTION_PROTECTED: + case \PhpOffice\PhpSpreadsheet\Style\Protection::PROTECTION_PROTECTED: return 1; - case \PhpSpreadsheet\Style\Protection::PROTECTION_UNPROTECTED: + case \PhpOffice\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 91e79138..ab75138c 100644 --- a/src/PhpSpreadsheet/Writer/Exception.php +++ b/src/PhpSpreadsheet/Writer/Exception.php @@ -1,6 +1,6 @@ spreadsheet)) { - throw new \PhpSpreadsheet\Writer\Exception('Internal Spreadsheet object not set to an instance of an object.'); + throw new \PhpOffice\PhpSpreadsheet\Writer\Exception('Internal Spreadsheet object not set to an instance of an object.'); } // Construct HTML @@ -394,14 +394,14 @@ class HTML extends BaseWriter implements IWriter /** * Generate sheet data * - * @throws \PhpSpreadsheet\Writer\Exception + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception * @return string */ public function generateSheetData() { // Spreadsheet object known? if (is_null($this->spreadsheet)) { - throw new \PhpSpreadsheet\Writer\Exception('Internal Spreadsheet object not set to an instance of an object.'); + throw new \PhpOffice\PhpSpreadsheet\Writer\Exception('Internal Spreadsheet object not set to an instance of an object.'); } // Ensure that Spans have been calculated? @@ -428,10 +428,10 @@ class HTML extends BaseWriter implements IWriter // Get worksheet dimension $dimension = explode(':', $sheet->calculateWorksheetDimension()); - $dimension[0] = \PhpSpreadsheet\Cell::coordinateFromString($dimension[0]); - $dimension[0][0] = \PhpSpreadsheet\Cell::columnIndexFromString($dimension[0][0]) - 1; - $dimension[1] = \PhpSpreadsheet\Cell::coordinateFromString($dimension[1]); - $dimension[1][0] = \PhpSpreadsheet\Cell::columnIndexFromString($dimension[1][0]) - 1; + $dimension[0] = \PhpOffice\PhpSpreadsheet\Cell::coordinateFromString($dimension[0]); + $dimension[0][0] = \PhpOffice\PhpSpreadsheet\Cell::columnIndexFromString($dimension[0][0]) - 1; + $dimension[1] = \PhpOffice\PhpSpreadsheet\Cell::coordinateFromString($dimension[1]); + $dimension[1][0] = \PhpOffice\PhpSpreadsheet\Cell::columnIndexFromString($dimension[1][0]) - 1; // row min,max $rowMin = $dimension[0][1]; @@ -475,7 +475,7 @@ class HTML extends BaseWriter implements IWriter while ($column++ < $dimension[1][0]) { // Cell exists? if ($sheet->cellExistsByColumnAndRow($column, $row)) { - $rowData[$column] = \PhpSpreadsheet\Cell::stringFromColumnIndex($column) . $row; + $rowData[$column] = \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($column) . $row; } else { $rowData[$column] = ''; } @@ -513,14 +513,14 @@ class HTML extends BaseWriter implements IWriter /** * Generate sheet tabs * - * @throws \PhpSpreadsheet\Writer\Exception + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception * @return string */ public function generateNavigation() { // Spreadsheet object known? if (is_null($this->spreadsheet)) { - throw new \PhpSpreadsheet\Writer\Exception('Internal Spreadsheet object not set to an instance of an object.'); + throw new \PhpOffice\PhpSpreadsheet\Writer\Exception('Internal Spreadsheet object not set to an instance of an object.'); } // Fetch sheets @@ -552,19 +552,19 @@ class HTML extends BaseWriter implements IWriter return $html; } - private function extendRowsForChartsAndImages(\PhpSpreadsheet\Worksheet $pSheet, $row) + private function extendRowsForChartsAndImages(\PhpOffice\PhpSpreadsheet\Worksheet $pSheet, $row) { $rowMax = $row; $colMax = 'A'; if ($this->includeCharts) { foreach ($pSheet->getChartCollection() as $chart) { - if ($chart instanceof \PhpSpreadsheet\Chart) { + if ($chart instanceof \PhpOffice\PhpSpreadsheet\Chart) { $chartCoordinates = $chart->getTopLeftPosition(); - $chartTL = \PhpSpreadsheet\Cell::coordinateFromString($chartCoordinates['cell']); - $chartCol = \PhpSpreadsheet\Cell::columnIndexFromString($chartTL[0]); + $chartTL = \PhpOffice\PhpSpreadsheet\Cell::coordinateFromString($chartCoordinates['cell']); + $chartCol = \PhpOffice\PhpSpreadsheet\Cell::columnIndexFromString($chartTL[0]); if ($chartTL[1] > $rowMax) { $rowMax = $chartTL[1]; - if ($chartCol > \PhpSpreadsheet\Cell::columnIndexFromString($colMax)) { + if ($chartCol > \PhpOffice\PhpSpreadsheet\Cell::columnIndexFromString($colMax)) { $colMax = $chartTL[0]; } } @@ -573,12 +573,12 @@ class HTML extends BaseWriter implements IWriter } foreach ($pSheet->getDrawingCollection() as $drawing) { - if ($drawing instanceof \PhpSpreadsheet\Worksheet\Drawing) { - $imageTL = \PhpSpreadsheet\Cell::coordinateFromString($drawing->getCoordinates()); - $imageCol = \PhpSpreadsheet\Cell::columnIndexFromString($imageTL[0]); + if ($drawing instanceof \PhpOffice\PhpSpreadsheet\Worksheet\Drawing) { + $imageTL = \PhpOffice\PhpSpreadsheet\Cell::coordinateFromString($drawing->getCoordinates()); + $imageCol = \PhpOffice\PhpSpreadsheet\Cell::columnIndexFromString($imageTL[0]); if ($imageTL[1] > $rowMax) { $rowMax = $imageTL[1]; - if ($imageCol > \PhpSpreadsheet\Cell::columnIndexFromString($colMax)) { + if ($imageCol > \PhpOffice\PhpSpreadsheet\Cell::columnIndexFromString($colMax)) { $colMax = $imageTL[0]; } } @@ -606,19 +606,19 @@ class HTML extends BaseWriter implements IWriter /** * Generate image tag in cell * - * @param \PhpSpreadsheet\Worksheet $pSheet \PhpSpreadsheet\Worksheet + * @param \PhpOffice\PhpSpreadsheet\Worksheet $pSheet \PhpOffice\PhpSpreadsheet\Worksheet * @param string $coordinates Cell coordinates - * @throws \PhpSpreadsheet\Writer\Exception + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception * @return string */ - private function writeImageInCell(\PhpSpreadsheet\Worksheet $pSheet, $coordinates) + private function writeImageInCell(\PhpOffice\PhpSpreadsheet\Worksheet $pSheet, $coordinates) { // Construct HTML $html = ''; // Write images foreach ($pSheet->getDrawingCollection() as $drawing) { - if ($drawing instanceof \PhpSpreadsheet\Worksheet\Drawing) { + if ($drawing instanceof \PhpOffice\PhpSpreadsheet\Worksheet\Drawing) { if ($drawing->getCoordinates() == $coordinates) { $filename = $drawing->getPath(); @@ -662,7 +662,7 @@ class HTML extends BaseWriter implements IWriter $imageData . '" border="0" />'; $html .= ''; } - } elseif ($drawing instanceof \PhpSpreadsheet\Worksheet\MemoryDrawing) { + } elseif ($drawing instanceof \PhpOffice\PhpSpreadsheet\Worksheet\MemoryDrawing) { if ($drawing->getCoordinates() != $coordinates) { continue; } @@ -687,22 +687,22 @@ class HTML extends BaseWriter implements IWriter /** * Generate chart tag in cell * - * @param \PhpSpreadsheet\Worksheet $pSheet \PhpSpreadsheet\Worksheet + * @param \PhpOffice\PhpSpreadsheet\Worksheet $pSheet \PhpOffice\PhpSpreadsheet\Worksheet * @param string $coordinates Cell coordinates - * @throws \PhpSpreadsheet\Writer\Exception + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception * @return string */ - private function writeChartInCell(\PhpSpreadsheet\Worksheet $pSheet, $coordinates) + private function writeChartInCell(\PhpOffice\PhpSpreadsheet\Worksheet $pSheet, $coordinates) { // Construct HTML $html = ''; // Write charts foreach ($pSheet->getChartCollection() as $chart) { - if ($chart instanceof \PhpSpreadsheet\Chart) { + if ($chart instanceof \PhpOffice\PhpSpreadsheet\Chart) { $chartCoordinates = $chart->getTopLeftPosition(); if ($chartCoordinates['cell'] == $coordinates) { - $chartFileName = \PhpSpreadsheet\Shared\File::sysGetTempDir() . '/' . uniqid() . '.png'; + $chartFileName = \PhpOffice\PhpSpreadsheet\Shared\File::sysGetTempDir() . '/' . uniqid() . '.png'; if (!$chart->render($chartFileName)) { return; } @@ -735,14 +735,14 @@ class HTML extends BaseWriter implements IWriter * Generate CSS styles * * @param bool $generateSurroundingHTML Generate surrounding HTML tags? (<style> and </style>) - * @throws \PhpSpreadsheet\Writer\Exception + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception * @return string */ public function generateStyles($generateSurroundingHTML = true) { // Spreadsheet object known? if (is_null($this->spreadsheet)) { - throw new \PhpSpreadsheet\Writer\Exception('Internal Spreadsheet object not set to an instance of an object.'); + throw new \PhpOffice\PhpSpreadsheet\Writer\Exception('Internal Spreadsheet object not set to an instance of an object.'); } // Build CSS @@ -777,14 +777,14 @@ class HTML extends BaseWriter implements IWriter * Build CSS styles * * @param bool $generateSurroundingHTML Generate surrounding HTML style? (html { }) - * @throws \PhpSpreadsheet\Writer\Exception + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception * @return array */ public function buildCSS($generateSurroundingHTML = true) { // Spreadsheet object known? if (is_null($this->spreadsheet)) { - throw new \PhpSpreadsheet\Writer\Exception('Internal Spreadsheet object not set to an instance of an object.'); + throw new \PhpOffice\PhpSpreadsheet\Writer\Exception('Internal Spreadsheet object not set to an instance of an object.'); } // Cached? @@ -860,7 +860,7 @@ class HTML extends BaseWriter implements IWriter $sheet->calculateColumnWidths(); // col elements, initialize - $highestColumnIndex = \PhpSpreadsheet\Cell::columnIndexFromString($sheet->getHighestColumn()) - 1; + $highestColumnIndex = \PhpOffice\PhpSpreadsheet\Cell::columnIndexFromString($sheet->getHighestColumn()) - 1; $column = -1; while ($column++ < $highestColumnIndex) { $this->columnWidths[$sheetIndex][$column] = 42; // approximation @@ -869,9 +869,9 @@ class HTML extends BaseWriter implements IWriter // col elements, loop through columnDimensions and set width foreach ($sheet->getColumnDimensions() as $columnDimension) { - if (($width = \PhpSpreadsheet\Shared\Drawing::cellDimensionToPixels($columnDimension->getWidth(), $this->defaultFont)) >= 0) { - $width = \PhpSpreadsheet\Shared\Drawing::pixelsToPoints($width); - $column = \PhpSpreadsheet\Cell::columnIndexFromString($columnDimension->getColumnIndex()) - 1; + if (($width = \PhpOffice\PhpSpreadsheet\Shared\Drawing::cellDimensionToPixels($columnDimension->getWidth(), $this->defaultFont)) >= 0) { + $width = \PhpOffice\PhpSpreadsheet\Shared\Drawing::pixelsToPoints($width); + $column = \PhpOffice\PhpSpreadsheet\Cell::columnIndexFromString($columnDimension->getColumnIndex()) - 1; $this->columnWidths[$sheetIndex][$column] = $width; $css['table.sheet' . $sheetIndex . ' col.col' . $column]['width'] = $width . 'pt'; @@ -931,10 +931,10 @@ class HTML extends BaseWriter implements IWriter /** * Create CSS style * - * @param \PhpSpreadsheet\Style $pStyle + * @param \PhpOffice\PhpSpreadsheet\Style $pStyle * @return array */ - private function createCSSStyle(\PhpSpreadsheet\Style $pStyle) + private function createCSSStyle(\PhpOffice\PhpSpreadsheet\Style $pStyle) { // Construct CSS $css = ''; @@ -952,12 +952,12 @@ class HTML extends BaseWriter implements IWriter } /** - * Create CSS style (\PhpSpreadsheet\Style\Alignment) + * Create CSS style (\PhpOffice\PhpSpreadsheet\Style\Alignment) * - * @param \PhpSpreadsheet\Style\Alignment $pStyle \PhpSpreadsheet\Style\Alignment + * @param \PhpOffice\PhpSpreadsheet\Style\Alignment $pStyle \PhpOffice\PhpSpreadsheet\Style\Alignment * @return array */ - private function createCSSStyleAlignment(\PhpSpreadsheet\Style\Alignment $pStyle) + private function createCSSStyleAlignment(\PhpOffice\PhpSpreadsheet\Style\Alignment $pStyle) { // Construct CSS $css = []; @@ -975,12 +975,12 @@ class HTML extends BaseWriter implements IWriter } /** - * Create CSS style (\PhpSpreadsheet\Style\Font) + * Create CSS style (\PhpOffice\PhpSpreadsheet\Style\Font) * - * @param \PhpSpreadsheet\Style\Font $pStyle \PhpSpreadsheet\Style\Font + * @param \PhpOffice\PhpSpreadsheet\Style\Font $pStyle \PhpOffice\PhpSpreadsheet\Style\Font * @return array */ - private function createCSSStyleFont(\PhpSpreadsheet\Style\Font $pStyle) + private function createCSSStyleFont(\PhpOffice\PhpSpreadsheet\Style\Font $pStyle) { // Construct CSS $css = []; @@ -989,9 +989,9 @@ class HTML extends BaseWriter implements IWriter if ($pStyle->getBold()) { $css['font-weight'] = 'bold'; } - if ($pStyle->getUnderline() != \PhpSpreadsheet\Style\Font::UNDERLINE_NONE && $pStyle->getStrikethrough()) { + if ($pStyle->getUnderline() != \PhpOffice\PhpSpreadsheet\Style\Font::UNDERLINE_NONE && $pStyle->getStrikethrough()) { $css['text-decoration'] = 'underline line-through'; - } elseif ($pStyle->getUnderline() != \PhpSpreadsheet\Style\Font::UNDERLINE_NONE) { + } elseif ($pStyle->getUnderline() != \PhpOffice\PhpSpreadsheet\Style\Font::UNDERLINE_NONE) { $css['text-decoration'] = 'underline'; } elseif ($pStyle->getStrikethrough()) { $css['text-decoration'] = 'line-through'; @@ -1008,12 +1008,12 @@ class HTML extends BaseWriter implements IWriter } /** - * Create CSS style (\PhpSpreadsheet\Style\Borders) + * Create CSS style (\PhpOffice\PhpSpreadsheet\Style\Borders) * - * @param \PhpSpreadsheet\Style\Borders $pStyle \PhpSpreadsheet\Style\Borders + * @param \PhpOffice\PhpSpreadsheet\Style\Borders $pStyle \PhpOffice\PhpSpreadsheet\Style\Borders * @return array */ - private function createCSSStyleBorders(\PhpSpreadsheet\Style\Borders $pStyle) + private function createCSSStyleBorders(\PhpOffice\PhpSpreadsheet\Style\Borders $pStyle) { // Construct CSS $css = []; @@ -1028,12 +1028,12 @@ class HTML extends BaseWriter implements IWriter } /** - * Create CSS style (\PhpSpreadsheet\Style\Border) + * Create CSS style (\PhpOffice\PhpSpreadsheet\Style\Border) * - * @param \PhpSpreadsheet\Style\Border $pStyle \PhpSpreadsheet\Style\Border + * @param \PhpOffice\PhpSpreadsheet\Style\Border $pStyle \PhpOffice\PhpSpreadsheet\Style\Border * @return string */ - private function createCSSStyleBorder(\PhpSpreadsheet\Style\Border $pStyle) + private function createCSSStyleBorder(\PhpOffice\PhpSpreadsheet\Style\Border $pStyle) { // Create CSS - add !important to non-none border styles for merged cells $borderStyle = $this->mapBorderStyle($pStyle->getBorderStyle()); @@ -1043,18 +1043,18 @@ class HTML extends BaseWriter implements IWriter } /** - * Create CSS style (\PhpSpreadsheet\Style\Fill) + * Create CSS style (\PhpOffice\PhpSpreadsheet\Style\Fill) * - * @param \PhpSpreadsheet\Style\Fill $pStyle \PhpSpreadsheet\Style\Fill + * @param \PhpOffice\PhpSpreadsheet\Style\Fill $pStyle \PhpOffice\PhpSpreadsheet\Style\Fill * @return array */ - private function createCSSStyleFill(\PhpSpreadsheet\Style\Fill $pStyle) + private function createCSSStyleFill(\PhpOffice\PhpSpreadsheet\Style\Fill $pStyle) { // Construct HTML $css = []; // Create CSS - $value = $pStyle->getFillType() == \PhpSpreadsheet\Style\Fill::FILL_NONE ? + $value = $pStyle->getFillType() == \PhpOffice\PhpSpreadsheet\Style\Fill::FILL_NONE ? 'white' : '#' . $pStyle->getStartColor()->getRGB(); $css['background-color'] = $value; @@ -1077,8 +1077,8 @@ class HTML extends BaseWriter implements IWriter /** * Generate table header * - * @param \PhpSpreadsheet\Worksheet $pSheet The worksheet for the table we are writing - * @throws \PhpSpreadsheet\Writer\Exception + * @param \PhpOffice\PhpSpreadsheet\Worksheet $pSheet The worksheet for the table we are writing + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception * @return string */ private function generateTableHeader($pSheet) @@ -1104,7 +1104,7 @@ class HTML extends BaseWriter implements IWriter } // Write elements - $highestColumnIndex = \PhpSpreadsheet\Cell::columnIndexFromString($pSheet->getHighestColumn()) - 1; + $highestColumnIndex = \PhpOffice\PhpSpreadsheet\Cell::columnIndexFromString($pSheet->getHighestColumn()) - 1; $i = -1; while ($i++ < $highestColumnIndex) { if (!$this->isPdf) { @@ -1124,7 +1124,7 @@ class HTML extends BaseWriter implements IWriter /** * Generate table footer * - * @throws \PhpSpreadsheet\Writer\Exception + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception */ private function generateTableFooter() { @@ -1136,13 +1136,13 @@ class HTML extends BaseWriter implements IWriter /** * Generate row * - * @param \PhpSpreadsheet\Worksheet $pSheet \PhpSpreadsheet\Worksheet + * @param \PhpOffice\PhpSpreadsheet\Worksheet $pSheet \PhpOffice\PhpSpreadsheet\Worksheet * @param array $pValues Array containing cells in a row * @param int $pRow Row number (0-based) - * @throws \PhpSpreadsheet\Writer\Exception + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception * @return string */ - private function generateRow(\PhpSpreadsheet\Worksheet $pSheet, $pValues = null, $pRow = 0, $cellType = 'td') + private function generateRow(\PhpOffice\PhpSpreadsheet\Worksheet $pSheet, $pValues = null, $pRow = 0, $cellType = 'td') { if (is_array($pValues)) { // Construct HTML @@ -1182,7 +1182,7 @@ class HTML extends BaseWriter implements IWriter $colNum = 0; foreach ($pValues as $cellAddress) { $cell = ($cellAddress > '') ? $pSheet->getCell($cellAddress) : ''; - $coordinate = \PhpSpreadsheet\Cell::stringFromColumnIndex($colNum) . ($pRow + 1); + $coordinate = \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($colNum) . ($pRow + 1); if (!$this->useInlineCss) { $cssClass = ''; $cssClass = 'column' . $colNum; @@ -1204,19 +1204,19 @@ class HTML extends BaseWriter implements IWriter // initialize $cellData = ' '; - // \PhpSpreadsheet\Cell - if ($cell instanceof \PhpSpreadsheet\Cell) { + // \PhpOffice\PhpSpreadsheet\Cell + if ($cell instanceof \PhpOffice\PhpSpreadsheet\Cell) { $cellData = ''; if (is_null($cell->getParent())) { $cell->attach($pSheet); } // Value - if ($cell->getValue() instanceof \PhpSpreadsheet\RichText) { + if ($cell->getValue() instanceof \PhpOffice\PhpSpreadsheet\RichText) { // Loop through rich text elements $elements = $cell->getValue()->getRichTextElements(); foreach ($elements as $element) { // Rich text start? - if ($element instanceof \PhpSpreadsheet\RichText\Run) { + if ($element instanceof \PhpOffice\PhpSpreadsheet\RichText\Run) { $cellData .= ''; if ($element->getFont()->getSuperScript()) { @@ -1230,7 +1230,7 @@ class HTML extends BaseWriter implements IWriter $cellText = $element->getText(); $cellData .= htmlspecialchars($cellText); - if ($element instanceof \PhpSpreadsheet\RichText\Run) { + if ($element instanceof \PhpOffice\PhpSpreadsheet\RichText\Run) { if ($element->getFont()->getSuperScript()) { $cellData .= ''; } elseif ($element->getFont()->getSubScript()) { @@ -1242,13 +1242,13 @@ class HTML extends BaseWriter implements IWriter } } else { if ($this->preCalculateFormulas) { - $cellData = \PhpSpreadsheet\Style\NumberFormat::toFormattedString( + $cellData = \PhpOffice\PhpSpreadsheet\Style\NumberFormat::toFormattedString( $cell->getCalculatedValue(), $pSheet->getParent()->getCellXfByIndex($cell->getXfIndex())->getNumberFormat()->getFormatCode(), [$this, 'formatColor'] ); } else { - $cellData = \PhpSpreadsheet\Style\NumberFormat::toFormattedString( + $cellData = \PhpOffice\PhpSpreadsheet\Style\NumberFormat::toFormattedString( $cell->getValue(), $pSheet->getParent()->getCellXfByIndex($cell->getXfIndex())->getNumberFormat()->getFormatCode(), [$this, 'formatColor'] @@ -1286,7 +1286,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() == \PhpSpreadsheet\Style\Alignment::HORIZONTAL_GENERAL + if ($sharedStyle->getAlignment()->getHorizontal() == \PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_GENERAL && isset($this->cssStyles['.' . $cell->getDataType()]['text-align'])) { $cssClass['text-align'] = $this->cssStyles['.' . $cell->getDataType()]['text-align']; } @@ -1312,7 +1312,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 = \PhpSpreadsheet\Cell::stringFromColumnIndex($colNum + $colSpan - 1) . ($pRow + $rowSpan); + $endCellCoord = \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($colNum + $colSpan - 1) . ($pRow + $rowSpan); if (!$this->useInlineCss) { $cssClass .= ' style' . $pSheet->getCell($endCellCoord)->getXfIndex(); } @@ -1325,7 +1325,7 @@ class HTML extends BaseWriter implements IWriter if (!$this->useInlineCss) { $html .= ' class="' . $cssClass . '"'; } else { - //** Necessary redundant code for the sake of PhpSpreadsheet\Writer\PDF ** + //** Necessary redundant code for the sake of \PhpOffice\PhpSpreadsheet\Writer\PDF ** // We must explicitly write the width of the element because TCPDF // does not recognize e.g. $width = 0; @@ -1381,7 +1381,7 @@ class HTML extends BaseWriter implements IWriter // Return return $html; } else { - throw new \PhpSpreadsheet\Writer\Exception('Invalid parameters passed.'); + throw new \PhpOffice\PhpSpreadsheet\Writer\Exception('Invalid parameters passed.'); } } @@ -1520,15 +1520,15 @@ class HTML extends BaseWriter implements IWriter // loop through all Excel merged cells foreach ($sheet->getMergeCells() as $cells) { - list($cells) = \PhpSpreadsheet\Cell::splitRange($cells); + list($cells) = \PhpOffice\PhpSpreadsheet\Cell::splitRange($cells); $first = $cells[0]; $last = $cells[1]; - list($fc, $fr) = \PhpSpreadsheet\Cell::coordinateFromString($first); - $fc = \PhpSpreadsheet\Cell::columnIndexFromString($fc) - 1; + list($fc, $fr) = \PhpOffice\PhpSpreadsheet\Cell::coordinateFromString($first); + $fc = \PhpOffice\PhpSpreadsheet\Cell::columnIndexFromString($fc) - 1; - list($lc, $lr) = \PhpSpreadsheet\Cell::coordinateFromString($last); - $lc = \PhpSpreadsheet\Cell::columnIndexFromString($lc) - 1; + list($lc, $lr) = \PhpOffice\PhpSpreadsheet\Cell::coordinateFromString($last); + $lc = \PhpOffice\PhpSpreadsheet\Cell::columnIndexFromString($lc) - 1; // loop through the individual cells in the individual merge $r = $fr - 1; @@ -1558,7 +1558,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 = \PhpSpreadsheet\Cell::columnIndexFromString($sheet->getHighestColumn()); + $countColumns = \PhpOffice\PhpSpreadsheet\Cell::columnIndexFromString($sheet->getHighestColumn()); foreach ($candidateSpannedRow as $rowIndex) { if (isset($this->isSpannedCell[$sheetIndex][$rowIndex])) { if (count($this->isSpannedCell[$sheetIndex][$rowIndex]) == $countColumns) { @@ -1592,7 +1592,7 @@ class HTML extends BaseWriter implements IWriter $this->spansAreCalculated = true; } - private function setMargins(\PhpSpreadsheet\Worksheet $pSheet) + private function setMargins(\PhpOffice\PhpSpreadsheet\Worksheet $pSheet) { $htmlPage = '@page { '; $htmlBody = 'body { '; diff --git a/src/PhpSpreadsheet/Writer/IWriter.php b/src/PhpSpreadsheet/Writer/IWriter.php index 57bc0820..fe3edd08 100644 --- a/src/PhpSpreadsheet/Writer/IWriter.php +++ b/src/PhpSpreadsheet/Writer/IWriter.php @@ -1,6 +1,6 @@ setSpreadsheet($spreadsheet); $writerPartsArray = [ - '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, + 'content' => \PhpOffice\PhpSpreadsheet\Writer\OpenDocument\Content::class, + 'meta' => \PhpOffice\PhpSpreadsheet\Writer\OpenDocument\Meta::class, + 'meta_inf' => \PhpOffice\PhpSpreadsheet\Writer\OpenDocument\MetaInf::class, + 'mimetype' => \PhpOffice\PhpSpreadsheet\Writer\OpenDocument\Mimetype::class, + 'settings' => \PhpOffice\PhpSpreadsheet\Writer\OpenDocument\Settings::class, + 'styles' => \PhpOffice\PhpSpreadsheet\Writer\OpenDocument\Styles::class, + 'thumbnails' => \PhpOffice\PhpSpreadsheet\Writer\OpenDocument\Thumbnails::class, ]; foreach ($writerPartsArray as $writer => $class) { @@ -85,12 +85,12 @@ class OpenDocument extends BaseWriter implements IWriter * Save PhpSpreadsheet to file * * @param string $pFilename - * @throws \PhpSpreadsheet\Writer\Exception + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception */ public function save($pFilename = null) { if (!$this->spreadSheet) { - throw new \PhpSpreadsheet\Writer\Exception('PhpSpreadsheet object unassigned.'); + throw new \PhpOffice\PhpSpreadsheet\Writer\Exception('PhpSpreadsheet object unassigned.'); } // garbage collect @@ -99,7 +99,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(\PhpSpreadsheet\Shared\File::sysGetTempDir(), 'phpxltmp'); + $pFilename = @tempnam(\PhpOffice\PhpSpreadsheet\Shared\File::sysGetTempDir(), 'phpxltmp'); if ($pFilename == '') { $pFilename = $originalFilename; } @@ -117,13 +117,13 @@ class OpenDocument extends BaseWriter implements IWriter // Close file if ($objZip->close() === false) { - throw new \PhpSpreadsheet\Writer\Exception("Could not close zip file $pFilename."); + throw new \PhpOffice\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 \PhpSpreadsheet\Writer\Exception("Could not copy temporary zip file $pFilename to $originalFilename."); + throw new \PhpOffice\PhpSpreadsheet\Writer\Exception("Could not copy temporary zip file $pFilename to $originalFilename."); } @unlink($pFilename); } @@ -133,13 +133,13 @@ class OpenDocument extends BaseWriter implements IWriter * Create zip object * * @param string $pFilename - * @throws \PhpSpreadsheet\Writer\Exception + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception * @return ZipArchive */ private function createZip($pFilename) { // Create new ZIP file and open it for writing - $zipClass = \PhpSpreadsheet\Settings::getZipClass(); + $zipClass = \PhpOffice\PhpSpreadsheet\Settings::getZipClass(); $objZip = new $zipClass(); // Retrieve OVERWRITE and CREATE constants from the instantiated zip class @@ -154,7 +154,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 \PhpSpreadsheet\Writer\Exception("Could not open $pFilename for writing."); + throw new \PhpOffice\PhpSpreadsheet\Writer\Exception("Could not open $pFilename for writing."); } } @@ -164,7 +164,7 @@ class OpenDocument extends BaseWriter implements IWriter /** * Get Spreadsheet object * - * @throws \PhpSpreadsheet\Writer\Exception + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception * @return Spreadsheet */ public function getSpreadsheet() @@ -172,18 +172,18 @@ class OpenDocument extends BaseWriter implements IWriter if ($this->spreadSheet !== null) { return $this->spreadSheet; } else { - throw new \PhpSpreadsheet\Writer\Exception('No PhpSpreadsheet assigned.'); + throw new \PhpOffice\PhpSpreadsheet\Writer\Exception('No PhpSpreadsheet assigned.'); } } /** * Set PhpSpreadsheet object * - * @param \PhpSpreadsheet\Spreadsheet $spreadsheet PhpSpreadsheet object - * @throws \PhpSpreadsheet\Writer\Exception + * @param \PhpOffice\PhpSpreadsheet\Spreadsheet $spreadsheet PhpSpreadsheet object + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception * @return Excel2007 */ - public function setSpreadsheet(\PhpSpreadsheet\SpreadSheet $spreadsheet = null) + public function setSpreadsheet(\PhpOffice\PhpSpreadsheet\SpreadSheet $spreadsheet = null) { $this->spreadSheet = $spreadsheet; diff --git a/src/PhpSpreadsheet/Writer/OpenDocument/Cell/Comment.php b/src/PhpSpreadsheet/Writer/OpenDocument/Cell/Comment.php index ce218364..dc57f6df 100644 --- a/src/PhpSpreadsheet/Writer/OpenDocument/Cell/Comment.php +++ b/src/PhpSpreadsheet/Writer/OpenDocument/Cell/Comment.php @@ -1,6 +1,6 @@ getWorksheet()->getComments(); if (!isset($comments[$cell->getCoordinate()])) { diff --git a/src/PhpSpreadsheet/Writer/OpenDocument/Content.php b/src/PhpSpreadsheet/Writer/OpenDocument/Content.php index 3453fd31..29f285b7 100644 --- a/src/PhpSpreadsheet/Writer/OpenDocument/Content.php +++ b/src/PhpSpreadsheet/Writer/OpenDocument/Content.php @@ -1,6 +1,6 @@ getParentWriter()->getSpreadsheet(); /* @var $spreadsheet PhpSpreadsheet */ @@ -52,9 +52,9 @@ class Content extends WriterPart $objWriter = null; if ($this->getParentWriter()->getUseDiskCaching()) { - $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); + $objWriter = new \PhpOffice\PhpSpreadsheet\Shared\XMLWriter(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); } else { - $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_MEMORY); + $objWriter = new \PhpOffice\PhpSpreadsheet\Shared\XMLWriter(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter::STORAGE_MEMORY); } // XML header @@ -115,9 +115,9 @@ class Content extends WriterPart /** * Write sheets * - * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter + * @param \PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter */ - private function writeSheets(\PhpSpreadsheet\Shared\XMLWriter $objWriter) + private function writeSheets(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter) { $spreadsheet = $this->getParentWriter()->getSpreadsheet(); /* @var $spreadsheet PhpSpreadsheet */ @@ -137,10 +137,10 @@ class Content extends WriterPart /** * Write rows of the specified sheet * - * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter - * @param \PhpSpreadsheet\Worksheet $sheet + * @param \PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter + * @param \PhpOffice\PhpSpreadsheet\Worksheet $sheet */ - private function writeRows(\PhpSpreadsheet\Shared\XMLWriter $objWriter, \PhpSpreadsheet\Worksheet $sheet) + private function writeRows(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter, \PhpOffice\PhpSpreadsheet\Worksheet $sheet) { $number_rows_repeated = self::NUMBER_ROWS_REPEATED_MAX; $span_row = 0; @@ -173,34 +173,34 @@ class Content extends WriterPart /** * Write cells of the specified row * - * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter - * @param \PhpSpreadsheet\Worksheet\Row $row - * @throws \PhpSpreadsheet\Writer\Exception + * @param \PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter + * @param \PhpOffice\PhpSpreadsheet\Worksheet\Row $row + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception */ - private function writeCells(\PhpSpreadsheet\Shared\XMLWriter $objWriter, \PhpSpreadsheet\Worksheet\Row $row) + private function writeCells(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter, \PhpOffice\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 = \PhpSpreadsheet\Cell::columnIndexFromString($cell->getColumn()) - 1; + $column = \PhpOffice\PhpSpreadsheet\Cell::columnIndexFromString($cell->getColumn()) - 1; $this->writeCellSpan($objWriter, $column, $prev_column); $objWriter->startElement('table:table-cell'); switch ($cell->getDataType()) { - case \PhpSpreadsheet\Cell\DataType::TYPE_BOOL: + case \PhpOffice\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 \PhpSpreadsheet\Cell\DataType::TYPE_ERROR: - throw new \PhpSpreadsheet\Writer\Exception('Writing of error not implemented yet.'); + case \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_ERROR: + throw new \PhpOffice\PhpSpreadsheet\Writer\Exception('Writing of error not implemented yet.'); break; - case \PhpSpreadsheet\Cell\DataType::TYPE_FORMULA: + case \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_FORMULA: try { $formula_value = $cell->getCalculatedValue(); } catch (Exception $e) { @@ -216,17 +216,17 @@ class Content extends WriterPart $objWriter->writeElement('text:p', $formula_value); break; - case \PhpSpreadsheet\Cell\DataType::TYPE_INLINE: - throw new \PhpSpreadsheet\Writer\Exception('Writing of inline not implemented yet.'); + case \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_INLINE: + throw new \PhpOffice\PhpSpreadsheet\Writer\Exception('Writing of inline not implemented yet.'); break; - case \PhpSpreadsheet\Cell\DataType::TYPE_NUMERIC: + case \PhpOffice\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 \PhpSpreadsheet\Cell\DataType::TYPE_STRING: + case \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING: $objWriter->writeAttribute('office:value-type', 'string'); $objWriter->writeElement('text:p', $cell->getValue()); break; @@ -251,11 +251,11 @@ class Content extends WriterPart /** * Write span * - * @param \PhpSpreadsheet\Shared\XMLWriter $objWriter + * @param \PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter * @param int $curColumn * @param int $prevColumn */ - private function writeCellSpan(\PhpSpreadsheet\Shared\XMLWriter $objWriter, $curColumn, $prevColumn) + private function writeCellSpan(\PhpOffice\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 44d7187a..c9a68253 100644 --- a/src/PhpSpreadsheet/Writer/OpenDocument/Meta.php +++ b/src/PhpSpreadsheet/Writer/OpenDocument/Meta.php @@ -1,6 +1,6 @@ getParentWriter()->getSpreadsheet(); @@ -41,9 +41,9 @@ class Meta extends WriterPart $objWriter = null; if ($this->getParentWriter()->getUseDiskCaching()) { - $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); + $objWriter = new \PhpOffice\PhpSpreadsheet\Shared\XMLWriter(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); } else { - $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_MEMORY); + $objWriter = new \PhpOffice\PhpSpreadsheet\Shared\XMLWriter(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter::STORAGE_MEMORY); } // XML header diff --git a/src/PhpSpreadsheet/Writer/OpenDocument/MetaInf.php b/src/PhpSpreadsheet/Writer/OpenDocument/MetaInf.php index 3054d13d..5924605e 100644 --- a/src/PhpSpreadsheet/Writer/OpenDocument/MetaInf.php +++ b/src/PhpSpreadsheet/Writer/OpenDocument/MetaInf.php @@ -1,6 +1,6 @@ getParentWriter()->getSpreadsheet(); @@ -41,9 +41,9 @@ class MetaInf extends WriterPart $objWriter = null; if ($this->getParentWriter()->getUseDiskCaching()) { - $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); + $objWriter = new \PhpOffice\PhpSpreadsheet\Shared\XMLWriter(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); } else { - $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_MEMORY); + $objWriter = new \PhpOffice\PhpSpreadsheet\Shared\XMLWriter(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter::STORAGE_MEMORY); } // XML header diff --git a/src/PhpSpreadsheet/Writer/OpenDocument/Mimetype.php b/src/PhpSpreadsheet/Writer/OpenDocument/Mimetype.php index 1eddda63..33a722c9 100644 --- a/src/PhpSpreadsheet/Writer/OpenDocument/Mimetype.php +++ b/src/PhpSpreadsheet/Writer/OpenDocument/Mimetype.php @@ -1,6 +1,6 @@ getParentWriter()->getSpreadsheet(); @@ -41,9 +41,9 @@ class Settings extends WriterPart $objWriter = null; if ($this->getParentWriter()->getUseDiskCaching()) { - $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); + $objWriter = new \PhpOffice\PhpSpreadsheet\Shared\XMLWriter(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); } else { - $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_MEMORY); + $objWriter = new \PhpOffice\PhpSpreadsheet\Shared\XMLWriter(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter::STORAGE_MEMORY); } // XML header diff --git a/src/PhpSpreadsheet/Writer/OpenDocument/Styles.php b/src/PhpSpreadsheet/Writer/OpenDocument/Styles.php index d18746a8..cadf27cc 100644 --- a/src/PhpSpreadsheet/Writer/OpenDocument/Styles.php +++ b/src/PhpSpreadsheet/Writer/OpenDocument/Styles.php @@ -1,6 +1,6 @@ getParentWriter()->getSpreadsheet(); @@ -41,9 +41,9 @@ class Styles extends WriterPart $objWriter = null; if ($this->getParentWriter()->getUseDiskCaching()) { - $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); + $objWriter = new \PhpOffice\PhpSpreadsheet\Shared\XMLWriter(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); } else { - $objWriter = new \PhpSpreadsheet\Shared\XMLWriter(\PhpSpreadsheet\Shared\XMLWriter::STORAGE_MEMORY); + $objWriter = new \PhpOffice\PhpSpreadsheet\Shared\XMLWriter(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter::STORAGE_MEMORY); } // XML header diff --git a/src/PhpSpreadsheet/Writer/OpenDocument/Thumbnails.php b/src/PhpSpreadsheet/Writer/OpenDocument/Thumbnails.php index f92b2808..5648d9b3 100644 --- a/src/PhpSpreadsheet/Writer/OpenDocument/Thumbnails.php +++ b/src/PhpSpreadsheet/Writer/OpenDocument/Thumbnails.php @@ -1,6 +1,6 @@ renderer = new $rendererName($spreadsheet); } diff --git a/src/PhpSpreadsheet/Writer/PDF/Core.php b/src/PhpSpreadsheet/Writer/PDF/Core.php index e983f595..8e20c3ff 100644 --- a/src/PhpSpreadsheet/Writer/PDF/Core.php +++ b/src/PhpSpreadsheet/Writer/PDF/Core.php @@ -1,6 +1,6 @@ 'LETTER', // (8.5 in. by 11 in.) - \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_LETTER_SMALL => 'LETTER', // (8.5 in. by 11 in.) - \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_TABLOID => [792.00, 1224.00], // (11 in. by 17 in.) - \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_LEDGER => [1224.00, 792.00], // (17 in. by 11 in.) - \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_LEGAL => 'LEGAL', // (8.5 in. by 14 in.) - \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_STATEMENT => [396.00, 612.00], // (5.5 in. by 8.5 in.) - \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_EXECUTIVE => 'EXECUTIVE', // (7.25 in. by 10.5 in.) - \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_A3 => 'A3', // (297 mm by 420 mm) - \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_A4 => 'A4', // (210 mm by 297 mm) - \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_A4_SMALL => 'A4', // (210 mm by 297 mm) - \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_A5 => 'A5', // (148 mm by 210 mm) - \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_B4 => 'B4', // (250 mm by 353 mm) - \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_B5 => 'B5', // (176 mm by 250 mm) - \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_FOLIO => 'FOLIO', // (8.5 in. by 13 in.) - \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_QUARTO => [609.45, 779.53], // (215 mm by 275 mm) - \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_STANDARD_1 => [720.00, 1008.00], // (10 in. by 14 in.) - \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_STANDARD_2 => [792.00, 1224.00], // (11 in. by 17 in.) - \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_NOTE => 'LETTER', // (8.5 in. by 11 in.) - \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_NO9_ENVELOPE => [279.00, 639.00], // (3.875 in. by 8.875 in.) - \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_NO10_ENVELOPE => [297.00, 684.00], // (4.125 in. by 9.5 in.) - \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_NO11_ENVELOPE => [324.00, 747.00], // (4.5 in. by 10.375 in.) - \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_NO12_ENVELOPE => [342.00, 792.00], // (4.75 in. by 11 in.) - \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_NO14_ENVELOPE => [360.00, 828.00], // (5 in. by 11.5 in.) - \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_C => [1224.00, 1584.00], // (17 in. by 22 in.) - \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_D => [1584.00, 2448.00], // (22 in. by 34 in.) - \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_E => [2448.00, 3168.00], // (34 in. by 44 in.) - \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_DL_ENVELOPE => [311.81, 623.62], // (110 mm by 220 mm) - \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_C5_ENVELOPE => 'C5', // (162 mm by 229 mm) - \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_C3_ENVELOPE => 'C3', // (324 mm by 458 mm) - \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_C4_ENVELOPE => 'C4', // (229 mm by 324 mm) - \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_C6_ENVELOPE => 'C6', // (114 mm by 162 mm) - \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_C65_ENVELOPE => [323.15, 649.13], // (114 mm by 229 mm) - \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_B4_ENVELOPE => 'B4', // (250 mm by 353 mm) - \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_B5_ENVELOPE => 'B5', // (176 mm by 250 mm) - \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_B6_ENVELOPE => [498.90, 354.33], // (176 mm by 125 mm) - \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_ITALY_ENVELOPE => [311.81, 651.97], // (110 mm by 230 mm) - \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_MONARCH_ENVELOPE => [279.00, 540.00], // (3.875 in. by 7.5 in.) - \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_6_3_4_ENVELOPE => [261.00, 468.00], // (3.625 in. by 6.5 in.) - \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_US_STANDARD_FANFOLD => [1071.00, 792.00], // (14.875 in. by 11 in.) - \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_GERMAN_STANDARD_FANFOLD => [612.00, 864.00], // (8.5 in. by 12 in.) - \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_GERMAN_LEGAL_FANFOLD => 'FOLIO', // (8.5 in. by 13 in.) - \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_ISO_B4 => 'B4', // (250 mm by 353 mm) - \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_JAPANESE_DOUBLE_POSTCARD => [566.93, 419.53], // (200 mm by 148 mm) - \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_STANDARD_PAPER_1 => [648.00, 792.00], // (9 in. by 11 in.) - \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_STANDARD_PAPER_2 => [720.00, 792.00], // (10 in. by 11 in.) - \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_STANDARD_PAPER_3 => [1080.00, 792.00], // (15 in. by 11 in.) - \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_INVITE_ENVELOPE => [623.62, 623.62], // (220 mm by 220 mm) - \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_LETTER_EXTRA_PAPER => [667.80, 864.00], // (9.275 in. by 12 in.) - \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_LEGAL_EXTRA_PAPER => [667.80, 1080.00], // (9.275 in. by 15 in.) - \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_TABLOID_EXTRA_PAPER => [841.68, 1296.00], // (11.69 in. by 18 in.) - \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_A4_EXTRA_PAPER => [668.98, 912.76], // (236 mm by 322 mm) - \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_LETTER_TRANSVERSE_PAPER => [595.80, 792.00], // (8.275 in. by 11 in.) - \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_A4_TRANSVERSE_PAPER => 'A4', // (210 mm by 297 mm) - \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_LETTER_EXTRA_TRANSVERSE_PAPER => [667.80, 864.00], // (9.275 in. by 12 in.) - \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_SUPERA_SUPERA_A4_PAPER => [643.46, 1009.13], // (227 mm by 356 mm) - \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_SUPERB_SUPERB_A3_PAPER => [864.57, 1380.47], // (305 mm by 487 mm) - \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_LETTER_PLUS_PAPER => [612.00, 913.68], // (8.5 in. by 12.69 in.) - \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_A4_PLUS_PAPER => [595.28, 935.43], // (210 mm by 330 mm) - \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_A5_TRANSVERSE_PAPER => 'A5', // (148 mm by 210 mm) - \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_JIS_B5_TRANSVERSE_PAPER => [515.91, 728.50], // (182 mm by 257 mm) - \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_A3_EXTRA_PAPER => [912.76, 1261.42], // (322 mm by 445 mm) - \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_A5_EXTRA_PAPER => [493.23, 666.14], // (174 mm by 235 mm) - \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_ISO_B5_EXTRA_PAPER => [569.76, 782.36], // (201 mm by 276 mm) - \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_A2_PAPER => 'A2', // (420 mm by 594 mm) - \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_A3_TRANSVERSE_PAPER => 'A3', // (297 mm by 420 mm) - \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_A3_EXTRA_TRANSVERSE_PAPER => [912.76, 1261.42], // (322 mm by 445 mm) + \PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_LETTER => 'LETTER', // (8.5 in. by 11 in.) + \PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_LETTER_SMALL => 'LETTER', // (8.5 in. by 11 in.) + \PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_TABLOID => [792.00, 1224.00], // (11 in. by 17 in.) + \PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_LEDGER => [1224.00, 792.00], // (17 in. by 11 in.) + \PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_LEGAL => 'LEGAL', // (8.5 in. by 14 in.) + \PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_STATEMENT => [396.00, 612.00], // (5.5 in. by 8.5 in.) + \PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_EXECUTIVE => 'EXECUTIVE', // (7.25 in. by 10.5 in.) + \PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_A3 => 'A3', // (297 mm by 420 mm) + \PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_A4 => 'A4', // (210 mm by 297 mm) + \PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_A4_SMALL => 'A4', // (210 mm by 297 mm) + \PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_A5 => 'A5', // (148 mm by 210 mm) + \PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_B4 => 'B4', // (250 mm by 353 mm) + \PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_B5 => 'B5', // (176 mm by 250 mm) + \PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_FOLIO => 'FOLIO', // (8.5 in. by 13 in.) + \PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_QUARTO => [609.45, 779.53], // (215 mm by 275 mm) + \PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_STANDARD_1 => [720.00, 1008.00], // (10 in. by 14 in.) + \PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_STANDARD_2 => [792.00, 1224.00], // (11 in. by 17 in.) + \PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_NOTE => 'LETTER', // (8.5 in. by 11 in.) + \PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_NO9_ENVELOPE => [279.00, 639.00], // (3.875 in. by 8.875 in.) + \PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_NO10_ENVELOPE => [297.00, 684.00], // (4.125 in. by 9.5 in.) + \PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_NO11_ENVELOPE => [324.00, 747.00], // (4.5 in. by 10.375 in.) + \PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_NO12_ENVELOPE => [342.00, 792.00], // (4.75 in. by 11 in.) + \PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_NO14_ENVELOPE => [360.00, 828.00], // (5 in. by 11.5 in.) + \PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_C => [1224.00, 1584.00], // (17 in. by 22 in.) + \PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_D => [1584.00, 2448.00], // (22 in. by 34 in.) + \PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_E => [2448.00, 3168.00], // (34 in. by 44 in.) + \PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_DL_ENVELOPE => [311.81, 623.62], // (110 mm by 220 mm) + \PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_C5_ENVELOPE => 'C5', // (162 mm by 229 mm) + \PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_C3_ENVELOPE => 'C3', // (324 mm by 458 mm) + \PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_C4_ENVELOPE => 'C4', // (229 mm by 324 mm) + \PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_C6_ENVELOPE => 'C6', // (114 mm by 162 mm) + \PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_C65_ENVELOPE => [323.15, 649.13], // (114 mm by 229 mm) + \PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_B4_ENVELOPE => 'B4', // (250 mm by 353 mm) + \PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_B5_ENVELOPE => 'B5', // (176 mm by 250 mm) + \PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_B6_ENVELOPE => [498.90, 354.33], // (176 mm by 125 mm) + \PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_ITALY_ENVELOPE => [311.81, 651.97], // (110 mm by 230 mm) + \PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_MONARCH_ENVELOPE => [279.00, 540.00], // (3.875 in. by 7.5 in.) + \PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_6_3_4_ENVELOPE => [261.00, 468.00], // (3.625 in. by 6.5 in.) + \PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_US_STANDARD_FANFOLD => [1071.00, 792.00], // (14.875 in. by 11 in.) + \PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_GERMAN_STANDARD_FANFOLD => [612.00, 864.00], // (8.5 in. by 12 in.) + \PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_GERMAN_LEGAL_FANFOLD => 'FOLIO', // (8.5 in. by 13 in.) + \PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_ISO_B4 => 'B4', // (250 mm by 353 mm) + \PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_JAPANESE_DOUBLE_POSTCARD => [566.93, 419.53], // (200 mm by 148 mm) + \PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_STANDARD_PAPER_1 => [648.00, 792.00], // (9 in. by 11 in.) + \PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_STANDARD_PAPER_2 => [720.00, 792.00], // (10 in. by 11 in.) + \PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_STANDARD_PAPER_3 => [1080.00, 792.00], // (15 in. by 11 in.) + \PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_INVITE_ENVELOPE => [623.62, 623.62], // (220 mm by 220 mm) + \PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_LETTER_EXTRA_PAPER => [667.80, 864.00], // (9.275 in. by 12 in.) + \PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_LEGAL_EXTRA_PAPER => [667.80, 1080.00], // (9.275 in. by 15 in.) + \PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_TABLOID_EXTRA_PAPER => [841.68, 1296.00], // (11.69 in. by 18 in.) + \PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_A4_EXTRA_PAPER => [668.98, 912.76], // (236 mm by 322 mm) + \PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_LETTER_TRANSVERSE_PAPER => [595.80, 792.00], // (8.275 in. by 11 in.) + \PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_A4_TRANSVERSE_PAPER => 'A4', // (210 mm by 297 mm) + \PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_LETTER_EXTRA_TRANSVERSE_PAPER => [667.80, 864.00], // (9.275 in. by 12 in.) + \PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_SUPERA_SUPERA_A4_PAPER => [643.46, 1009.13], // (227 mm by 356 mm) + \PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_SUPERB_SUPERB_A3_PAPER => [864.57, 1380.47], // (305 mm by 487 mm) + \PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_LETTER_PLUS_PAPER => [612.00, 913.68], // (8.5 in. by 12.69 in.) + \PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_A4_PLUS_PAPER => [595.28, 935.43], // (210 mm by 330 mm) + \PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_A5_TRANSVERSE_PAPER => 'A5', // (148 mm by 210 mm) + \PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_JIS_B5_TRANSVERSE_PAPER => [515.91, 728.50], // (182 mm by 257 mm) + \PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_A3_EXTRA_PAPER => [912.76, 1261.42], // (322 mm by 445 mm) + \PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_A5_EXTRA_PAPER => [493.23, 666.14], // (174 mm by 235 mm) + \PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_ISO_B5_EXTRA_PAPER => [569.76, 782.36], // (201 mm by 276 mm) + \PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_A2_PAPER => 'A2', // (420 mm by 594 mm) + \PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_A3_TRANSVERSE_PAPER => 'A3', // (297 mm by 420 mm) + \PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_A3_EXTRA_TRANSVERSE_PAPER => [912.76, 1261.42], // (322 mm by 445 mm) ]; /** * Create a new PDF Writer instance * - * @param \PhpSpreadsheet\Spreadsheet $spreadsheet Spreadsheet object + * @param \PhpOffice\PhpSpreadsheet\Spreadsheet $spreadsheet Spreadsheet object */ - public function __construct(\PhpSpreadsheet\Spreadsheet $spreadsheet) + public function __construct(\PhpOffice\PhpSpreadsheet\Spreadsheet $spreadsheet) { parent::__construct($spreadsheet); $this->setUseInlineCss(true); - $this->tempDir = \PhpSpreadsheet\Shared\File::sysGetTempDir(); + $this->tempDir = \PhpOffice\PhpSpreadsheet\Shared\File::sysGetTempDir(); } /** @@ -189,7 +189,7 @@ abstract class Core extends \PhpSpreadsheet\Writer\HTML * @param string $pValue Paper size * @return self */ - public function setPaperSize($pValue = \PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_LETTER) + public function setPaperSize($pValue = \PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_LETTER) { $this->paperSize = $pValue; @@ -212,7 +212,7 @@ abstract class Core extends \PhpSpreadsheet\Writer\HTML * @param string $pValue Page orientation * @return self */ - public function setOrientation($pValue = \PhpSpreadsheet\Worksheet\PageSetup::ORIENTATION_DEFAULT) + public function setOrientation($pValue = \PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::ORIENTATION_DEFAULT) { $this->orientation = $pValue; @@ -233,7 +233,7 @@ abstract class Core extends \PhpSpreadsheet\Writer\HTML * Set temporary storage directory * * @param string $pValue Temporary storage directory - * @throws \PhpSpreadsheet\Writer\Exception when directory does not exist + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception when directory does not exist * @return self */ public function setTempDir($pValue = '') @@ -241,7 +241,7 @@ abstract class Core extends \PhpSpreadsheet\Writer\HTML if (is_dir($pValue)) { $this->tempDir = $pValue; } else { - throw new \PhpSpreadsheet\Writer\Exception("Directory does not exist: $pValue"); + throw new \PhpOffice\PhpSpreadsheet\Writer\Exception("Directory does not exist: $pValue"); } return $this; @@ -251,20 +251,20 @@ abstract class Core extends \PhpSpreadsheet\Writer\HTML * Save Spreadsheet to PDF file, pre-save * * @param string $pFilename Name of the file to save as - * @throws \PhpSpreadsheet\Writer\Exception + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception */ protected function prepareForSave($pFilename = null) { // garbage collect $this->spreadsheet->garbageCollect(); - $this->saveArrayReturnType = \PhpSpreadsheet\Calculation::getArrayReturnType(); - \PhpSpreadsheet\Calculation::setArrayReturnType(\PhpSpreadsheet\Calculation::RETURN_ARRAY_AS_VALUE); + $this->saveArrayReturnType = \PhpOffice\PhpSpreadsheet\Calculation::getArrayReturnType(); + \PhpOffice\PhpSpreadsheet\Calculation::setArrayReturnType(\PhpOffice\PhpSpreadsheet\Calculation::RETURN_ARRAY_AS_VALUE); // Open file $fileHandle = fopen($pFilename, 'w'); if ($fileHandle === false) { - throw new \PhpSpreadsheet\Writer\Exception("Could not open file $pFilename for writing."); + throw new \PhpOffice\PhpSpreadsheet\Writer\Exception("Could not open file $pFilename for writing."); } // Set PDF @@ -279,13 +279,13 @@ abstract class Core extends \PhpSpreadsheet\Writer\HTML * Save PhpSpreadsheet to PDF file, post-save * * @param resource $fileHandle - * @throws \PhpSpreadsheet\Writer\Exception + * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception */ protected function restoreStateAfterSave($fileHandle) { // Close file fclose($fileHandle); - \PhpSpreadsheet\Calculation::setArrayReturnType($this->saveArrayReturnType); + \PhpOffice\PhpSpreadsheet\Calculation::setArrayReturnType($this->saveArrayReturnType); } } diff --git a/src/PhpSpreadsheet/Writer/PDF/DomPDF.php b/src/PhpSpreadsheet/Writer/PDF/DomPDF.php index 23c03b76..4fdfabda 100644 --- a/src/PhpSpreadsheet/Writer/PDF/DomPDF.php +++ b/src/PhpSpreadsheet/Writer/PDF/DomPDF.php @@ -1,13 +1,13 @@ getSheetIndex())) { $orientation = ($this->spreadsheet->getSheet(0)->getPageSetup()->getOrientation() - == \PhpSpreadsheet\Worksheet\PageSetup::ORIENTATION_LANDSCAPE) ? 'L' : 'P'; + == \PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::ORIENTATION_LANDSCAPE) ? 'L' : 'P'; $printPaperSize = $this->spreadsheet->getSheet(0)->getPageSetup()->getPaperSize(); $printMargins = $this->spreadsheet->getSheet(0)->getPageMargins(); } else { $orientation = ($this->spreadsheet->getSheet($this->getSheetIndex())->getPageSetup()->getOrientation() - == \PhpSpreadsheet\Worksheet\PageSetup::ORIENTATION_LANDSCAPE) ? 'L' : 'P'; + == \PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::ORIENTATION_LANDSCAPE) ? 'L' : 'P'; $printPaperSize = $this->spreadsheet->getSheet($this->getSheetIndex())->getPageSetup()->getPaperSize(); $printMargins = $this->spreadsheet->getSheet($this->getSheetIndex())->getPageMargins(); } @@ -74,8 +74,8 @@ class DomPDF extends Core implements \PhpSpreadsheet\Writer\IWriter // Override Page Orientation if (!is_null($this->getOrientation())) { - $orientation = ($this->getOrientation() == \PhpSpreadsheet\Worksheet\PageSetup::ORIENTATION_DEFAULT) - ? \PhpSpreadsheet\Worksheet\PageSetup::ORIENTATION_PORTRAIT + $orientation = ($this->getOrientation() == \PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::ORIENTATION_DEFAULT) + ? \PhpOffice\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 a7fbd337..38b63cc0 100644 --- a/src/PhpSpreadsheet/Writer/PDF/MPDF.php +++ b/src/PhpSpreadsheet/Writer/PDF/MPDF.php @@ -1,13 +1,13 @@ getSheetIndex())) { $orientation = ($this->spreadsheet->getSheet(0)->getPageSetup()->getOrientation() - == \PhpSpreadsheet\Worksheet\PageSetup::ORIENTATION_LANDSCAPE) ? 'L' : 'P'; + == \PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::ORIENTATION_LANDSCAPE) ? 'L' : 'P'; $printPaperSize = $this->spreadsheet->getSheet(0)->getPageSetup()->getPaperSize(); $printMargins = $this->spreadsheet->getSheet(0)->getPageMargins(); } else { $orientation = ($this->spreadsheet->getSheet($this->getSheetIndex())->getPageSetup()->getOrientation() - == \PhpSpreadsheet\Worksheet\PageSetup::ORIENTATION_LANDSCAPE) ? 'L' : 'P'; + == \PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::ORIENTATION_LANDSCAPE) ? 'L' : 'P'; $printPaperSize = $this->spreadsheet->getSheet($this->getSheetIndex())->getPageSetup()->getPaperSize(); $printMargins = $this->spreadsheet->getSheet($this->getSheetIndex())->getPageMargins(); } @@ -73,8 +73,8 @@ class MPDF extends Core implements \PhpSpreadsheet\Writer\IWriter // Override Page Orientation if (!is_null($this->getOrientation())) { - $orientation = ($this->getOrientation() == \PhpSpreadsheet\Worksheet\PageSetup::ORIENTATION_DEFAULT) - ? \PhpSpreadsheet\Worksheet\PageSetup::ORIENTATION_PORTRAIT + $orientation = ($this->getOrientation() == \PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::ORIENTATION_DEFAULT) + ? \PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::ORIENTATION_PORTRAIT : $this->getOrientation(); } $orientation = strtoupper($orientation); diff --git a/src/PhpSpreadsheet/Writer/PDF/TcPDF.php b/src/PhpSpreadsheet/Writer/PDF/TcPDF.php index 84cf48f0..d3ea95f3 100644 --- a/src/PhpSpreadsheet/Writer/PDF/TcPDF.php +++ b/src/PhpSpreadsheet/Writer/PDF/TcPDF.php @@ -1,14 +1,14 @@ getSheetIndex())) { $orientation = ($this->spreadsheet->getSheet(0)->getPageSetup()->getOrientation() - == \PhpSpreadsheet\Worksheet\PageSetup::ORIENTATION_LANDSCAPE) ? 'L' : 'P'; + == \PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::ORIENTATION_LANDSCAPE) ? 'L' : 'P'; $printPaperSize = $this->spreadsheet->getSheet(0)->getPageSetup()->getPaperSize(); $printMargins = $this->spreadsheet->getSheet(0)->getPageMargins(); } else { $orientation = ($this->spreadsheet->getSheet($this->getSheetIndex())->getPageSetup()->getOrientation() - == \PhpSpreadsheet\Worksheet\PageSetup::ORIENTATION_LANDSCAPE) ? 'L' : 'P'; + == \PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::ORIENTATION_LANDSCAPE) ? 'L' : 'P'; $printPaperSize = $this->spreadsheet->getSheet($this->getSheetIndex())->getPageSetup()->getPaperSize(); $printMargins = $this->spreadsheet->getSheet($this->getSheetIndex())->getPageMargins(); } // Override Page Orientation if (!is_null($this->getOrientation())) { - $orientation = ($this->getOrientation() == \PhpSpreadsheet\Worksheet\PageSetup::ORIENTATION_LANDSCAPE) + $orientation = ($this->getOrientation() == \PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::ORIENTATION_LANDSCAPE) ? 'L' : 'P'; } diff --git a/tests/PhpSpreadsheetTests/Calculation/DateTimeTest.php b/tests/PhpSpreadsheetTests/Calculation/DateTimeTest.php index 6c72d6f8..a7e8c3c8 100644 --- a/tests/PhpSpreadsheetTests/Calculation/DateTimeTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/DateTimeTest.php @@ -1,10 +1,10 @@ complexAssert = new \PhpSpreadsheetTests\Custom\ComplexAssert(); + $this->complexAssert = new \PhpOffice\PhpSpreadsheetTests\Custom\ComplexAssert(); Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } diff --git a/tests/PhpSpreadsheetTests/Calculation/FinancialTest.php b/tests/PhpSpreadsheetTests/Calculation/FinancialTest.php index 48c49b60..3390b1e1 100644 --- a/tests/PhpSpreadsheetTests/Calculation/FinancialTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/FinancialTest.php @@ -1,9 +1,9 @@ getSamples() as $name => $sample) { if (!in_array($name, $skipped)) { diff --git a/tests/PhpSpreadsheetTests/SettingsTest.php b/tests/PhpSpreadsheetTests/SettingsTest.php index 4712f206..c35c63d4 100644 --- a/tests/PhpSpreadsheetTests/SettingsTest.php +++ b/tests/PhpSpreadsheetTests/SettingsTest.php @@ -1,6 +1,6 @@ assertTrue((bool) ((LIBXML_DTDLOAD | LIBXML_DTDATTR) & $result)); } @@ -20,8 +20,8 @@ class SettingsTest extends \PHPUnit_Framework_TestCase */ public function testSetXMLSettings() { - call_user_func_array([\PhpSpreadsheet\Settings::class, 'setLibXmlLoaderOptions'], [LIBXML_DTDLOAD | LIBXML_DTDATTR | LIBXML_DTDVALID]); - $result = \PhpSpreadsheet\Settings::getLibXmlLoaderOptions(); + call_user_func_array([\PhpOffice\PhpSpreadsheet\Settings::class, 'setLibXmlLoaderOptions'], [LIBXML_DTDLOAD | LIBXML_DTDATTR | LIBXML_DTDVALID]); + $result = \PhpOffice\PhpSpreadsheet\Settings::getLibXmlLoaderOptions(); $this->assertTrue((bool) ((LIBXML_DTDLOAD | LIBXML_DTDATTR | LIBXML_DTDVALID) & $result)); } } diff --git a/tests/PhpSpreadsheetTests/Shared/CodePageTest.php b/tests/PhpSpreadsheetTests/Shared/CodePageTest.php index 7376a97c..7598e655 100644 --- a/tests/PhpSpreadsheetTests/Shared/CodePageTest.php +++ b/tests/PhpSpreadsheetTests/Shared/CodePageTest.php @@ -1,9 +1,9 @@ assertInstanceOf(AutoFilter::class, $result); $result = $this->testAutoFilterObject->getColumns(); - // Result should be an array of \PhpSpreadsheet\Worksheet\AutoFilter\Column + // Result should be an array of \PhpOffice\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 \PhpSpreadsheet\Exception + * @expectedException \PhpOffice\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 \PhpSpreadsheet\Worksheet\AutoFilter\Column + // Result should be an array of \PhpOffice\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 \PhpSpreadsheet\Exception + * @expectedException \PhpOffice\PhpSpreadsheet\Exception */ public function testSetInvalidColumnWithObject() { @@ -198,7 +198,7 @@ class AutoFilterTest extends \PHPUnit_Framework_TestCase } /** - * @expectedException \PhpSpreadsheet\Exception + * @expectedException \PhpOffice\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 \PhpSpreadsheet\Worksheet\AutoFilter\Column + // Result should be an array of \PhpOffice\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 \PhpSpreadsheet\Worksheet\AutoFilter\Column object returned + // get a \PhpOffice\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 \PhpSpreadsheet\Worksheet\AutoFilter\Column object returned + // get a \PhpOffice\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 \PhpSpreadsheet\Worksheet\AutoFilter\Column object returned + // get a \PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column object returned $result = $this->testAutoFilterObject->getColumn('K'); $this->assertInstanceOf(Column::class, $result); } /** - * @expectedException \PhpSpreadsheet\Exception + * @expectedException \PhpOffice\PhpSpreadsheet\Exception */ public function testGetColumnWithoutRangeSet() { diff --git a/tests/PhpSpreadsheetTests/Worksheet/CellCollectionTest.php b/tests/PhpSpreadsheetTests/Worksheet/CellCollectionTest.php index 935533f2..164c0ea8 100644 --- a/tests/PhpSpreadsheetTests/Worksheet/CellCollectionTest.php +++ b/tests/PhpSpreadsheetTests/Worksheet/CellCollectionTest.php @@ -1,9 +1,9 @@