A lot of namespacing work

This commit is contained in:
MarkBaker 2015-05-25 17:28:50 +01:00
parent fff1f247f6
commit c2f5bd844d
116 changed files with 1967 additions and 1928 deletions

View File

@ -34,7 +34,8 @@ class Autoloader
* Register the Autoloader with SPL
*
*/
public static function register() {
public static function register()
{
if (function_exists('__autoload')) {
// Register any existing autoloader function with SPL, so we don't get any clashes
spl_autoload_register('__autoload');
@ -49,7 +50,8 @@ class Autoloader
*
* @param string $className Name of the object to load
*/
public static function load($className) {
public static function load($className)
{
if ((class_exists($className, false)) || (strpos($className, 'PHPExcel\\') !== 0)) {
// Either already loaded, or not a PHPExcel class request
return false;

View File

@ -1,81 +0,0 @@
<?php
PHPExcel_Autoloader::register();
// As we always try to run the autoloader before anything else, we can use it to do a few
// simple checks and initialisations
//PHPExcel_Shared_ZipStreamWrapper::register();
// check mbstring.func_overload
if (ini_get('mbstring.func_overload') & 2) {
throw new PHPExcel_Exception('Multibyte function overloading in PHP must be disabled for string functions (2).');
}
PHPExcel_Shared_String::buildCharacterSets();
/**
* PHPExcel
*
* Copyright (c) 2006 - 2015 PHPExcel
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
class PHPExcel_Autoloader
{
/**
* Register the Autoloader with SPL
*
*/
public static function register()
{
if (function_exists('__autoload')) {
// Register any existing autoloader function with SPL, so we don't get any clashes
spl_autoload_register('__autoload');
}
// Register ourselves with SPL
if (version_compare(PHP_VERSION, '5.3.0') >= 0) {
return spl_autoload_register(array('PHPExcel_Autoloader', 'load'), true, true);
} else {
return spl_autoload_register(array('PHPExcel_Autoloader', 'load'));
}
}
/**
* Autoload a class identified by name
*
* @param string $pClassName Name of the object to load
*/
public static function load($pClassName)
{
if ((class_exists($pClassName, false)) || (strpos($pClassName, 'PHPExcel') !== 0)) {
// Either already loaded, or not a PHPExcel class request
return false;
}
$pClassFilePath = PHPEXCEL_ROOT .
str_replace('_', DIRECTORY_SEPARATOR, $pClassName) .
'.php';
if ((file_exists($pClassFilePath) === false) || (is_readable($pClassFilePath) === false)) {
// Can't load
return false;
}
require($pClassFilePath);
}
}

View File

@ -1,5 +1,7 @@
<?php
namespace PHPExcel\CachedObjectStorage;
/**
* PHPExcel_CachedObjectStorage_APC
*
@ -25,7 +27,7 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
class PHPExcel_CachedObjectStorage_APC extends PHPExcel_CachedObjectStorage_CacheBase implements PHPExcel_CachedObjectStorage_ICache
class APC extends CacheBase implements ICache
{
/**
* Prefix used to uniquely identify cache data for this worksheet
@ -48,8 +50,7 @@ class PHPExcel_CachedObjectStorage_APC extends PHPExcel_CachedObjectStorage_Cach
* and the 'nullify' the current cell object
*
* @access private
* @return void
* @throws PHPExcel_Exception
* @throws \PHPExcel\Exception
*/
protected function storeData()
{
@ -62,7 +63,7 @@ class PHPExcel_CachedObjectStorage_APC extends PHPExcel_CachedObjectStorage_Cach
$this->cacheTime
)) {
$this->__destruct();
throw new PHPExcel_Exception('Failed to store cell ' . $this->currentObjectID . ' in APC');
throw new \PHPExcel\Exception('Failed to store cell ' . $this->currentObjectID . ' in APC');
}
$this->currentCellIsDirty = false;
}
@ -74,11 +75,11 @@ class PHPExcel_CachedObjectStorage_APC extends PHPExcel_CachedObjectStorage_Cach
*
* @access public
* @param string $pCoord Coordinate address of the cell to update
* @param PHPExcel_Cell $cell Cell to update
* @return PHPExcel_Cell
* @throws PHPExcel_Exception
* @param \PHPExcel\Cell $cell Cell to update
* @return \PHPExcel\Cell
* @throws \PHPExcel\Exception
*/
public function addCacheData($pCoord, PHPExcel_Cell $cell)
public function addCacheData($pCoord, \PHPExcel\Cell $cell)
{
if (($pCoord !== $this->currentObjectID) && ($this->currentObjectID !== null)) {
$this->storeData();
@ -97,7 +98,7 @@ class PHPExcel_CachedObjectStorage_APC extends PHPExcel_CachedObjectStorage_Cach
*
* @access public
* @param string $pCoord Coordinate address of the cell to check
* @throws PHPExcel_Exception
* @throws \PHPExcel\Exception
* @return boolean
*/
public function isDataSet($pCoord)
@ -112,7 +113,7 @@ class PHPExcel_CachedObjectStorage_APC extends PHPExcel_CachedObjectStorage_Cach
if ($success === false) {
// Entry no longer exists in APC, so clear it from the cache array
parent::deleteCacheData($pCoord);
throw new PHPExcel_Exception('Cell entry '.$pCoord.' no longer exists in APC cache');
throw new \PHPExcel\Exception('Cell entry '.$pCoord.' no longer exists in APC cache');
}
return true;
}
@ -191,11 +192,10 @@ class PHPExcel_CachedObjectStorage_APC extends PHPExcel_CachedObjectStorage_Cach
* Clone the cell collection
*
* @access public
* @param PHPExcel_Worksheet $parent The new worksheet
* @throws PHPExcel_Exception
* @return void
* @param \PHPExcel\Worksheet $parent The new worksheet that we're copying to
* @throws \PHPExcel\Exception
*/
public function copyCellCollection(PHPExcel_Worksheet $parent)
public function copyCellCollection(\PHPExcel\Worksheet $parent)
{
parent::copyCellCollection($parent);
// Get a new id for the new file name
@ -208,11 +208,11 @@ class PHPExcel_CachedObjectStorage_APC extends PHPExcel_CachedObjectStorage_Cach
if ($obj === false) {
// Entry no longer exists in APC, so clear it from the cache array
parent::deleteCacheData($cellID);
throw new PHPExcel_Exception('Cell entry ' . $cellID . ' no longer exists in APC');
throw new \PHPExcel\Exception('Cell entry ' . $cellID . ' no longer exists in APC');
}
if (!apc_store($newCachePrefix . $cellID . '.cache', $obj, $this->cacheTime)) {
$this->__destruct();
throw new PHPExcel_Exception('Failed to store cell ' . $cellID . ' in APC');
throw new \PHPExcel\Exception('Failed to store cell ' . $cellID . ' in APC');
}
}
}

View File

@ -1,5 +1,7 @@
<?php
namespace PHPExcel\CachedObjectStorage;
/**
* PHPExcel_CachedObjectStorage_CacheBase
*
@ -25,19 +27,19 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
abstract class PHPExcel_CachedObjectStorage_CacheBase
abstract class CacheBase
{
/**
* Parent worksheet
*
* @var PHPExcel_Worksheet
* @var \PHPExcel\Worksheet
*/
protected $parent;
/**
* The currently active Cell
*
* @var PHPExcel_Cell
* @var \PHPExcel\Cell
*/
protected $currentObject = null;
@ -66,12 +68,12 @@ abstract class PHPExcel_CachedObjectStorage_CacheBase
/**
* Initialise this new cell collection
*
* @param PHPExcel_Worksheet $parent The worksheet for this cell collection
* @param \PHPExcel\Worksheet $parent The worksheet for this cell collection
*/
public function __construct(PHPExcel_Worksheet $parent)
public function __construct(\PHPExcel\Worksheet $parent)
{
// Set our parent worksheet.
// This is maintained within the cache controller to facilitate re-attaching it to PHPExcel_Cell objects when
// This is maintained within the cache controller to facilitate re-attaching it to \PHPExcel\Cell objects when
// they are woken from a serialized state
$this->parent = $parent;
}
@ -79,7 +81,7 @@ abstract class PHPExcel_CachedObjectStorage_CacheBase
/**
* Return the parent worksheet for this cell collection
*
* @return PHPExcel_Worksheet
* @return \PHPExcel\Worksheet
*/
public function getParent()
{
@ -87,7 +89,7 @@ abstract class PHPExcel_CachedObjectStorage_CacheBase
}
/**
* Is a value set in the current PHPExcel_CachedObjectStorage_ICache for an indexed cell?
* Is a value set in the current \PHPExcel\CachedObjectStorage\ICache for an indexed cell?
*
* @param string $pCoord Coordinate address of the cell to check
* @return boolean
@ -125,11 +127,11 @@ abstract class PHPExcel_CachedObjectStorage_CacheBase
/**
* Add or Update a cell in cache
*
* @param PHPExcel_Cell $cell Cell to update
* @return PHPExcel_Cell
* @throws PHPExcel_Exception
* @param \PHPExcel\Cell $cell Cell to update
* @return \PHPExcel\Cell
* @throws \PHPExcel\Exception
*/
public function updateCacheData(PHPExcel_Cell $cell)
public function updateCacheData(\PHPExcel\Cell $cell)
{
return $this->addCacheData($cell->getCoordinate(), $cell);
}
@ -138,7 +140,7 @@ abstract class PHPExcel_CachedObjectStorage_CacheBase
* Delete a cell in cache identified by coordinate address
*
* @param string $pCoord Coordinate address of the cell to delete
* @throws PHPExcel_Exception
* @throws \PHPExcel\Exception
*/
public function deleteCacheData($pCoord)
{
@ -260,9 +262,9 @@ abstract class PHPExcel_CachedObjectStorage_CacheBase
if ($r != $row) {
continue;
}
$columnList[] = PHPExcel_Cell::columnIndexFromString($c);
$columnList[] = \PHPExcel\Cell::columnIndexFromString($c);
}
return PHPExcel_Cell::stringFromColumnIndex(max($columnList) - 1);
return \PHPExcel\Cell::stringFromColumnIndex(max($columnList) - 1);
}
/**
@ -309,10 +311,9 @@ abstract class PHPExcel_CachedObjectStorage_CacheBase
/**
* Clone the cell collection
*
* @param PHPExcel_Worksheet $parent The new worksheet
* @return void
* @param \PHPExcel\Worksheet $parent The new worksheet that we're copying to
*/
public function copyCellCollection(PHPExcel_Worksheet $parent)
public function copyCellCollection(\PHPExcel\Worksheet $parent)
{
$this->currentCellIsDirty;
$this->storeData();
@ -321,7 +322,7 @@ abstract class PHPExcel_CachedObjectStorage_CacheBase
if (($this->currentObject !== null) && (is_object($this->currentObject))) {
$this->currentObject->attach($this);
}
} // function copyCellCollection()
}
/**
* Remove a row, deleting all cells in that row

View File

@ -1,5 +1,7 @@
<?php
namespace PHPExcel\CachedObjectStorage;
/**
* PHPExcel_CachedObjectStorage_DiscISAM
*
@ -25,7 +27,7 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
class PHPExcel_CachedObjectStorage_DiscISAM extends PHPExcel_CachedObjectStorage_CacheBase implements PHPExcel_CachedObjectStorage_ICache
class DiscISAM extends CacheBase implements ICache
{
/**
* Name of the file for this cache
@ -75,11 +77,11 @@ class PHPExcel_CachedObjectStorage_DiscISAM extends PHPExcel_CachedObjectStorage
* Add or Update a cell in cache identified by coordinate address
*
* @param string $pCoord Coordinate address of the cell to update
* @param PHPExcel_Cell $cell Cell to update
* @return PHPExcel_Cell
* @throws PHPExcel_Exception
* @param \PHPExcel\Cell $cell Cell to update
* @return \PHPExcel\Cell
* @throws \PHPExcel\Exception
*/
public function addCacheData($pCoord, PHPExcel_Cell $cell)
public function addCacheData($pCoord, \PHPExcel\Cell $cell)
{
if (($pCoord !== $this->currentObjectID) && ($this->currentObjectID !== null)) {
$this->storeData();
@ -140,9 +142,9 @@ class PHPExcel_CachedObjectStorage_DiscISAM extends PHPExcel_CachedObjectStorage
/**
* Clone the cell collection
*
* @param PHPExcel_Worksheet $parent The new worksheet
* @param \PHPExcel\Worksheet $parent The new worksheet that we're copying to
*/
public function copyCellCollection(PHPExcel_Worksheet $parent)
public function copyCellCollection(\PHPExcel\Worksheet $parent)
{
parent::copyCellCollection($parent);
// Get a new id for the new file name

View File

@ -1,5 +1,7 @@
<?php
namespace PHPExcel\CachedObjectStorage;
/**
* PHPExcel_CachedObjectStorage_ICache
*
@ -25,26 +27,26 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
interface PHPExcel_CachedObjectStorage_ICache
interface ICache
{
/**
* Add or Update a cell in cache identified by coordinate address
*
* @param string $pCoord Coordinate address of the cell to update
* @param PHPExcel_Cell $cell Cell to update
* @return PHPExcel_Cell
* @throws PHPExcel_Exception
* @param \PHPExcel\Cell $cell Cell to update
* @return \PHPExcel\Cell
* @throws \PHPExcel\Exception
*/
public function addCacheData($pCoord, PHPExcel_Cell $cell);
public function addCacheData($pCoord, \PHPExcel\Cell $cell);
/**
* Add or Update a cell in cache
*
* @param PHPExcel_Cell $cell Cell to update
* @return PHPExcel_Cell
* @throws PHPExcel_Exception
* @param \PHPExcel\Cell $cell Cell to update
* @return \PHPExcel\Cell
* @throws \PHPExcel\Exception
*/
public function updateCacheData(PHPExcel_Cell $cell);
public function updateCacheData(\PHPExcel\Cell $cell);
/**
* Fetch a cell from cache identified by coordinate address
@ -88,10 +90,9 @@ interface PHPExcel_CachedObjectStorage_ICache
/**
* Clone the cell collection
*
* @param PHPExcel_Worksheet $parent The new worksheet
* @return void
* @param \PHPExcel\Worksheet $parent The new worksheet that we're copying to
*/
public function copyCellCollection(PHPExcel_Worksheet $parent);
public function copyCellCollection(\PHPExcel\Worksheet $parent);
/**
* Identify whether the caching method is currently available

View File

@ -1,5 +1,7 @@
<?php
namespace PHPExcel\CachedObjectStorage;
/**
* PHPExcel_CachedObjectStorage_Igbinary
*
@ -25,14 +27,14 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
class PHPExcel_CachedObjectStorage_Igbinary extends PHPExcel_CachedObjectStorage_CacheBase implements PHPExcel_CachedObjectStorage_ICache
class Igbinary extends CacheBase implements ICache
{
/**
* Store cell data in cache for the current cell object if it's "dirty",
* and the 'nullify' the current cell object
*
* @return void
* @throws PHPExcel_Exception
* @throws \PHPExcel\Exception
*/
protected function storeData()
{
@ -50,11 +52,11 @@ class PHPExcel_CachedObjectStorage_Igbinary extends PHPExcel_CachedObjectStorage
* Add or Update a cell in cache identified by coordinate address
*
* @param string $pCoord Coordinate address of the cell to update
* @param PHPExcel_Cell $cell Cell to update
* @return PHPExcel_Cell
* @throws PHPExcel_Exception
* @param \PHPExcel\Cell $cell Cell to update
* @return \PHPExcel\Cell
* @throws \PHPExcel\Exception
*/
public function addCacheData($pCoord, PHPExcel_Cell $cell)
public function addCacheData($pCoord, \PHPExcel\Cell $cell)
{
if (($pCoord !== $this->currentObjectID) && ($this->currentObjectID !== null)) {
$this->storeData();
@ -65,15 +67,15 @@ class PHPExcel_CachedObjectStorage_Igbinary extends PHPExcel_CachedObjectStorage
$this->currentCellIsDirty = true;
return $cell;
} // function addCacheData()
}
/**
* Get cell at a specific coordinate
*
* @param string $pCoord Coordinate of the cell
* @throws PHPExcel_Exception
* @return PHPExcel_Cell Cell that was found, or null if not found
* @throws \PHPExcel\Exception
* @return \PHPExcel\Cell Cell that was found, or null if not found
*/
public function getCacheData($pCoord)
{

View File

@ -1,5 +1,7 @@
<?php
namespace PHPExcel\CachedObjectStorage;
/**
* PHPExcel_CachedObjectStorage_Memcache
*
@ -25,7 +27,7 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
class PHPExcel_CachedObjectStorage_Memcache extends PHPExcel_CachedObjectStorage_CacheBase implements PHPExcel_CachedObjectStorage_ICache
class Memcache extends CacheBase implements ICache
{
/**
* Prefix used to uniquely identify cache data for this worksheet
@ -53,8 +55,7 @@ class PHPExcel_CachedObjectStorage_Memcache extends PHPExcel_CachedObjectStorage
* Store cell data in cache for the current cell object if it's "dirty",
* and the 'nullify' the current cell object
*
* @return void
* @throws PHPExcel_Exception
* @throws \PHPExcel\Exception
*/
protected function storeData()
{
@ -65,24 +66,24 @@ class PHPExcel_CachedObjectStorage_Memcache extends PHPExcel_CachedObjectStorage
if (!$this->memcache->replace($this->cachePrefix . $this->currentObjectID . '.cache', $obj, null, $this->cacheTime)) {
if (!$this->memcache->add($this->cachePrefix . $this->currentObjectID . '.cache', $obj, null, $this->cacheTime)) {
$this->__destruct();
throw new PHPExcel_Exception("Failed to store cell {$this->currentObjectID} in MemCache");
throw new \PHPExcel\Exception("Failed to store cell {$this->currentObjectID} in MemCache");
}
}
$this->currentCellIsDirty = false;
}
$this->currentObjectID = $this->currentObject = null;
} // function _storeData()
}
/**
* Add or Update a cell in cache identified by coordinate address
*
* @param string $pCoord Coordinate address of the cell to update
* @param PHPExcel_Cell $cell Cell to update
* @return PHPExcel_Cell
* @throws PHPExcel_Exception
* @param \PHPExcel\Cell $cell Cell to update
* @return \PHPExcel\Cell
* @throws \PHPExcel\Exception
*/
public function addCacheData($pCoord, PHPExcel_Cell $cell)
public function addCacheData($pCoord, \PHPExcel\Cell $cell)
{
if (($pCoord !== $this->currentObjectID) && ($this->currentObjectID !== null)) {
$this->storeData();
@ -94,7 +95,7 @@ class PHPExcel_CachedObjectStorage_Memcache extends PHPExcel_CachedObjectStorage
$this->currentCellIsDirty = true;
return $cell;
} // function addCacheData()
}
/**
@ -193,10 +194,9 @@ class PHPExcel_CachedObjectStorage_Memcache extends PHPExcel_CachedObjectStorage
/**
* Clone the cell collection
*
* @param PHPExcel_Worksheet $parent The new worksheet
* @return void
* @param \PHPExcel\Worksheet $parent The new worksheet that we're copying to
*/
public function copyCellCollection(PHPExcel_Worksheet $parent)
public function copyCellCollection(\PHPExcel\Worksheet $parent)
{
parent::copyCellCollection($parent);
// Get a new id for the new file name

View File

@ -1,5 +1,7 @@
<?php
namespace PHPExcel\CachedObjectStorage;
/**
* PHPExcel_CachedObjectStorage_Memory
*
@ -25,7 +27,7 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
class PHPExcel_CachedObjectStorage_Memory extends PHPExcel_CachedObjectStorage_CacheBase implements PHPExcel_CachedObjectStorage_ICache
class Memory extends CacheBase implements ICache
{
/**
* Dummy method callable from CacheBase, but unused by Memory cache
@ -40,11 +42,11 @@ class PHPExcel_CachedObjectStorage_Memory extends PHPExcel_CachedObjectStorage_C
* Add or Update a cell in cache identified by coordinate address
*
* @param string $pCoord Coordinate address of the cell to update
* @param PHPExcel_Cell $cell Cell to update
* @return PHPExcel_Cell
* @throws PHPExcel_Exception
* @param \PHPExcel\Cell $cell Cell to update
* @return \PHPExcel\Cell
* @throws \PHPExcel\Exception
*/
public function addCacheData($pCoord, PHPExcel_Cell $cell)
public function addCacheData($pCoord, \PHPExcel\Cell $cell)
{
$this->cellCache[$pCoord] = $cell;
@ -82,9 +84,9 @@ class PHPExcel_CachedObjectStorage_Memory extends PHPExcel_CachedObjectStorage_C
/**
* Clone the cell collection
*
* @param PHPExcel_Worksheet $parent The new worksheet
* @param \PHPExcel\Worksheet $parent The new worksheet that we're copying to
*/
public function copyCellCollection(PHPExcel_Worksheet $parent)
public function copyCellCollection(\PHPExcel\Worksheet $parent)
{
parent::copyCellCollection($parent);

View File

@ -1,5 +1,7 @@
<?php
namespace PHPExcel\CachedObjectStorage;
/**
* PHPExcel_CachedObjectStorage_MemoryGZip
*
@ -25,7 +27,7 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
class PHPExcel_CachedObjectStorage_MemoryGZip extends PHPExcel_CachedObjectStorage_CacheBase implements PHPExcel_CachedObjectStorage_ICache
class MemoryGZip extends CacheBase implements ICache
{
/**
* Store cell data in cache for the current cell object if it's "dirty",
@ -50,11 +52,11 @@ class PHPExcel_CachedObjectStorage_MemoryGZip extends PHPExcel_CachedObjectStora
* Add or Update a cell in cache identified by coordinate address
*
* @param string $pCoord Coordinate address of the cell to update
* @param PHPExcel_Cell $cell Cell to update
* @return PHPExcel_Cell
* @throws PHPExcel_Exception
* @param \PHPExcel\Cell $cell Cell to update
* @return \PHPExcel\Cell
* @throws \PHPExcel\Exception
*/
public function addCacheData($pCoord, PHPExcel_Cell $cell)
public function addCacheData($pCoord, \PHPExcel\Cell $cell)
{
if (($pCoord !== $this->currentObjectID) && ($this->currentObjectID !== null)) {
$this->storeData();

View File

@ -1,5 +1,7 @@
<?php
namespace PHPExcel\CachedObjectStorage;
/**
* PHPExcel_CachedObjectStorage_MemorySerialized
*
@ -25,7 +27,7 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
class PHPExcel_CachedObjectStorage_MemorySerialized extends PHPExcel_CachedObjectStorage_CacheBase implements PHPExcel_CachedObjectStorage_ICache
class MemorySerialized extends CacheBase implements ICache
{
/**
* Store cell data in cache for the current cell object if it's "dirty",
@ -49,11 +51,11 @@ class PHPExcel_CachedObjectStorage_MemorySerialized extends PHPExcel_CachedObjec
* Add or Update a cell in cache identified by coordinate address
*
* @param string $pCoord Coordinate address of the cell to update
* @param PHPExcel_Cell $cell Cell to update
* @return PHPExcel_Cell
* @throws PHPExcel_Exception
* @param \PHPExcel\Cell $cell Cell to update
* @return \PHPExcel\Cell
* @throws \PHPExcel\Exception
*/
public function addCacheData($pCoord, PHPExcel_Cell $cell)
public function addCacheData($pCoord, \PHPExcel\Cell $cell)
{
if (($pCoord !== $this->currentObjectID) && ($this->currentObjectID !== null)) {
$this->storeData();

View File

@ -1,5 +1,7 @@
<?php
namespace PHPExcel\CachedObjectStorage;
/**
* PHPExcel_CachedObjectStorage_PHPTemp
*
@ -25,7 +27,7 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
class PHPExcel_CachedObjectStorage_PHPTemp extends PHPExcel_CachedObjectStorage_CacheBase implements PHPExcel_CachedObjectStorage_ICache
class PHPTemp extends CacheBase implements ICache
{
/**
* Name of the file for this cache
@ -45,8 +47,7 @@ class PHPExcel_CachedObjectStorage_PHPTemp extends PHPExcel_CachedObjectStorage_
* Store cell data in cache for the current cell object if it's "dirty",
* and the 'nullify' the current cell object
*
* @return void
* @throws PHPExcel_Exception
* @throws \PHPExcel\Exception
*/
protected function storeData()
{
@ -69,11 +70,11 @@ class PHPExcel_CachedObjectStorage_PHPTemp extends PHPExcel_CachedObjectStorage_
* Add or Update a cell in cache identified by coordinate address
*
* @param string $pCoord Coordinate address of the cell to update
* @param PHPExcel_Cell $cell Cell to update
* @return PHPExcel_Cell
* @throws PHPExcel_Exception
* @param \PHPExcel\Cell $cell Cell to update
* @return \PHPExcel\Cell
* @throws \PHPExcel\Exception
*/
public function addCacheData($pCoord, PHPExcel_Cell $cell)
public function addCacheData($pCoord, \PHPExcel\Cell $cell)
{
if (($pCoord !== $this->currentObjectID) && ($this->currentObjectID !== null)) {
$this->storeData();
@ -135,10 +136,9 @@ class PHPExcel_CachedObjectStorage_PHPTemp extends PHPExcel_CachedObjectStorage_
/**
* Clone the cell collection
*
* @param PHPExcel_Worksheet $parent The new worksheet
* @return void
* @param \PHPExcel\Worksheet $parent The new worksheet that we're copying to
*/
public function copyCellCollection(PHPExcel_Worksheet $parent)
public function copyCellCollection(\PHPExcel\Worksheet $parent)
{
parent::copyCellCollection($parent);
// Open a new stream for the cell cache data

View File

@ -1,5 +1,7 @@
<?php
namespace PHPExcel\CachedObjectStorage;
/**
* PHPExcel_CachedObjectStorage_SQLite
*
@ -25,7 +27,7 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
class PHPExcel_CachedObjectStorage_SQLite extends PHPExcel_CachedObjectStorage_CacheBase implements PHPExcel_CachedObjectStorage_ICache
class SQLite extends CacheBase implements ICache
{
/**
* Database table name
@ -45,8 +47,7 @@ class PHPExcel_CachedObjectStorage_SQLite extends PHPExcel_CachedObjectStorage_C
* Store cell data in cache for the current cell object if it's "dirty",
* and the 'nullify' the current cell object
*
* @return void
* @throws PHPExcel_Exception
* @throws \PHPExcel\Exception
*/
protected function storeData()
{
@ -54,7 +55,7 @@ class PHPExcel_CachedObjectStorage_SQLite extends PHPExcel_CachedObjectStorage_C
$this->currentObject->detach();
if (!$this->DBHandle->queryExec("INSERT OR REPLACE INTO kvp_".$this->TableName." VALUES('".$this->currentObjectID."','".sqlite_escape_string(serialize($this->currentObject))."')")) {
throw new PHPExcel_Exception(sqlite_error_string($this->DBHandle->lastError()));
throw new \PHPExcel\Exception(sqlite_error_string($this->DBHandle->lastError()));
}
$this->currentCellIsDirty = false;
}
@ -65,11 +66,11 @@ class PHPExcel_CachedObjectStorage_SQLite extends PHPExcel_CachedObjectStorage_C
* Add or Update a cell in cache identified by coordinate address
*
* @param string $pCoord Coordinate address of the cell to update
* @param PHPExcel_Cell $cell Cell to update
* @return PHPExcel_Cell
* @throws PHPExcel_Exception
* @param \PHPExcel\Cell $cell Cell to update
* @return \PHPExcel\Cell
* @throws \PHPExcel\Exception
*/
public function addCacheData($pCoord, PHPExcel_Cell $cell)
public function addCacheData($pCoord, \PHPExcel\Cell $cell)
{
if (($pCoord !== $this->currentObjectID) && ($this->currentObjectID !== null)) {
$this->storeData();
@ -86,8 +87,8 @@ class PHPExcel_CachedObjectStorage_SQLite extends PHPExcel_CachedObjectStorage_C
* Get cell at a specific coordinate
*
* @param string $pCoord Coordinate of the cell
* @throws PHPExcel_Exception
* @return PHPExcel_Cell Cell that was found, or null if not found
* @throws \PHPExcel\Exception
* @return \PHPExcel\Cell Cell that was found, or null if not found
*/
public function getCacheData($pCoord)
{
@ -219,10 +220,9 @@ class PHPExcel_CachedObjectStorage_SQLite extends PHPExcel_CachedObjectStorage_C
/**
* Clone the cell collection
*
* @param PHPExcel_Worksheet $parent The new worksheet
* @return void
* @param \PHPExcel\Worksheet $parent The new worksheet that we're copying to
*/
public function copyCellCollection(PHPExcel_Worksheet $parent)
public function copyCellCollection(\PHPExcel\Worksheet $parent)
{
$this->currentCellIsDirty;
$this->storeData();

View File

@ -1,5 +1,7 @@
<?php
namespace PHPExcel\CachedObjectStorage;
/**
* PHPExcel_CachedObjectStorage_SQLite3
*
@ -25,7 +27,7 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
class PHPExcel_CachedObjectStorage_SQLite3 extends PHPExcel_CachedObjectStorage_CacheBase implements PHPExcel_CachedObjectStorage_ICache
class SQLite3 extends CacheBase implements ICache
{
/**
* Database table name
@ -73,8 +75,7 @@ class PHPExcel_CachedObjectStorage_SQLite3 extends PHPExcel_CachedObjectStorage_
* Store cell data in cache for the current cell object if it's "dirty",
* and the 'nullify' the current cell object
*
* @return void
* @throws PHPExcel_Exception
* @throws \PHPExcel\Exception
*/
protected function storeData()
{
@ -85,7 +86,7 @@ class PHPExcel_CachedObjectStorage_SQLite3 extends PHPExcel_CachedObjectStorage_
$this->insertQuery->bindValue('data', serialize($this->currentObject), SQLITE3_BLOB);
$result = $this->insertQuery->execute();
if ($result === false) {
throw new PHPExcel_Exception($this->DBHandle->lastErrorMsg());
throw new \PHPExcel\Exception($this->DBHandle->lastErrorMsg());
}
$this->currentCellIsDirty = false;
}
@ -96,9 +97,9 @@ class PHPExcel_CachedObjectStorage_SQLite3 extends PHPExcel_CachedObjectStorage_
* Add or Update a cell in cache identified by coordinate address
*
* @param string $pCoord Coordinate address of the cell to update
* @param PHPExcel_Cell $cell Cell to update
* @return PHPExcel_Cell
* @throws PHPExcel_Exception
* @param \PHPExcel\Cell $cell Cell to update
* @return \PHPExcel\Cell
* @throws \PHPExcel\Exception
*/
public function addCacheData($pCoord, PHPExcel_Cell $cell)
{
@ -252,10 +253,9 @@ class PHPExcel_CachedObjectStorage_SQLite3 extends PHPExcel_CachedObjectStorage_
/**
* Clone the cell collection
*
* @param PHPExcel_Worksheet $parent The new worksheet
* @return void
* @param \PHPExcel\Worksheet $parent The new worksheet that we're copying to
*/
public function copyCellCollection(PHPExcel_Worksheet $parent)
public function copyCellCollection(\PHPExcel\Worksheet $parent)
{
$this->currentCellIsDirty;
$this->storeData();

View File

@ -1,5 +1,7 @@
<?php
namespace PHPExcel\CachedObjectStorage;
/**
* PHPExcel_CachedObjectStorage_Wincache
*
@ -25,7 +27,7 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
class PHPExcel_CachedObjectStorage_Wincache extends PHPExcel_CachedObjectStorage_CacheBase implements PHPExcel_CachedObjectStorage_ICache
class Wincache extends CacheBase implements ICache
{
/**
* Prefix used to uniquely identify cache data for this worksheet
@ -76,11 +78,11 @@ class PHPExcel_CachedObjectStorage_Wincache extends PHPExcel_CachedObjectStorage
* Add or Update a cell in cache identified by coordinate address
*
* @param string $pCoord Coordinate address of the cell to update
* @param PHPExcel_Cell $cell Cell to update
* @return PHPExcel_Cell
* @throws PHPExcel_Exception
* @param \PHPExcel\Cell $cell Cell to update
* @return \PHPExcel\Cell
* @throws \PHPExcel\Exception
*/
public function addCacheData($pCoord, PHPExcel_Cell $cell)
public function addCacheData($pCoord, \PHPExcel\Cell $cell)
{
if (($pCoord !== $this->currentObjectID) && ($this->currentObjectID !== null)) {
$this->storeData();
@ -192,10 +194,9 @@ class PHPExcel_CachedObjectStorage_Wincache extends PHPExcel_CachedObjectStorage
/**
* Clone the cell collection
*
* @param PHPExcel_Worksheet $parent The new worksheet
* @return void
* @param \PHPExcel\Worksheet $parent The new worksheet that we're copying to
*/
public function copyCellCollection(PHPExcel_Worksheet $parent)
public function copyCellCollection(\PHPExcel\Worksheet $parent)
{
parent::copyCellCollection($parent);
// Get a new id for the new file name

View File

@ -1,5 +1,7 @@
<?php
namespace PHPExcel;
/**
* PHPExcel_CachedObjectStorageFactory
*
@ -25,91 +27,91 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
class PHPExcel_CachedObjectStorageFactory
class CachedObjectStorageFactory
{
const cache_in_memory = 'Memory';
const cache_in_memory_gzip = 'MemoryGZip';
const cache_in_memory_serialized = 'MemorySerialized';
const cache_igbinary = 'Igbinary';
const cache_to_discISAM = 'DiscISAM';
const cache_to_apc = 'APC';
const cache_to_memcache = 'Memcache';
const cache_to_phpTemp = 'PHPTemp';
const cache_to_wincache = 'Wincache';
const cache_to_sqlite = 'SQLite';
const cache_to_sqlite3 = 'SQLite3';
const CACHE_IN_MEMORY = 'Memory';
const CACHE_IN_MEMORY_GZIP = 'MemoryGZip';
const CACHE_IN_MEMORY_SERIALIZED = 'MemorySerialized';
const CACHE_IGBINARY = 'Igbinary';
const CACHE_TO_DISCISAM = 'DiscISAM';
const CACHE_TO_APC = 'APC';
const CACHE_TO_MEMCACHE = 'Memcache';
const CACHE_TO_PHPTEMP = 'PHPTemp';
const CACHE_TO_WINCACHE = 'Wincache';
const CACHE_TO_SQLITE = 'SQLite';
const CACHE_TO_SQLITE3 = 'SQLite3';
/**
* Name of the method used for cell cacheing
*
* @var string
*/
private static $cacheStorageMethod = null;
private static $cacheStorageMethod;
/**
* Name of the class used for cell cacheing
*
* @var string
*/
private static $cacheStorageClass = null;
private static $cacheStorageClass;
/**
* List of all possible cache storage methods
*
* @var string[]
*/
private static $storageMethods = array(
self::cache_in_memory,
self::cache_in_memory_gzip,
self::cache_in_memory_serialized,
self::cache_igbinary,
self::cache_to_phpTemp,
self::cache_to_discISAM,
self::cache_to_apc,
self::cache_to_memcache,
self::cache_to_wincache,
self::cache_to_sqlite,
self::cache_to_sqlite3,
);
private static $storageMethods = [
self::CACHE_IN_MEMORY,
self::CACHE_IN_MEMORY_GZIP,
self::CACHE_IN_MEMORY_SERIALIZED,
self::CACHE_IGBINARY,
self::CACHE_TO_PHPTEMP,
self::CACHE_TO_DISCISAM,
self::CACHE_TO_APC,
self::CACHE_TO_MEMCACHE,
self::CACHE_TO_WINCACHE,
self::CACHE_TO_SQLITE,
self::CACHE_TO_SQLITE3,
];
/**
* Default arguments for each cache storage method
*
* @var array of mixed array
*/
private static $storageMethodDefaultParameters = array(
self::cache_in_memory => array(
),
self::cache_in_memory_gzip => array(
),
self::cache_in_memory_serialized => array(
),
self::cache_igbinary => array(
),
self::cache_to_phpTemp => array( 'memoryCacheSize' => '1MB'
),
self::cache_to_discISAM => array( 'dir' => null
),
self::cache_to_apc => array( 'cacheTime' => 600
),
self::cache_to_memcache => array( 'memcacheServer' => 'localhost',
private static $storageMethodDefaultParameters = [
self::CACHE_IN_MEMORY => [],
self::CACHE_IN_MEMORY_GZIP => [],
self::CACHE_IN_MEMORY_SERIALIZED => [],
self::CACHE_IGBINARY => [],
self::CACHE_TO_PHPTEMP => [
'memoryCacheSize' => '1MB',
],
self::CACHE_TO_DISCISAM => [
'dir' => null,
],
self::CACHE_TO_APC => [
'cacheTime' => 600,
],
self::CACHE_TO_MEMCACHE => [
'memcacheServer' => 'localhost',
'memcachePort' => 11211,
'cacheTime' => 600
),
self::cache_to_wincache => array( 'cacheTime' => 600
),
self::cache_to_sqlite => array(
),
self::cache_to_sqlite3 => array(
),
);
'cacheTime' => 600,
],
self::CACHE_TO_WINCACHE => [
'cacheTime' => 600,
],
self::CACHE_TO_SQLITE => [],
self::CACHE_TO_SQLITE3 => [],
];
/**
* Arguments for the active cache storage method
*
* @var array of mixed array
* @var mixed[]
*/
private static $storageMethodParameters = array();
private static $storageMethodParameters = [];
/**
* Return the current cache storage method
@ -124,7 +126,7 @@ class PHPExcel_CachedObjectStorageFactory
/**
* Return the current cache storage class
*
* @return PHPExcel_CachedObjectStorage_ICache|null
* @return \CachedObjectStorage\ICache|null
**/
public static function getCacheStorageClass()
{
@ -162,31 +164,30 @@ class PHPExcel_CachedObjectStorageFactory
* Identify the cache storage method to use
*
* @param string $method Name of the method to use for cell cacheing
* @param array of mixed $arguments Additional arguments to pass to the cell caching class
* @param mixed[] $arguments Additional arguments to pass to the cell caching class
* when instantiating
* @return boolean
**/
public static function initialize($method = self::cache_in_memory, $arguments = array())
public static function initialize($method = self::CACHE_IN_MEMORY, $arguments = [])
{
if (!in_array($method, self::$storageMethods)) {
return false;
}
$cacheStorageClass = 'PHPExcel_CachedObjectStorage_'.$method;
if (!call_user_func(array( $cacheStorageClass,
'cacheMethodIsAvailable'))) {
$cacheStorageClass = '\\PHPExcel\\CachedObjectStorage\\'.$method;
if (!call_user_func([$cacheStorageClass, 'cacheMethodIsAvailable'])) {
return false;
}
self::$storageMethodParameters[$method] = self::$storageMethodDefaultParameters[$method];
foreach ($arguments as $k => $v) {
if (array_key_exists($k, self::$storageMethodParameters[$method])) {
self::$storageMethodParameters[$method][$k] = $v;
foreach ($arguments as $argument => $value) {
if (array_key_exists($argument, self::$storageMethodParameters[$method])) {
self::$storageMethodParameters[$method][$argument] = $value;
}
}
if (self::$cacheStorageMethod === null) {
self::$cacheStorageClass = 'PHPExcel_CachedObjectStorage_' . $method;
self::$cacheStorageClass = '\\PHPExcel\\CachedObjectStorage\\' . $method;
self::$cacheStorageMethod = $method;
}
return true;
@ -195,10 +196,10 @@ class PHPExcel_CachedObjectStorageFactory
/**
* Initialise the cache storage
*
* @param PHPExcel_Worksheet $parent Enable cell caching for this worksheet
* @return PHPExcel_CachedObjectStorage_ICache
* @param Worksheet $parent Enable cell caching for this worksheet
* @return CachedObjectStorage\ICache
**/
public static function getInstance(PHPExcel_Worksheet $parent)
public static function getInstance(Worksheet $parent)
{
$cacheMethodIsAvailable = true;
if (self::$cacheStorageMethod === null) {

View File

@ -1,5 +1,7 @@
<?php
namespace PHPExcel\CalcEngine;
/**
* PHPExcel_CalcEngine_CyclicReferenceStack
*
@ -25,7 +27,7 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
class PHPExcel_CalcEngine_CyclicReferenceStack
class CyclicReferenceStack
{
/**
* The call stack for calculated cells

View File

@ -1,5 +1,7 @@
<?php
namespace PHPExcel\CalcEngine;
/**
* PHPExcel_CalcEngine_Logger
*
@ -25,7 +27,7 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
class PHPExcel_CalcEngine_Logger
class Logger
{
/**
* Flag to determine whether a debug log should be generated by the calculation engine
@ -65,7 +67,7 @@ class PHPExcel_CalcEngine_Logger
*
* @param PHPExcel_CalcEngine_CyclicReferenceStack $stack
*/
public function __construct(PHPExcel_CalcEngine_CyclicReferenceStack $stack)
public function __construct(CyclicReferenceStack $stack)
{
$this->cellStack = $stack;
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,150 @@
<?php
namespace PHPExcel\Calculation;
/**
* PHPExcel_Calculation_Categories
*
* Copyright (c) 2006 - 2015 PHPExcel
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel_Calculation
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
class Categories
{
/* Function categories */
const CATEGORY_CUBE = 'Cube';
const CATEGORY_DATABASE = 'Database';
const CATEGORY_DATE_AND_TIME = 'Date and Time';
const CATEGORY_ENGINEERING = 'Engineering';
const CATEGORY_FINANCIAL = 'Financial';
const CATEGORY_INFORMATION = 'Information';
const CATEGORY_LOGICAL = 'Logical';
const CATEGORY_LOOKUP_AND_REFERENCE = 'Lookup and Reference';
const CATEGORY_MATH_AND_TRIG = 'Math and Trig';
const CATEGORY_STATISTICAL = 'Statistical';
const CATEGORY_TEXT_AND_DATA = 'Text and Data';
/**
* Category (represented by CATEGORY_*)
*
* @var string
*/
private $category;
/**
* Excel name
*
* @var string
*/
private $excelName;
/**
* PHPExcel name
*
* @var string
*/
private $phpExcelName;
/**
* Create a new PHPExcel_Calculation_Function
*
* @param string $pCategory Category (represented by CATEGORY_*)
* @param string $pExcelName Excel function name
* @param string $pPHPExcelName PHPExcel function mapping
* @throws PHPExcel_Calculation_Exception
*/
public function __construct($pCategory = null, $pExcelName = null, $pPHPExcelName = null)
{
if (($pCategory !== null) && ($pExcelName !== null) && ($pPHPExcelName !== null)) {
// Initialise values
$this->category = $pCategory;
$this->excelName = $pExcelName;
$this->phpExcelName = $pPHPExcelName;
} else {
throw new PHPExcel_Calculation_Exception("Invalid parameters passed.");
}
}
/**
* Get Category (represented by CATEGORY_*)
*
* @return string
*/
public function getCategory()
{
return $this->category;
}
/**
* Set Category (represented by CATEGORY_*)
*
* @param string $value
* @throws PHPExcel_Calculation_Exception
*/
public function setCategory($value = null)
{
if (!is_null($value)) {
$this->category = $value;
} else {
throw new PHPExcel_Calculation_Exception("Invalid parameter passed.");
}
}
/**
* Get Excel name
*
* @return string
*/
public function getExcelName()
{
return $this->excelName;
}
/**
* Set Excel name
*
* @param string $value
*/
public function setExcelName($value)
{
$this->excelName = $value;
}
/**
* Get PHPExcel name
*
* @return string
*/
public function getPHPExcelName()
{
return $this->phpExcelName;
}
/**
* Set PHPExcel name
*
* @param string $value
*/
public function setPHPExcelName($value)
{
$this->phpExcelName = $value;
}
}

View File

@ -1,13 +1,6 @@
<?php
/** PHPExcel root directory */
if (!defined('PHPEXCEL_ROOT')) {
/**
* @ignore
*/
define('PHPEXCEL_ROOT', dirname(__FILE__) . '/../../');
require(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
}
namespace PHPExcel\Calculation;
/**
* PHPExcel_Calculation_Database
@ -34,7 +27,7 @@ if (!defined('PHPEXCEL_ROOT')) {
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
class PHPExcel_Calculation_Database
class Database
{
/**
* fieldExtract

View File

@ -1,13 +1,6 @@
<?php
/** PHPExcel root directory */
if (!defined('PHPEXCEL_ROOT')) {
/**
* @ignore
*/
define('PHPEXCEL_ROOT', dirname(__FILE__) . '/../../');
require(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
}
namespace PHPExcel\Calculation;
/**
* PHPExcel_Calculation_DateTime
@ -34,7 +27,7 @@ if (!defined('PHPEXCEL_ROOT')) {
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
class PHPExcel_Calculation_DateTime
class DateTime
{
/**
* Identify if a year is a leap year or not

View File

@ -1,13 +1,6 @@
<?php
/** PHPExcel root directory */
if (!defined('PHPEXCEL_ROOT')) {
/**
* @ignore
*/
define('PHPEXCEL_ROOT', dirname(__FILE__) . '/../../');
require(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
}
namespace PHPExcel\Calculation;
/** EULER */
define('EULER', 2.71828182845904523536);
@ -37,7 +30,7 @@ define('EULER', 2.71828182845904523536);
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
class PHPExcel_Calculation_Engineering
class Engineering
{
/**
* Details of the Units of measure that can be used in CONVERTUOM()

View File

@ -1,5 +1,7 @@
<?php
namespace PHPExcel\Calculation;
/**
* PHPExcel_Calculation_Exception
*
@ -25,7 +27,7 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
class PHPExcel_Calculation_Exception extends PHPExcel_Exception
class Exception extends \PHPExcel\Exception
{
/**
* Error handler callback

View File

@ -1,5 +1,7 @@
<?php
namespace PHPExcel\Calculation;
/**
* PHPExcel_Calculation_ExceptionHandler
*
@ -25,7 +27,7 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
class PHPExcel_Calculation_ExceptionHandler
class ExceptionHandler
{
/**
* Register errorhandler

View File

@ -1,13 +1,6 @@
<?php
/** PHPExcel root directory */
if (!defined('PHPEXCEL_ROOT')) {
/**
* @ignore
*/
define('PHPEXCEL_ROOT', dirname(__FILE__) . '/../../');
require(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
}
namespace PHPExcel\Calculation;
/** FINANCIAL_MAX_ITERATIONS */
define('FINANCIAL_MAX_ITERATIONS', 128);
@ -40,7 +33,7 @@ define('FINANCIAL_PRECISION', 1.0e-08);
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
class PHPExcel_Calculation_Financial
class Financial
{
/**
* isLastDayOfMonth

View File

@ -1,27 +1,6 @@
<?php
/*
PARTLY BASED ON:
Copyright (c) 2007 E. W. Bachtal, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software
and associated documentation files (the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial
portions of the Software.
The software is provided "as is", without warranty of any kind, express or implied, including but not
limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In
no event shall the authors or copyright holders be liable for any claim, damages or other liability,
whether in an action of contract, tort or otherwise, arising from, out of or in connection with the
software or the use or other dealings in the software.
http://ewbi.blogs.com/develops/2007/03/excel_formula_p.html
http://ewbi.blogs.com/develops/2004/12/excel_formula_p.html
*/
namespace PHPExcel\Calculation;
/**
* PHPExcel_Calculation_FormulaParser
@ -48,9 +27,29 @@ PARTLY BASED ON:
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
/*
PARTLY BASED ON:
Copyright (c) 2007 E. W. Bachtal, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software
and associated documentation files (the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
class PHPExcel_Calculation_FormulaParser
The above copyright notice and this permission notice shall be included in all copies or substantial
portions of the Software.
The software is provided "as is", without warranty of any kind, express or implied, including but not
limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In
no event shall the authors or copyright holders be liable for any claim, damages or other liability,
whether in an action of contract, tort or otherwise, arising from, out of or in connection with the
software or the use or other dealings in the software.
http://ewbi.blogs.com/develops/2007/03/excel_formula_p.html
http://ewbi.blogs.com/develops/2004/12/excel_formula_p.html
*/
class FormulaParser
{
/* Character constants */
const QUOTE_DOUBLE = '"';

View File

@ -1,27 +1,6 @@
<?php
/*
PARTLY BASED ON:
Copyright (c) 2007 E. W. Bachtal, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software
and associated documentation files (the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial
portions of the Software.
The software is provided "as is", without warranty of any kind, express or implied, including but not
limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In
no event shall the authors or copyright holders be liable for any claim, damages or other liability,
whether in an action of contract, tort or otherwise, arising from, out of or in connection with the
software or the use or other dealings in the software.
http://ewbi.blogs.com/develops/2007/03/excel_formula_p.html
http://ewbi.blogs.com/develops/2004/12/excel_formula_p.html
*/
namespace PHPExcel\Calculation;
/**
* PHPExcel_Calculation_FormulaToken
@ -48,9 +27,30 @@ PARTLY BASED ON:
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
/*
PARTLY BASED ON:
Copyright (c) 2007 E. W. Bachtal, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software
and associated documentation files (the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
class PHPExcel_Calculation_FormulaToken
The above copyright notice and this permission notice shall be included in all copies or substantial
portions of the Software.
The software is provided "as is", without warranty of any kind, express or implied, including but not
limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In
no event shall the authors or copyright holders be liable for any claim, damages or other liability,
whether in an action of contract, tort or otherwise, arising from, out of or in connection with the
software or the use or other dealings in the software.
http://ewbi.blogs.com/develops/2007/03/excel_formula_p.html
http://ewbi.blogs.com/develops/2004/12/excel_formula_p.html
*/
class FormulaToken
{
/* Token types */
const TOKEN_TYPE_NOOP = 'Noop';

View File

@ -1,5 +1,7 @@
<?php
namespace PHPExcel\Calculation;
/**
* PHPExcel_Calculation_Function
*
@ -25,7 +27,7 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
class PHPExcel_Calculation_Function
class Function
{
/* Function categories */
const CATEGORY_CUBE = 'Cube';

View File

@ -1,14 +1,6 @@
<?php
/** PHPExcel root directory */
if (!defined('PHPEXCEL_ROOT')) {
/**
* @ignore
*/
define('PHPEXCEL_ROOT', dirname(__FILE__) . '/../../');
require(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
}
namespace PHPExcel\Calculation;
/** MAX_VALUE */
define('MAX_VALUE', 1.2e308);
@ -48,7 +40,7 @@ define('PRECISION', 8.88E-016);
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
class PHPExcel_Calculation_Functions
class Functions
{
/** constants */

View File

@ -1,13 +1,6 @@
<?php
/** PHPExcel root directory */
if (!defined('PHPEXCEL_ROOT')) {
/**
* @ignore
*/
define('PHPEXCEL_ROOT', dirname(__FILE__) . '/../../');
require(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
}
namespace PHPExcel\Calculation;
/**
* PHPExcel_Calculation_Logical

View File

@ -1,13 +1,6 @@
<?php
/** PHPExcel root directory */
if (!defined('PHPEXCEL_ROOT')) {
/**
* @ignore
*/
define('PHPEXCEL_ROOT', dirname(__FILE__) . '/../../');
require(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
}
namespace PHPExcel\Calculation;
/**
* PHPExcel_Calculation_LookupRef
@ -34,7 +27,7 @@ if (!defined('PHPEXCEL_ROOT')) {
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
class PHPExcel_Calculation_LookupRef
class LookupRef
{
/**
* CELL_ADDRESS

View File

@ -1,13 +1,6 @@
<?php
/** PHPExcel root directory */
if (!defined('PHPEXCEL_ROOT')) {
/**
* @ignore
*/
define('PHPEXCEL_ROOT', dirname(__FILE__) . '/../../');
require(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
}
namespace PHPExcel\Calculation;
/**
* PHPExcel_Calculation_MathTrig
@ -34,7 +27,7 @@ if (!defined('PHPEXCEL_ROOT')) {
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
class PHPExcel_Calculation_MathTrig
class MathTrig
{
//
// Private method to return an array of the factors of the input value

View File

@ -1,14 +1,6 @@
<?php
/** PHPExcel root directory */
if (!defined('PHPEXCEL_ROOT')) {
/**
* @ignore
*/
define('PHPEXCEL_ROOT', dirname(__FILE__) . '/../../');
require(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
}
namespace PHPExcel\Calculation;
require_once PHPEXCEL_ROOT . 'PHPExcel/Shared/trend/trendClass.php';
@ -50,7 +42,7 @@ define('SQRT2PI', 2.5066282746310005024157652848110452530069867406099);
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
class PHPExcel_Calculation_Statistical
class Statistical
{
private static function checkTrendArrays(&$array1, &$array2)
{

View File

@ -1,13 +1,6 @@
<?php
/** PHPExcel root directory */
if (!defined('PHPEXCEL_ROOT')) {
/**
* @ignore
*/
define('PHPEXCEL_ROOT', dirname(__FILE__) . '/../../');
require(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
}
namespace PHPExcel\Calculation;
/**
* PHPExcel_Calculation_TextData
@ -34,7 +27,7 @@ if (!defined('PHPEXCEL_ROOT')) {
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
class PHPExcel_Calculation_TextData
class TextData
{
private static $invalidChars;

View File

@ -1,5 +1,7 @@
<?php
namespace PHPExcel;
/**
* PHPExcel_Cell
*
@ -25,7 +27,7 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
class PHPExcel_Cell
class Cell
{
/**
* Default range variable constant
@ -37,7 +39,7 @@ class PHPExcel_Cell
/**
* Value binder to use
*
* @var PHPExcel_Cell_IValueBinder
* @var Cell\IValueBinder
*/
private static $valueBinder;
@ -70,7 +72,7 @@ class PHPExcel_Cell
/**
* Parent worksheet
*
* @var PHPExcel_CachedObjectStorage_CacheBase
* @var CachedObjectStorage\CacheBase
*/
private $parent;
@ -105,7 +107,7 @@ class PHPExcel_Cell
$this->parent = null;
}
public function attach(PHPExcel_CachedObjectStorage_CacheBase $parent)
public function attach(CachedObjectStorage\CacheBase $parent)
{
$this->parent = $parent;
}
@ -116,10 +118,10 @@ class PHPExcel_Cell
*
* @param mixed $pValue
* @param string $pDataType
* @param PHPExcel_Worksheet $pSheet
* @throws PHPExcel_Exception
* @param Worksheet $pSheet
* @throws Exception
*/
public function __construct($pValue = null, $pDataType = null, PHPExcel_Worksheet $pSheet = null)
public function __construct($pValue = null, $pDataType = null, Worksheet $pSheet = null)
{
// Initialise cell value
$this->value = $pValue;
@ -129,12 +131,12 @@ class PHPExcel_Cell
// Set datatype?
if ($pDataType !== null) {
if ($pDataType == PHPExcel_Cell_DataType::TYPE_STRING2) {
$pDataType = PHPExcel_Cell_DataType::TYPE_STRING;
if ($pDataType == Cell\DataType::TYPE_STRING2) {
$pDataType = Cell\DataType::TYPE_STRING;
}
$this->dataType = $pDataType;
} elseif (!self::getValueBinder()->bindValue($this, $pValue)) {
throw new PHPExcel_Exception("Value could not be bound to cell.");
throw new Exception("Value could not be bound to cell.");
}
}
@ -185,7 +187,7 @@ class PHPExcel_Cell
*/
public function getFormattedValue()
{
return (string) PHPExcel_Style_NumberFormat::toFormattedString(
return (string) Style\NumberFormat::toFormattedString(
$this->getCalculatedValue(),
$this->getStyle()
->getNumberFormat()->getFormatCode()
@ -198,13 +200,13 @@ class PHPExcel_Cell
* Sets the value for a cell, automatically determining the datatype using the value binder
*
* @param mixed $pValue Value
* @return PHPExcel_Cell
* @throws PHPExcel_Exception
* @return Cell
* @throws Exception
*/
public function setValue($pValue = null)
{
if (!self::getValueBinder()->bindValue($this, $pValue)) {
throw new PHPExcel_Exception("Value could not be bound to cell.");
throw new Exception("Value could not be bound to cell.");
}
return $this;
}
@ -214,39 +216,39 @@ class PHPExcel_Cell
*
* @param mixed $pValue Value
* @param string $pDataType Explicit data type
* @return PHPExcel_Cell
* @throws PHPExcel_Exception
* @return Cell
* @throws Exception
*/
public function setValueExplicit($pValue = null, $pDataType = PHPExcel_Cell_DataType::TYPE_STRING)
public function setValueExplicit($pValue = null, $pDataType = Cell\DataType::TYPE_STRING)
{
// set the value according to data type
switch ($pDataType) {
case PHPExcel_Cell_DataType::TYPE_NULL:
case Cell\DataType::TYPE_NULL:
$this->value = $pValue;
break;
case PHPExcel_Cell_DataType::TYPE_STRING2:
$pDataType = PHPExcel_Cell_DataType::TYPE_STRING;
case Cell\DataType::TYPE_STRING2:
$pDataType = Cell\DataType::TYPE_STRING;
// no break
case PHPExcel_Cell_DataType::TYPE_STRING:
case Cell\DataType::TYPE_STRING:
// Synonym for string
case PHPExcel_Cell_DataType::TYPE_INLINE:
case Cell\DataType::TYPE_INLINE:
// Rich text
$this->value = PHPExcel_Cell_DataType::checkString($pValue);
$this->value = Cell\DataType::checkString($pValue);
break;
case PHPExcel_Cell_DataType::TYPE_NUMERIC:
case Cell\DataType::TYPE_NUMERIC:
$this->value = (float) $pValue;
break;
case PHPExcel_Cell_DataType::TYPE_FORMULA:
case Cell\DataType::TYPE_FORMULA:
$this->value = (string) $pValue;
break;
case PHPExcel_Cell_DataType::TYPE_BOOL:
case Cell\DataType::TYPE_BOOL:
$this->value = (bool) $pValue;
break;
case PHPExcel_Cell_DataType::TYPE_ERROR:
$this->value = PHPExcel_Cell_DataType::checkErrorCode($pValue);
case Cell\DataType::TYPE_ERROR:
$this->value = Cell\DataType::checkErrorCode($pValue);
break;
default:
throw new PHPExcel_Exception('Invalid datatype: ' . $pDataType);
throw new Exception('Invalid datatype: ' . $pDataType);
break;
}
@ -263,15 +265,15 @@ class PHPExcel_Cell
*
* @param boolean $resetLog Whether the calculation engine logger should be reset or not
* @return mixed
* @throws PHPExcel_Exception
* @throws Exception
*/
public function getCalculatedValue($resetLog = true)
{
//echo 'Cell '.$this->getCoordinate().' value is a '.$this->dataType.' with a value of '.$this->getValue().PHP_EOL;
if ($this->dataType == PHPExcel_Cell_DataType::TYPE_FORMULA) {
if ($this->dataType == Cell\DataType::TYPE_FORMULA) {
try {
//echo 'Cell value for '.$this->getCoordinate().' is a formula: Calculating value'.PHP_EOL;
$result = PHPExcel_Calculation::getInstance(
$result = Calculation::getInstance(
$this->getWorksheet()->getParent()
)->calculateCellValue($this, $resetLog);
//echo $this->getCoordinate().' calculation result is '.$result.PHP_EOL;
@ -281,14 +283,14 @@ class PHPExcel_Cell
$result = array_pop($result);
}
}
} catch (PHPExcel_Exception $ex) {
} catch (Exception $ex) {
if (($ex->getMessage() === 'Unable to access External Workbook') && ($this->calculatedValue !== null)) {
//echo 'Returning fallback value of '.$this->calculatedValue.' for cell '.$this->getCoordinate().PHP_EOL;
return $this->calculatedValue; // Fallback for calculations referencing external files.
}
//echo 'Calculation Exception: '.$ex->getMessage().PHP_EOL;
$result = '#N/A';
throw new PHPExcel_Calculation_Exception(
throw new Calculation\Exception(
$this->getWorksheet()->getTitle().'!'.$this->getCoordinate().' -> '.$ex->getMessage()
);
}
@ -299,7 +301,7 @@ class PHPExcel_Cell
}
//echo 'Returning calculated value of '.$result.' for cell '.$this->getCoordinate().PHP_EOL;
return $result;
} elseif ($this->value instanceof PHPExcel_RichText) {
} elseif ($this->value instanceof RichText) {
// echo 'Cell value for '.$this->getCoordinate().' is rich text: Returning data value of '.$this->value.'<br />';
return $this->value->getPlainText();
}
@ -311,7 +313,7 @@ class PHPExcel_Cell
* Set old calculated value (cached)
*
* @param mixed $pValue Value
* @return PHPExcel_Cell
* @return Cell
*/
public function setCalculatedValue($pValue = null)
{
@ -351,12 +353,12 @@ class PHPExcel_Cell
* Set cell data type
*
* @param string $pDataType
* @return PHPExcel_Cell
* @return Cell
*/
public function setDataType($pDataType = PHPExcel_Cell_DataType::TYPE_STRING)
public function setDataType($pDataType = Cell\DataType::TYPE_STRING)
{
if ($pDataType == PHPExcel_Cell_DataType::TYPE_STRING2) {
$pDataType = PHPExcel_Cell_DataType::TYPE_STRING;
if ($pDataType == Cell\DataType::TYPE_STRING2) {
$pDataType = Cell\DataType::TYPE_STRING;
}
$this->dataType = $pDataType;
@ -370,19 +372,19 @@ class PHPExcel_Cell
*/
public function isFormula()
{
return $this->dataType == PHPExcel_Cell_DataType::TYPE_FORMULA;
return $this->dataType == Cell\DataType::TYPE_FORMULA;
}
/**
* Does this cell contain Data validation rules?
*
* @return boolean
* @throws PHPExcel_Exception
* @throws Exception
*/
public function hasDataValidation()
{
if (!isset($this->parent)) {
throw new PHPExcel_Exception('Cannot check for data validation when cell is not bound to a worksheet');
throw new Exception('Cannot check for data validation when cell is not bound to a worksheet');
}
return $this->getWorksheet()->dataValidationExists($this->getCoordinate());
@ -391,13 +393,13 @@ class PHPExcel_Cell
/**
* Get Data validation rules
*
* @return PHPExcel_Cell_DataValidation
* @throws PHPExcel_Exception
* @return Cell\DataValidation
* @throws Exception
*/
public function getDataValidation()
{
if (!isset($this->parent)) {
throw new PHPExcel_Exception('Cannot get data validation for cell that is not bound to a worksheet');
throw new Exception('Cannot get data validation for cell that is not bound to a worksheet');
}
return $this->getWorksheet()->getDataValidation($this->getCoordinate());
@ -406,14 +408,14 @@ class PHPExcel_Cell
/**
* Set Data validation rules
*
* @param PHPExcel_Cell_DataValidation $pDataValidation
* @return PHPExcel_Cell
* @throws PHPExcel_Exception
* @param Cell\DataValidation $pDataValidation
* @return Cell
* @throws Exception
*/
public function setDataValidation(PHPExcel_Cell_DataValidation $pDataValidation = null)
public function setDataValidation(Cell\DataValidation $pDataValidation = null)
{
if (!isset($this->parent)) {
throw new PHPExcel_Exception('Cannot set data validation for cell that is not bound to a worksheet');
throw new Exception('Cannot set data validation for cell that is not bound to a worksheet');
}
$this->getWorksheet()->setDataValidation($this->getCoordinate(), $pDataValidation);
@ -425,12 +427,12 @@ class PHPExcel_Cell
* Does this cell contain a Hyperlink?
*
* @return boolean
* @throws PHPExcel_Exception
* @throws Exception
*/
public function hasHyperlink()
{
if (!isset($this->parent)) {
throw new PHPExcel_Exception('Cannot check for hyperlink when cell is not bound to a worksheet');
throw new Exception('Cannot check for hyperlink when cell is not bound to a worksheet');
}
return $this->getWorksheet()->hyperlinkExists($this->getCoordinate());
@ -439,13 +441,13 @@ class PHPExcel_Cell
/**
* Get Hyperlink
*
* @return PHPExcel_Cell_Hyperlink
* @throws PHPExcel_Exception
* @return Cell\Hyperlink
* @throws Exception
*/
public function getHyperlink()
{
if (!isset($this->parent)) {
throw new PHPExcel_Exception('Cannot get hyperlink for cell that is not bound to a worksheet');
throw new Exception('Cannot get hyperlink for cell that is not bound to a worksheet');
}
return $this->getWorksheet()->getHyperlink($this->getCoordinate());
@ -454,14 +456,14 @@ class PHPExcel_Cell
/**
* Set Hyperlink
*
* @param PHPExcel_Cell_Hyperlink $pHyperlink
* @return PHPExcel_Cell
* @throws PHPExcel_Exception
* @param Cell\Hyperlink $pHyperlink
* @return Cell
* @throws Exception
*/
public function setHyperlink(PHPExcel_Cell_Hyperlink $pHyperlink = null)
public function setHyperlink(Cell\Hyperlink $pHyperlink = null)
{
if (!isset($this->parent)) {
throw new PHPExcel_Exception('Cannot set hyperlink for cell that is not bound to a worksheet');
throw new Exception('Cannot set hyperlink for cell that is not bound to a worksheet');
}
$this->getWorksheet()->setHyperlink($this->getCoordinate(), $pHyperlink);
@ -472,7 +474,7 @@ class PHPExcel_Cell
/**
* Get parent worksheet
*
* @return PHPExcel_CachedObjectStorage_CacheBase
* @return CachedObjectStorage\CacheBase
*/
public function getParent()
{
@ -482,7 +484,7 @@ class PHPExcel_Cell
/**
* Get parent worksheet
*
* @return PHPExcel_Worksheet
* @return Worksheet
*/
public function getWorksheet()
{
@ -507,7 +509,7 @@ class PHPExcel_Cell
public function isMergeRangeValueCell()
{
if ($mergeRange = $this->getMergeRange()) {
$mergeRange = PHPExcel_Cell::splitRange($mergeRange);
$mergeRange = Cell::splitRange($mergeRange);
list($startCell) = $mergeRange[0];
if ($this->getCoordinate() === $startCell) {
return true;
@ -534,7 +536,7 @@ class PHPExcel_Cell
/**
* Get cell style
*
* @return PHPExcel_Style
* @return Style
*/
public function getStyle()
{
@ -544,10 +546,10 @@ class PHPExcel_Cell
/**
* Re-bind parent
*
* @param PHPExcel_Worksheet $parent
* @return PHPExcel_Cell
* @param Worksheet $parent
* @return Cell
*/
public function rebindParent(PHPExcel_Worksheet $parent)
public function rebindParent(Worksheet $parent)
{
$this->parent = $parent->getCellCacheController();
@ -579,19 +581,19 @@ class PHPExcel_Cell
*
* @param string $pCoordinateString
* @return array Array containing column and row (indexes 0 and 1)
* @throws PHPExcel_Exception
* @throws Exception
*/
public static function coordinateFromString($pCoordinateString = 'A1')
{
if (preg_match("/^([$]?[A-Z]{1,3})([$]?\d{1,7})$/", $pCoordinateString, $matches)) {
return array($matches[1],$matches[2]);
} elseif ((strpos($pCoordinateString, ':') !== false) || (strpos($pCoordinateString, ',') !== false)) {
throw new PHPExcel_Exception('Cell coordinate string can not be a range of cells');
throw new Exception('Cell coordinate string can not be a range of cells');
} elseif ($pCoordinateString == '') {
throw new PHPExcel_Exception('Cell coordinate can not be zero-length string');
throw new Exception('Cell coordinate can not be zero-length string');
}
throw new PHPExcel_Exception('Invalid cell coordinate '.$pCoordinateString);
throw new Exception('Invalid cell coordinate '.$pCoordinateString);
}
/**
@ -600,7 +602,7 @@ class PHPExcel_Cell
* @param string $pCoordinateString e.g. 'A' or '1' or 'A1'
* Note that this value can be a row or column reference as well as a cell reference
* @return string Absolute coordinate e.g. '$A' or '$1' or '$A$1'
* @throws PHPExcel_Exception
* @throws Exception
*/
public static function absoluteReference($pCoordinateString = 'A1')
{
@ -624,7 +626,7 @@ class PHPExcel_Cell
return $worksheet . self::absoluteCoordinate($pCoordinateString);
}
throw new PHPExcel_Exception('Cell coordinate string can not be a range of cells');
throw new Exception('Cell coordinate string can not be a range of cells');
}
/**
@ -632,7 +634,7 @@ class PHPExcel_Cell
*
* @param string $pCoordinateString e.g. 'A1'
* @return string Absolute coordinate e.g. '$A$1'
* @throws PHPExcel_Exception
* @throws Exception
*/
public static function absoluteCoordinate($pCoordinateString = 'A1')
{
@ -654,7 +656,7 @@ class PHPExcel_Cell
return $worksheet . '$' . $column . '$' . $row;
}
throw new PHPExcel_Exception('Cell coordinate string can not be a range of cells');
throw new Exception('Cell coordinate string can not be a range of cells');
}
/**
@ -685,13 +687,13 @@ class PHPExcel_Cell
*
* @param array $pRange Array containg one or more arrays containing one or two coordinate strings
* @return string String representation of $pRange
* @throws PHPExcel_Exception
* @throws Exception
*/
public static function buildRange($pRange)
{
// Verify range
if (!is_array($pRange) || empty($pRange) || !is_array($pRange[0])) {
throw new PHPExcel_Exception('Range does not contain any information');
throw new Exception('Range does not contain any information');
}
// Build range
@ -821,7 +823,7 @@ class PHPExcel_Cell
return $_indexCache[$pString];
}
}
throw new PHPExcel_Exception("Column string index can not be " . ((isset($pString{0})) ? "longer than 3 characters" : "empty"));
throw new Exception("Column string index can not be " . ((isset($pString{0})) ? "longer than 3 characters" : "empty"));
}
/**
@ -919,11 +921,11 @@ class PHPExcel_Cell
/**
* Compare 2 cells
*
* @param PHPExcel_Cell $a Cell a
* @param PHPExcel_Cell $b Cell b
* @param Cell $a Cell a
* @param Cell $b Cell b
* @return int Result of comparison (always -1 or 1, never zero!)
*/
public static function compareCells(PHPExcel_Cell $a, PHPExcel_Cell $b)
public static function compareCells(Cell $a, Cell $b)
{
if ($a->getRow() < $b->getRow()) {
return -1;
@ -939,12 +941,12 @@ class PHPExcel_Cell
/**
* Get value binder to use
*
* @return PHPExcel_Cell_IValueBinder
* @return Cell\IValueBinder
*/
public static function getValueBinder()
{
if (self::$valueBinder === null) {
self::$valueBinder = new PHPExcel_Cell_DefaultValueBinder();
self::$valueBinder = new Cell\DefaultValueBinder();
}
return self::$valueBinder;
@ -953,13 +955,13 @@ class PHPExcel_Cell
/**
* Set value binder to use
*
* @param PHPExcel_Cell_IValueBinder $binder
* @throws PHPExcel_Exception
* @param Cell\IValueBinder $binder
* @throws Exception
*/
public static function setValueBinder(PHPExcel_Cell_IValueBinder $binder = null)
public static function setValueBinder(Cell\IValueBinder $binder = null)
{
if ($binder === null) {
throw new PHPExcel_Exception("A PHPExcel_Cell_IValueBinder is required for PHPExcel to function correctly.");
throw new Exception("A \\PHPExcel\\Cell\\IValueBinder is required for PHPExcel to function correctly.");
}
self::$valueBinder = $binder;
@ -994,7 +996,7 @@ class PHPExcel_Cell
* Set index to cellXf
*
* @param int $pValue
* @return PHPExcel_Cell
* @return Cell
*/
public function setXfIndex($pValue = 0)
{

View File

@ -1,13 +1,6 @@
<?php
/** PHPExcel root directory */
if (!defined('PHPEXCEL_ROOT')) {
/**
* @ignore
*/
define('PHPEXCEL_ROOT', dirname(__FILE__) . '/../../');
require(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
}
namespace PHPExcel\Cell;
/**
* PHPExcel_Cell_AdvancedValueBinder
@ -34,7 +27,7 @@ if (!defined('PHPEXCEL_ROOT')) {
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
class PHPExcel_Cell_AdvancedValueBinder extends PHPExcel_Cell_DefaultValueBinder implements PHPExcel_Cell_IValueBinder
class AdvancedValueBinder extends DefaultValueBinder implements IValueBinder
{
/**
* Bind value to a cell
@ -43,7 +36,7 @@ class PHPExcel_Cell_AdvancedValueBinder extends PHPExcel_Cell_DefaultValueBinder
* @param mixed $value Value to bind in cell
* @return boolean
*/
public function bindValue(PHPExcel_Cell $cell, $value = null)
public function bindValue(\PHPExcel\Cell $cell, $value = null)
{
// sanitize UTF-8 strings
if (is_string($value)) {

View File

@ -1,5 +1,7 @@
<?php
namespace PHPExcel\Cell;
/**
* PHPExcel_Cell_DataType
*
@ -25,7 +27,7 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
class PHPExcel_Cell_DataType
class DataType
{
/* Data types */
const TYPE_STRING2 = 'str';
@ -71,7 +73,7 @@ class PHPExcel_Cell_DataType
*/
public static function dataTypeForValue($pValue = null)
{
return PHPExcel_Cell_DefaultValueBinder::dataTypeForValue($pValue);
return DefaultValueBinder::dataTypeForValue($pValue);
}
/**
@ -82,13 +84,13 @@ class PHPExcel_Cell_DataType
*/
public static function checkString($pValue = null)
{
if ($pValue instanceof PHPExcel_RichText) {
if ($pValue instanceof \PHPExcel\RichText) {
// TODO: Sanitize Rich-Text string (max. character count is 32,767)
return $pValue;
}
// string must never be longer than 32,767 characters, truncate if necessary
$pValue = PHPExcel_Shared_String::Substring($pValue, 0, 32767);
$pValue = \PHPExcel\Shared\String::Substring($pValue, 0, 32767);
// we require that newline is represented as "\n" in core, not as "\r\n" or "\r"
$pValue = str_replace(array("\r\n", "\r"), "\n", $pValue);

View File

@ -1,5 +1,7 @@
<?php
namespace PHPExcel\Cell;
/**
* PHPExcel_Cell_DataValidation
*
@ -25,7 +27,7 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
class PHPExcel_Cell_DataValidation
class DataValidation
{
/* Data validation types */
const TYPE_NONE = 'none';
@ -57,111 +59,97 @@ class PHPExcel_Cell_DataValidation
*
* @var string
*/
private $formula1;
private $formula1 = '';
/**
* Formula 2
*
* @var string
*/
private $formula2;
private $formula2 = '';
/**
* Type
*
* @var string
*/
private $type = PHPExcel_Cell_DataValidation::TYPE_NONE;
private $type = DataValidation::TYPE_NONE;
/**
* Error style
*
* @var string
*/
private $errorStyle = PHPExcel_Cell_DataValidation::STYLE_STOP;
private $errorStyle = DataValidation::STYLE_STOP;
/**
* Operator
*
* @var string
*/
private $operator;
private $operator = '';
/**
* Allow Blank
*
* @var boolean
*/
private $allowBlank;
private $allowBlank = false;
/**
* Show DropDown
*
* @var boolean
*/
private $showDropDown;
private $showDropDown = false;
/**
* Show InputMessage
*
* @var boolean
*/
private $showInputMessage;
private $showInputMessage = false;
/**
* Show ErrorMessage
*
* @var boolean
*/
private $showErrorMessage;
private $showErrorMessage = false;
/**
* Error title
*
* @var string
*/
private $errorTitle;
private $errorTitle = '';
/**
* Error
*
* @var string
*/
private $error;
private $error = '';
/**
* Prompt title
*
* @var string
*/
private $promptTitle;
private $promptTitle = '';
/**
* Prompt
*
* @var string
*/
private $prompt;
private $prompt = '';
/**
* Create a new PHPExcel_Cell_DataValidation
*/
public function __construct()
{
// Initialise member variables
$this->formula1 = '';
$this->formula2 = '';
$this->type = PHPExcel_Cell_DataValidation::TYPE_NONE;
$this->errorStyle = PHPExcel_Cell_DataValidation::STYLE_STOP;
$this->operator = '';
$this->allowBlank = false;
$this->showDropDown = false;
$this->showInputMessage = false;
$this->showErrorMessage = false;
$this->errorTitle = '';
$this->error = '';
$this->promptTitle = '';
$this->prompt = '';
}
/**

View File

@ -1,13 +1,6 @@
<?php
/** PHPExcel root directory */
if (!defined('PHPEXCEL_ROOT')) {
/**
* @ignore
*/
define('PHPEXCEL_ROOT', dirname(__FILE__) . '/../../');
require(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
}
namespace PHPExcel\Cell;
/**
* PHPExcel_Cell_DefaultValueBinder
@ -34,25 +27,25 @@ if (!defined('PHPEXCEL_ROOT')) {
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
class PHPExcel_Cell_DefaultValueBinder implements PHPExcel_Cell_IValueBinder
class DefaultValueBinder implements IValueBinder
{
/**
* Bind value to a cell
*
* @param PHPExcel_Cell $cell Cell to bind value to
* @param \PHPExcel\Cell $cell Cell to bind value to
* @param mixed $value Value to bind in cell
* @return boolean
*/
public function bindValue(PHPExcel_Cell $cell, $value = null)
public function bindValue(\PHPExcel\Cell $cell, $value = null)
{
// sanitize UTF-8 strings
if (is_string($value)) {
$value = PHPExcel_Shared_String::SanitizeUTF8($value);
$value = \PHPExcel\Shared\String::SanitizeUTF8($value);
} elseif (is_object($value)) {
// Handle any objects that might be injected
if ($value instanceof DateTime) {
$value = $value->format('Y-m-d H:i:s');
} elseif (!($value instanceof PHPExcel_RichText)) {
} elseif (!($value instanceof \PHPExcel\RichText)) {
$value = (string) $value;
}
}
@ -74,29 +67,29 @@ class PHPExcel_Cell_DefaultValueBinder implements PHPExcel_Cell_IValueBinder
{
// Match the value against a few data types
if ($pValue === null) {
return PHPExcel_Cell_DataType::TYPE_NULL;
return DataType::TYPE_NULL;
} elseif ($pValue === '') {
return PHPExcel_Cell_DataType::TYPE_STRING;
} elseif ($pValue instanceof PHPExcel_RichText) {
return PHPExcel_Cell_DataType::TYPE_INLINE;
return DataType::TYPE_STRING;
} elseif ($pValue instanceof \PHPExcel\RichText) {
return DataType::TYPE_INLINE;
} elseif ($pValue{0} === '=' && strlen($pValue) > 1) {
return PHPExcel_Cell_DataType::TYPE_FORMULA;
return DataType::TYPE_FORMULA;
} elseif (is_bool($pValue)) {
return PHPExcel_Cell_DataType::TYPE_BOOL;
return DataType::TYPE_BOOL;
} elseif (is_float($pValue) || is_int($pValue)) {
return PHPExcel_Cell_DataType::TYPE_NUMERIC;
return DataType::TYPE_NUMERIC;
} elseif (preg_match('/^[\+\-]?([0-9]+\\.?[0-9]*|[0-9]*\\.?[0-9]+)([Ee][\-\+]?[0-2]?\d{1,3})?$/', $pValue)) {
$tValue = ltrim($pValue, '+-');
if (is_string($pValue) && $tValue{0} === '0' && strlen($tValue) > 1 && $tValue{1} !== '.') {
return PHPExcel_Cell_DataType::TYPE_STRING;
return DataType::TYPE_STRING;
} elseif ((strpos($pValue, '.') === false) && ($pValue > PHP_INT_MAX)) {
return PHPExcel_Cell_DataType::TYPE_STRING;
return DataType::TYPE_STRING;
}
return PHPExcel_Cell_DataType::TYPE_NUMERIC;
} elseif (is_string($pValue) && array_key_exists($pValue, PHPExcel_Cell_DataType::getErrorCodes())) {
return PHPExcel_Cell_DataType::TYPE_ERROR;
return DataType::TYPE_NUMERIC;
} elseif (is_string($pValue) && array_key_exists($pValue, DataType::getErrorCodes())) {
return DataType::TYPE_ERROR;
}
return PHPExcel_Cell_DataType::TYPE_STRING;
return DataType::TYPE_STRING;
}
}

View File

@ -1,5 +1,7 @@
<?php
namespace PHPExcel\Cell;
/**
* PHPExcel_Cell_Hyperlink
*
@ -25,7 +27,7 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
class PHPExcel_Cell_Hyperlink
class Hyperlink
{
/**
* URL to link the cell to

View File

@ -1,7 +1,9 @@
<?php
namespace PHPExcel\Cell;
/**
* PHPExcel
* PHPExcel_Cell_IValueBinder
*
* Copyright (c) 2006 - 2015 PHPExcel
*
@ -25,16 +27,7 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
/**
* PHPExcel_Cell_IValueBinder
*
* @category PHPExcel
* @package PHPExcel_Cell
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
*/
interface PHPExcel_Cell_IValueBinder
interface IValueBinder
{
/**
* Bind value to a cell
@ -43,5 +36,5 @@ interface PHPExcel_Cell_IValueBinder
* @param mixed $value Value to bind in cell
* @return boolean
*/
public function bindValue(PHPExcel_Cell $cell, $value = null);
public function bindValue(\PHPExcel\Cell $cell, $value = null);
}

View File

@ -1,5 +1,7 @@
<?php
namespace PHPExcel;
/**
* PHPExcel_Chart
*
@ -25,7 +27,7 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
class PHPExcel_Chart
class Chart
{
/**
* Chart Name
@ -37,7 +39,7 @@ class PHPExcel_Chart
/**
* Worksheet
*
* @var PHPExcel_Worksheet
* @var \PHPExcel\Worksheet
*/
private $worksheet;

View File

@ -1,5 +1,7 @@
<?php
namespace PHPExcel\Chart;
/**
* Created by PhpStorm.
* User: Wiktor Trzonkowski
@ -7,7 +9,7 @@
* Time: 12:11 PM
*/
class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties
class Axis extends Properties
{
/**
* Axis Number

View File

@ -1,6 +1,9 @@
<?php
namespace PHPExcel\Chart;
/**
* PHPExcel
* PHPExcel_Chart_DataSeries
*
* Copyright (c) 2006 - 2015 PHPExcel
*
@ -24,15 +27,6 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
/**
* PHPExcel_Chart_DataSeries
*
* @category PHPExcel
* @package PHPExcel_Chart
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
*/
class PHPExcel_Chart_DataSeries
{
const TYPE_BARCHART = 'barChart';

View File

@ -1,5 +1,7 @@
<?php
namespace PHPExcel\Chart;
/**
* PHPExcel_Chart_DataSeriesValues
*
@ -25,7 +27,7 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
class PHPExcel_Chart_DataSeriesValues
class DataSeriesValues
{
const DATASERIES_TYPE_STRING = 'String';

View File

@ -1,5 +1,7 @@
<?php
namespace PHPExcel\Chart;
/**
* PHPExcel_Chart_Exception
*
@ -25,7 +27,7 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
class PHPExcel_Chart_Exception extends PHPExcel_Exception
class Exception extends PHPExcel_Exception
{
/**
* Error handler callback

View File

@ -1,5 +1,7 @@
<?php
namespace PHPExcel\Chart;
/**
* Created by PhpStorm.
* User: Wiktor Trzonkowski
@ -7,7 +9,7 @@
* Time: 2:36 PM
*/
class PHPExcel_Chart_GridLines extends PHPExcel_Chart_Properties
class GridLines extends Properties
{
/**

View File

@ -1,6 +1,9 @@
<?php
namespace PHPExcel\Chart;
/**
* PHPExcel
* PHPExcel_Chart_Layout
*
* Copyright (c) 2006 - 2015 PHPExcel
*
@ -24,16 +27,7 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
/**
* PHPExcel_Chart_Layout
*
* @category PHPExcel
* @package PHPExcel_Chart
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
*/
class PHPExcel_Chart_Layout
class Layout
{
/**
* layoutTarget

View File

@ -1,5 +1,7 @@
<?php
namespace PHPExcel\Chart;
/**
* PHPExcel_Chart_Legend
*
@ -25,7 +27,7 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
class PHPExcel_Chart_Legend
class Legend
{
/** Legend positions */
const xlLegendPositionBottom = -4107; // Below the chart.

View File

@ -1,5 +1,7 @@
<?php
namespace PHPExcel\Chart;
/**
* PHPExcel_Chart_PlotArea
*
@ -25,7 +27,7 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
class PHPExcel_Chart_PlotArea
class PlotArea
{
/**
* PlotArea Layout
@ -44,7 +46,7 @@ class PHPExcel_Chart_PlotArea
/**
* Create a new PHPExcel_Chart_PlotArea
*/
public function __construct(PHPExcel_Chart_Layout $layout = null, $plotSeries = array())
public function __construct(Layout $layout = null, $plotSeries = array())
{
$this->layout = $layout;
$this->plotSeries = $plotSeries;

View File

@ -1,4 +1,7 @@
<?php
namespace PHPExcel\Chart;
/**
* Created by PhpStorm.
* User: nhw2h8s
@ -6,7 +9,7 @@
* Time: 5:45 PM
*/
abstract class PHPExcel_Chart_Properties
abstract class Properties
{
const
EXCEL_COLOR_TYPE_STANDARD = 'prstClr',

View File

@ -1,5 +1,7 @@
<?php
namespace PHPExcel\Chart\Renderer;
require_once(PHPExcel_Settings::getChartRendererPath().'/jpgraph.php');
/**
@ -27,21 +29,21 @@ require_once(PHPExcel_Settings::getChartRendererPath().'/jpgraph.php');
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
class PHPExcel_Chart_Renderer_jpgraph
class jpgraph
{
private static $width = 640;
private static $height = 480;
private static $colourSet = array(
private static $colourSet = [
'mediumpurple1', 'palegreen3', 'gold1', 'cadetblue1',
'darkmagenta', 'coral', 'dodgerblue3', 'eggplant',
'mediumblue', 'magenta', 'sandybrown', 'cyan',
'firebrick1', 'forestgreen', 'deeppink4', 'darkolivegreen',
'goldenrod2'
);
];
private static $markSet = array(
private static $markSet = [
'diamond' => MARK_DIAMOND,
'square' => MARK_SQUARE,
'triangle' => MARK_UTRIANGLE,
@ -51,7 +53,7 @@ class PHPExcel_Chart_Renderer_jpgraph
'dash' => MARK_DTRIANGLE,
'circle' => MARK_CIRCLE,
'plus' => MARK_CROSS
);
];
private $chart;

View File

@ -1,5 +1,7 @@
<?php
namespace PHPExcel\Chart;
/**
* PHPExcel_Chart_Title
*
@ -25,7 +27,7 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
class PHPExcel_Chart_Title
class Title
{
/**
@ -45,7 +47,7 @@ class PHPExcel_Chart_Title
/**
* Create a new PHPExcel_Chart_Title
*/
public function __construct($caption = null, PHPExcel_Chart_Layout $layout = null)
public function __construct($caption = null, Layout $layout = null)
{
$this->caption = $caption;
$this->layout = $layout;

View File

@ -1,5 +1,7 @@
<?php
namespace PHPExcel;
/**
* PHPExcel_Comment
*
@ -25,7 +27,7 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
class PHPExcel_Comment implements PHPExcel_IComparable
class Comment implements IComparable
{
/**
* Author

View File

@ -1,7 +1,9 @@
<?php
namespace PHPExcel\Document;
/**
* PHPExcel_DocumentProperties
* PHPExcel_Document_Properties
*
* Copyright (c) 2006 - 2015 PHPExcel
*
@ -25,7 +27,7 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
class PHPExcel_DocumentProperties
class Properties
{
/** constants */
const PROPERTY_TYPE_BOOLEAN = 'b';

View File

@ -1,7 +1,9 @@
<?php
namespace PHPExcel\Document;
/**
* PHPExcel_DocumentSecurity
* PHPExcel_Document_Security
*
* Copyright (c) 2006 - 2015 PHPExcel
*
@ -25,54 +27,48 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
class PHPExcel_DocumentSecurity
class Security
{
/**
* LockRevision
*
* @var boolean
*/
private $lockRevision;
private $lockRevision = false;
/**
* LockStructure
*
* @var boolean
*/
private $lockStructure;
private $lockStructure = false;
/**
* LockWindows
*
* @var boolean
*/
private $lockWindows;
private $lockWindows = false;
/**
* RevisionsPassword
*
* @var string
*/
private $revisionsPassword;
private $revisionsPassword = '';
/**
* WorkbookPassword
*
* @var string
*/
private $workbookPassword;
private $workbookPassword = '';
/**
* Create a new PHPExcel_DocumentSecurity
*/
public function __construct()
{
// Initialise values
$this->lockRevision = false;
$this->lockStructure = false;
$this->lockWindows = false;
$this->revisionsPassword = '';
$this->workbookPassword = '';
}
/**

View File

@ -1,6 +1,9 @@
<?php
namespace PHPExcel;
/**
* PHPExcel
* PHPExcel\Exception
*
* Copyright (c) 2006 - 2015 PHPExcel
*
@ -24,16 +27,7 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
/**
* PHPExcel_Exception
*
* @category PHPExcel
* @package PHPExcel
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
*/
class PHPExcel_Exception extends Exception
class Exception extends \Exception
{
/**
* Error handler callback

View File

@ -1,7 +1,9 @@
<?php
namespace PHPExcel;
/**
* PHPExcel_HashTable
* PHPExcel\HashTable
*
* Copyright (c) 2006 - 2015 PHPExcel
*
@ -25,27 +27,27 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
class PHPExcel_HashTable
class HashTable
{
/**
* HashTable elements
*
* @var array
* @var mixed[]
*/
protected $items = array();
protected $items = [];
/**
* HashTable key map
*
* @var array
* @var mixed[]
*/
protected $keyMap = array();
protected $keyMap = [];
/**
* Create a new PHPExcel_HashTable
* Create a new \PHPExcel\HashTable
*
* @param PHPExcel_IComparable[] $pSource Optional source array to create HashTable from
* @throws PHPExcel_Exception
* @param IComparable[] $pSource Optional source array to create HashTable from
* @throws Exception
*/
public function __construct($pSource = null)
{
@ -58,8 +60,8 @@ class PHPExcel_HashTable
/**
* Add HashTable items from source
*
* @param PHPExcel_IComparable[] $pSource Source array to create HashTable from
* @throws PHPExcel_Exception
* @param IComparable[] $pSource Source array to create HashTable from
* @throws Exception
*/
public function addFromSource($pSource = null)
{
@ -79,7 +81,7 @@ class PHPExcel_HashTable
* Add HashTable item
*
* @param PHPExcel_IComparable $pSource Item to add
* @throws PHPExcel_Exception
* @throws Exception
*/
public function add(PHPExcel_IComparable $pSource = null)
{
@ -93,8 +95,8 @@ class PHPExcel_HashTable
/**
* Remove HashTable item
*
* @param PHPExcel_IComparable $pSource Item to remove
* @throws PHPExcel_Exception
* @param IComparable $pSource Item to remove
* @throws Exception
*/
public function remove(PHPExcel_IComparable $pSource = null)
{
@ -151,7 +153,7 @@ class PHPExcel_HashTable
* Get by index
*
* @param int $pIndex
* @return PHPExcel_IComparable
* @return IComparable
*
*/
public function getByIndex($pIndex = 0)
@ -167,7 +169,7 @@ class PHPExcel_HashTable
* Get by hashcode
*
* @param string $pHashCode
* @return PHPExcel_IComparable
* @return IComparable
*
*/
public function getByHashCode($pHashCode = '')
@ -182,7 +184,7 @@ class PHPExcel_HashTable
/**
* HashTable to array
*
* @return PHPExcel_IComparable[]
* @return IComparable[]
*/
public function toArray()
{

View File

@ -1,8 +1,10 @@
<?php
class PHPExcel_Helper_HTML
namespace PHPExcel\Helper;
class HTML
{
protected static $colourMap = array(
protected static $colourMap = [
'aliceblue' => 'f0f8ff',
'antiquewhite' => 'faebd7',
'antiquewhite1' => 'ffefdb',
@ -520,7 +522,7 @@ class PHPExcel_Helper_HTML
'yellow3' => 'cdcd00',
'yellow4' => '8b8b00',
'yellowgreen' => '9acd32',
);
];
protected $face;
protected $size;

View File

@ -1,13 +1,6 @@
<?php
/** PHPExcel root directory */
if (!defined('PHPEXCEL_ROOT')) {
/**
* @ignore
*/
define('PHPEXCEL_ROOT', dirname(__FILE__) . '/../');
require(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
}
namespace PHPExcel;
/**
* PHPExcel_IOFactory
@ -34,7 +27,7 @@ if (!defined('PHPEXCEL_ROOT')) {
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
class PHPExcel_IOFactory
class IOFactory
{
/**
* Search locations

View File

@ -1,5 +1,7 @@
<?php
namespace PHPExcel;
/**
* PHPExcel_NamedRange
*
@ -25,7 +27,7 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
class PHPExcel_NamedRange
class NamedRange
{
/**
* Range name

View File

@ -1,5 +1,7 @@
<?php
namespace PHPExcel;
/**
* PHPExcel_ReferenceHelper (Singleton)
*
@ -25,7 +27,7 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
class PHPExcel_ReferenceHelper
class ReferenceHelper
{
/** Constants */
/** Regular Expressions */
@ -37,26 +39,26 @@ class PHPExcel_ReferenceHelper
/**
* Instance of this class
*
* @var PHPExcel_ReferenceHelper
* @var ReferenceHelper
*/
private static $instance;
/**
* Get an instance of this class
*
* @return PHPExcel_ReferenceHelper
* @return ReferenceHelper
*/
public static function getInstance()
{
if (!isset(self::$instance) || (self::$instance === null)) {
self::$instance = new PHPExcel_ReferenceHelper();
self::$instance = new ReferenceHelper();
}
return self::$instance;
}
/**
* Create a new PHPExcel_ReferenceHelper
* Create a new ReferenceHelper
*/
protected function __construct()
{
@ -138,8 +140,8 @@ class PHPExcel_ReferenceHelper
*/
private static function cellAddressInDeleteRange($cellAddress, $beforeRow, $pNumRows, $beforeColumnIndex, $pNumCols)
{
list($cellColumn, $cellRow) = PHPExcel_Cell::coordinateFromString($cellAddress);
$cellColumnIndex = PHPExcel_Cell::columnIndexFromString($cellColumn);
list($cellColumn, $cellRow) = Cell::coordinateFromString($cellAddress);
$cellColumnIndex = Cell::columnIndexFromString($cellColumn);
// Is cell within the range of rows/columns if we're deleting
if ($pNumRows < 0 &&
($cellRow >= ($beforeRow + $pNumRows)) &&
@ -156,32 +158,32 @@ class PHPExcel_ReferenceHelper
/**
* Update page breaks when inserting/deleting rows/columns
*
* @param PHPExcel_Worksheet $pSheet The worksheet that we're editing
* @param Worksheet $pSheet The worksheet that we're editing
* @param string $pBefore Insert/Delete before this cell address (e.g. 'A1')
* @param integer $beforeColumnIndex Index number of the column we're inserting/deleting before
* @param integer $pNumCols Number of columns to insert/delete (negative values indicate deletion)
* @param integer $beforeRow Number of the row we're inserting/deleting before
* @param integer $pNumRows Number of rows to insert/delete (negative values indicate deletion)
*/
protected function adjustPageBreaks(PHPExcel_Worksheet $pSheet, $pBefore, $beforeColumnIndex, $pNumCols, $beforeRow, $pNumRows)
protected function adjustPageBreaks(Worksheet $pSheet, $pBefore, $beforeColumnIndex, $pNumCols, $beforeRow, $pNumRows)
{
$aBreaks = $pSheet->getBreaks();
($pNumCols > 0 || $pNumRows > 0) ?
uksort($aBreaks, array('PHPExcel_ReferenceHelper','cellReverseSort')) :
uksort($aBreaks, array('PHPExcel_ReferenceHelper','cellSort'));
uksort($aBreaks, array('self','cellReverseSort')) :
uksort($aBreaks, array('self','cellSort'));
foreach ($aBreaks as $key => $value) {
if (self::cellAddressInDeleteRange($key, $beforeRow, $pNumRows, $beforeColumnIndex, $pNumCols)) {
// If we're deleting, then clear any defined breaks that are within the range
// of rows/columns that we're deleting
$pSheet->setBreak($key, PHPExcel_Worksheet::BREAK_NONE);
$pSheet->setBreak($key, Worksheet::BREAK_NONE);
} else {
// Otherwise update any affected breaks by inserting a new break at the appropriate point
// and removing the old affected break
$newReference = $this->updateCellReference($key, $pBefore, $pNumCols, $pNumRows);
if ($key != $newReference) {
$pSheet->setBreak($newReference, $value)
->setBreak($key, PHPExcel_Worksheet::BREAK_NONE);
->setBreak($key, Worksheet::BREAK_NONE);
}
}
}
@ -190,7 +192,7 @@ class PHPExcel_ReferenceHelper
/**
* Update cell comments when inserting/deleting rows/columns
*
* @param PHPExcel_Worksheet $pSheet The worksheet that we're editing
* @param Worksheet $pSheet The worksheet that we're editing
* @param string $pBefore Insert/Delete before this cell address (e.g. 'A1')
* @param integer $beforeColumnIndex Index number of the column we're inserting/deleting before
* @param integer $pNumCols Number of columns to insert/delete (negative values indicate deletion)
@ -217,7 +219,7 @@ class PHPExcel_ReferenceHelper
/**
* Update hyperlinks when inserting/deleting rows/columns
*
* @param PHPExcel_Worksheet $pSheet The worksheet that we're editing
* @param Worksheet $pSheet The worksheet that we're editing
* @param string $pBefore Insert/Delete before this cell address (e.g. 'A1')
* @param integer $beforeColumnIndex Index number of the column we're inserting/deleting before
* @param integer $pNumCols Number of columns to insert/delete (negative values indicate deletion)
@ -227,7 +229,9 @@ class PHPExcel_ReferenceHelper
protected function adjustHyperlinks($pSheet, $pBefore, $beforeColumnIndex, $pNumCols, $beforeRow, $pNumRows)
{
$aHyperlinkCollection = $pSheet->getHyperlinkCollection();
($pNumCols > 0 || $pNumRows > 0) ? uksort($aHyperlinkCollection, array('PHPExcel_ReferenceHelper','cellReverseSort')) : uksort($aHyperlinkCollection, array('PHPExcel_ReferenceHelper','cellSort'));
($pNumCols > 0 || $pNumRows > 0) ?
uksort($aHyperlinkCollection, array('self','cellReverseSort')) :
uksort($aHyperlinkCollection, array('self','cellSort'));
foreach ($aHyperlinkCollection as $key => $value) {
$newReference = $this->updateCellReference($key, $pBefore, $pNumCols, $pNumRows);
@ -241,7 +245,7 @@ class PHPExcel_ReferenceHelper
/**
* Update data validations when inserting/deleting rows/columns
*
* @param PHPExcel_Worksheet $pSheet The worksheet that we're editing
* @param Worksheet $pSheet The worksheet that we're editing
* @param string $pBefore Insert/Delete before this cell address (e.g. 'A1')
* @param integer $beforeColumnIndex Index number of the column we're inserting/deleting before
* @param integer $pNumCols Number of columns to insert/delete (negative values indicate deletion)
@ -251,7 +255,9 @@ class PHPExcel_ReferenceHelper
protected function adjustDataValidations($pSheet, $pBefore, $beforeColumnIndex, $pNumCols, $beforeRow, $pNumRows)
{
$aDataValidationCollection = $pSheet->getDataValidationCollection();
($pNumCols > 0 || $pNumRows > 0) ? uksort($aDataValidationCollection, array('PHPExcel_ReferenceHelper','cellReverseSort')) : uksort($aDataValidationCollection, array('PHPExcel_ReferenceHelper','cellSort'));
($pNumCols > 0 || $pNumRows > 0) ?
uksort($aDataValidationCollection, array('self','cellReverseSort')) :
uksort($aDataValidationCollection, array('self','cellSort'));
foreach ($aDataValidationCollection as $key => $value) {
$newReference = $this->updateCellReference($key, $pBefore, $pNumCols, $pNumRows);
@ -265,7 +271,7 @@ class PHPExcel_ReferenceHelper
/**
* Update merged cells when inserting/deleting rows/columns
*
* @param PHPExcel_Worksheet $pSheet The worksheet that we're editing
* @param Worksheet $pSheet The worksheet that we're editing
* @param string $pBefore Insert/Delete before this cell address (e.g. 'A1')
* @param integer $beforeColumnIndex Index number of the column we're inserting/deleting before
* @param integer $pNumCols Number of columns to insert/delete (negative values indicate deletion)
@ -286,7 +292,7 @@ class PHPExcel_ReferenceHelper
/**
* Update protected cells when inserting/deleting rows/columns
*
* @param PHPExcel_Worksheet $pSheet The worksheet that we're editing
* @param Worksheet $pSheet The worksheet that we're editing
* @param string $pBefore Insert/Delete before this cell address (e.g. 'A1')
* @param integer $beforeColumnIndex Index number of the column we're inserting/deleting before
* @param integer $pNumCols Number of columns to insert/delete (negative values indicate deletion)
@ -297,8 +303,8 @@ class PHPExcel_ReferenceHelper
{
$aProtectedCells = $pSheet->getProtectedCells();
($pNumCols > 0 || $pNumRows > 0) ?
uksort($aProtectedCells, array('PHPExcel_ReferenceHelper','cellReverseSort')) :
uksort($aProtectedCells, array('PHPExcel_ReferenceHelper','cellSort'));
uksort($aProtectedCells, array('self','cellReverseSort')) :
uksort($aProtectedCells, array('self','cellSort'));
foreach ($aProtectedCells as $key => $value) {
$newReference = $this->updateCellReference($key, $pBefore, $pNumCols, $pNumRows);
if ($key != $newReference) {
@ -311,7 +317,7 @@ class PHPExcel_ReferenceHelper
/**
* Update column dimensions when inserting/deleting rows/columns
*
* @param PHPExcel_Worksheet $pSheet The worksheet that we're editing
* @param Worksheet $pSheet The worksheet that we're editing
* @param string $pBefore Insert/Delete before this cell address (e.g. 'A1')
* @param integer $beforeColumnIndex Index number of the column we're inserting/deleting before
* @param integer $pNumCols Number of columns to insert/delete (negative values indicate deletion)
@ -324,7 +330,7 @@ class PHPExcel_ReferenceHelper
if (!empty($aColumnDimensions)) {
foreach ($aColumnDimensions as $objColumnDimension) {
$newReference = $this->updateCellReference($objColumnDimension->getColumnIndex() . '1', $pBefore, $pNumCols, $pNumRows);
list($newReference) = PHPExcel_Cell::coordinateFromString($newReference);
list($newReference) = Cell::coordinateFromString($newReference);
if ($objColumnDimension->getColumnIndex() != $newReference) {
$objColumnDimension->setColumnIndex($newReference);
}
@ -336,7 +342,7 @@ class PHPExcel_ReferenceHelper
/**
* Update row dimensions when inserting/deleting rows/columns
*
* @param PHPExcel_Worksheet $pSheet The worksheet that we're editing
* @param Worksheet $pSheet The worksheet that we're editing
* @param string $pBefore Insert/Delete before this cell address (e.g. 'A1')
* @param integer $beforeColumnIndex Index number of the column we're inserting/deleting before
* @param integer $pNumCols Number of columns to insert/delete (negative values indicate deletion)
@ -349,7 +355,7 @@ class PHPExcel_ReferenceHelper
if (!empty($aRowDimensions)) {
foreach ($aRowDimensions as $objRowDimension) {
$newReference = $this->updateCellReference('A' . $objRowDimension->getRowIndex(), $pBefore, $pNumCols, $pNumRows);
list(, $newReference) = PHPExcel_Cell::coordinateFromString($newReference);
list(, $newReference) = Cell::coordinateFromString($newReference);
if ($objRowDimension->getRowIndex() != $newReference) {
$objRowDimension->setRowIndex($newReference);
}
@ -373,10 +379,10 @@ class PHPExcel_ReferenceHelper
* @param string $pBefore Insert before this cell address (e.g. 'A1')
* @param integer $pNumCols Number of columns to insert/delete (negative values indicate deletion)
* @param integer $pNumRows Number of rows to insert/delete (negative values indicate deletion)
* @param PHPExcel_Worksheet $pSheet The worksheet that we're editing
* @throws PHPExcel_Exception
* @param Worksheet $pSheet The worksheet that we're editing
* @throws Exception
*/
public function insertNewBefore($pBefore = 'A1', $pNumCols = 0, $pNumRows = 0, PHPExcel_Worksheet $pSheet = null)
public function insertNewBefore($pBefore = 'A1', $pNumCols = 0, $pNumRows = 0, Worksheet $pSheet = null)
{
$remove = ($pNumCols < 0 || $pNumRows < 0);
$aCellCollection = $pSheet->getCellCollection();
@ -384,8 +390,8 @@ class PHPExcel_ReferenceHelper
// Get coordinates of $pBefore
$beforeColumn = 'A';
$beforeRow = 1;
list($beforeColumn, $beforeRow) = PHPExcel_Cell::coordinateFromString($pBefore);
$beforeColumnIndex = PHPExcel_Cell::columnIndexFromString($beforeColumn);
list($beforeColumn, $beforeRow) = Cell::coordinateFromString($pBefore);
$beforeColumnIndex = Cell::columnIndexFromString($beforeColumn);
// Clear cells if we are removing columns or rows
$highestColumn = $pSheet->getHighestColumn();
@ -395,10 +401,10 @@ class PHPExcel_ReferenceHelper
if ($pNumCols < 0 && $beforeColumnIndex - 2 + $pNumCols > 0) {
for ($i = 1; $i <= $highestRow - 1; ++$i) {
for ($j = $beforeColumnIndex - 1 + $pNumCols; $j <= $beforeColumnIndex - 2; ++$j) {
$coordinate = PHPExcel_Cell::stringFromColumnIndex($j) . $i;
$coordinate = Cell::stringFromColumnIndex($j) . $i;
$pSheet->removeConditionalStyles($coordinate);
if ($pSheet->cellExists($coordinate)) {
$pSheet->getCell($coordinate)->setValueExplicit('', PHPExcel_Cell_DataType::TYPE_NULL);
$pSheet->getCell($coordinate)->setValueExplicit('', Cell\DataType::TYPE_NULL);
$pSheet->getCell($coordinate)->setXfIndex(0);
}
}
@ -407,12 +413,12 @@ class PHPExcel_ReferenceHelper
// 2. Clear row strips if we are removing rows
if ($pNumRows < 0 && $beforeRow - 1 + $pNumRows > 0) {
for ($i = $beforeColumnIndex - 1; $i <= PHPExcel_Cell::columnIndexFromString($highestColumn) - 1; ++$i) {
for ($i = $beforeColumnIndex - 1; $i <= Cell::columnIndexFromString($highestColumn) - 1; ++$i) {
for ($j = $beforeRow + $pNumRows; $j <= $beforeRow - 1; ++$j) {
$coordinate = PHPExcel_Cell::stringFromColumnIndex($i) . $j;
$coordinate = Cell::stringFromColumnIndex($i) . $j;
$pSheet->removeConditionalStyles($coordinate);
if ($pSheet->cellExists($coordinate)) {
$pSheet->getCell($coordinate)->setValueExplicit('', PHPExcel_Cell_DataType::TYPE_NULL);
$pSheet->getCell($coordinate)->setValueExplicit('', Cell\DataType::TYPE_NULL);
$pSheet->getCell($coordinate)->setXfIndex(0);
}
}
@ -426,14 +432,14 @@ class PHPExcel_ReferenceHelper
}
while ($cellID = array_pop($aCellCollection)) {
$cell = $pSheet->getCell($cellID);
$cellIndex = PHPExcel_Cell::columnIndexFromString($cell->getColumn());
$cellIndex = Cell::columnIndexFromString($cell->getColumn());
if ($cellIndex-1 + $pNumCols < 0) {
continue;
}
// New coordinates
$newCoordinates = PHPExcel_Cell::stringFromColumnIndex($cellIndex-1 + $pNumCols) . ($cell->getRow() + $pNumRows);
$newCoordinates = Cell::stringFromColumnIndex($cellIndex-1 + $pNumCols) . ($cell->getRow() + $pNumRows);
// Should the cell be updated? Move value and cellXf index from one cell to another.
if (($cellIndex >= $beforeColumnIndex) && ($cell->getRow() >= $beforeRow)) {
@ -441,7 +447,7 @@ class PHPExcel_ReferenceHelper
$pSheet->getCell($newCoordinates)->setXfIndex($cell->getXfIndex());
// Insert this cell at its new location
if ($cell->getDataType() == PHPExcel_Cell_DataType::TYPE_FORMULA) {
if ($cell->getDataType() == Cell\DataType::TYPE_FORMULA) {
// Formula should be adjusted
$pSheet->getCell($newCoordinates)
->setValue($this->updateFormulaReferences($cell->getValue(), $pBefore, $pNumCols, $pNumRows, $pSheet->getTitle()));
@ -455,7 +461,7 @@ class PHPExcel_ReferenceHelper
} else {
/* We don't need to update styles for rows/columns before our insertion position,
but we do still need to adjust any formulae in those cells */
if ($cell->getDataType() == PHPExcel_Cell_DataType::TYPE_FORMULA) {
if ($cell->getDataType() == Cell\DataType::TYPE_FORMULA) {
// Formula should be adjusted
$cell->setValue($this->updateFormulaReferences($cell->getValue(), $pBefore, $pNumCols, $pNumRows, $pSheet->getTitle()));
}
@ -470,7 +476,7 @@ class PHPExcel_ReferenceHelper
if ($pNumCols > 0 && $beforeColumnIndex - 2 > 0) {
for ($i = $beforeRow; $i <= $highestRow - 1; ++$i) {
// Style
$coordinate = PHPExcel_Cell::stringFromColumnIndex($beforeColumnIndex - 2) . $i;
$coordinate = Cell::stringFromColumnIndex($beforeColumnIndex - 2) . $i;
if ($pSheet->cellExists($coordinate)) {
$xfIndex = $pSheet->getCell($coordinate)->getXfIndex();
$conditionalStyles = $pSheet->conditionalStylesExists($coordinate) ?
@ -482,7 +488,7 @@ class PHPExcel_ReferenceHelper
foreach ($conditionalStyles as $conditionalStyle) {
$cloned[] = clone $conditionalStyle;
}
$pSheet->setConditionalStyles(PHPExcel_Cell::stringFromColumnIndex($j) . $i, $cloned);
$pSheet->setConditionalStyles(Cell::stringFromColumnIndex($j) . $i, $cloned);
}
}
}
@ -491,21 +497,21 @@ class PHPExcel_ReferenceHelper
}
if ($pNumRows > 0 && $beforeRow - 1 > 0) {
for ($i = $beforeColumnIndex - 1; $i <= PHPExcel_Cell::columnIndexFromString($highestColumn) - 1; ++$i) {
for ($i = $beforeColumnIndex - 1; $i <= Cell::columnIndexFromString($highestColumn) - 1; ++$i) {
// Style
$coordinate = PHPExcel_Cell::stringFromColumnIndex($i) . ($beforeRow - 1);
$coordinate = Cell::stringFromColumnIndex($i) . ($beforeRow - 1);
if ($pSheet->cellExists($coordinate)) {
$xfIndex = $pSheet->getCell($coordinate)->getXfIndex();
$conditionalStyles = $pSheet->conditionalStylesExists($coordinate) ?
$pSheet->getConditionalStyles($coordinate) : false;
for ($j = $beforeRow; $j <= $beforeRow - 1 + $pNumRows; ++$j) {
$pSheet->getCell(PHPExcel_Cell::stringFromColumnIndex($i) . $j)->setXfIndex($xfIndex);
$pSheet->getCell(Cell::stringFromColumnIndex($i) . $j)->setXfIndex($xfIndex);
if ($conditionalStyles) {
$cloned = array();
foreach ($conditionalStyles as $conditionalStyle) {
$cloned[] = clone $conditionalStyle;
}
$pSheet->setConditionalStyles(PHPExcel_Cell::stringFromColumnIndex($i) . $j, $cloned);
$pSheet->setConditionalStyles(Cell::stringFromColumnIndex($i) . $j, $cloned);
}
}
}
@ -544,8 +550,8 @@ class PHPExcel_ReferenceHelper
$autoFilterColumns = array_keys($autoFilter->getColumns());
if (count($autoFilterColumns) > 0) {
sscanf($pBefore, '%[A-Z]%d', $column, $row);
$columnIndex = PHPExcel_Cell::columnIndexFromString($column);
list($rangeStart, $rangeEnd) = PHPExcel_Cell::rangeBoundaries($autoFilterRange);
$columnIndex = Cell::columnIndexFromString($column);
list($rangeStart, $rangeEnd) = Cell::rangeBoundaries($autoFilterRange);
if ($columnIndex <= $rangeEnd[0]) {
if ($pNumCols < 0) {
// If we're actually deleting any columns that fall within the autofilter range,
@ -553,8 +559,8 @@ class PHPExcel_ReferenceHelper
$deleteColumn = $columnIndex + $pNumCols - 1;
$deleteCount = abs($pNumCols);
for ($i = 1; $i <= $deleteCount; ++$i) {
if (in_array(PHPExcel_Cell::stringFromColumnIndex($deleteColumn), $autoFilterColumns)) {
$autoFilter->clearColumn(PHPExcel_Cell::stringFromColumnIndex($deleteColumn));
if (in_array(Cell::stringFromColumnIndex($deleteColumn), $autoFilterColumns)) {
$autoFilter->clearColumn(Cell::stringFromColumnIndex($deleteColumn));
}
++$deleteColumn;
}
@ -564,24 +570,24 @@ class PHPExcel_ReferenceHelper
// Shuffle columns in autofilter range
if ($pNumCols > 0) {
// For insert, we shuffle from end to beginning to avoid overwriting
$startColID = PHPExcel_Cell::stringFromColumnIndex($startCol-1);
$toColID = PHPExcel_Cell::stringFromColumnIndex($startCol+$pNumCols-1);
$endColID = PHPExcel_Cell::stringFromColumnIndex($rangeEnd[0]);
$startColID = Cell::stringFromColumnIndex($startCol-1);
$toColID = Cell::stringFromColumnIndex($startCol+$pNumCols-1);
$endColID = Cell::stringFromColumnIndex($rangeEnd[0]);
$startColRef = $startCol;
$endColRef = $rangeEnd[0];
$toColRef = $rangeEnd[0]+$pNumCols;
do {
$autoFilter->shiftColumn(PHPExcel_Cell::stringFromColumnIndex($endColRef-1), PHPExcel_Cell::stringFromColumnIndex($toColRef-1));
$autoFilter->shiftColumn(Cell::stringFromColumnIndex($endColRef-1), Cell::stringFromColumnIndex($toColRef-1));
--$endColRef;
--$toColRef;
} while ($startColRef <= $endColRef);
} else {
// For delete, we shuffle from beginning to end to avoid overwriting
$startColID = PHPExcel_Cell::stringFromColumnIndex($startCol-1);
$toColID = PHPExcel_Cell::stringFromColumnIndex($startCol+$pNumCols-1);
$endColID = PHPExcel_Cell::stringFromColumnIndex($rangeEnd[0]);
$startColID = Cell::stringFromColumnIndex($startCol-1);
$toColID = Cell::stringFromColumnIndex($startCol+$pNumCols-1);
$endColID = Cell::stringFromColumnIndex($rangeEnd[0]);
do {
$autoFilter->shiftColumn($startColID, $toColID);
++$startColID;
@ -635,7 +641,7 @@ class PHPExcel_ReferenceHelper
* @param int $pNumRows Number of rows to insert
* @param string $sheetName Worksheet name/title
* @return string Updated formula
* @throws PHPExcel_Exception
* @throws Exception
*/
public function updateFormulaReferences($pFormula = '', $pBefore = 'A1', $pNumCols = 0, $pNumRows = 0, $sheetName = '')
{
@ -686,7 +692,7 @@ class PHPExcel_ReferenceHelper
$toString = ($match[2] > '') ? $match[2].'!' : '';
$toString .= $modified3.':'.$modified4;
// Max worksheet size is 1,048,576 rows by 16,384 columns in Excel 2007, so our adjustments need to be at least one digit more
$column = PHPExcel_Cell::columnIndexFromString(trim($match[3], '$')) + 100000;
$column = Cell::columnIndexFromString(trim($match[3], '$')) + 100000;
$row = 10000000;
$cellIndex = $column.$row;
@ -710,9 +716,9 @@ class PHPExcel_ReferenceHelper
if (($match[2] == '') || (trim($match[2], "'") == $sheetName)) {
$toString = ($match[2] > '') ? $match[2].'!' : '';
$toString .= $modified3.':'.$modified4;
list($column, $row) = PHPExcel_Cell::coordinateFromString($match[3]);
list($column, $row) = Cell::coordinateFromString($match[3]);
// Max worksheet size is 1,048,576 rows by 16,384 columns in Excel 2007, so our adjustments need to be at least one digit more
$column = PHPExcel_Cell::columnIndexFromString(trim($column, '$')) + 100000;
$column = Cell::columnIndexFromString(trim($column, '$')) + 100000;
$row = trim($row, '$') + 10000000;
$cellIndex = $column.$row;
@ -736,9 +742,9 @@ class PHPExcel_ReferenceHelper
if (($match[2] == '') || (trim($match[2], "'") == $sheetName)) {
$toString = ($match[2] > '') ? $match[2].'!' : '';
$toString .= $modified3;
list($column, $row) = PHPExcel_Cell::coordinateFromString($match[3]);
list($column, $row) = Cell::coordinateFromString($match[3]);
// Max worksheet size is 1,048,576 rows by 16,384 columns in Excel 2007, so our adjustments need to be at least one digit more
$column = PHPExcel_Cell::columnIndexFromString(trim($column, '$')) + 100000;
$column = Cell::columnIndexFromString(trim($column, '$')) + 100000;
$row = trim($row, '$') + 10000000;
$cellIndex = $row . $column;
@ -775,7 +781,7 @@ class PHPExcel_ReferenceHelper
* @param int $pNumCols Number of columns to increment
* @param int $pNumRows Number of rows to increment
* @return string Updated cell range
* @throws PHPExcel_Exception
* @throws Exception
*/
public function updateCellReference($pCellRange = 'A1', $pBefore = 'A1', $pNumCols = 0, $pNumRows = 0)
{
@ -802,7 +808,7 @@ class PHPExcel_ReferenceHelper
* @param string $oldName Old name (name to replace)
* @param string $newName New name
*/
public function updateNamedFormulas(PHPExcel $pPhpExcel, $oldName = '', $newName = '')
public function updateNamedFormulas(Spreadsheet $pPhpExcel, $oldName = '', $newName = '')
{
if ($oldName == '') {
return;
@ -811,12 +817,12 @@ class PHPExcel_ReferenceHelper
foreach ($pPhpExcel->getWorksheetIterator() as $sheet) {
foreach ($sheet->getCellCollection(false) as $cellID) {
$cell = $sheet->getCell($cellID);
if (($cell !== null) && ($cell->getDataType() == PHPExcel_Cell_DataType::TYPE_FORMULA)) {
if (($cell !== null) && ($cell->getDataType() == Cell\DataType::TYPE_FORMULA)) {
$formula = $cell->getValue();
if (strpos($formula, $oldName) !== false) {
$formula = str_replace("'" . $oldName . "'!", "'" . $newName . "'!", $formula);
$formula = str_replace($oldName . "!", $newName . "!", $formula);
$cell->setValueExplicit($formula, PHPExcel_Cell_DataType::TYPE_FORMULA);
$cell->setValueExplicit($formula, Cell\DataType::TYPE_FORMULA);
}
}
}
@ -831,22 +837,22 @@ class PHPExcel_ReferenceHelper
* @param int $pNumCols Number of columns to increment
* @param int $pNumRows Number of rows to increment
* @return string Updated cell range
* @throws PHPExcel_Exception
* @throws Exception
*/
private function updateCellRange($pCellRange = 'A1:A1', $pBefore = 'A1', $pNumCols = 0, $pNumRows = 0)
{
if (strpos($pCellRange, ':') !== false || strpos($pCellRange, ',') !== false) {
// Update range
$range = PHPExcel_Cell::splitRange($pCellRange);
$range = Cell::splitRange($pCellRange);
$ic = count($range);
for ($i = 0; $i < $ic; ++$i) {
$jc = count($range[$i]);
for ($j = 0; $j < $jc; ++$j) {
if (ctype_alpha($range[$i][$j])) {
$r = PHPExcel_Cell::coordinateFromString($this->updateSingleCellReference($range[$i][$j].'1', $pBefore, $pNumCols, $pNumRows));
$r = Cell::coordinateFromString($this->updateSingleCellReference($range[$i][$j].'1', $pBefore, $pNumCols, $pNumRows));
$range[$i][$j] = $r[0];
} elseif (ctype_digit($range[$i][$j])) {
$r = PHPExcel_Cell::coordinateFromString($this->updateSingleCellReference('A'.$range[$i][$j], $pBefore, $pNumCols, $pNumRows));
$r = Cell::coordinateFromString($this->updateSingleCellReference('A'.$range[$i][$j], $pBefore, $pNumCols, $pNumRows));
$range[$i][$j] = $r[1];
} else {
$range[$i][$j] = $this->updateSingleCellReference($range[$i][$j], $pBefore, $pNumCols, $pNumRows);
@ -855,9 +861,9 @@ class PHPExcel_ReferenceHelper
}
// Recreate range string
return PHPExcel_Cell::buildRange($range);
return Cell::buildRange($range);
} else {
throw new PHPExcel_Exception("Only cell ranges may be passed to this method.");
throw new Exception("Only cell ranges may be passed to this method.");
}
}
@ -869,24 +875,24 @@ class PHPExcel_ReferenceHelper
* @param int $pNumCols Number of columns to increment
* @param int $pNumRows Number of rows to increment
* @return string Updated cell reference
* @throws PHPExcel_Exception
* @throws Exception
*/
private function updateSingleCellReference($pCellReference = 'A1', $pBefore = 'A1', $pNumCols = 0, $pNumRows = 0)
{
if (strpos($pCellReference, ':') === false && strpos($pCellReference, ',') === false) {
// Get coordinates of $pBefore
list($beforeColumn, $beforeRow) = PHPExcel_Cell::coordinateFromString($pBefore);
list($beforeColumn, $beforeRow) = Cell::coordinateFromString($pBefore);
// Get coordinates of $pCellReference
list($newColumn, $newRow) = PHPExcel_Cell::coordinateFromString($pCellReference);
list($newColumn, $newRow) = Cell::coordinateFromString($pCellReference);
// Verify which parts should be updated
$updateColumn = (($newColumn{0} != '$') && ($beforeColumn{0} != '$') && (PHPExcel_Cell::columnIndexFromString($newColumn) >= PHPExcel_Cell::columnIndexFromString($beforeColumn)));
$updateColumn = (($newColumn{0} != '$') && ($beforeColumn{0} != '$') && (Cell::columnIndexFromString($newColumn) >= Cell::columnIndexFromString($beforeColumn)));
$updateRow = (($newRow{0} != '$') && ($beforeRow{0} != '$') && $newRow >= $beforeRow);
// Create new column reference
if ($updateColumn) {
$newColumn = PHPExcel_Cell::stringFromColumnIndex(PHPExcel_Cell::columnIndexFromString($newColumn) - 1 + $pNumCols);
$newColumn = Cell::stringFromColumnIndex(Cell::columnIndexFromString($newColumn) - 1 + $pNumCols);
}
// Create new row reference
@ -897,17 +903,17 @@ class PHPExcel_ReferenceHelper
// Return new reference
return $newColumn . $newRow;
} else {
throw new PHPExcel_Exception("Only single cell references may be passed to this method.");
throw new Exception("Only single cell references may be passed to this method.");
}
}
/**
* __clone implementation. Cloning should not be allowed in a Singleton!
*
* @throws PHPExcel_Exception
* @throws Exception
*/
final public function __clone()
{
throw new PHPExcel_Exception("Cloning a Singleton is not allowed!");
throw new Exception("Cloning a Singleton is not allowed!");
}
}

View File

@ -1,5 +1,7 @@
<?php
namespace PHPExcel;
/**
* PHPExcel_RichText
*
@ -25,7 +27,7 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
class PHPExcel_RichText implements PHPExcel_IComparable
class RichText implements PHPExcel_IComparable
{
/**
* Rich text elements

View File

@ -1,5 +1,7 @@
<?php
namespace PHPExcel\RichText;
/**
* PHPExcel_RichText_ITextElement
*
@ -23,7 +25,7 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
interface PHPExcel_RichText_ITextElement
interface ITextElement
{
/**
* Get text

View File

@ -1,5 +1,7 @@
<?php
namespace PHPExcel\RichText;
/**
* PHPExcel_RichText_Run
*
@ -23,7 +25,7 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
class PHPExcel_RichText_Run extends PHPExcel_RichText_TextElement implements PHPExcel_RichText_ITextElement
class Run extends TextElement implements ITextElement
{
/**
* Font

View File

@ -1,5 +1,7 @@
<?php
namespace PHPExcel\RichText;
/**
* PHPExcel_RichText_TextElement
*
@ -23,7 +25,7 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
class PHPExcel_RichText_TextElement implements PHPExcel_RichText_ITextElement
class TextElement implements ITextElement
{
/**
* Text

View File

@ -1,13 +1,6 @@
<?php
/** PHPExcel root directory */
if (!defined('PHPEXCEL_ROOT')) {
/**
* @ignore
*/
define('PHPEXCEL_ROOT', dirname(__FILE__) . '/../');
require(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
}
namespace PHPExcel;
/**
* PHPExcel_Settings
@ -34,7 +27,7 @@ if (!defined('PHPEXCEL_ROOT')) {
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
class PHPExcel_Settings
class Settings
{
/** constants */
/** Available Zip library classes */

View File

@ -1,5 +1,7 @@
<?php
namespace PHPExcel\Shared;
/**
* PHPExcel_Shared_CodePage
*
@ -25,7 +27,7 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
class PHPExcel_Shared_CodePage
class CodePage
{
/**
* Convert Microsoft Code Page Identifier to Code Page Name which iconv

View File

@ -1,5 +1,7 @@
<?php
namespace PHPExcel\Shared;
/**
* PHPExcel_Shared_Date
*
@ -25,7 +27,7 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
class PHPExcel_Shared_Date
class Date
{
/** constants */
const CALENDAR_WINDOWS_1900 = 1900; // Base date of 1st Jan 1900 = 1.0
@ -38,7 +40,7 @@ class PHPExcel_Shared_Date
* @public
* @var string[]
*/
public static $monthNames = array(
public static $monthNames = [
'Jan' => 'January',
'Feb' => 'February',
'Mar' => 'March',
@ -51,7 +53,7 @@ class PHPExcel_Shared_Date
'Oct' => 'October',
'Nov' => 'November',
'Dec' => 'December',
);
];
/*
* Names of the months of the year, indexed by shortname
@ -60,12 +62,12 @@ class PHPExcel_Shared_Date
* @public
* @var string[]
*/
public static $numberSuffixes = array(
public static $numberSuffixes = [
'st',
'nd',
'rd',
'th',
);
];
/*
* Base calendar year to use for calculations
@ -150,7 +152,7 @@ class PHPExcel_Shared_Date
* Convert a date from Excel to a PHP Date/Time object
*
* @param integer $dateValue Excel date/time value
* @return DateTime PHP date/time object
* @return \DateTime PHP date/time object
*/
public static function ExcelToPHPObject($dateValue = 0)
{
@ -183,7 +185,7 @@ class PHPExcel_Shared_Date
$saveTimeZone = date_default_timezone_get();
date_default_timezone_set('UTC');
$retValue = false;
if ((is_object($dateValue)) && ($dateValue instanceof DateTime)) {
if ((is_object($dateValue)) && ($dateValue instanceof \DateTime)) {
$retValue = self::FormattedPHPToExcel($dateValue->format('Y'), $dateValue->format('m'), $dateValue->format('d'), $dateValue->format('H'), $dateValue->format('i'), $dateValue->format('s'));
} elseif (is_numeric($dateValue)) {
$retValue = self::FormattedPHPToExcel(date('Y', $dateValue), date('m', $dateValue), date('d', $dateValue), date('H', $dateValue), date('i', $dateValue), date('s', $dateValue));
@ -247,7 +249,7 @@ class PHPExcel_Shared_Date
* @param PHPExcel_Cell $pCell
* @return boolean
*/
public static function isDateTime(PHPExcel_Cell $pCell)
public static function isDateTime(\PHPExcel\Cell $pCell)
{
return self::isDateTimeFormat(
$pCell->getWorksheet()->getStyle(
@ -263,7 +265,7 @@ class PHPExcel_Shared_Date
* @param PHPExcel_Style_NumberFormat $pFormat
* @return boolean
*/
public static function isDateTimeFormat(PHPExcel_Style_NumberFormat $pFormat)
public static function isDateTimeFormat(\PHPExcel\Style\NumberFormat $pFormat)
{
return self::isDateTimeFormatCode($pFormat->getFormatCode());
}
@ -358,15 +360,15 @@ class PHPExcel_Shared_Date
return false;
}
$dateValueNew = PHPExcel_Calculation_DateTime::DATEVALUE($dateValue);
$dateValueNew = \PHPExcel\Calculation\DateTime::DATEVALUE($dateValue);
if ($dateValueNew === PHPExcel_Calculation_Functions::VALUE()) {
if ($dateValueNew === \PHPExcel\Calculation\Functions::VALUE()) {
return false;
}
if (strpos($dateValue, ':') !== false) {
$timeValue = PHPExcel_Calculation_DateTime::TIMEVALUE($dateValue);
if ($timeValue === PHPExcel_Calculation_Functions::VALUE()) {
$timeValue = \PHPExcel\Calculation\DateTime::TIMEVALUE($dateValue);
if ($timeValue === \PHPExcel\Calculation\Functions::VALUE()) {
return false;
}
$dateValueNew += $timeValue;

View File

@ -1,6 +1,9 @@
<?php
namespace PHPExcel\Shared;
/**
* PHPExcel
* PHPExcel_Shared_Drawing
*
* Copyright (c) 2006 - 2015 PHPExcel
*
@ -24,15 +27,6 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
/**
* PHPExcel_Shared_Drawing
*
* @category PHPExcel
* @package PHPExcel_Shared
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
*/
class PHPExcel_Shared_Drawing
{
/**

View File

@ -1,5 +1,7 @@
<?php
namespace PHPExcel\Shared;
/**
* PHPExcel_Shared_Escher
*
@ -25,7 +27,7 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
class PHPExcel_Shared_Escher
class Escher
{
/**
* Drawing Group Container

View File

@ -1,5 +1,7 @@
<?php
namespace PHPExcel\Shared;
/**
* PHPExcel_Shared_Excel5
*
@ -25,7 +27,7 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
class PHPExcel_Shared_Excel5
class Excel5
{
/**
* Get the width of a column in pixels. We use the relationship y = ceil(7x) where

View File

@ -1,5 +1,7 @@
<?php
namespace PHPExcel\Shared;
/**
* PHPExcel_Shared_File
*
@ -25,7 +27,7 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
class PHPExcel_Shared_File
class File
{
/*
* Use Temp or File Upload Temp for temporary files

View File

@ -1,6 +1,9 @@
<?php
namespace PHPExcel\Shared;
/**
* PHPExcel
* PHPExcel_Shared_Font
*
* Copyright (c) 2006 - 2015 PHPExcel
*
@ -24,16 +27,7 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
/**
* PHPExcel_Shared_Font
*
* @category PHPExcel
* @package PHPExcel_Shared
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
*/
class PHPExcel_Shared_Font
class Font
{
/* Methods for resolving autosize value */
const AUTOSIZE_METHOD_APPROX = 'approx';

View File

@ -1,4 +1,7 @@
<?php
namespace PHPExcel\Shared;
/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
// | PHP Version 4 |
@ -35,7 +38,7 @@ $GLOBALS['_OLE_INSTANCES'] = array();
* @category PHPExcel
* @package PHPExcel_Shared_OLE
*/
class PHPExcel_Shared_OLE
class OLE
{
const OLE_PPS_TYPE_ROOT = 5;
const OLE_PPS_TYPE_DIR = 1;

View File

@ -1,4 +1,7 @@
<?php
namespace PHPExcel\Shared;
/**
* PHPExcel
*
@ -28,7 +31,7 @@
defined('IDENTIFIER_OLE') ||
define('IDENTIFIER_OLE', pack('CCCCCCCC', 0xd0, 0xcf, 0x11, 0xe0, 0xa1, 0xb1, 0x1a, 0xe1));
class PHPExcel_Shared_OLERead
class OLERead
{
private $data = '';

View File

@ -1,6 +1,9 @@
<?php
namespace PHPExcel\Shared;
/**
* PHPExcel
* PHPExcel_Shared_PasswordHasher
*
* Copyright (c) 2006 - 2015 PHPExcel
*
@ -24,16 +27,7 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
/**
* PHPExcel_Shared_PasswordHasher
*
* @category PHPExcel
* @package PHPExcel_Shared
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
*/
class PHPExcel_Shared_PasswordHasher
class PasswordHasher
{
/**
* Create a password hash from a given string.

View File

@ -1,5 +1,7 @@
<?php
namespace PHPExcel\Shared;
/**
* PHPExcel_Shared_String
*
@ -25,7 +27,7 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
class PHPExcel_Shared_String
class String
{
/** Constants */
/** Regular Expressions */

View File

@ -1,7 +1,9 @@
<?php
namespace PHPExcel\Shared;
/**
* PHPExcel
* PHPExcel_Shared_TimeZone
*
* Copyright (c) 2006 - 2015 PHPExcel
*
@ -25,16 +27,7 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
/**
* PHPExcel_Shared_TimeZone
*
* @category PHPExcel
* @package PHPExcel_Shared
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
*/
class PHPExcel_Shared_TimeZone
class TimeZone
{
/*
* Default Timezone used for date/time conversions

View File

@ -1,5 +1,7 @@
<?php
namespace PHPExcel\Shared;
if (!defined('DATE_W3C')) {
define('DATE_W3C', 'Y-m-d\TH:i:sP');
}
@ -33,7 +35,7 @@ if (!defined('DEBUGMODE_ENABLED')) {
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
class PHPExcel_Shared_XMLWriter extends XMLWriter
class XMLWriter extends \XMLWriter
{
/** Temporary storage method */
const STORAGE_MEMORY = 1;

View File

@ -1,5 +1,7 @@
<?php
namespace PHPExcel\Shared;
if (!defined('PCLZIP_TEMPORARY_DIR')) {
define('PCLZIP_TEMPORARY_DIR', PHPExcel_Shared_File::sys_get_temp_dir() . DIRECTORY_SEPARATOR);
}
@ -30,7 +32,7 @@ require_once PHPEXCEL_ROOT . 'PHPExcel/Shared/PCLZip/pclzip.lib.php';
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
class PHPExcel_Shared_ZipArchive
class ZipArchive
{
/** constants */

View File

@ -1,5 +1,7 @@
<?php
namespace PHPExcel\Shared;
/**
* PHPExcel_Shared_ZipStreamWrapper
*
@ -25,7 +27,7 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
class PHPExcel_Shared_ZipStreamWrapper
class ZipStreamWrapper
{
/**
* Internal ZipAcrhive

View File

@ -157,12 +157,12 @@ class Spreadsheet
/**
* Set the macros code
*
* @param string $MacrosCode string|null
* @param string $macroCode string|null
*/
public function setMacrosCode($MacrosCode = null)
public function setMacrosCode($macroCode = null)
{
$this->macrosCode=$MacrosCode;
$this->setHasMacros(!is_null($MacrosCode));
$this->macrosCode = $macroCode;
$this->setHasMacros(!is_null($macroCode));
}
/**
@ -180,9 +180,9 @@ class Spreadsheet
*
* @param string|null $Certificate
*/
public function setMacrosCertificate($Certificate = null)
public function setMacrosCertificate($certificate = null)
{
$this->macrosCertificate=$Certificate;
$this->macrosCertificate = $certificate;
}
/**
@ -220,10 +220,10 @@ class Spreadsheet
* set ribbon XML data
*
*/
public function setRibbonXMLData($Target = null, $XMLData = null)
public function setRibbonXMLData($target = null, $xmlData = null)
{
if (!is_null($Target) && !is_null($XMLData)) {
$this->ribbonXMLData = array('target' => $Target, 'data' => $XMLData);
if (!is_null($target) && !is_null($xmlData)) {
$this->ribbonXMLData = array('target' => $target, 'data' => $xmlData);
} else {
$this->ribbonXMLData = null;
}
@ -234,23 +234,23 @@ class Spreadsheet
*
* return string|null|array
*/
public function getRibbonXMLData($What = 'all') //we need some constants here...
public function getRibbonXMLData($what = 'all') //we need some constants here...
{
$ReturnData = null;
$What = strtolower($What);
switch ($What){
$returnData = null;
$what = strtolower($what);
switch ($what){
case 'all':
$ReturnData = $this->ribbonXMLData;
$returnData = $this->ribbonXMLData;
break;
case 'target':
case 'data':
if (is_array($this->ribbonXMLData) && array_key_exists($What, $this->ribbonXMLData)) {
$ReturnData = $this->ribbonXMLData[$What];
if (is_array($this->ribbonXMLData) && array_key_exists($what, $this->ribbonXMLData)) {
$returnData = $this->ribbonXMLData[$what];
}
break;
}
return $ReturnData;
return $returnData;
}
/**

View File

@ -1,5 +1,7 @@
<?php
namespace PHPExcel;
/**
* PHPExcel_Style
*
@ -25,54 +27,54 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
class PHPExcel_Style extends PHPExcel_Style_Supervisor implements PHPExcel_IComparable
class Style extends Style\Supervisor implements IComparable
{
/**
* Font
*
* @var PHPExcel_Style_Font
* @var Style\Font
*/
protected $font;
/**
* Fill
*
* @var PHPExcel_Style_Fill
* @var Style\Fill
*/
protected $fill;
/**
* Borders
*
* @var PHPExcel_Style_Borders
* @var Style\Borders
*/
protected $borders;
/**
* Alignment
*
* @var PHPExcel_Style_Alignment
* @var Style\Alignment
*/
protected $alignment;
/**
* Number Format
*
* @var PHPExcel_Style_NumberFormat
* @var Style\NumberFormat
*/
protected $numberFormat;
/**
* Conditional styles
*
* @var PHPExcel_Style_Conditional[]
* @var Style\Conditional[]
*/
protected $conditionalStyles;
/**
* Protection
*
* @var PHPExcel_Style_Protection
* @var Style\Protection
*/
protected $protection;
@ -91,7 +93,7 @@ class PHPExcel_Style extends PHPExcel_Style_Supervisor implements PHPExcel_IComp
protected $quotePrefix = false;
/**
* Create a new PHPExcel_Style
* Create a new Style
*
* @param boolean $isSupervisor Flag indicating if this is a supervisor or not
* Leave this value at default unless you understand exactly what
@ -107,12 +109,12 @@ class PHPExcel_Style extends PHPExcel_Style_Supervisor implements PHPExcel_IComp
// Initialise values
$this->conditionalStyles = array();
$this->font = new PHPExcel_Style_Font($isSupervisor, $isConditional);
$this->fill = new PHPExcel_Style_Fill($isSupervisor, $isConditional);
$this->borders = new PHPExcel_Style_Borders($isSupervisor, $isConditional);
$this->alignment = new PHPExcel_Style_Alignment($isSupervisor, $isConditional);
$this->numberFormat = new PHPExcel_Style_NumberFormat($isSupervisor, $isConditional);
$this->protection = new PHPExcel_Style_Protection($isSupervisor, $isConditional);
$this->font = new Style\Font($isSupervisor, $isConditional);
$this->fill = new Style\Fill($isSupervisor, $isConditional);
$this->borders = new Style\Borders($isSupervisor, $isConditional);
$this->alignment = new Style\Alignment($isSupervisor, $isConditional);
$this->numberFormat = new Style\NumberFormat($isSupervisor, $isConditional);
$this->protection = new Style\Protection($isSupervisor, $isConditional);
// bind parent if we are a supervisor
if ($isSupervisor) {
@ -129,7 +131,7 @@ class PHPExcel_Style extends PHPExcel_Style_Supervisor implements PHPExcel_IComp
* Get the shared style component for the currently active cell in currently active sheet.
* Only used for style supervisor
*
* @return PHPExcel_Style
* @return Style
*/
public function getSharedComponent()
{
@ -176,7 +178,7 @@ class PHPExcel_Style extends PHPExcel_Style_Supervisor implements PHPExcel_IComp
* 'name' => 'Arial',
* 'bold' => true,
* 'italic' => false,
* 'underline' => PHPExcel_Style_Font::UNDERLINE_DOUBLE,
* 'underline' => \PHPExcel\Style\Font::UNDERLINE_DOUBLE,
* 'strike' => false,
* 'color' => array(
* 'rgb' => '808080'
@ -184,13 +186,13 @@ class PHPExcel_Style extends PHPExcel_Style_Supervisor implements PHPExcel_IComp
* ),
* 'borders' => array(
* 'bottom' => array(
* 'style' => PHPExcel_Style_Border::BORDER_DASHDOT,
* 'style' => \PHPExcel\Style\Border::BORDER_DASHDOT,
* 'color' => array(
* 'rgb' => '808080'
* )
* ),
* 'top' => array(
* 'style' => PHPExcel_Style_Border::BORDER_DASHDOT,
* 'style' => \PHPExcel\Style\Border::BORDER_DASHDOT,
* 'color' => array(
* 'rgb' => '808080'
* )
@ -203,8 +205,8 @@ class PHPExcel_Style extends PHPExcel_Style_Supervisor implements PHPExcel_IComp
*
* @param array $pStyles Array containing style information
* @param boolean $pAdvanced Advanced mode for setting borders.
* @throws PHPExcel_Exception
* @return PHPExcel_Style
* @throws Exception
* @return Style
*/
public function applyFromArray($pStyles = null, $pAdvanced = true)
{
@ -224,12 +226,12 @@ class PHPExcel_Style extends PHPExcel_Style_Supervisor implements PHPExcel_IComp
}
// Calculate range outer borders
$rangeStart = PHPExcel_Cell::coordinateFromString($rangeA);
$rangeEnd = PHPExcel_Cell::coordinateFromString($rangeB);
$rangeStart = Cell::coordinateFromString($rangeA);
$rangeEnd = Cell::coordinateFromString($rangeB);
// Translate column into index
$rangeStart[0] = PHPExcel_Cell::columnIndexFromString($rangeStart[0]) - 1;
$rangeEnd[0] = PHPExcel_Cell::columnIndexFromString($rangeEnd[0]) - 1;
$rangeStart[0] = Cell::columnIndexFromString($rangeStart[0]) - 1;
$rangeEnd[0] = Cell::columnIndexFromString($rangeEnd[0]) - 1;
// Make sure we can loop upwards on rows and columns
if ($rangeStart[0] > $rangeEnd[0] && $rangeStart[1] > $rangeEnd[1]) {
@ -278,12 +280,12 @@ class PHPExcel_Style extends PHPExcel_Style_Supervisor implements PHPExcel_IComp
for ($x = 1; $x <= $xMax; ++$x) {
// start column index for region
$colStart = ($x == 3) ?
PHPExcel_Cell::stringFromColumnIndex($rangeEnd[0])
: PHPExcel_Cell::stringFromColumnIndex($rangeStart[0] + $x - 1);
Cell::stringFromColumnIndex($rangeEnd[0])
: Cell::stringFromColumnIndex($rangeStart[0] + $x - 1);
// end column index for region
$colEnd = ($x == 1) ?
PHPExcel_Cell::stringFromColumnIndex($rangeStart[0])
: PHPExcel_Cell::stringFromColumnIndex($rangeEnd[0] - $xMax + $x);
Cell::stringFromColumnIndex($rangeStart[0])
: Cell::stringFromColumnIndex($rangeEnd[0] - $xMax + $x);
for ($y = 1; $y <= $yMax; ++$y) {
// which edges are touching the region
@ -464,7 +466,7 @@ class PHPExcel_Style extends PHPExcel_Style_Supervisor implements PHPExcel_IComp
}
}
} else {
throw new PHPExcel_Exception("Invalid style array passed.");
throw new Exception("Invalid style array passed.");
}
return $this;
}
@ -472,7 +474,7 @@ class PHPExcel_Style extends PHPExcel_Style_Supervisor implements PHPExcel_IComp
/**
* Get Fill
*
* @return PHPExcel_Style_Fill
* @return Style\Fill
*/
public function getFill()
{
@ -482,7 +484,7 @@ class PHPExcel_Style extends PHPExcel_Style_Supervisor implements PHPExcel_IComp
/**
* Get Font
*
* @return PHPExcel_Style_Font
* @return Style\Font
*/
public function getFont()
{
@ -492,10 +494,10 @@ class PHPExcel_Style extends PHPExcel_Style_Supervisor implements PHPExcel_IComp
/**
* Set font
*
* @param PHPExcel_Style_Font $font
* @return PHPExcel_Style
* @param Style\Font $font
* @return Style
*/
public function setFont(PHPExcel_Style_Font $font)
public function setFont(Style\Font $font)
{
$this->font = $font;
return $this;
@ -504,7 +506,7 @@ class PHPExcel_Style extends PHPExcel_Style_Supervisor implements PHPExcel_IComp
/**
* Get Borders
*
* @return PHPExcel_Style_Borders
* @return Style\Borders
*/
public function getBorders()
{
@ -514,7 +516,7 @@ class PHPExcel_Style extends PHPExcel_Style_Supervisor implements PHPExcel_IComp
/**
* Get Alignment
*
* @return PHPExcel_Style_Alignment
* @return Style\Alignment
*/
public function getAlignment()
{
@ -524,7 +526,7 @@ class PHPExcel_Style extends PHPExcel_Style_Supervisor implements PHPExcel_IComp
/**
* Get Number Format
*
* @return PHPExcel_Style_NumberFormat
* @return Style\NumberFormat
*/
public function getNumberFormat()
{
@ -534,7 +536,7 @@ class PHPExcel_Style extends PHPExcel_Style_Supervisor implements PHPExcel_IComp
/**
* Get Conditional Styles. Only used on supervisor.
*
* @return PHPExcel_Style_Conditional[]
* @return Style\Conditional[]
*/
public function getConditionalStyles()
{
@ -544,8 +546,8 @@ class PHPExcel_Style extends PHPExcel_Style_Supervisor implements PHPExcel_IComp
/**
* Set Conditional Styles. Only used on supervisor.
*
* @param PHPExcel_Style_Conditional[] $pValue Array of condtional styles
* @return PHPExcel_Style
* @param Style\Conditional[] $pValue Array of condtional styles
* @return Style
*/
public function setConditionalStyles($pValue = null)
{
@ -558,7 +560,7 @@ class PHPExcel_Style extends PHPExcel_Style_Supervisor implements PHPExcel_IComp
/**
* Get Protection
*
* @return PHPExcel_Style_Protection
* @return Style\Protection
*/
public function getProtection()
{

View File

@ -1,4 +1,7 @@
<?php
namespace PHPExcel\Style;
/**
* PHPExcel_Style_Alignment
*
@ -24,7 +27,7 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
class PHPExcel_Style_Alignment extends PHPExcel_Style_Supervisor implements PHPExcel_IComparable
class Alignment extends Supervisor implements \PHPExcel\IComparable
{
/* Horizontal alignment styles */
const HORIZONTAL_GENERAL = 'general';
@ -53,14 +56,14 @@ class PHPExcel_Style_Alignment extends PHPExcel_Style_Supervisor implements PHPE
*
* @var string
*/
protected $horizontal = PHPExcel_Style_Alignment::HORIZONTAL_GENERAL;
protected $horizontal = self::HORIZONTAL_GENERAL;
/**
* Vertical alignment
*
* @var string
*/
protected $vertical = PHPExcel_Style_Alignment::VERTICAL_BOTTOM;
protected $vertical = self::VERTICAL_BOTTOM;
/**
* Text rotation

View File

@ -1,5 +1,7 @@
<?php
namespace PHPExcel\Style;
/**
* PHPExcel_Style_Border
*
@ -25,7 +27,7 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
class PHPExcel_Style_Border extends PHPExcel_Style_Supervisor implements PHPExcel_IComparable
class Border extends Supervisor implements \PHPExcel\IComparable
{
/* Border style */
const BORDER_NONE = 'none';
@ -48,7 +50,7 @@ class PHPExcel_Style_Border extends PHPExcel_Style_Supervisor implements PHPExce
*
* @var string
*/
protected $borderStyle = PHPExcel_Style_Border::BORDER_NONE;
protected $borderStyle = self::BORDER_NONE;
/**
* Border color
@ -65,7 +67,7 @@ class PHPExcel_Style_Border extends PHPExcel_Style_Supervisor implements PHPExce
protected $parentPropertyName;
/**
* Create a new PHPExcel_Style_Border
* Create a new Border
*
* @param boolean $isSupervisor Flag indicating if this is a supervisor or not
* Leave this value at default unless you understand exactly what
@ -80,7 +82,7 @@ class PHPExcel_Style_Border extends PHPExcel_Style_Supervisor implements PHPExce
parent::__construct($isSupervisor);
// Initialise values
$this->color = new PHPExcel_Style_Color(PHPExcel_Style_Color::COLOR_BLACK, $isSupervisor);
$this->color = new Color(Color::COLOR_BLACK, $isSupervisor);
// bind parent if we are a supervisor
if ($isSupervisor) {
@ -91,9 +93,9 @@ class PHPExcel_Style_Border extends PHPExcel_Style_Supervisor implements PHPExce
/**
* Bind parent. Only used for supervisor
*
* @param PHPExcel_Style_Borders $parent
* @param Borders $parent
* @param string $parentPropertyName
* @return PHPExcel_Style_Border
* @return Border
*/
public function bindParent($parent, $parentPropertyName = null)
{
@ -106,7 +108,7 @@ class PHPExcel_Style_Border extends PHPExcel_Style_Supervisor implements PHPExce
* Get the shared style component for the currently active cell in currently active sheet.
* Only used for style supervisor
*
* @return PHPExcel_Style_Border
* @return Border
* @throws PHPExcel_Exception
*/
public function getSharedComponent()
@ -117,7 +119,7 @@ class PHPExcel_Style_Border extends PHPExcel_Style_Supervisor implements PHPExce
case 'inside':
case 'outline':
case 'vertical':
throw new PHPExcel_Exception('Cannot get shared component for a pseudo-border.');
throw new \PHPExcel\Exception('Cannot get shared component for a pseudo-border.');
break;
case 'bottom':
return $this->parent->getSharedComponent()->getBottom();
@ -163,7 +165,7 @@ class PHPExcel_Style_Border extends PHPExcel_Style_Supervisor implements PHPExce
* <code>
* $objPHPExcel->getActiveSheet()->getStyle('B2')->getBorders()->getTop()->applyFromArray(
* array(
* 'style' => PHPExcel_Style_Border::BORDER_DASHDOT,
* 'style' => \PHPExcel\Style\Border::BORDER_DASHDOT,
* 'color' => array(
* 'rgb' => '808080'
* )
@ -173,7 +175,7 @@ class PHPExcel_Style_Border extends PHPExcel_Style_Supervisor implements PHPExce
*
* @param array $pStyles Array containing style information
* @throws PHPExcel_Exception
* @return PHPExcel_Style_Border
* @return Border
*/
public function applyFromArray($pStyles = null)
{
@ -189,7 +191,7 @@ class PHPExcel_Style_Border extends PHPExcel_Style_Supervisor implements PHPExce
}
}
} else {
throw new PHPExcel_Exception("Invalid style array passed.");
throw new \PHPExcel\Exception("Invalid style array passed.");
}
return $this;
}
@ -211,17 +213,17 @@ class PHPExcel_Style_Border extends PHPExcel_Style_Supervisor implements PHPExce
* Set Border style
*
* @param string|boolean $pValue
* When passing a boolean, FALSE equates PHPExcel_Style_Border::BORDER_NONE
* and TRUE to PHPExcel_Style_Border::BORDER_MEDIUM
* @return PHPExcel_Style_Border
* When passing a boolean, FALSE equates Border::BORDER_NONE
* and TRUE to Border::BORDER_MEDIUM
* @return Border
*/
public function setBorderStyle($pValue = PHPExcel_Style_Border::BORDER_NONE)
public function setBorderStyle($pValue = Border::BORDER_NONE)
{
if (empty($pValue)) {
$pValue = PHPExcel_Style_Border::BORDER_NONE;
$pValue = Border::BORDER_NONE;
} elseif (is_bool($pValue) && $pValue) {
$pValue = PHPExcel_Style_Border::BORDER_MEDIUM;
$pValue = Border::BORDER_MEDIUM;
}
if ($this->isSupervisor) {
$styleArray = $this->getStyleArray(array('style' => $pValue));
@ -247,7 +249,7 @@ class PHPExcel_Style_Border extends PHPExcel_Style_Supervisor implements PHPExce
*
* @param PHPExcel_Style_Color $pValue
* @throws PHPExcel_Exception
* @return PHPExcel_Style_Border
* @return Border
*/
public function setColor(PHPExcel_Style_Color $pValue = null)
{

View File

@ -1,5 +1,7 @@
<?php
namespace PHPExcel\Style;
/**
* PHPExcel_Style_Borders
*
@ -25,7 +27,7 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
class PHPExcel_Style_Borders extends PHPExcel_Style_Supervisor implements PHPExcel_IComparable
class Borders extends Supervisor implements \PHPExcel\IComparable
{
/* Diagonal directions */
const DIAGONAL_NONE = 0;
@ -36,35 +38,35 @@ class PHPExcel_Style_Borders extends PHPExcel_Style_Supervisor implements PHPExc
/**
* Left
*
* @var PHPExcel_Style_Border
* @var Border
*/
protected $left;
/**
* Right
*
* @var PHPExcel_Style_Border
* @var Border
*/
protected $right;
/**
* Top
*
* @var PHPExcel_Style_Border
* @var Border
*/
protected $top;
/**
* Bottom
*
* @var PHPExcel_Style_Border
* @var Border
*/
protected $bottom;
/**
* Diagonal
*
* @var PHPExcel_Style_Border
* @var Border
*/
protected $diagonal;
@ -78,40 +80,40 @@ class PHPExcel_Style_Borders extends PHPExcel_Style_Supervisor implements PHPExc
/**
* All borders psedo-border. Only applies to supervisor.
*
* @var PHPExcel_Style_Border
* @var Border
*/
protected $allBorders;
/**
* Outline psedo-border. Only applies to supervisor.
*
* @var PHPExcel_Style_Border
* @var Border
*/
protected $outline;
/**
* Inside psedo-border. Only applies to supervisor.
*
* @var PHPExcel_Style_Border
* @var Border
*/
protected $inside;
/**
* Vertical pseudo-border. Only applies to supervisor.
*
* @var PHPExcel_Style_Border
* @var Border
*/
protected $vertical;
/**
* Horizontal pseudo-border. Only applies to supervisor.
*
* @var PHPExcel_Style_Border
* @var Border
*/
protected $horizontal;
/**
* Create a new PHPExcel_Style_Borders
* Create a new Borders
*
* @param boolean $isSupervisor Flag indicating if this is a supervisor or not
* Leave this value at default unless you understand exactly what
@ -126,21 +128,21 @@ class PHPExcel_Style_Borders extends PHPExcel_Style_Supervisor implements PHPExc
parent::__construct($isSupervisor);
// Initialise values
$this->left = new PHPExcel_Style_Border($isSupervisor, $isConditional);
$this->right = new PHPExcel_Style_Border($isSupervisor, $isConditional);
$this->top = new PHPExcel_Style_Border($isSupervisor, $isConditional);
$this->bottom = new PHPExcel_Style_Border($isSupervisor, $isConditional);
$this->diagonal = new PHPExcel_Style_Border($isSupervisor, $isConditional);
$this->diagonalDirection = PHPExcel_Style_Borders::DIAGONAL_NONE;
$this->left = new Border($isSupervisor, $isConditional);
$this->right = new Border($isSupervisor, $isConditional);
$this->top = new Border($isSupervisor, $isConditional);
$this->bottom = new Border($isSupervisor, $isConditional);
$this->diagonal = new Border($isSupervisor, $isConditional);
$this->diagonalDirection = self::DIAGONAL_NONE;
// Specially for supervisor
if ($isSupervisor) {
// Initialize pseudo-borders
$this->allBorders = new PHPExcel_Style_Border(true);
$this->outline = new PHPExcel_Style_Border(true);
$this->inside = new PHPExcel_Style_Border(true);
$this->vertical = new PHPExcel_Style_Border(true);
$this->horizontal = new PHPExcel_Style_Border(true);
$this->allBorders = new Border(true);
$this->outline = new Border(true);
$this->inside = new Border(true);
$this->vertical = new Border(true);
$this->horizontal = new Border(true);
// bind parent if we are a supervisor
$this->left->bindParent($this, 'left');
@ -160,7 +162,7 @@ class PHPExcel_Style_Borders extends PHPExcel_Style_Supervisor implements PHPExc
* Get the shared style component for the currently active cell in currently active sheet.
* Only used for style supervisor
*
* @return PHPExcel_Style_Borders
* @return Borders
*/
public function getSharedComponent()
{
@ -185,13 +187,13 @@ class PHPExcel_Style_Borders extends PHPExcel_Style_Supervisor implements PHPExc
* $objPHPExcel->getActiveSheet()->getStyle('B2')->getBorders()->applyFromArray(
* array(
* 'bottom' => array(
* 'style' => PHPExcel_Style_Border::BORDER_DASHDOT,
* 'style' => \PHPExcel\Style\Border::BORDER_DASHDOT,
* 'color' => array(
* 'rgb' => '808080'
* )
* ),
* 'top' => array(
* 'style' => PHPExcel_Style_Border::BORDER_DASHDOT,
* 'style' => \PHPExcel\Style\Border::BORDER_DASHDOT,
* 'color' => array(
* 'rgb' => '808080'
* )
@ -203,7 +205,7 @@ class PHPExcel_Style_Borders extends PHPExcel_Style_Supervisor implements PHPExc
* $objPHPExcel->getActiveSheet()->getStyle('B2')->getBorders()->applyFromArray(
* array(
* 'allborders' => array(
* 'style' => PHPExcel_Style_Border::BORDER_DASHDOT,
* 'style' => \PHPExcel\Style\Border::BORDER_DASHDOT,
* 'color' => array(
* 'rgb' => '808080'
* )
@ -214,7 +216,7 @@ class PHPExcel_Style_Borders extends PHPExcel_Style_Supervisor implements PHPExc
*
* @param array $pStyles Array containing style information
* @throws PHPExcel_Exception
* @return PHPExcel_Style_Borders
* @return Borders
*/
public function applyFromArray($pStyles = null)
{
@ -256,7 +258,7 @@ class PHPExcel_Style_Borders extends PHPExcel_Style_Supervisor implements PHPExc
/**
* Get Left
*
* @return PHPExcel_Style_Border
* @return Border
*/
public function getLeft()
{
@ -266,7 +268,7 @@ class PHPExcel_Style_Borders extends PHPExcel_Style_Supervisor implements PHPExc
/**
* Get Right
*
* @return PHPExcel_Style_Border
* @return Border
*/
public function getRight()
{
@ -276,7 +278,7 @@ class PHPExcel_Style_Borders extends PHPExcel_Style_Supervisor implements PHPExc
/**
* Get Top
*
* @return PHPExcel_Style_Border
* @return Border
*/
public function getTop()
{
@ -286,7 +288,7 @@ class PHPExcel_Style_Borders extends PHPExcel_Style_Supervisor implements PHPExc
/**
* Get Bottom
*
* @return PHPExcel_Style_Border
* @return Border
*/
public function getBottom()
{
@ -296,7 +298,7 @@ class PHPExcel_Style_Borders extends PHPExcel_Style_Supervisor implements PHPExc
/**
* Get Diagonal
*
* @return PHPExcel_Style_Border
* @return Border
*/
public function getDiagonal()
{
@ -306,7 +308,7 @@ class PHPExcel_Style_Borders extends PHPExcel_Style_Supervisor implements PHPExc
/**
* Get AllBorders (pseudo-border). Only applies to supervisor.
*
* @return PHPExcel_Style_Border
* @return Border
* @throws PHPExcel_Exception
*/
public function getAllBorders()
@ -348,7 +350,7 @@ class PHPExcel_Style_Borders extends PHPExcel_Style_Supervisor implements PHPExc
/**
* Get Vertical (pseudo-border). Only applies to supervisor.
*
* @return PHPExcel_Style_Border
* @return Border
* @throws PHPExcel_Exception
*/
public function getVertical()
@ -362,7 +364,7 @@ class PHPExcel_Style_Borders extends PHPExcel_Style_Supervisor implements PHPExc
/**
* Get Horizontal (pseudo-border). Only applies to supervisor.
*
* @return PHPExcel_Style_Border
* @return Border
* @throws PHPExcel_Exception
*/
public function getHorizontal()
@ -390,12 +392,12 @@ class PHPExcel_Style_Borders extends PHPExcel_Style_Supervisor implements PHPExc
* Set DiagonalDirection
*
* @param int $pValue
* @return PHPExcel_Style_Borders
* @return Borders
*/
public function setDiagonalDirection($pValue = PHPExcel_Style_Borders::DIAGONAL_NONE)
public function setDiagonalDirection($pValue = Borders::DIAGONAL_NONE)
{
if ($pValue == '') {
$pValue = PHPExcel_Style_Borders::DIAGONAL_NONE;
$pValue = Borders::DIAGONAL_NONE;
}
if ($this->isSupervisor) {
$styleArray = $this->getStyleArray(array('diagonaldirection' => $pValue));

View File

@ -1,5 +1,7 @@
<?php
namespace PHPExcel\Style;
/**
* PHPExcel_Style_Color
*
@ -25,7 +27,7 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
class PHPExcel_Style_Color extends PHPExcel_Style_Supervisor implements PHPExcel_IComparable
class Color extends Supervisor implements \PHPExcel\IComparable
{
/* Colors */
const COLOR_BLACK = 'FF000000';

View File

@ -1,6 +1,9 @@
<?php
namespace PHPExcel\Style;
/**
* PHPExcel
* PHPExcel_Style_Conditional
*
* Copyright (c) 2006 - 2015 PHPExcel
*
@ -24,16 +27,7 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
/**
* PHPExcel_Style_Conditional
*
* @category PHPExcel
* @package PHPExcel_Style
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
*/
class PHPExcel_Style_Conditional implements PHPExcel_IComparable
class Conditional implements \PHPExcel\IComparable
{
/* Condition types */
const CONDITION_NONE = 'none';

View File

@ -1,5 +1,7 @@
<?php
namespace PHPExcel\Style;
/**
* PHPExcel_Style_Fill
*
@ -25,7 +27,7 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
class PHPExcel_Style_Fill extends PHPExcel_Style_Supervisor implements PHPExcel_IComparable
class Fill extends Supervisor implements \PHPExcel\IComparable
{
/* Fill types */
const FILL_NONE = 'none';
@ -55,7 +57,7 @@ class PHPExcel_Style_Fill extends PHPExcel_Style_Supervisor implements PHPExcel_
*
* @var string
*/
protected $fillType = PHPExcel_Style_Fill::FILL_NONE;
protected $fillType = self::FILL_NONE;
/**
* Rotation
@ -67,19 +69,19 @@ class PHPExcel_Style_Fill extends PHPExcel_Style_Supervisor implements PHPExcel_
/**
* Start color
*
* @var PHPExcel_Style_Color
* @var Color
*/
protected $startColor;
/**
* End color
*
* @var PHPExcel_Style_Color
* @var Color
*/
protected $endColor;
/**
* Create a new PHPExcel_Style_Fill
* Create a new Fill
*
* @param boolean $isSupervisor Flag indicating if this is a supervisor or not
* Leave this value at default unless you understand exactly what
@ -97,8 +99,8 @@ class PHPExcel_Style_Fill extends PHPExcel_Style_Supervisor implements PHPExcel_
if ($isConditional) {
$this->fillType = null;
}
$this->startColor = new PHPExcel_Style_Color(PHPExcel_Style_Color::COLOR_WHITE, $isSupervisor, $isConditional);
$this->endColor = new PHPExcel_Style_Color(PHPExcel_Style_Color::COLOR_BLACK, $isSupervisor, $isConditional);
$this->startColor = new Color(Color::COLOR_WHITE, $isSupervisor, $isConditional);
$this->endColor = new Color(Color::COLOR_BLACK, $isSupervisor, $isConditional);
// bind parent if we are a supervisor
if ($isSupervisor) {
@ -111,7 +113,7 @@ class PHPExcel_Style_Fill extends PHPExcel_Style_Supervisor implements PHPExcel_
* Get the shared style component for the currently active cell in currently active sheet.
* Only used for style supervisor
*
* @return PHPExcel_Style_Fill
* @return Fill
*/
public function getSharedComponent()
{
@ -135,7 +137,7 @@ class PHPExcel_Style_Fill extends PHPExcel_Style_Supervisor implements PHPExcel_
* <code>
* $objPHPExcel->getActiveSheet()->getStyle('B2')->getFill()->applyFromArray(
* array(
* 'type' => PHPExcel_Style_Fill::FILL_GRADIENT_LINEAR,
* 'type' => \PHPExcel\Style\Fill::FILL_GRADIENT_LINEAR,
* 'rotation' => 0,
* 'startcolor' => array(
* 'rgb' => '000000'
@ -148,8 +150,8 @@ class PHPExcel_Style_Fill extends PHPExcel_Style_Supervisor implements PHPExcel_
* </code>
*
* @param array $pStyles Array containing style information
* @throws PHPExcel_Exception
* @return PHPExcel_Style_Fill
* @throws \PHPExcel\Exception
* @return Fill
*/
public function applyFromArray($pStyles = null)
{
@ -174,7 +176,7 @@ class PHPExcel_Style_Fill extends PHPExcel_Style_Supervisor implements PHPExcel_
}
}
} else {
throw new PHPExcel_Exception("Invalid style array passed.");
throw new \PHPExcel\Exception("Invalid style array passed.");
}
return $this;
}
@ -195,10 +197,10 @@ class PHPExcel_Style_Fill extends PHPExcel_Style_Supervisor implements PHPExcel_
/**
* Set Fill Type
*
* @param string $pValue PHPExcel_Style_Fill fill type
* @return PHPExcel_Style_Fill
* @param string $pValue Fill type
* @return Fill
*/
public function setFillType($pValue = PHPExcel_Style_Fill::FILL_NONE)
public function setFillType($pValue = Fill::FILL_NONE)
{
if ($this->isSupervisor) {
$styleArray = $this->getStyleArray(array('type' => $pValue));
@ -226,7 +228,7 @@ class PHPExcel_Style_Fill extends PHPExcel_Style_Supervisor implements PHPExcel_
* Set Rotation
*
* @param double $pValue
* @return PHPExcel_Style_Fill
* @return Fill
*/
public function setRotation($pValue = 0)
{
@ -242,7 +244,7 @@ class PHPExcel_Style_Fill extends PHPExcel_Style_Supervisor implements PHPExcel_
/**
* Get Start Color
*
* @return PHPExcel_Style_Color
* @return Color
*/
public function getStartColor()
{
@ -252,11 +254,11 @@ class PHPExcel_Style_Fill extends PHPExcel_Style_Supervisor implements PHPExcel_
/**
* Set Start Color
*
* @param PHPExcel_Style_Color $pValue
* @throws PHPExcel_Exception
* @return PHPExcel_Style_Fill
* @param Color $pValue
* @throws \PHPExcel\Exception
* @return Fill
*/
public function setStartColor(PHPExcel_Style_Color $pValue = null)
public function setStartColor(Color $pValue = null)
{
// make sure parameter is a real color and not a supervisor
$color = $pValue->getIsSupervisor() ? $pValue->getSharedComponent() : $pValue;
@ -273,7 +275,7 @@ class PHPExcel_Style_Fill extends PHPExcel_Style_Supervisor implements PHPExcel_
/**
* Get End Color
*
* @return PHPExcel_Style_Color
* @return Color
*/
public function getEndColor()
{
@ -283,11 +285,11 @@ class PHPExcel_Style_Fill extends PHPExcel_Style_Supervisor implements PHPExcel_
/**
* Set End Color
*
* @param PHPExcel_Style_Color $pValue
* @throws PHPExcel_Exception
* @return PHPExcel_Style_Fill
* @param Color $pValue
* @throws \PHPExcel\Exception
* @return Fill
*/
public function setEndColor(PHPExcel_Style_Color $pValue = null)
public function setEndColor(Color $pValue = null)
{
// make sure parameter is a real color and not a supervisor
$color = $pValue->getIsSupervisor() ? $pValue->getSharedComponent() : $pValue;

View File

@ -1,5 +1,7 @@
<?php
namespace PHPExcel\Style;
/**
* PHPExcel_Style_Font
*
@ -25,7 +27,7 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
class PHPExcel_Style_Font extends PHPExcel_Style_Supervisor implements PHPExcel_IComparable
class Font extends Supervisor implements \PHPExcel\IComparable
{
/* Underline types */
const UNDERLINE_NONE = 'none';
@ -93,12 +95,12 @@ class PHPExcel_Style_Font extends PHPExcel_Style_Supervisor implements PHPExcel_
/**
* Foreground color
*
* @var PHPExcel_Style_Color
* @var Color
*/
protected $color;
/**
* Create a new PHPExcel_Style_Font
* Create a new Font
*
* @param boolean $isSupervisor Flag indicating if this is a supervisor or not
* Leave this value at default unless you understand exactly what
@ -122,9 +124,9 @@ class PHPExcel_Style_Font extends PHPExcel_Style_Supervisor implements PHPExcel_
$this->subScript = null;
$this->underline = null;
$this->strikethrough = null;
$this->color = new PHPExcel_Style_Color(PHPExcel_Style_Color::COLOR_BLACK, $isSupervisor, $isConditional);
$this->color = new Color(Color::COLOR_BLACK, $isSupervisor, $isConditional);
} else {
$this->color = new PHPExcel_Style_Color(PHPExcel_Style_Color::COLOR_BLACK, $isSupervisor);
$this->color = new Color(Color::COLOR_BLACK, $isSupervisor);
}
// bind parent if we are a supervisor
if ($isSupervisor) {
@ -136,7 +138,7 @@ class PHPExcel_Style_Font extends PHPExcel_Style_Supervisor implements PHPExcel_
* Get the shared style component for the currently active cell in currently active sheet.
* Only used for style supervisor
*
* @return PHPExcel_Style_Font
* @return Font
*/
public function getSharedComponent()
{
@ -163,7 +165,7 @@ class PHPExcel_Style_Font extends PHPExcel_Style_Supervisor implements PHPExcel_
* 'name' => 'Arial',
* 'bold' => TRUE,
* 'italic' => FALSE,
* 'underline' => PHPExcel_Style_Font::UNDERLINE_DOUBLE,
* 'underline' => \PHPExcel\Style\Font::UNDERLINE_DOUBLE,
* 'strike' => FALSE,
* 'color' => array(
* 'rgb' => '808080'
@ -173,8 +175,8 @@ class PHPExcel_Style_Font extends PHPExcel_Style_Supervisor implements PHPExcel_
* </code>
*
* @param array $pStyles Array containing style information
* @throws PHPExcel_Exception
* @return PHPExcel_Style_Font
* @throws \PHPExcel\Exception
* @return Font
*/
public function applyFromArray($pStyles = null)
{
@ -211,7 +213,7 @@ class PHPExcel_Style_Font extends PHPExcel_Style_Supervisor implements PHPExcel_
}
}
} else {
throw new PHPExcel_Exception("Invalid style array passed.");
throw new \PHPExcel\Exception("Invalid style array passed.");
}
return $this;
}
@ -233,7 +235,7 @@ class PHPExcel_Style_Font extends PHPExcel_Style_Supervisor implements PHPExcel_
* Set Name
*
* @param string $pValue
* @return PHPExcel_Style_Font
* @return Font
*/
public function setName($pValue = 'Calibri')
{
@ -266,7 +268,7 @@ class PHPExcel_Style_Font extends PHPExcel_Style_Supervisor implements PHPExcel_
* Set Size
*
* @param double $pValue
* @return PHPExcel_Style_Font
* @return Font
*/
public function setSize($pValue = 10)
{
@ -299,7 +301,7 @@ class PHPExcel_Style_Font extends PHPExcel_Style_Supervisor implements PHPExcel_
* Set Bold
*
* @param boolean $pValue
* @return PHPExcel_Style_Font
* @return Font
*/
public function setBold($pValue = false)
{
@ -332,7 +334,7 @@ class PHPExcel_Style_Font extends PHPExcel_Style_Supervisor implements PHPExcel_
* Set Italic
*
* @param boolean $pValue
* @return PHPExcel_Style_Font
* @return Font
*/
public function setItalic($pValue = false)
{
@ -365,7 +367,7 @@ class PHPExcel_Style_Font extends PHPExcel_Style_Supervisor implements PHPExcel_
* Set SuperScript
*
* @param boolean $pValue
* @return PHPExcel_Style_Font
* @return Font
*/
public function setSuperScript($pValue = false)
{
@ -399,7 +401,7 @@ class PHPExcel_Style_Font extends PHPExcel_Style_Supervisor implements PHPExcel_
* Set SubScript
*
* @param boolean $pValue
* @return PHPExcel_Style_Font
* @return Font
*/
public function setSubScript($pValue = false)
{
@ -432,10 +434,10 @@ class PHPExcel_Style_Font extends PHPExcel_Style_Supervisor implements PHPExcel_
/**
* Set Underline
*
* @param string|boolean $pValue PHPExcel_Style_Font underline type
* @param string|boolean $pValue \PHPExcel\Style\Font underline type
* If a boolean is passed, then TRUE equates to UNDERLINE_SINGLE,
* false equates to UNDERLINE_NONE
* @return PHPExcel_Style_Font
* @return Font
*/
public function setUnderline($pValue = self::UNDERLINE_NONE)
{
@ -470,7 +472,7 @@ class PHPExcel_Style_Font extends PHPExcel_Style_Supervisor implements PHPExcel_
* Set Strikethrough
*
* @param boolean $pValue
* @return PHPExcel_Style_Font
* @return Font
*/
public function setStrikethrough($pValue = false)
{
@ -489,7 +491,7 @@ class PHPExcel_Style_Font extends PHPExcel_Style_Supervisor implements PHPExcel_
/**
* Get Color
*
* @return PHPExcel_Style_Color
* @return Color
*/
public function getColor()
{
@ -499,11 +501,11 @@ class PHPExcel_Style_Font extends PHPExcel_Style_Supervisor implements PHPExcel_
/**
* Set Color
*
* @param PHPExcel_Style_Color $pValue
* @throws PHPExcel_Exception
* @return PHPExcel_Style_Font
* @param Color $pValue
* @throws \PHPExcel\Exception
* @return Font
*/
public function setColor(PHPExcel_Style_Color $pValue = null)
public function setColor(Color $pValue = null)
{
// make sure parameter is a real color and not a supervisor
$color = $pValue->getIsSupervisor() ? $pValue->getSharedComponent() : $pValue;

View File

@ -1,5 +1,7 @@
<?php
namespace PHPExcel\Style;
/**
* PHPExcel_Style_NumberFormat
*
@ -25,7 +27,7 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
class PHPExcel_Style_NumberFormat extends PHPExcel_Style_Supervisor implements PHPExcel_IComparable
class NumberFormat extends Supervisor implements \PHPExcel\IComparable
{
/* Pre-defined formats */
const FORMAT_GENERAL = 'General';
@ -86,7 +88,7 @@ class PHPExcel_Style_NumberFormat extends PHPExcel_Style_Supervisor implements P
*
* @var string
*/
protected $formatCode = PHPExcel_Style_NumberFormat::FORMAT_GENERAL;
protected $formatCode = self::FORMAT_GENERAL;
/**
* Built-in format Code
@ -96,7 +98,7 @@ class PHPExcel_Style_NumberFormat extends PHPExcel_Style_Supervisor implements P
protected $builtInFormatCode = 0;
/**
* Create a new PHPExcel_Style_NumberFormat
* Create a new NumberFormat
*
* @param boolean $isSupervisor Flag indicating if this is a supervisor or not
* Leave this value at default unless you understand exactly what
@ -120,7 +122,7 @@ class PHPExcel_Style_NumberFormat extends PHPExcel_Style_Supervisor implements P
* Get the shared style component for the currently active cell in currently active sheet.
* Only used for style supervisor
*
* @return PHPExcel_Style_NumberFormat
* @return NumberFormat
*/
public function getSharedComponent()
{
@ -144,14 +146,14 @@ class PHPExcel_Style_NumberFormat extends PHPExcel_Style_Supervisor implements P
* <code>
* $objPHPExcel->getActiveSheet()->getStyle('B2')->getNumberFormat()->applyFromArray(
* array(
* 'code' => PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_EUR_SIMPLE
* 'code' => \PHPExcel\Style\NumberFormat::FORMAT_CURRENCY_EUR_SIMPLE
* )
* );
* </code>
*
* @param array $pStyles Array containing style information
* @throws PHPExcel_Exception
* @return PHPExcel_Style_NumberFormat
* @return NumberFormat
*/
public function applyFromArray($pStyles = null)
{
@ -189,12 +191,12 @@ class PHPExcel_Style_NumberFormat extends PHPExcel_Style_Supervisor implements P
* Set Format Code
*
* @param string $pValue
* @return PHPExcel_Style_NumberFormat
* @return NumberFormat
*/
public function setFormatCode($pValue = PHPExcel_Style_NumberFormat::FORMAT_GENERAL)
public function setFormatCode($pValue = NumberFormat::FORMAT_GENERAL)
{
if ($pValue == '') {
$pValue = PHPExcel_Style_NumberFormat::FORMAT_GENERAL;
$pValue = NumberFormat::FORMAT_GENERAL;
}
if ($this->isSupervisor) {
$styleArray = $this->getStyleArray(array('code' => $pValue));
@ -223,7 +225,7 @@ class PHPExcel_Style_NumberFormat extends PHPExcel_Style_Supervisor implements P
* Set Built-In Format Code
*
* @param int $pValue
* @return PHPExcel_Style_NumberFormat
* @return NumberFormat
*/
public function setBuiltInFormatCode($pValue = 0)
{
@ -248,7 +250,7 @@ class PHPExcel_Style_NumberFormat extends PHPExcel_Style_Supervisor implements P
self::$builtInFormats = array();
// General
self::$builtInFormats[0] = PHPExcel_Style_NumberFormat::FORMAT_GENERAL;
self::$builtInFormats[0] = NumberFormat::FORMAT_GENERAL;
self::$builtInFormats[1] = '0';
self::$builtInFormats[2] = '0.00';
self::$builtInFormats[3] = '#,##0';
@ -538,7 +540,7 @@ class PHPExcel_Style_NumberFormat extends PHPExcel_Style_Supervisor implements P
* @param array $callBack Callback function for additional formatting of string
* @return string Formatted string
*/
public static function toFormattedString($value = '0', $format = PHPExcel_Style_NumberFormat::FORMAT_GENERAL, $callBack = null)
public static function toFormattedString($value = '0', $format = NumberFormat::FORMAT_GENERAL, $callBack = null)
{
// For now we do not treat strings although section 4 of a format code affects strings
if (!is_numeric($value)) {
@ -547,7 +549,7 @@ class PHPExcel_Style_NumberFormat extends PHPExcel_Style_Supervisor implements P
// For 'General' format code, we just pass the value although this is not entirely the way Excel does it,
// it seems to round numbers to a total of 10 digits.
if (($format === PHPExcel_Style_NumberFormat::FORMAT_GENERAL) || ($format === PHPExcel_Style_NumberFormat::FORMAT_TEXT)) {
if (($format === NumberFormat::FORMAT_GENERAL) || ($format === NumberFormat::FORMAT_TEXT)) {
return $value;
}

View File

@ -1,5 +1,7 @@
<?php
namespace PHPExcel\Style;
/**
* PHPExcel_Style_Protection
*
@ -25,7 +27,7 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
class PHPExcel_Style_Protection extends PHPExcel_Style_Supervisor implements PHPExcel_IComparable
class Protection extends Supervisor implements \PHPExcel\IComparable
{
/** Protection styles */
const PROTECTION_INHERIT = 'inherit';

View File

@ -1,5 +1,7 @@
<?php
namespace PHPExcel\Style;
/**
* PHPExcel_Style_Supervisor
*
@ -25,7 +27,7 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
abstract class PHPExcel_Style_Supervisor
abstract class Supervisor
{
/**
* Supervisor?

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,7 @@
<?php
namespace PHPExcel\Worksheet;
/**
* PHPExcel_Worksheet_AutoFilter
*
@ -25,7 +27,7 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
class PHPExcel_Worksheet_AutoFilter
class AutoFilter
{
/**
* Autofilter Worksheet
@ -57,7 +59,7 @@ class PHPExcel_Worksheet_AutoFilter
* @param string $pRange Cell range (i.e. A1:E10)
* @param PHPExcel_Worksheet $pSheet
*/
public function __construct($pRange = '', PHPExcel_Worksheet $pSheet = null)
public function __construct($pRange = '', \PHPExcel\Worksheet $pSheet = null)
{
$this->range = $pRange;
$this->workSheet = $pSheet;
@ -79,7 +81,7 @@ class PHPExcel_Worksheet_AutoFilter
* @param PHPExcel_Worksheet $pSheet
* @return PHPExcel_Worksheet_AutoFilter
*/
public function setParent(PHPExcel_Worksheet $pSheet = null)
public function setParent(\PHPExcel\Worksheet $pSheet = null)
{
$this->workSheet = $pSheet;

View File

@ -1,5 +1,7 @@
<?php
namespace PHPExcel\Worksheet;
/**
* PHPExcel_Worksheet_BaseDrawing
*
@ -25,7 +27,7 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
class PHPExcel_Worksheet_BaseDrawing implements PHPExcel_IComparable
class BaseDrawing implements \PHPExcel\IComparable
{
/**
* Image counter

View File

@ -1,5 +1,7 @@
<?php
namespace PHPExcel\Worksheet;
/**
* PHPExcel_Worksheet_CellIterator
*
@ -25,7 +27,7 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
abstract class PHPExcel_Worksheet_CellIterator
abstract class CellIterator
{
/**
* PHPExcel_Worksheet to iterate

View File

@ -1,5 +1,7 @@
<?php
namespace PHPExcel\Worksheet;
/**
* PHPExcel_Worksheet_Column
*
@ -25,7 +27,7 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
class PHPExcel_Worksheet_Column
class Column
{
/**
* PHPExcel_Worksheet

Some files were not shown because too many files have changed in this diff Show More