diff --git a/src/PhpSpreadsheet/Calculation/Categories.php b/src/PhpSpreadsheet/Calculation/Categories.php index 4ecc609c..8f3ba238 100644 --- a/src/PhpSpreadsheet/Calculation/Categories.php +++ b/src/PhpSpreadsheet/Calculation/Categories.php @@ -125,21 +125,21 @@ class Categories } /** - * Get PhpSpreadsheet function name + * Get Spreadsheet function name * * @return string */ - public function getPhpSpreadsheetName() + public function getSpreadsheetName() { return $this->spreadsheetName; } /** - * Set PhpSpreadsheet function name + * Set Spreadsheet function name * * @param string $value */ - public function setPhpSpreadsheetName($value) + public function setSpreadsheetName($value) { $this->spreadsheetName = $value; } diff --git a/src/PhpSpreadsheet/Reader/Excel2003XML.php b/src/PhpSpreadsheet/Reader/Excel2003XML.php index b313cf5e..761b751d 100644 --- a/src/PhpSpreadsheet/Reader/Excel2003XML.php +++ b/src/PhpSpreadsheet/Reader/Excel2003XML.php @@ -2,6 +2,8 @@ namespace PhpSpreadsheet\Reader; +use PhpSpreadsheet\Spreadsheet; + /** * Copyright (c) 2006 - 2016 PhpSpreadsheet * @@ -100,7 +102,7 @@ class Excel2003XML extends BaseReader implements IReader } /** - * Reads names of the worksheets from a file, without parsing the whole file to a PhpSpreadsheet object + * Reads names of the worksheets from a file, without parsing the whole file to a Spreadsheet object * * @param string $pFilename * @throws Exception @@ -208,7 +210,7 @@ class Excel2003XML extends BaseReader implements IReader } /** - * Loads PhpSpreadsheet from file + * Loads Spreadsheet from file * * @param string $pFilename * @throws Exception @@ -216,8 +218,8 @@ class Excel2003XML extends BaseReader implements IReader */ public function load($pFilename) { - // Create new PhpSpreadsheet - $spreadsheet = new PhpSpreadsheet(); + // Create new Spreadsheet + $spreadsheet = new Spreadsheet(); $spreadsheet->removeSheetByIndex(0); // Load into this instance @@ -273,7 +275,7 @@ class Excel2003XML extends BaseReader implements IReader } /** - * Loads PhpSpreadsheet from file into PhpSpreadsheet instance + * Loads from file into Spreadsheet instance * * @param string $pFilename * @param \PhpSpreadsheet\Spreadsheet $spreadsheet @@ -371,7 +373,7 @@ class Excel2003XML extends BaseReader implements IReader if (isset($xml->CustomDocumentProperties)) { foreach ($xml->CustomDocumentProperties[0] as $propertyName => $propertyValue) { $propertyAttributes = $propertyValue->attributes($namespaces['dt']); - $propertyName = preg_replace_callback('/_x([0-9a-z]{4})_/', '\\PhpSpreadsheet\\Reader\\Excel2003XML::hex2str', $propertyName); + $propertyName = preg_replace_callback('/_x([0-9a-z]{4})_/', ['self', 'hex2str'], $propertyName); $propertyType = \PhpSpreadsheet\Document\Properties::PROPERTY_TYPE_UNKNOWN; switch ((string) $propertyAttributes) { case 'string': diff --git a/src/PhpSpreadsheet/Reader/Gnumeric.php b/src/PhpSpreadsheet/Reader/Gnumeric.php index 08591480..246b655f 100644 --- a/src/PhpSpreadsheet/Reader/Gnumeric.php +++ b/src/PhpSpreadsheet/Reader/Gnumeric.php @@ -2,6 +2,8 @@ namespace PhpSpreadsheet\Reader; +use PhpSpreadsheet\Spreadsheet; + /** * Copyright (c) 2006 - 2016 PhpSpreadsheet * @@ -83,7 +85,7 @@ class Gnumeric extends BaseReader implements IReader } /** - * Reads names of the worksheets from a file, without parsing the whole file to a PhpSpreadsheet object + * Reads names of the worksheets from a file, without parsing the whole file to a Spreadsheet object * * @param string $pFilename * @throws Exception @@ -178,30 +180,30 @@ class Gnumeric extends BaseReader implements IReader } /** - * Loads PhpSpreadsheet from file + * Loads Spreadsheet from file * * @param string $pFilename * @throws Exception - * @return PhpSpreadsheet + * @return Spreadsheet */ public function load($pFilename) { - // Create new PhpSpreadsheet - $spreadsheet = new PhpSpreadsheet(); + // Create new Spreadsheet + $spreadsheet = new Spreadsheet(); // Load into this instance return $this->loadIntoExisting($pFilename, $spreadsheet); } /** - * Loads PhpSpreadsheet from file into PhpSpreadsheet instance + * Loads from file into Spreadsheet instance * * @param string $pFilename - * @param \PhpSpreadsheet\Spreadsheet $spreadsheet + * @param Spreadsheet $spreadsheet * @throws Exception * @return PhpSpreadsheet */ - public function loadIntoExisting($pFilename, \PhpSpreadsheet\Spreadsheet $spreadsheet) + public function loadIntoExisting($pFilename, Spreadsheet $spreadsheet) { // Check if file exists if (!file_exists($pFilename)) { diff --git a/src/PhpSpreadsheet/Writer/Excel2007.php b/src/PhpSpreadsheet/Writer/Excel2007.php index 6e178bbd..be64d163 100644 --- a/src/PhpSpreadsheet/Writer/Excel2007.php +++ b/src/PhpSpreadsheet/Writer/Excel2007.php @@ -2,6 +2,8 @@ namespace PhpSpreadsheet\Writer; +use PhpSpreadsheet\Spreadsheet; + /** * PhpSpreadsheet\Writer\Excel2007 * @@ -113,7 +115,7 @@ class Excel2007 extends BaseWriter implements IWriter public function __construct(\PhpSpreadsheet\Spreadsheet $spreadsheet = null) { // Assign PhpSpreadsheet - $this->setPhpSpreadsheet($spreadsheet); + $this->setSpreadsheet($spreadsheet); $writerPartsArray = [ 'stringtable' => '\\PhpSpreadsheet\\Writer\\Excel2007\\StringTable', @@ -397,28 +399,28 @@ class Excel2007 extends BaseWriter implements IWriter } /** - * Get PhpSpreadsheet object + * Get Spreadsheet object * * @throws \PhpSpreadsheet\Writer\Exception - * @return PhpSpreadsheet + * @return Spreadsheet */ - public function getPhpSpreadsheet() + public function getSpreadsheet() { if ($this->spreadSheet !== null) { return $this->spreadSheet; } else { - throw new \PhpSpreadsheet\Writer\Exception('No PhpSpreadsheet object assigned.'); + throw new \PhpSpreadsheet\Writer\Exception('No Spreadsheet object assigned.'); } } /** - * Set PhpSpreadsheet object + * Set Spreadsheet object * * @param \PhpSpreadsheet\Spreadsheet $spreadsheet PhpSpreadsheet object * @throws Exception * @return Excel2007 */ - public function setPhpSpreadsheet(\PhpSpreadsheet\Spreadsheet $spreadsheet = null) + public function setSpreadsheet(Spreadsheet $spreadsheet = null) { $this->spreadSheet = $spreadsheet; diff --git a/src/PhpSpreadsheet/Writer/Excel2007/Worksheet.php b/src/PhpSpreadsheet/Writer/Excel2007/Worksheet.php index 62f276d9..ea886c21 100644 --- a/src/PhpSpreadsheet/Writer/Excel2007/Worksheet.php +++ b/src/PhpSpreadsheet/Writer/Excel2007/Worksheet.php @@ -211,7 +211,7 @@ class Worksheet extends WriterPart // Sheet selected? $sheetSelected = false; - if ($this->getParentWriter()->getPhpSpreadsheet()->getIndex($pSheet) == $this->getParentWriter()->getPhpSpreadsheet()->getActiveSheetIndex()) { + if ($this->getParentWriter()->getSpreadsheet()->getIndex($pSheet) == $this->getParentWriter()->getSpreadsheet()->getActiveSheetIndex()) { $sheetSelected = true; } diff --git a/src/PhpSpreadsheet/Writer/HTML.php b/src/PhpSpreadsheet/Writer/HTML.php index 0a027c71..5325d58d 100644 --- a/src/PhpSpreadsheet/Writer/HTML.php +++ b/src/PhpSpreadsheet/Writer/HTML.php @@ -1,6 +1,6 @@ setPhpSpreadsheet($spreadsheet); + $this->setSpreadsheet($spreadsheet); $writerPartsArray = [ 'content' => \PhpSpreadsheet\Writer\OpenDocument\Content::class, @@ -160,12 +162,12 @@ class OpenDocument extends BaseWriter implements IWriter } /** - * Get PhpSpreadsheet object + * Get Spreadsheet object * * @throws \PhpSpreadsheet\Writer\Exception - * @return PhpSpreadsheet + * @return Spreadsheet */ - public function getPhpSpreadsheet() + public function getSpreadsheet() { if ($this->spreadSheet !== null) { return $this->spreadSheet; @@ -181,7 +183,7 @@ class OpenDocument extends BaseWriter implements IWriter * @throws \PhpSpreadsheet\Writer\Exception * @return Excel2007 */ - public function setPhpSpreadsheet(\PhpSpreadsheet\SpreadSheet $spreadsheet = null) + public function setSpreadsheet(\PhpSpreadsheet\SpreadSheet $spreadsheet = null) { $this->spreadSheet = $spreadsheet; diff --git a/src/PhpSpreadsheet/Writer/OpenDocument/Content.php b/src/PhpSpreadsheet/Writer/OpenDocument/Content.php index 8ab14baf..929af08d 100644 --- a/src/PhpSpreadsheet/Writer/OpenDocument/Content.php +++ b/src/PhpSpreadsheet/Writer/OpenDocument/Content.php @@ -47,7 +47,7 @@ class Content extends WriterPart public function write(\PhpSpreadsheet\SpreadSheet $spreadsheet = null) { if (!$spreadsheet) { - $spreadsheet = $this->getParentWriter()->getPhpSpreadsheet(); /* @var $spreadsheet PhpSpreadsheet */ + $spreadsheet = $this->getParentWriter()->getSpreadsheet(); /* @var $spreadsheet PhpSpreadsheet */ } $objWriter = null; @@ -119,7 +119,7 @@ class Content extends WriterPart */ private function writeSheets(\PhpSpreadsheet\Shared\XMLWriter $objWriter) { - $spreadsheet = $this->getParentWriter()->getPhpSpreadsheet(); /* @var $spreadsheet PhpSpreadsheet */ + $spreadsheet = $this->getParentWriter()->getSpreadsheet(); /* @var $spreadsheet PhpSpreadsheet */ $sheet_count = $spreadsheet->getSheetCount(); for ($i = 0; $i < $sheet_count; ++$i) { diff --git a/src/PhpSpreadsheet/Writer/OpenDocument/Meta.php b/src/PhpSpreadsheet/Writer/OpenDocument/Meta.php index bd5082c7..44d7187a 100644 --- a/src/PhpSpreadsheet/Writer/OpenDocument/Meta.php +++ b/src/PhpSpreadsheet/Writer/OpenDocument/Meta.php @@ -36,7 +36,7 @@ class Meta extends WriterPart public function write(\PhpSpreadsheet\SpreadSheet $spreadsheet = null) { if (!$spreadsheet) { - $spreadsheet = $this->getParentWriter()->getPhpSpreadsheet(); + $spreadsheet = $this->getParentWriter()->getSpreadsheet(); } $objWriter = null; diff --git a/src/PhpSpreadsheet/Writer/OpenDocument/MetaInf.php b/src/PhpSpreadsheet/Writer/OpenDocument/MetaInf.php index 94374cad..3054d13d 100644 --- a/src/PhpSpreadsheet/Writer/OpenDocument/MetaInf.php +++ b/src/PhpSpreadsheet/Writer/OpenDocument/MetaInf.php @@ -36,7 +36,7 @@ class MetaInf extends WriterPart public function writeManifest(\PhpSpreadsheet\SpreadSheet $spreadsheet = null) { if (!$spreadsheet) { - $spreadsheet = $this->getParentWriter()->getPhpSpreadsheet(); + $spreadsheet = $this->getParentWriter()->getSpreadsheet(); } $objWriter = null; diff --git a/src/PhpSpreadsheet/Writer/OpenDocument/Settings.php b/src/PhpSpreadsheet/Writer/OpenDocument/Settings.php index 10ae515c..01e74f96 100644 --- a/src/PhpSpreadsheet/Writer/OpenDocument/Settings.php +++ b/src/PhpSpreadsheet/Writer/OpenDocument/Settings.php @@ -36,7 +36,7 @@ class Settings extends WriterPart public function write(\PhpSpreadsheet\SpreadSheet $spreadsheet = null) { if (!$spreadsheet) { - $spreadsheet = $this->getParentWriter()->getPhpSpreadsheet(); + $spreadsheet = $this->getParentWriter()->getSpreadsheet(); } $objWriter = null; diff --git a/src/PhpSpreadsheet/Writer/OpenDocument/Styles.php b/src/PhpSpreadsheet/Writer/OpenDocument/Styles.php index 6c5bcdf1..d18746a8 100644 --- a/src/PhpSpreadsheet/Writer/OpenDocument/Styles.php +++ b/src/PhpSpreadsheet/Writer/OpenDocument/Styles.php @@ -36,7 +36,7 @@ class Styles extends WriterPart public function write(\PhpSpreadsheet\SpreadSheet $spreadsheet = null) { if (!$spreadsheet) { - $spreadsheet = $this->getParentWriter()->getPhpSpreadsheet(); + $spreadsheet = $this->getParentWriter()->getSpreadsheet(); } $objWriter = null; diff --git a/src/PhpSpreadsheet/Writer/PDF/DomPDF.php b/src/PhpSpreadsheet/Writer/PDF/DomPDF.php index f525c4f3..302e97f4 100644 --- a/src/PhpSpreadsheet/Writer/PDF/DomPDF.php +++ b/src/PhpSpreadsheet/Writer/PDF/DomPDF.php @@ -59,15 +59,15 @@ class DomPDF extends Core implements \PhpSpreadsheet\Writer\IWriter // Check for paper size and page orientation if (is_null($this->getSheetIndex())) { - $orientation = ($this->phpSpreadsheet->getSheet(0)->getPageSetup()->getOrientation() + $orientation = ($this->spreadsheet->getSheet(0)->getPageSetup()->getOrientation() == \PhpSpreadsheet\Worksheet\PageSetup::ORIENTATION_LANDSCAPE) ? 'L' : 'P'; - $printPaperSize = $this->phpSpreadsheet->getSheet(0)->getPageSetup()->getPaperSize(); - $printMargins = $this->phpSpreadsheet->getSheet(0)->getPageMargins(); + $printPaperSize = $this->spreadsheet->getSheet(0)->getPageSetup()->getPaperSize(); + $printMargins = $this->spreadsheet->getSheet(0)->getPageMargins(); } else { - $orientation = ($this->phpSpreadsheet->getSheet($this->getSheetIndex())->getPageSetup()->getOrientation() + $orientation = ($this->spreadsheet->getSheet($this->getSheetIndex())->getPageSetup()->getOrientation() == \PhpSpreadsheet\Worksheet\PageSetup::ORIENTATION_LANDSCAPE) ? 'L' : 'P'; - $printPaperSize = $this->phpSpreadsheet->getSheet($this->getSheetIndex())->getPageSetup()->getPaperSize(); - $printMargins = $this->phpSpreadsheet->getSheet($this->getSheetIndex())->getPageMargins(); + $printPaperSize = $this->spreadsheet->getSheet($this->getSheetIndex())->getPageSetup()->getPaperSize(); + $printMargins = $this->spreadsheet->getSheet($this->getSheetIndex())->getPageMargins(); } $orientation = ($orientation == 'L') ? 'landscape' : 'portrait'; diff --git a/src/PhpSpreadsheet/Writer/PDF/MPDF.php b/src/PhpSpreadsheet/Writer/PDF/MPDF.php index fa377a95..a3c503c6 100644 --- a/src/PhpSpreadsheet/Writer/PDF/MPDF.php +++ b/src/PhpSpreadsheet/Writer/PDF/MPDF.php @@ -59,15 +59,15 @@ class MPDF extends Core implements \PhpSpreadsheet\Writer\IWriter // Check for paper size and page orientation if (is_null($this->getSheetIndex())) { - $orientation = ($this->phpSpreadsheet->getSheet(0)->getPageSetup()->getOrientation() + $orientation = ($this->spreadsheet->getSheet(0)->getPageSetup()->getOrientation() == \PhpSpreadsheet\Worksheet\PageSetup::ORIENTATION_LANDSCAPE) ? 'L' : 'P'; - $printPaperSize = $this->phpSpreadsheet->getSheet(0)->getPageSetup()->getPaperSize(); - $printMargins = $this->phpSpreadsheet->getSheet(0)->getPageMargins(); + $printPaperSize = $this->spreadsheet->getSheet(0)->getPageSetup()->getPaperSize(); + $printMargins = $this->spreadsheet->getSheet(0)->getPageMargins(); } else { - $orientation = ($this->phpSpreadsheet->getSheet($this->getSheetIndex())->getPageSetup()->getOrientation() + $orientation = ($this->spreadsheet->getSheet($this->getSheetIndex())->getPageSetup()->getOrientation() == \PhpSpreadsheet\Worksheet\PageSetup::ORIENTATION_LANDSCAPE) ? 'L' : 'P'; - $printPaperSize = $this->phpSpreadsheet->getSheet($this->getSheetIndex())->getPageSetup()->getPaperSize(); - $printMargins = $this->phpSpreadsheet->getSheet($this->getSheetIndex())->getPageMargins(); + $printPaperSize = $this->spreadsheet->getSheet($this->getSheetIndex())->getPageSetup()->getPaperSize(); + $printMargins = $this->spreadsheet->getSheet($this->getSheetIndex())->getPageMargins(); } $this->setOrientation($orientation); @@ -96,11 +96,11 @@ class MPDF extends Core implements \PhpSpreadsheet\Writer\IWriter $pdf->AddPage($orientation); // Document info - $pdf->SetTitle($this->phpSpreadsheet->getProperties()->getTitle()); - $pdf->SetAuthor($this->phpSpreadsheet->getProperties()->getCreator()); - $pdf->SetSubject($this->phpSpreadsheet->getProperties()->getSubject()); - $pdf->SetKeywords($this->phpSpreadsheet->getProperties()->getKeywords()); - $pdf->SetCreator($this->phpSpreadsheet->getProperties()->getCreator()); + $pdf->SetTitle($this->spreadsheet->getProperties()->getTitle()); + $pdf->SetAuthor($this->spreadsheet->getProperties()->getCreator()); + $pdf->SetSubject($this->spreadsheet->getProperties()->getSubject()); + $pdf->SetKeywords($this->spreadsheet->getProperties()->getKeywords()); + $pdf->SetCreator($this->spreadsheet->getProperties()->getCreator()); $pdf->WriteHTML( $this->generateHTMLHeader(false) . diff --git a/src/PhpSpreadsheet/Writer/PDF/TcPDF.php b/src/PhpSpreadsheet/Writer/PDF/TcPDF.php index b8a3855f..d88d9077 100644 --- a/src/PhpSpreadsheet/Writer/PDF/TcPDF.php +++ b/src/PhpSpreadsheet/Writer/PDF/TcPDF.php @@ -60,15 +60,15 @@ class TcPDF extends Core implements \PhpSpreadsheet\Writer\IWriter // Check for paper size and page orientation if (is_null($this->getSheetIndex())) { - $orientation = ($this->phpSpreadsheet->getSheet(0)->getPageSetup()->getOrientation() + $orientation = ($this->spreadsheet->getSheet(0)->getPageSetup()->getOrientation() == \PhpSpreadsheet\Worksheet\PageSetup::ORIENTATION_LANDSCAPE) ? 'L' : 'P'; - $printPaperSize = $this->phpSpreadsheet->getSheet(0)->getPageSetup()->getPaperSize(); - $printMargins = $this->phpSpreadsheet->getSheet(0)->getPageMargins(); + $printPaperSize = $this->spreadsheet->getSheet(0)->getPageSetup()->getPaperSize(); + $printMargins = $this->spreadsheet->getSheet(0)->getPageMargins(); } else { - $orientation = ($this->phpSpreadsheet->getSheet($this->getSheetIndex())->getPageSetup()->getOrientation() + $orientation = ($this->spreadsheet->getSheet($this->getSheetIndex())->getPageSetup()->getOrientation() == \PhpSpreadsheet\Worksheet\PageSetup::ORIENTATION_LANDSCAPE) ? 'L' : 'P'; - $printPaperSize = $this->phpSpreadsheet->getSheet($this->getSheetIndex())->getPageSetup()->getPaperSize(); - $printMargins = $this->phpSpreadsheet->getSheet($this->getSheetIndex())->getPageMargins(); + $printPaperSize = $this->spreadsheet->getSheet($this->getSheetIndex())->getPageSetup()->getPaperSize(); + $printMargins = $this->spreadsheet->getSheet($this->getSheetIndex())->getPageMargins(); } // Override Page Orientation @@ -107,11 +107,11 @@ class TcPDF extends Core implements \PhpSpreadsheet\Writer\IWriter ); // Document info - $pdf->SetTitle($this->phpSpreadsheet->getProperties()->getTitle()); - $pdf->SetAuthor($this->phpSpreadsheet->getProperties()->getCreator()); - $pdf->SetSubject($this->phpSpreadsheet->getProperties()->getSubject()); - $pdf->SetKeywords($this->phpSpreadsheet->getProperties()->getKeywords()); - $pdf->SetCreator($this->phpSpreadsheet->getProperties()->getCreator()); + $pdf->SetTitle($this->spreadsheet->getProperties()->getTitle()); + $pdf->SetAuthor($this->spreadsheet->getProperties()->getCreator()); + $pdf->SetSubject($this->spreadsheet->getProperties()->getSubject()); + $pdf->SetKeywords($this->spreadsheet->getProperties()->getKeywords()); + $pdf->SetCreator($this->spreadsheet->getProperties()->getCreator()); // Write to file fwrite($fileHandle, $pdf->output($pFilename, 'S'));