set private properties to protected

This commit is contained in:
Mark Baker 2013-06-22 00:33:10 +01:00
parent 5b921af905
commit 4d5ad7b86e
23 changed files with 142 additions and 179 deletions

View File

@ -156,13 +156,13 @@ class Autoloader
public function loadClass($className)
{
if (null === $this->_namespace || $this->_namespace.$this->_namespaceSeparator === substr($className, 0, strlen($this->_namespace.$this->_namespaceSeparator))) {
$fileName = '';
$namespace = '';
if (false !== ($lastNsPos = strripos($className, $this->_namespaceSeparator))) {
$namespace = substr($className, 0, $lastNsPos);
$className = substr($className, $lastNsPos + 1);
$fileName = str_replace($this->_namespaceSeparator, DIRECTORY_SEPARATOR, $namespace) . DIRECTORY_SEPARATOR;
}
// $fileName = '';
// $namespace = '';
// if (false !== ($lastNsPos = strripos($className, $this->_namespaceSeparator))) {
// $namespace = substr($className, 0, $lastNsPos);
// $className = substr($className, $lastNsPos + 1);
// $fileName = str_replace($this->_namespaceSeparator, DIRECTORY_SEPARATOR, $namespace) . DIRECTORY_SEPARATOR;
// }
$fileName = str_replace(array('\\','_'), DIRECTORY_SEPARATOR, $className) . $this->_fileExtension;
require ($this->_includePath !== null ? $this->_includePath . DIRECTORY_SEPARATOR : '') . $fileName;
}

View File

@ -42,63 +42,63 @@ class Chart
*
* @var string
*/
private $_name = '';
protected $_name = '';
/**
* Worksheet
*
* @var PHPExcel\Worksheet
*/
private $_worksheet = null;
protected $_worksheet = null;
/**
* Chart Title
*
* @var PHPExcel\Chart_Title
*/
private $_title = null;
protected $_title = null;
/**
* Chart Legend
*
* @var PHPExcel\Chart_Legend
*/
private $_legend = null;
protected $_legend = null;
/**
* X-Axis Label
*
* @var PHPExcel\Chart_Title
*/
private $_xAxisLabel = null;
protected $_xAxisLabel = null;
/**
* Y-Axis Label
*
* @var PHPExcel\Chart_Title
*/
private $_yAxisLabel = null;
protected $_yAxisLabel = null;
/**
* Chart Plot Area
*
* @var PHPExcel\Chart_PlotArea
*/
private $_plotArea = null;
protected $_plotArea = null;
/**
* Plot Visible Only
*
* @var boolean
*/
private $_plotVisibleOnly = true;
protected $_plotVisibleOnly = true;
/**
* Display Blanks as
*
* @var string
*/
private $_displayBlanksAs = '0';
protected $_displayBlanksAs = '0';
/**
@ -106,7 +106,7 @@ class Chart
*
* @var string
*/
private $_topLeftCellRef = 'A1';
protected $_topLeftCellRef = 'A1';
/**
@ -114,7 +114,7 @@ class Chart
*
* @var integer
*/
private $_topLeftXOffset = 0;
protected $_topLeftXOffset = 0;
/**
@ -122,7 +122,7 @@ class Chart
*
* @var integer
*/
private $_topLeftYOffset = 0;
protected $_topLeftYOffset = 0;
/**
@ -130,7 +130,7 @@ class Chart
*
* @var string
*/
private $_bottomRightCellRef = 'A1';
protected $_bottomRightCellRef = 'A1';
/**
@ -138,7 +138,7 @@ class Chart
*
* @var integer
*/
private $_bottomRightXOffset = 10;
protected $_bottomRightXOffset = 10;
/**
@ -146,7 +146,7 @@ class Chart
*
* @var integer
*/
private $_bottomRightYOffset = 10;
protected $_bottomRightYOffset = 10;
/**

View File

@ -42,47 +42,41 @@ class DocumentSecurity
*
* @var boolean
*/
protected $_lockRevision;
protected $_lockRevision = false;
/**
* LockStructure
*
* @var boolean
*/
protected $_lockStructure;
protected $_lockStructure = false;
/**
* LockWindows
*
* @var boolean
*/
protected $_lockWindows;
protected $_lockWindows = false;
/**
* RevisionsPassword
*
* @var string
*/
protected $_revisionsPassword;
protected $_revisionsPassword = '';
/**
* WorkbookPassword
*
* @var string
*/
protected $_workbookPassword;
protected $_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

@ -67,7 +67,7 @@ class ReferenceHelper
/**
* Create a new PHPExcel\ReferenceHelper
*/
protected function __construct() {
private function __construct() {
}
/**

View File

@ -40,7 +40,7 @@ class RichText_Run extends RichText_TextElement implements RichText_ITextElement
*
* @var PHPExcel\Style_Font
*/
private $_font;
protected $_font;
/**
* Create a new PHPExcel\RichText_Run instance

View File

@ -40,7 +40,7 @@ class RichText_TextElement implements RichText_ITextElement
*
* @var string
*/
private $_text;
protected $_text;
/**
* Create a new PHPExcel\RichText_TextElement instance

View File

@ -62,35 +62,35 @@ class Style_Conditional implements IComparable
*
* @var int
*/
private $_conditionType;
protected $_conditionType = Style_Conditional::CONDITION_NONE;
/**
* Operator type
*
* @var int
*/
private $_operatorType;
protected $_operatorType = Style_Conditional::OPERATOR_NONE;
/**
* Text
*
* @var string
*/
private $_text;
protected $_text;
/**
* Condition
*
* @var string[]
*/
private $_condition = array();
protected $_condition = array();
/**
* Style
*
* @var PHPExcel\Style
*/
private $_style;
protected $_style;
/**
* Create a new PHPExcel\Style_Conditional
@ -98,10 +98,6 @@ class Style_Conditional implements IComparable
public function __construct()
{
// Initialise values
$this->_conditionType = Style_Conditional::CONDITION_NONE;
$this->_operatorType = Style_Conditional::OPERATOR_NONE;
$this->_text = null;
$this->_condition = array();
$this->_style = new Style(FALSE, TRUE);
}

View File

@ -251,7 +251,7 @@ class Style_NumberFormat extends Style_Supervisor implements IComparable
/**
* Fill built-in format codes
*/
private static function fillBuiltInFormatCodes()
protected static function fillBuiltInFormatCodes()
{
// Built-in format codes
if (is_null(self::$_builtInFormats)) {
@ -376,7 +376,7 @@ class Style_NumberFormat extends Style_Supervisor implements IComparable
*
* @var array
*/
private static $_dateFormatReplacements = array(
protected static $_dateFormatReplacements = array(
// first remove escapes related to non-format characters
'\\' => '',
// 12-hour suffix
@ -419,7 +419,7 @@ class Style_NumberFormat extends Style_Supervisor implements IComparable
*
* @var array
*/
private static $_dateFormatReplacements24 = array(
protected static $_dateFormatReplacements24 = array(
'hh' => 'H',
'h' => 'G'
);
@ -428,12 +428,12 @@ class Style_NumberFormat extends Style_Supervisor implements IComparable
*
* @var array
*/
private static $_dateFormatReplacements12 = array(
protected static $_dateFormatReplacements12 = array(
'hh' => 'h',
'h' => 'g'
);
private static function _formatAsDate(&$value, &$format)
protected static function _formatAsDate(&$value, &$format)
{
// dvc: convert Excel formats to PHP date formats
@ -456,7 +456,7 @@ class Style_NumberFormat extends Style_Supervisor implements IComparable
$value = $dateObj->format($format);
}
private static function _formatAsPercentage(&$value, &$format)
protected static function _formatAsPercentage(&$value, &$format)
{
if ($format === self::FORMAT_PERCENTAGE) {
$value = round( (100 * $value), 0) . '%';
@ -474,7 +474,7 @@ class Style_NumberFormat extends Style_Supervisor implements IComparable
}
}
private static function _formatAsFraction(&$value, &$format)
protected static function _formatAsFraction(&$value, &$format)
{
$sign = ($value < 0) ? '-' : '';
@ -499,7 +499,7 @@ class Style_NumberFormat extends Style_Supervisor implements IComparable
}
}
private static function _complexNumberFormatMask($number, $mask) {
protected static function _complexNumberFormatMask($number, $mask) {
if (strpos($mask,'.') !== false) {
$numbers = explode('.', $number . '.0');
$masks = explode('.', $mask . '.0');

View File

@ -42,7 +42,7 @@ class Worksheet_AutoFilter
*
* @var PHPExcel\Worksheet
*/
private $_workSheet = NULL;
protected $_workSheet = NULL;
/**
@ -50,7 +50,7 @@ class Worksheet_AutoFilter
*
* @var string
*/
private $_range = '';
protected $_range = '';
/**
@ -58,7 +58,7 @@ class Worksheet_AutoFilter
*
* @var array of PHPExcel\Worksheet_AutoFilter_Column
*/
private $_columns = array();
protected $_columns = array();
/**

View File

@ -42,28 +42,28 @@ class Worksheet_BaseDrawing implements IComparable
*
* @var int
*/
private static $_imageCounter = 0;
protected static $_imageCounter = 0;
/**
* Image index
*
* @var int
*/
private $_imageIndex = 0;
protected $_imageIndex = 0;
/**
* Name
*
* @var string
*/
protected $_name;
protected $_name = '';
/**
* Description
*
* @var string
*/
protected $_description;
protected $_description = '';
/**
* Worksheet
@ -77,49 +77,49 @@ class Worksheet_BaseDrawing implements IComparable
*
* @var string
*/
protected $_coordinates;
protected $_coordinates = 'A1';
/**
* Offset X
*
* @var int
*/
protected $_offsetX;
protected $_offsetX = 0;
/**
* Offset Y
*
* @var int
*/
protected $_offsetY;
protected $_offsetY = 0;
/**
* Width
*
* @var int
*/
protected $_width;
protected $_width = 0;
/**
* Height
*
* @var int
*/
protected $_height;
protected $_height = 0;
/**
* Proportional resize
*
* @var boolean
*/
protected $_resizeProportional;
protected $_resizeProportional = true;
/**
* Rotation
*
* @var int
*/
protected $_rotation;
protected $_rotation = 0;
/**
* Shadow
@ -134,16 +134,6 @@ class Worksheet_BaseDrawing implements IComparable
public function __construct()
{
// Initialise values
$this->_name = '';
$this->_description = '';
$this->_worksheet = null;
$this->_coordinates = 'A1';
$this->_offsetX = 0;
$this->_offsetY = 0;
$this->_width = 0;
$this->_height = 0;
$this->_resizeProportional = true;
$this->_rotation = 0;
$this->_shadow = new Worksheet_Drawing_Shadow();
// Set image index

View File

@ -44,28 +44,28 @@ class Worksheet_CellIterator implements \Iterator
*
* @var PHPExcel\Worksheet
*/
private $_subject;
protected $_subject;
/**
* Row index
*
* @var int
*/
private $_rowIndex;
protected $_rowIndex;
/**
* Current iterator position
*
* @var int
*/
private $_position = 0;
protected $_position = 0;
/**
* Loop only existing cells
*
* @var boolean
*/
private $_onlyExistingCells = true;
protected $_onlyExistingCells = true;
/**
* Create a new cell iterator

View File

@ -42,7 +42,7 @@ class Worksheet_ColumnDimension
*
* @var int
*/
private $_columnIndex;
protected $_columnIndex;
/**
* Column width
@ -51,42 +51,42 @@ class Worksheet_ColumnDimension
*
* @var double
*/
private $_width = -1;
protected $_width = -1;
/**
* Auto size?
*
* @var bool
*/
private $_autoSize = false;
protected $_autoSize = false;
/**
* Visible?
*
* @var bool
*/
private $_visible = true;
protected $_visible = true;
/**
* Outline level
*
* @var int
*/
private $_outlineLevel = 0;
protected $_outlineLevel = 0;
/**
* Collapsed
*
* @var bool
*/
private $_collapsed = false;
protected $_collapsed = false;
/**
* Index to cellXf
*
* @var int
*/
private $_xfIndex;
protected $_xfIndex = 0;
/**
* Create a new PHPExcel\Worksheet_ColumnDimension
@ -97,9 +97,6 @@ class Worksheet_ColumnDimension
{
// Initialise values
$this->_columnIndex = $pIndex;
// set default index to cellXf
$this->_xfIndex = 0;
}
/**

View File

@ -42,16 +42,13 @@ class Worksheet_Drawing extends Worksheet_BaseDrawing implements IComparable
*
* @var string
*/
private $_path;
protected $_path = '';
/**
* Create a new PHPExcel\Worksheet_Drawing
*/
public function __construct()
{
// Initialise values
$this->_path = '';
// Initialize parent
parent::__construct();
}

View File

@ -110,77 +110,77 @@ class Worksheet_HeaderFooter
*
* @var string
*/
private $_oddHeader = '';
protected $_oddHeader = '';
/**
* OddFooter
*
* @var string
*/
private $_oddFooter = '';
protected $_oddFooter = '';
/**
* EvenHeader
*
* @var string
*/
private $_evenHeader = '';
protected $_evenHeader = '';
/**
* EvenFooter
*
* @var string
*/
private $_evenFooter = '';
protected $_evenFooter = '';
/**
* FirstHeader
*
* @var string
*/
private $_firstHeader = '';
protected $_firstHeader = '';
/**
* FirstFooter
*
* @var string
*/
private $_firstFooter = '';
protected $_firstFooter = '';
/**
* Different header for Odd/Even, defaults to false
*
* @var boolean
*/
private $_differentOddEven = false;
protected $_differentOddEven = false;
/**
* Different header for first page, defaults to false
*
* @var boolean
*/
private $_differentFirst = false;
protected $_differentFirst = false;
/**
* Scale with document, defaults to true
*
* @var boolean
*/
private $_scaleWithDocument = true;
protected $_scaleWithDocument = true;
/**
* Align with margins, defaults to true
*
* @var boolean
*/
private $_alignWithMargins = true;
protected $_alignWithMargins = true;
/**
* Header/footer images
*
* @var PHPExcel\Worksheet_HeaderFooterDrawing[]
*/
private $_headerFooterImages = array();
protected $_headerFooterImages = array();
/**
* Create a new PHPExcel\Worksheet_HeaderFooter

View File

@ -42,63 +42,55 @@ class Worksheet_HeaderFooterDrawing extends Worksheet_Drawing implements ICompar
*
* @var string
*/
private $_path;
protected $_path = '';
/**
* Name
*
* @var string
*/
protected $_name;
protected $_name = '';
/**
* Offset X
*
* @var int
*/
protected $_offsetX;
protected $_offsetX = 0;
/**
* Offset Y
*
* @var int
*/
protected $_offsetY;
protected $_offsetY = 0;
/**
* Width
*
* @var int
*/
protected $_width;
protected $_width = 0;
/**
* Height
*
* @var int
*/
protected $_height;
protected $_height = 0;
/**
* Proportional resize
*
* @var boolean
*/
protected $_resizeProportional;
protected $_resizeProportional = true;
/**
* Create a new PHPExcel\Worksheet_HeaderFooterDrawing
*/
public function __construct()
{
// Initialise values
$this->_path = '';
$this->_name = '';
$this->_offsetX = 0;
$this->_offsetY = 0;
$this->_width = 0;
$this->_height = 0;
$this->_resizeProportional = true;
}
/**

View File

@ -54,28 +54,28 @@ class Worksheet_MemoryDrawing extends Worksheet_BaseDrawing implements IComparab
*
* @var resource
*/
private $_imageResource;
protected $_imageResource;
/**
* Rendering function
*
* @var string
*/
private $_renderingFunction;
protected $_renderingFunction = self::RENDERING_DEFAULT;
/**
* Mime type
*
* @var string
*/
private $_mimeType;
protected $_mimeType = self::MIMETYPE_DEFAULT;
/**
* Unique name
*
* @var string
*/
private $_uniqueName;
protected $_uniqueName;
/**
* Create a new PHPExcel\Worksheet_MemoryDrawing
@ -83,9 +83,6 @@ class Worksheet_MemoryDrawing extends Worksheet_BaseDrawing implements IComparab
public function __construct()
{
// Initialise values
$this->_imageResource = null;
$this->_renderingFunction = self::RENDERING_DEFAULT;
$this->_mimeType = self::MIMETYPE_DEFAULT;
$this->_uniqueName = md5(rand(0, 9999). time() . rand(0, 9999));
// Initialize parent

View File

@ -42,42 +42,42 @@ class Worksheet_PageMargins
*
* @var double
*/
private $_left = 0.7;
protected $_left = 0.7;
/**
* Right
*
* @var double
*/
private $_right = 0.7;
protected $_right = 0.7;
/**
* Top
*
* @var double
*/
private $_top = 0.75;
protected $_top = 0.75;
/**
* Bottom
*
* @var double
*/
private $_bottom = 0.75;
protected $_bottom = 0.75;
/**
* Header
*
* @var double
*/
private $_header = 0.3;
protected $_header = 0.3;
/**
* Footer
*
* @var double
*/
private $_footer = 0.3;
protected $_footer = 0.3;
/**
* Create a new PHPExcel\Worksheet_PageMargins

View File

@ -191,14 +191,14 @@ class Worksheet_PageSetup
*
* @var int
*/
private $_paperSize = Worksheet_PageSetup::PAPERSIZE_LETTER;
protected $_paperSize = Worksheet_PageSetup::PAPERSIZE_LETTER;
/**
* Orientation
*
* @var string
*/
private $_orientation = Worksheet_PageSetup::ORIENTATION_DEFAULT;
protected $_orientation = Worksheet_PageSetup::ORIENTATION_DEFAULT;
/**
* Scale (Print Scale)
@ -208,7 +208,7 @@ class Worksheet_PageSetup
*
* @var int?
*/
private $_scale = 100;
protected $_scale = 100;
/**
* Fit To Page
@ -216,7 +216,7 @@ class Worksheet_PageSetup
*
* @var boolean
*/
private $_fitToPage = FALSE;
protected $_fitToPage = FALSE;
/**
* Fit To Height
@ -224,7 +224,7 @@ class Worksheet_PageSetup
*
* @var int?
*/
private $_fitToHeight = 1;
protected $_fitToHeight = 1;
/**
* Fit To Width
@ -232,49 +232,49 @@ class Worksheet_PageSetup
*
* @var int?
*/
private $_fitToWidth = 1;
protected $_fitToWidth = 1;
/**
* Columns to repeat at left
*
* @var array Containing start column and end column, empty array if option unset
*/
private $_columnsToRepeatAtLeft = array('', '');
protected $_columnsToRepeatAtLeft = array('', '');
/**
* Rows to repeat at top
*
* @var array Containing start row number and end row number, empty array if option unset
*/
private $_rowsToRepeatAtTop = array(0, 0);
protected $_rowsToRepeatAtTop = array(0, 0);
/**
* Center page horizontally
*
* @var boolean
*/
private $_horizontalCentered = FALSE;
protected $_horizontalCentered = FALSE;
/**
* Center page vertically
*
* @var boolean
*/
private $_verticalCentered = FALSE;
protected $_verticalCentered = FALSE;
/**
* Print area
*
* @var string
*/
private $_printArea = NULL;
protected $_printArea = NULL;
/**
* First page number
*
* @var int
*/
private $_firstPageNumber = NULL;
protected $_firstPageNumber = NULL;
/**
* Create a new PHPExcel\Worksheet_PageSetup

View File

@ -42,119 +42,119 @@ class Worksheet_Protection
*
* @var boolean
*/
private $_sheet = false;
protected $_sheet = false;
/**
* Objects
*
* @var boolean
*/
private $_objects = false;
protected $_objects = false;
/**
* Scenarios
*
* @var boolean
*/
private $_scenarios = false;
protected $_scenarios = false;
/**
* Format cells
*
* @var boolean
*/
private $_formatCells = false;
protected $_formatCells = false;
/**
* Format columns
*
* @var boolean
*/
private $_formatColumns = false;
protected $_formatColumns = false;
/**
* Format rows
*
* @var boolean
*/
private $_formatRows = false;
protected $_formatRows = false;
/**
* Insert columns
*
* @var boolean
*/
private $_insertColumns = false;
protected $_insertColumns = false;
/**
* Insert rows
*
* @var boolean
*/
private $_insertRows = false;
protected $_insertRows = false;
/**
* Insert hyperlinks
*
* @var boolean
*/
private $_insertHyperlinks = false;
protected $_insertHyperlinks = false;
/**
* Delete columns
*
* @var boolean
*/
private $_deleteColumns = false;
protected $_deleteColumns = false;
/**
* Delete rows
*
* @var boolean
*/
private $_deleteRows = false;
protected $_deleteRows = false;
/**
* Select locked cells
*
* @var boolean
*/
private $_selectLockedCells = false;
protected $_selectLockedCells = false;
/**
* Sort
*
* @var boolean
*/
private $_sort = false;
protected $_sort = false;
/**
* AutoFilter
*
* @var boolean
*/
private $_autoFilter = false;
protected $_autoFilter = false;
/**
* Pivot tables
*
* @var boolean
*/
private $_pivotTables = false;
protected $_pivotTables = false;
/**
* Select unlocked cells
*
* @var boolean
*/
private $_selectUnlockedCells = false;
protected $_selectUnlockedCells = false;
/**
* Password
*
* @var string
*/
private $_password = '';
protected $_password = '';
/**
* Create a new PHPExcel\Worksheet_Protection

View File

@ -44,14 +44,14 @@ class Worksheet_Row
*
* @var PHPExcel\Worksheet
*/
private $_parent;
protected $_parent;
/**
* Row index
*
* @var int
*/
private $_rowIndex = 0;
protected $_rowIndex = 0;
/**
* Create a new row

View File

@ -42,7 +42,7 @@ class Worksheet_RowDimension
*
* @var int
*/
private $_rowIndex;
protected $_rowIndex;
/**
* Row height (in pt)
@ -51,42 +51,42 @@ class Worksheet_RowDimension
*
* @var double
*/
private $_rowHeight = -1;
protected $_rowHeight = -1;
/**
* ZeroHeight for Row?
*
* @var bool
*/
private $_zeroHeight = false;
protected $_zeroHeight = false;
/**
* Visible?
*
* @var bool
*/
private $_visible = true;
protected $_visible = true;
/**
* Outline level
*
* @var int
*/
private $_outlineLevel = 0;
protected $_outlineLevel = 0;
/**
* Collapsed
*
* @var bool
*/
private $_collapsed = false;
protected $_collapsed = false;
/**
* Index to cellXf. Null value means row has no explicit cellXf format.
*
* @var int|null
*/
private $_xfIndex;
protected $_xfIndex;
/**
* Create a new PHPExcel\Worksheet_RowDimension

View File

@ -44,21 +44,21 @@ class Worksheet_RowIterator implements \Iterator
*
* @var PHPExcel\Worksheet
*/
private $_subject;
protected $_subject;
/**
* Current iterator position
*
* @var int
*/
private $_position = 1;
protected $_position = 1;
/**
* Start position
*
* @var int
*/
private $_startRow = 1;
protected $_startRow = 1;
/**

View File

@ -43,7 +43,7 @@ class Worksheet_SheetView
const SHEETVIEW_PAGE_LAYOUT = 'pageLayout';
const SHEETVIEW_PAGE_BREAK_PREVIEW = 'pageBreakPreview';
private static $_sheetViewTypes = array(
protected static $_sheetViewTypes = array(
self::SHEETVIEW_NORMAL,
self::SHEETVIEW_PAGE_LAYOUT,
self::SHEETVIEW_PAGE_BREAK_PREVIEW,
@ -56,7 +56,7 @@ class Worksheet_SheetView
*
* @var int
*/
private $_zoomScale = 100;
protected $_zoomScale = 100;
/**
* ZoomScaleNormal
@ -65,7 +65,7 @@ class Worksheet_SheetView
*
* @var int
*/
private $_zoomScaleNormal = 100;
protected $_zoomScaleNormal = 100;
/**
* View
@ -74,7 +74,7 @@ class Worksheet_SheetView
*
* @var string
*/
private $_sheetviewType = self::SHEETVIEW_NORMAL;
protected $_sheetviewType = self::SHEETVIEW_NORMAL;
/**
* Create a new PHPExcel\Worksheet_SheetView