← All changes
|
vendor/phpoffice/phpexcel/Classes/PHPExcel/CalcEngine/CyclicReferenceStack.php
+70
-66
3.1.1
→
3.0.10
View file →
| @@ -1,10 +1,9 @@ | ||
| 1 | 1 | <?php |
| 2 | - | |
| 3 | 2 | /** |
| 4 | - * PHPExcel_CalcEngine_CyclicReferenceStack | |
| 3 | + * PHPExcel | |
| 5 | 4 | * |
| 6 | - * Copyright (c) 2006 - 2015 PHPExcel | |
| 5 | + * Copyright (c) 2006 - 2014 PHPExcel | |
| 7 | 6 | * |
| 8 | 7 | * This library is free software; you can redistribute it and/or |
| 9 | 8 | * modify it under the terms of the GNU Lesser General Public |
| 10 | 9 | * License as published by the Free Software Foundation; either |
| @@ -20,75 +19,80 @@ | ||
| 20 | 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 21 | 20 | * |
| 22 | 21 | * @category PHPExcel |
| 23 | 22 | * @package PHPExcel_Calculation |
| 24 | - * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) | |
| 25 | - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL | |
| 26 | - * @version ##VERSION##, ##DATE## | |
| 23 | + * @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel) | |
| 24 | + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL | |
| 25 | + * @version ##VERSION##, ##DATE## | |
| 27 | 26 | */ |
| 28 | -class PHPExcel_CalcEngine_CyclicReferenceStack | |
| 29 | -{ | |
| 30 | - /** | |
| 31 | - * The call stack for calculated cells | |
| 32 | - * | |
| 33 | - * @var mixed[] | |
| 34 | - */ | |
| 35 | - private $stack = array(); | |
| 36 | 27 | |
| 37 | - /** | |
| 38 | - * Return the number of entries on the stack | |
| 39 | - * | |
| 40 | - * @return integer | |
| 41 | - */ | |
| 42 | - public function count() | |
| 43 | - { | |
| 44 | - return count($this->stack); | |
| 45 | - } | |
| 46 | 28 | |
| 47 | - /** | |
| 48 | - * Push a new entry onto the stack | |
| 49 | - * | |
| 50 | - * @param mixed $value | |
| 51 | - */ | |
| 52 | - public function push($value) | |
| 53 | - { | |
| 54 | - $this->stack[$value] = $value; | |
| 55 | - } | |
| 29 | +/** | |
| 30 | + * PHPExcel_CalcEngine_CyclicReferenceStack | |
| 31 | + * | |
| 32 | + * @category PHPExcel_CalcEngine_CyclicReferenceStack | |
| 33 | + * @package PHPExcel_Calculation | |
| 34 | + * @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel) | |
| 35 | + */ | |
| 36 | +class PHPExcel_CalcEngine_CyclicReferenceStack { | |
| 56 | 37 | |
| 57 | - /** | |
| 58 | - * Pop the last entry from the stack | |
| 59 | - * | |
| 60 | - * @return mixed | |
| 61 | - */ | |
| 62 | - public function pop() | |
| 63 | - { | |
| 64 | - return array_pop($this->stack); | |
| 65 | - } | |
| 38 | + /** | |
| 39 | + * The call stack for calculated cells | |
| 40 | + * | |
| 41 | + * @var mixed[] | |
| 42 | + */ | |
| 43 | + private $_stack = array(); | |
| 66 | 44 | |
| 67 | - /** | |
| 68 | - * Test to see if a specified entry exists on the stack | |
| 69 | - * | |
| 70 | - * @param mixed $value The value to test | |
| 71 | - */ | |
| 72 | - public function onStack($value) | |
| 73 | - { | |
| 74 | - return isset($this->stack[$value]); | |
| 75 | - } | |
| 76 | 45 | |
| 77 | - /** | |
| 78 | - * Clear the stack | |
| 79 | - */ | |
| 80 | - public function clear() | |
| 81 | - { | |
| 82 | - $this->stack = array(); | |
| 83 | - } | |
| 46 | + /** | |
| 47 | + * Return the number of entries on the stack | |
| 48 | + * | |
| 49 | + * @return integer | |
| 50 | + */ | |
| 51 | + public function count() { | |
| 52 | + return count($this->_stack); | |
| 53 | + } | |
| 84 | 54 | |
| 85 | - /** | |
| 86 | - * Return an array of all entries on the stack | |
| 87 | - * | |
| 88 | - * @return mixed[] | |
| 89 | - */ | |
| 90 | - public function showStack() | |
| 91 | - { | |
| 92 | - return $this->stack; | |
| 93 | - } | |
| 55 | + /** | |
| 56 | + * Push a new entry onto the stack | |
| 57 | + * | |
| 58 | + * @param mixed $value | |
| 59 | + */ | |
| 60 | + public function push($value) { | |
| 61 | + $this->_stack[$value] = $value; | |
| 62 | + } | |
| 63 | + | |
| 64 | + /** | |
| 65 | + * Pop the last entry from the stack | |
| 66 | + * | |
| 67 | + * @return mixed | |
| 68 | + */ | |
| 69 | + public function pop() { | |
| 70 | + return array_pop($this->_stack); | |
| 71 | + } | |
| 72 | + | |
| 73 | + /** | |
| 74 | + * Test to see if a specified entry exists on the stack | |
| 75 | + * | |
| 76 | + * @param mixed $value The value to test | |
| 77 | + */ | |
| 78 | + public function onStack($value) { | |
| 79 | + return isset($this->_stack[$value]); | |
| 80 | + } | |
| 81 | + | |
| 82 | + /** | |
| 83 | + * Clear the stack | |
| 84 | + */ | |
| 85 | + public function clear() { | |
| 86 | + $this->_stack = array(); | |
| 87 | + } | |
| 88 | + | |
| 89 | + /** | |
| 90 | + * Return an array of all entries on the stack | |
| 91 | + * | |
| 92 | + * @return mixed[] | |
| 93 | + */ | |
| 94 | + public function showStack() { | |
| 95 | + return $this->_stack; | |
| 96 | + } | |
| 97 | + | |
| 94 | 98 | } |