More namespacing work

This commit is contained in:
MarkBaker 2015-06-03 08:21:50 +01:00
parent f1e8ec1f4d
commit ed087dd396
19 changed files with 101 additions and 94 deletions

View File

@ -2102,7 +2102,7 @@ class Calculation
* Get an instance of this class
*
* @access public
* @param PHPExcel $spreadsheet Injected spreadsheet for working with a PHPExcel object,
* @param Spreadsheet $spreadsheet Injected spreadsheet for working with a PHPExcel Spreadsheet object,
* or NULL to create a standalone claculation engine
* @return Calculation
*/
@ -2126,9 +2126,9 @@ class Calculation
* Unset an instance of this class
*
* @access public
* @param PHPExcel $spreadsheet Injected spreadsheet identifying the instance to unset
* @param Spreadsheet $spreadsheet Injected spreadsheet identifying the instance to unset
*/
public static function unsetInstance(PHPExcel $spreadsheet = null)
public static function unsetInstance(Spreadsheet $spreadsheet = null)
{
if ($spreadsheet !== null) {
if (isset(self::$spreadsheetSets[$spreadsheet->getID()])) {

View File

@ -50,14 +50,14 @@ class Categories
private $category;
/**
* Excel name
* Excel function name
*
* @var string
*/
private $excelName;
/**
* PHPExcel name
* PHPExcel function name
*
* @var string
*/
@ -67,7 +67,7 @@ class Categories
* Create a new Categories
* @param string $pCategory Category (represented by CATEGORY_*)
* @param string $pExcelName Excel function name
* @param string $pPHPExcelName PHPExcel function mapping
* @param string $pPHPExcelName PHPExcel internal function name
* @throws Exception
*/
public function __construct($pCategory = null, $pExcelName = null, $pPHPExcelName = null)
@ -108,7 +108,7 @@ class Categories
}
/**
* Get Excel name
* Get Excel function name
*
* @return string
*/
@ -118,7 +118,7 @@ class Categories
}
/**
* Set Excel name
* Set Excel function name
*
* @param string $value
*/
@ -128,7 +128,7 @@ class Categories
}
/**
* Get PHPExcel name
* Get PHPExcel function name
*
* @return string
*/
@ -138,7 +138,7 @@ class Categories
}
/**
* Set PHPExcel name
* Set PHPExcel function name
*
* @param string $value
*/

View File

@ -430,7 +430,7 @@ class DateTime
case Functions::RETURNDATE_EXCEL:
$date = 0;
$calendar = \PHPExcel\Shared\Date::getExcelCalendar();
if ($calendar != PHPExcel\Shared\Date::CALENDAR_WINDOWS_1900) {
if ($calendar != \PHPExcel\Shared\Date::CALENDAR_WINDOWS_1900) {
$date = 1;
}
return (float) \PHPExcel\Shared\Date::FormattedPHPToExcel($calendar, 1, $date, $hour, $minute, $second);

View File

@ -593,7 +593,7 @@ class TextData
$value = Functions::flattenSingleValue($value);
$format = Functions::flattenSingleValue($format);
if ((is_string($value)) && (!is_numeric($value)) && PHPExcel\Shared\Date::isDateTimeFormatCode($format)) {
if ((is_string($value)) && (!is_numeric($value)) && \PHPExcel\Shared\Date::isDateTimeFormatCode($format)) {
$value = DateTime::DATEVALUE($value);
}

View File

@ -114,12 +114,12 @@ class IOFactory
*
* @static
* @access public
* @param PHPExcel $phpExcel
* @param Spreadsheet $phpExcel
* @param string $writerType Example: Excel2007
* @return Writer\IWriter
* @throws Writer\Exception
*/
public static function createWriter(PHPExcel $phpExcel, $writerType = '')
public static function createWriter(Spreadsheet $phpExcel, $writerType = '')
{
// Search type
$searchType = 'IWriter';
@ -171,12 +171,12 @@ class IOFactory
}
/**
* Loads PHPExcel from file using automatic Reader\IReader resolution
* Loads Spreadsheet from file using automatic Reader\IReader resolution
*
* @static
* @access public
* @param string $pFilename The name of the spreadsheet file
* @return PHPExcel
* @return Spreadsheet
* @throws Reader\Exception
*/
public static function load($pFilename)

View File

@ -194,16 +194,16 @@ class CSV extends BaseReader implements IReader
}
/**
* Loads PHPExcel from file
* Loads Spreadsheet from file
*
* @param string $pFilename
* @return PHPExcel
* @return \PHPExcel\Spreadsheet
* @throws Exception
*/
public function load($pFilename)
{
// Create new PHPExcel
$objPHPExcel = new PHPExcel();
// Create new Spreadsheet
$objPHPExcel = new \PHPExcel\Spreadsheet();
// Load into this instance
return $this->loadIntoExisting($pFilename, $objPHPExcel);

View File

@ -218,7 +218,7 @@ class Excel2003XML extends BaseReader implements IReader
* Loads PHPExcel from file
*
* @param string $pFilename
* @return Spreadsheet
* @return \PHPExcel\Spreadsheet
* @throws Exception
*/
public function load($pFilename)

View File

@ -364,7 +364,7 @@ class Excel2007 extends BaseReader implements IReader
}
// Initialisations
$excel = new Spreadsheet;
$excel = new \PHPExcel\Spreadsheet;
$excel->removeSheetByIndex(0);
if (!$this->readDataOnly) {
$excel->removeCellStyleXfByIndex(0); // remove the default style

View File

@ -195,7 +195,7 @@ class Excel5 extends BaseReader implements IReader
/**
* Workbook to be returned by the reader.
*
* @var Spreadsheet
* @var \PHPExcel\Spreadsheet
*/
private $phpExcel;

View File

@ -290,13 +290,13 @@ class OOCalc extends BaseReader implements IReader
* Loads PHPExcel from file
*
* @param string $pFilename
* @return Spreadsheet
* @return \PHPExcel\Spreadsheet
* @throws Exception
*/
public function load($pFilename)
{
// Create new PHPExcel
$objPHPExcel = new PHPExcel();
// Create new Spreadsheet
$objPHPExcel = new \PHPExcel\Spreadsheet();
// Load into this instance
return $this->loadIntoExisting($pFilename, $objPHPExcel);
@ -318,8 +318,8 @@ class OOCalc extends BaseReader implements IReader
* Loads PHPExcel from file into PHPExcel instance
*
* @param string $pFilename
* @param Spreadsheet $objPHPExcel
* @return Spreadsheet
* @param \PHPExcel\Spreadsheet $objPHPExcel
* @return \PHPExcel\Spreadsheet
* @throws Exception
*/
public function loadIntoExisting($pFilename, PHPExcel $objPHPExcel)
@ -330,7 +330,7 @@ class OOCalc extends BaseReader implements IReader
}
$timezoneObj = new DateTimeZone('Europe/London');
$GMT = new DateTimeZone('UTC');
$GMT = new \DateTimeZone('UTC');
$zipClass = \PHPExcel\Settings::getZipClass();

View File

@ -184,13 +184,13 @@ class SYLK extends BaseReader implements IReader
* Loads PHPExcel from file
*
* @param string $pFilename
* @return Spreadsheet
* @return \PHPExcel\Spreadsheet
* @throws Exception
*/
public function load($pFilename)
{
// Create new PHPExcel
$objPHPExcel = new Spreadsheet();
// Create new Spreadsheet
$objPHPExcel = new \PHPExcel\Spreadsheet();
// Load into this instance
return $this->loadIntoExisting($pFilename, $objPHPExcel);
@ -200,11 +200,11 @@ class SYLK extends BaseReader implements IReader
* Loads PHPExcel from file into PHPExcel instance
*
* @param string $pFilename
* @param Spreadsheet $objPHPExcel
* @return Spreadsheet
* @param \PHPExcel\Spreadsheet $objPHPExcel
* @return \PHPExcel\Spreadsheet
* @throws Exception
*/
public function loadIntoExisting($pFilename, Spreadsheet $objPHPExcel)
public function loadIntoExisting($pFilename, \PHPExcel\Spreadsheet $objPHPExcel)
{
// Open file
$this->openFile($pFilename);

View File

@ -81,9 +81,9 @@ class CSV extends BaseWriter implements IWriter
/**
* Create a new CSV
*
* @param Spreadsheet $phpExcel Spreadsheet object
* @param \PHPExcel\Spreadsheet $phpExcel Spreadsheet object
*/
public function __construct(Spreadsheet $phpExcel)
public function __construct(\PHPExcel\Spreadsheet $phpExcel)
{
$this->phpExcel = $phpExcel;
}

View File

@ -1,5 +1,7 @@
<?php
namespace PHPExcel\Writer;
/**
* PHPExcel_Writer_Excel2007
*
@ -25,7 +27,7 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
class PHPExcel_Writer_Excel2007 extends PHPExcel_Writer_Abstract implements PHPExcel_Writer_IWriter
class Excel2007 extends BaseWriter implements IWriter
{
/**
* Pre-calculate formulas
@ -48,14 +50,14 @@ class PHPExcel_Writer_Excel2007 extends PHPExcel_Writer_Abstract implements PHPE
/**
* Private writer parts
*
* @var PHPExcel_Writer_Excel2007_WriterPart[]
* @var Excel2007\WriterPart[]
*/
private $writerParts = array();
/**
* Private PHPExcel
* Private Spreadsheet
*
* @var PHPExcel
* @var \PHPExcel\Spreadsheet
*/
private $spreadSheet;
@ -67,9 +69,9 @@ class PHPExcel_Writer_Excel2007 extends PHPExcel_Writer_Abstract implements PHPE
private $stringTable = array();
/**
* Private unique PHPExcel_Style_Conditional HashTable
* Private unique \PHPExcel\Style\Conditional HashTable
*
* @var PHPExcel_HashTable
* @var \PHPExcel\HashTable
*/
private $stylesConditionalHashTable;
@ -81,37 +83,37 @@ class PHPExcel_Writer_Excel2007 extends PHPExcel_Writer_Abstract implements PHPE
private $styleHashTable;
/**
* Private unique PHPExcel_Style_Fill HashTable
* Private unique \PHPExcel\Style\Fill HashTable
*
* @var PHPExcel_HashTable
* @var \PHPExcel\HashTable
*/
private $fillHashTable;
/**
* Private unique PHPExcel_Style_Font HashTable
* Private unique \PHPExcel\Style\Font HashTable
*
* @var PHPExcel_HashTable
* @var \PHPExcel\HashTable
*/
private $fontHashTable;
/**
* Private unique PHPExcel_Style_Borders HashTable
* Private unique \PHPExcel\Style\Borders HashTable
*
* @var PHPExcel_HashTable
* @var \PHPExcel\HashTable
*/
private $bordersHashTable ;
/**
* Private unique PHPExcel_Style_NumberFormat HashTable
* Private unique \PHPExcel\Style\NumberFormat HashTable
*
* @var PHPExcel_HashTable
* @var \PHPExcel\HashTable
*/
private $numFmtHashTable;
/**
* Private unique PHPExcel_Worksheet_BaseDrawing HashTable
* Private unique \PHPExcel\Worksheet\BaseDrawing HashTable
*
* @var PHPExcel_HashTable
* @var \PHPExcel\HashTable
*/
private $drawingHashTable;
@ -120,25 +122,26 @@ class PHPExcel_Writer_Excel2007 extends PHPExcel_Writer_Abstract implements PHPE
*
* @param PHPExcel $pPHPExcel
*/
public function __construct(PHPExcel $pPHPExcel = null)
public function __construct(\PHPExcel\Spreadsheet $pPHPExcel = null)
{
// Assign PHPExcel
$this->setPHPExcel($pPHPExcel);
$writerPartsArray = array( 'stringtable' => 'PHPExcel_Writer_Excel2007_StringTable',
'contenttypes' => 'PHPExcel_Writer_Excel2007_ContentTypes',
'docprops' => 'PHPExcel_Writer_Excel2007_DocProps',
'rels' => 'PHPExcel_Writer_Excel2007_Rels',
'theme' => 'PHPExcel_Writer_Excel2007_Theme',
'style' => 'PHPExcel_Writer_Excel2007_Style',
'workbook' => 'PHPExcel_Writer_Excel2007_Workbook',
'worksheet' => 'PHPExcel_Writer_Excel2007_Worksheet',
'drawing' => 'PHPExcel_Writer_Excel2007_Drawing',
'comments' => 'PHPExcel_Writer_Excel2007_Comments',
'chart' => 'PHPExcel_Writer_Excel2007_Chart',
'relsvba' => 'PHPExcel_Writer_Excel2007_RelsVBA',
'relsribbonobjects' => 'PHPExcel_Writer_Excel2007_RelsRibbon'
);
$writerPartsArray = [
'stringtable' => '\\PHPExcel\\Writer\\Excel2007\\StringTable',
'contenttypes' => '\\PHPExcel\\Writer\\Excel2007\\ContentTypes',
'docprops' => '\\PHPExcel\\Writer\\Excel2007\\DocProps',
'rels' => '\\PHPExcel\\Writer\\Excel2007\\Rels',
'theme' => '\\PHPExcel\\Writer\\Excel2007\\Theme',
'style' => '\\PHPExcel\\Writer\\Excel2007\\Style',
'workbook' => '\\PHPExcel\\Writer\\Excel2007\\Workbook',
'worksheet' => '\\PHPExcel\\Writer\\Excel2007\\Worksheet',
'drawing' => '\\PHPExcel\\Writer\\Excel2007\\Drawing',
'comments' => '\\PHPExcel\\Writer\\Excel2007\\Comments',
'chart' => '\\PHPExcel\\Writer\\Excel2007\\Chart',
'relsvba' => '\\PHPExcel\\Writer\\Excel2007\\RelsVBA',
'relsribbonobjects' => '\\PHPExcel\\Writer\\Excel2007\\RelsRibbon'
];
// Initialise writer parts
// and Assign their parent IWriters
@ -419,11 +422,11 @@ class PHPExcel_Writer_Excel2007 extends PHPExcel_Writer_Abstract implements PHPE
/**
* Set PHPExcel object
*
* @param PHPExcel $pPHPExcel PHPExcel object
* @throws PHPExcel_Writer_Exception
* @return PHPExcel_Writer_Excel2007
* @param \PHPExcel\Spreadsheet $pPHPExcel PHPExcel object
* @throws Exception
* @return Excel2007
*/
public function setPHPExcel(PHPExcel $pPHPExcel = null)
public function setPHPExcel(\PHPExcel\Spreadsheet $pPHPExcel = null)
{
$this->spreadSheet = $pPHPExcel;
return $this;

View File

@ -1,5 +1,7 @@
<?php
namespace PHPExcel\Writer\Excel2007;
/**
* PHPExcel_Writer_Excel2007_StringTable
*
@ -25,12 +27,12 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
class PHPExcel_Writer_Excel2007_StringTable extends PHPExcel_Writer_Excel2007_WriterPart
class StringTable extends WriterPart
{
/**
* Create worksheet stringtable
*
* @param PHPExcel_Worksheet $pSheet Worksheet
* @param \PHPExcel\Worksheet $pSheet Worksheet
* @param string[] $pExistingTable Existing table to eventually merge with
* @return string[] String table for worksheet
* @throws PHPExcel_Writer_Exception

View File

@ -1,5 +1,7 @@
<?php
namespace PHPExcel\Writer\Excel2007;
/**
* PHPExcel_Writer_Excel2007_WriterPart
*
@ -25,22 +27,22 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
abstract class PHPExcel_Writer_Excel2007_WriterPart
abstract class WriterPart
{
/**
* Parent IWriter object
*
* @var PHPExcel_Writer_IWriter
* @var \PHPExcel\Writer\IWriter
*/
private $parentWriter;
/**
* Set parent IWriter object
*
* @param PHPExcel_Writer_IWriter $pWriter
* @throws PHPExcel_Writer_Exception
* @param \PHPExcel\Writer\IWriter $pWriter
* @throws \PHPExcel\Writer\Exception
*/
public function setParentWriter(PHPExcel_Writer_IWriter $pWriter = null)
public function setParentWriter(\PHPExcel\Writer\IWriter $pWriter = null)
{
$this->parentWriter = $pWriter;
}
@ -48,25 +50,25 @@ abstract class PHPExcel_Writer_Excel2007_WriterPart
/**
* Get parent IWriter object
*
* @return PHPExcel_Writer_IWriter
* @throws PHPExcel_Writer_Exception
* @return \PHPExcel\Writer\IWriter
* @throws \PHPExcel\Writer\Exception
*/
public function getParentWriter()
{
if (!is_null($this->parentWriter)) {
return $this->parentWriter;
} else {
throw new PHPExcel_Writer_Exception("No parent PHPExcel_Writer_IWriter assigned.");
throw new \PHPExcel\Writer\Exception("No parent \PHPExcel\Writer\IWriter assigned.");
}
}
/**
* Set parent IWriter object
*
* @param PHPExcel_Writer_IWriter $pWriter
* @throws PHPExcel_Writer_Exception
* @param \PHPExcel\Writer\IWriter $pWriter
* @throws \PHPExcel\Writer\Exception
*/
public function __construct(PHPExcel_Writer_IWriter $pWriter = null)
public function __construct(\PHPExcel\Writer\IWriter $pWriter = null)
{
if (!is_null($pWriter)) {
$this->parentWriter = $pWriter;

View File

@ -208,9 +208,9 @@ abstract class Core extends \PHPExcel\Writer\HTML
/**
* Create a new PDF Writer instance
*
* @param Spreadsheet $phpExcel Spreadsheet object
* @param \PHPExcel\Spreadsheet $phpExcel Spreadsheet object
*/
public function __construct(Spreadsheet $phpExcel)
public function __construct(\PHPExcel\Spreadsheet $phpExcel)
{
parent::__construct($phpExcel);
$this->setUseInlineCss(true);

View File

@ -40,9 +40,9 @@ class DomPDF extends Core implements \PHPExcel\Writer\IWriter
/**
* Create a new DomPDF Writer instance
*
* @param Spreadsheet $phpExcel Spreadsheet object
* @param \PHPExcel\Spreadsheet $phpExcel Spreadsheet object
*/
public function __construct(Spreadsheet $phpExcel)
public function __construct(\PHPExcel\Spreadsheet $phpExcel)
{
parent::__construct($phpExcel);
}
@ -51,7 +51,7 @@ class DomPDF extends Core implements \PHPExcel\Writer\IWriter
* Save Spreadsheet to file
*
* @param string $pFilename Name of the file to save as
* @throws PHPExcel_Writer_Exception
* @throws \PHPExcel\Writer\Exception
*/
public function save($pFilename = null)
{

View File

@ -40,9 +40,9 @@ class mPDF extends Core implements \PHPExcel\Writer\IWriter
/**
* Create a mPDF Writer instance
*
* @param Spreadsheet $phpExcel Spreadsheet object
* @param \PHPExcel\Spreadsheet $phpExcel Spreadsheet object
*/
public function __construct(Spreadsheet $phpExcel)
public function __construct(\PHPExcel\Spreadsheet $phpExcel)
{
parent::__construct($phpExcel);
}

View File

@ -41,9 +41,9 @@ class tcPDF extends Core implements \PHPExcel\Writer\IWriter
/**
* Create a new tcPDF Writer instance
*
* @param Spreadsheet $phpExcel Spreadsheet object
* @param \PHPExcel\Spreadsheet $phpExcel Spreadsheet object
*/
public function __construct(Spreadsheet $phpExcel)
public function __construct(\PHPExcel\Spreadsheet $phpExcel)
{
parent::__construct($phpExcel);
}