Docblock comments

This commit is contained in:
Mark Baker 2013-04-27 16:02:07 +01:00
parent cfdd19e47c
commit 28f266bbba
6 changed files with 135 additions and 17 deletions

View File

@ -26,31 +26,71 @@
*/ */
/**
* PHPExcel_CalcEngine_CyclicReferenceStack
*
* @category PHPExcel_CalcEngine_CyclicReferenceStack
* @package PHPExcel_Calculation
* @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel)
*/
class PHPExcel_CalcEngine_CyclicReferenceStack { class PHPExcel_CalcEngine_CyclicReferenceStack {
/**
* The call stack for calculated cells
*
* @var mixed[]
*/
private $_stack = array(); private $_stack = array();
/**
* Return the number of entries on the stack
*
* @return integer
*/
public function count() { public function count() {
return count($this->_stack); return count($this->_stack);
} }
/**
* Push a new entry onto the stack
*
* @param mixed $value
*/
public function push($value) { public function push($value) {
$this->_stack[] = $value; $this->_stack[] = $value;
} // function push() } // function push()
/**
* Pop the last entry from the stack
*
* @return mixed
*/
public function pop() { public function pop() {
return array_pop($this->_stack); return array_pop($this->_stack);
} // function pop() } // function pop()
/**
* Test to see if a specified entry exists on the stack
*
* @param mixed $value The value to test
*/
public function onStack($value) { public function onStack($value) {
return in_array($value,$this->_stack); return in_array($value, $this->_stack);
} }
/**
* Clear the stack
*/
public function clear() { public function clear() {
$this->_stack = array(); $this->_stack = array();
} // function push() } // function push()
/**
* Return an array of all entries on the stack
*
* @return mixed[]
*/
public function showStack() { public function showStack() {
return $this->_stack; return $this->_stack;
} }

View File

@ -40,7 +40,6 @@ class PHPExcel_CalcEngine_Logger {
* If false, then a debug log will not be generated * If false, then a debug log will not be generated
* *
* @var boolean * @var boolean
*
*/ */
private $_writeDebugLog = FALSE; private $_writeDebugLog = FALSE;
@ -51,7 +50,6 @@ class PHPExcel_CalcEngine_Logger {
* A debug log can only be echoed if it is generated * A debug log can only be echoed if it is generated
* *
* @var boolean * @var boolean
*
*/ */
private $_echoDebugLog = FALSE; private $_echoDebugLog = FALSE;
@ -59,7 +57,6 @@ class PHPExcel_CalcEngine_Logger {
* The debug log generated by the calculation engine * The debug log generated by the calculation engine
* *
* @var string[] * @var string[]
*
*/ */
private $_debugLog = array(); private $_debugLog = array();
@ -67,31 +64,58 @@ class PHPExcel_CalcEngine_Logger {
* The calculation engine cell reference stack * The calculation engine cell reference stack
* *
* @var PHPExcel_CalcEngine_CyclicReferenceStack * @var PHPExcel_CalcEngine_CyclicReferenceStack
*
*/ */
private $_cellStack; private $_cellStack;
/**
* Instantiate a Calculation engine logger
*
* @param PHPExcel_CalcEngine_CyclicReferenceStack $stack
*/
public function __construct(PHPExcel_CalcEngine_CyclicReferenceStack $stack) { public function __construct(PHPExcel_CalcEngine_CyclicReferenceStack $stack) {
$this->_cellStack = $stack; $this->_cellStack = $stack;
} }
/**
* Enable/Disable Calculation engine logging
*
* @param boolean $pValue
*/
public function setWriteDebugLog($pValue = FALSE) { public function setWriteDebugLog($pValue = FALSE) {
$this->_writeDebugLog = $pValue; $this->_writeDebugLog = $pValue;
} }
/**
* Return whether calculation engine logging is enabled or disabled
*
* @return boolean
*/
public function getWriteDebugLog() { public function getWriteDebugLog() {
return $this->_writeDebugLog; return $this->_writeDebugLog;
} }
/**
* Enable/Disable echoing of debug log information
*
* @param boolean $pValue
*/
public function setEchoDebugLog($pValue = FALSE) { public function setEchoDebugLog($pValue = FALSE) {
$this->_echoDebugLog = $pValue; $this->_echoDebugLog = $pValue;
} }
/**
* Return whether echoing of debug log information is enabled or disabled
*
* @return boolean
*/
public function getEchoDebugLog() { public function getEchoDebugLog() {
return $this->_echoDebugLog; return $this->_echoDebugLog;
} }
/**
* Write an entry to the calculation engine debug log
*/
public function writeDebugLog() { public function writeDebugLog() {
// Only write the debug log if logging is enabled // Only write the debug log if logging is enabled
if ($this->_writeDebugLog) { if ($this->_writeDebugLog) {
@ -109,10 +133,18 @@ class PHPExcel_CalcEngine_Logger {
} }
} // function _writeDebug() } // function _writeDebug()
/**
* Clear the calculation engine debug log
*/
public function clearLog() { public function clearLog() {
$this->_debugLog = array(); $this->_debugLog = array();
} // function flushLogger() } // function flushLogger()
/**
* Return the calculation engine debug log
*
* @return string[]
*/
public function getLog() { public function getLog() {
return $this->_debugLog; return $this->_debugLog;
} // function flushLogger() } // function flushLogger()

View File

@ -26,18 +26,47 @@
*/ */
/**
* PHPExcel_Calculation_Token_Stack
*
* @category PHPExcel_Calculation_Token_Stack
* @package PHPExcel_Calculation
* @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel)
*/
class PHPExcel_Calculation_Token_Stack { class PHPExcel_Calculation_Token_Stack {
/**
* The parser stack for formulae
*
* @var mixed[]
*/
private $_stack = array(); private $_stack = array();
/**
* Count of entries in the parser stack
*
* @var integer
*/
private $_count = 0; private $_count = 0;
/**
* Return the number of entries on the stack
*
* @return integer
*/
public function count() { public function count() {
return $this->_count; return $this->_count;
} // function count() } // function count()
/**
public function push($type,$value,$reference=null) { * Push a new entry onto the stack
*
* @param mixed $type
* @param mixed $value
* @param mixed $reference
*/
public function push($type, $value, $reference = NULL) {
$this->_stack[$this->_count++] = array('type' => $type, $this->_stack[$this->_count++] = array('type' => $type,
'value' => $value, 'value' => $value,
'reference' => $reference 'reference' => $reference
@ -50,23 +79,34 @@ class PHPExcel_Calculation_Token_Stack {
} }
} // function push() } // function push()
/**
* Pop the last entry from the stack
*
* @return mixed
*/
public function pop() { public function pop() {
if ($this->_count > 0) { if ($this->_count > 0) {
return $this->_stack[--$this->_count]; return $this->_stack[--$this->_count];
} }
return null; return NULL;
} // function pop() } // function pop()
/**
public function last($n=1) { * Return an entry from the stack without removing it
if ($this->_count-$n < 0) { *
return null; * @param integer $n number indicating how far back in the stack we want to look
* @return mixed
*/
public function last($n = 1) {
if ($this->_count - $n < 0) {
return NULL;
} }
return $this->_stack[$this->_count-$n]; return $this->_stack[$this->_count - $n];
} // function last() } // function last()
/**
* Clear the stack
*/
function clear() { function clear() {
$this->_stack = array(); $this->_stack = array();
$this->_count = 0; $this->_count = 0;

View File

@ -268,6 +268,7 @@ class PHPExcel_Cell
* *
* @deprecated Since version 1.7.8 for planned changes to cell for array formula handling * @deprecated Since version 1.7.8 for planned changes to cell for array formula handling
* *
* @param boolean $resetLog Whether the calculation engine logger should be reset or not
* @return mixed * @return mixed
* @throws PHPExcel_Exception * @throws PHPExcel_Exception
*/ */
@ -858,7 +859,7 @@ class PHPExcel_Cell
* Compare 2 cells * Compare 2 cells
* *
* @param PHPExcel_Cell $a Cell a * @param PHPExcel_Cell $a Cell a
* @param PHPExcel_Cell $a Cell b * @param PHPExcel_Cell $b Cell b
* @return int Result of comparison (always -1 or 1, never zero!) * @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(PHPExcel_Cell $a, PHPExcel_Cell $b)

View File

@ -315,6 +315,11 @@ class PHPExcel_Comment implements PHPExcel_IComparable
} }
} }
/**
* Convert to string
*
* @return string
*/
public function __toString() { public function __toString() {
return $this->_text->getPlainText(); return $this->_text->getPlainText();
} }

View File

@ -45,7 +45,7 @@ class PHPExcel_RichText implements PHPExcel_IComparable
/** /**
* Create a new PHPExcel_RichText instance * Create a new PHPExcel_RichText instance
* *
* @param PHPExcel_Cell $pParent * @param PHPExcel_Cell $pCell
* @throws PHPExcel_Exception * @throws PHPExcel_Exception
*/ */
public function __construct(PHPExcel_Cell $pCell = null) public function __construct(PHPExcel_Cell $pCell = null)