Working toward PSR-2 standards

This commit is contained in:
Mark Baker 2013-06-23 23:44:16 +01:00
parent 1549cc42ca
commit ee8062fece
23 changed files with 64 additions and 64 deletions

View File

@ -44,7 +44,7 @@
namespace PHPExcel;
/**
* PHPExcel\Autoloader
*
@ -58,11 +58,11 @@ class Autoloader
private $namespace;
private $includePath;
private $namespaceSeparator = '\\';
/**
* Creates a new SplClassLoader that loads classes of the
* specified namespace.
*
*
* @param string $namespace The namespace to use.
* @param string $includePath The directory path for that namespace.
*/
@ -71,17 +71,17 @@ class Autoloader
$this->namespace = $namespace;
$this->includePath = $includePath;
}
/**
* Sets the namespace separator used by classes in the namespace of this class loader.
*
*
* @param string $sep The separator to use.
*/
public function setNamespaceSeparator($sep)
{
$this->namespaceSeparator = $sep;
}
/**
* Gets the namespace seperator used by classes in the namespace of this class loader.
*
@ -91,17 +91,17 @@ class Autoloader
{
return $this->namespaceSeparator;
}
/**
* Sets the base include path for all class files in the namespace of this class loader.
*
*
* @param string $includePath
*/
public function setIncludePath($includePath)
{
$this->includePath = $includePath;
}
/**
* Gets the base include path for all class files in the namespace of this class loader.
*
@ -111,17 +111,17 @@ class Autoloader
{
return $this->includePath;
}
/**
* Sets the file extension of class files in the namespace of this class loader.
*
*
* @param string $fileExtension
*/
public function setFileExtension($fileExtension)
{
$this->fileExtension = $fileExtension;
}
/**
* Gets the file extension of class files in the namespace of this class loader.
*
@ -131,7 +131,7 @@ class Autoloader
{
return $this->fileExtension;
}
/**
* Installs this class loader on the SPL autoload stack.
*/
@ -139,7 +139,7 @@ class Autoloader
{
spl_autoload_register(array($this, 'loadClass'));
}
/**
* Uninstalls this class loader from the SPL autoloader stack.
*/
@ -147,7 +147,7 @@ class Autoloader
{
spl_autoload_unregister(array($this, 'loadClass'));
}
/**
* Loads the given class or interface.
*

View File

@ -26,7 +26,7 @@
*/
namespace PHPExcel;
/** PHPOffice root directory */
if (!defined('PHPEXCEL_ROOT')) {
define('PHPEXCEL_ROOT', dirname(__FILE__));

View File

@ -27,7 +27,7 @@
namespace PHPExcel;
/**
* PHPExcel\CachedObjectStorage_APC
*

View File

@ -27,7 +27,7 @@
namespace PHPExcel;
/**
* PHPExcel\CachedObjectStorage_ICache
*

View File

@ -28,7 +28,7 @@
namespace PHPExcel;
/**
* PHPExcel\CachedObjectStorageFactory
*

View File

@ -27,7 +27,7 @@
namespace PHPExcel;
/**
* PHPExcel\CalcEngine_CyclicReferenceStack
*

View File

@ -26,7 +26,7 @@
*/
namespace PHPExcel;
/**
* PHPExcel\CalcEngine_Logger
*
@ -69,7 +69,7 @@ class CalcEngine_Logger {
*/
private $_cellStack;
/**
* Instantiate a Calculation engine logger
*
@ -124,13 +124,13 @@ class CalcEngine_Logger {
$message = implode(func_get_args());
$cellReference = implode(' -> ', $this->_cellStack->showStack());
if ($this->_echoDebugLog) {
echo $cellReference,
($this->_cellStack->count() > 0 ? ' => ' : ''),
$message,
echo $cellReference,
($this->_cellStack->count() > 0 ? ' => ' : ''),
$message,
PHP_EOL;
}
$this->_debugLog[] = $cellReference .
($this->_cellStack->count() > 0 ? ' => ' : '') .
$this->_debugLog[] = $cellReference .
($this->_cellStack->count() > 0 ? ' => ' : '') .
$message;
}
}

View File

@ -1309,10 +1309,10 @@ class Calculation_Financial {
/**
* IRR
*
* Returns the internal rate of return for a series of cash flows represented by the numbers in values.
* These cash flows do not have to be even, as they would be for an annuity. However, the cash flows must occur
* Returns the internal rate of return for a series of cash flows represented by the numbers in values.
* These cash flows do not have to be even, as they would be for an annuity. However, the cash flows must occur
* at regular intervals, such as monthly or annually. The internal rate of return is the interest rate received
* for an investment consisting of payments (negative values) and income (positive values) that occur at regular
* for an investment consisting of payments (negative values) and income (positive values) that occur at regular
* periods.
*
* Excel Function:
@ -1320,7 +1320,7 @@ class Calculation_Financial {
*
* @param float[] $values An array or a reference to cells that contain numbers for which you want
* to calculate the internal rate of return.
* Values must contain at least one positive value and one negative value to
* Values must contain at least one positive value and one negative value to
* calculate the internal rate of return.
* @param float $guess A number that you guess is close to the result of IRR
* @return float
@ -1358,9 +1358,9 @@ class Calculation_Financial {
$dx *= 0.5;
$x_mid = $rtb + $dx;
$f_mid = self::NPV($x_mid, $values);
if ($f_mid <= 0.0)
if ($f_mid <= 0.0)
$rtb = $x_mid;
if ((abs($f_mid) < FINANCIAL_PRECISION) || (abs($dx) < FINANCIAL_PRECISION))
if ((abs($f_mid) < FINANCIAL_PRECISION) || (abs($dx) < FINANCIAL_PRECISION))
return $x_mid;
}
return Calculation_Functions::VALUE();
@ -1411,7 +1411,7 @@ class Calculation_Financial {
/**
* MIRR
*
* Returns the modified internal rate of return for a series of periodic cash flows. MIRR considers both
* Returns the modified internal rate of return for a series of periodic cash flows. MIRR considers both
* the cost of the investment and the interest received on reinvestment of cash.
*
* Excel Function:

View File

@ -27,7 +27,7 @@
namespace PHPExcel;
/**
* PHPExcel\Calculation_Function
*

View File

@ -482,7 +482,7 @@ class Calculation_TextData {
* @param string $oldText String to modify
* @param int $start Start character
* @param int $chars Number of characters
* @param string $newText String to replace in defined position
* @param string $newText String to replace in defined position
* @return string
*/
public static function REPLACE($oldText = '', $start = 1, $chars = null, $newText) {

View File

@ -27,7 +27,7 @@
namespace PHPExcel;
/**
* PHPExcel\Cell
*

View File

@ -25,7 +25,7 @@
namespace PHPExcel;
/**
* PHPExcel\IComparable
*

View File

@ -88,7 +88,7 @@ class Reader_Excel2003XML extends Reader_Abstract implements Reader_IReader
// Open file
$this->_openFile($pFilename);
$fileHandle = $this->_fileHandle;
// Read sample data (first 2 KB will do)
$data = fread($fileHandle, 2048);
fclose($fileHandle);

View File

@ -25,7 +25,7 @@
* @version ##VERSION##, ##DATE##
*/
namespace PHPExcel;
defined('IDENTIFIER_OLE') ||

View File

@ -27,7 +27,7 @@
namespace PHPExcel;
/**
* PHPExcel\Shared_String
*

View File

@ -27,7 +27,7 @@
namespace PHPExcel;
if (!defined('DATE_W3C')) {
define('DATE_W3C', 'Y-m-d\TH:i:sP');
}

View File

@ -27,7 +27,7 @@
namespace PHPExcel;
if (!defined('PCLZIP_TEMPORARY_DIR')) {
define('PCLZIP_TEMPORARY_DIR', Shared_File::sys_get_temp_dir());
}

View File

@ -26,7 +26,7 @@
*/
namespace PHPExcel;
/**
* PHPExcel
*

View File

@ -27,7 +27,7 @@
namespace PHPExcel;
/**
* PHPExcel\Worksheet
*
@ -1165,8 +1165,8 @@ class Worksheet implements IComparable
$cell = $this->_cellCollection->addCacheData(
$pCoordinate,
new Cell(
null,
Cell_DataType::TYPE_NULL,
null,
Cell_DataType::TYPE_NULL,
$this
)
);
@ -1193,7 +1193,7 @@ class Worksheet implements IComparable
return $cell;
}
/**
* Does the cell at a specific coordinate exist?
*

View File

@ -130,7 +130,7 @@ class Writer_Excel2007_Theme extends Writer_Excel2007_WriterPart
'hlink' => '0000FF',
'folHlink' => '800080',
);
/**
* Write theme to XML format
*
@ -868,6 +868,6 @@ class Writer_Excel2007_Theme extends Writer_Excel2007_WriterPart
$objWriter->endElement();
}
}
}

View File

@ -60,7 +60,7 @@ class Writer_Excel5_Escher
* @var array
*/
private $_spTypes;
/**
* Constructor
*
@ -317,7 +317,7 @@ class Writer_Excel5_Escher
// get the shape offsets relative to the spgrContainer record
$spOffsets = $writer->getSpOffsets();
$spTypes = $writer->getSpTypes();
// save the shape offsets relative to dgContainer
foreach ($spOffsets as & $spOffset) {
$spOffset += 24; // add length of dgContainer header data (8 bytes) plus dg data (16 bytes)
@ -361,7 +361,7 @@ class Writer_Excel5_Escher
// save the shape offsets (where new shape records begin)
$totalSize += strlen($spData);
$spOffsets[] = $totalSize;
$spTypes = array_merge($spTypes, $writer->getSpTypes());
}
@ -469,7 +469,7 @@ class Writer_Excel5_Escher
$clientAnchorData = pack('vvvvvvvvv', $this->_object->getSpFlag(),
$c1, $startOffsetX, $r1, $startOffsetY,
$c2, $endOffsetX, $r2, $endOffsetY);
$length = strlen($clientAnchorData);
$recVerInstance = $recVer;
@ -534,6 +534,6 @@ class Writer_Excel5_Escher
{
return $this->_spTypes;
}
}

View File

@ -966,9 +966,9 @@ class Writer_HTML extends Writer_Abstract implements Writer_IWriter {
private function _createCSSStyleBorder(Style_Border $pStyle) {
// Create CSS
// $css = $this->_mapBorderStyle($pStyle->getBorderStyle()) . ' #' . $pStyle->getColor()->getRGB();
// Create CSS - add !important to non-none border styles for merged cells
$borderStyle = $this->_mapBorderStyle($pStyle->getBorderStyle());
$css = $borderStyle . ' #' . $pStyle->getColor()->getRGB() . (($borderStyle == 'none') ? '' : ' !important');
// Create CSS - add !important to non-none border styles for merged cells
$borderStyle = $this->_mapBorderStyle($pStyle->getBorderStyle());
$css = $borderStyle . ' #' . $pStyle->getColor()->getRGB() . (($borderStyle == 'none') ? '' : ' !important');
// Return
return $css;
@ -1019,7 +1019,7 @@ class Writer_HTML extends Writer_Abstract implements Writer_IWriter {
// Construct HTML
$html = '';
$html .= $this->_setMargins($pSheet);
if (!$this->_useInlineCss) {
$gridlines = $pSheet->getShowGridLines() ? ' gridlines' : '';
$html .= ' <table border="0" cellpadding="0" cellspacing="0" id="sheet' . $sheetIndex . '" class="sheet' . $sheetIndex . $gridlines . '">' . PHP_EOL;

View File

@ -43,7 +43,7 @@ class Writer_PDF
*
* @var PHPExcel\Writer_PDF_Core
*/
private $_renderer = null;
private $renderer = null;
/**
* Instantiate a new renderer of the configured type within this container class
@ -69,7 +69,7 @@ class Writer_PDF
}
$rendererName = __NAMESPACE__ . '\Writer_PDF_' . $pdfLibraryName;
$this->_renderer = new $rendererName($phpExcel);
$this->renderer = new $rendererName($phpExcel);
}
@ -82,10 +82,10 @@ class Writer_PDF
*/
public function __call($name, $arguments)
{
if ($this->_renderer === null) {
if ($this->renderer === null) {
throw new Writer_Exception("PDF Rendering library has not been defined.");
}
return call_user_func_array(array($this->_renderer, $name), $arguments);
return call_user_func_array(array($this->renderer, $name), $arguments);
}
}