Skip to content

Commit b3d2db7

Browse files
author
MarkBaker
committed
Minor case-sensitivity bugfix to getCell when cell reference is a worksheet!cell
Work on PSR2 Coding standards
1 parent e83c359 commit b3d2db7

File tree

13 files changed

+3267
-3271
lines changed

13 files changed

+3267
-3271
lines changed

Classes/PHPExcel/Style.php

Lines changed: 69 additions & 92 deletions
Large diffs are not rendered by default.

Classes/PHPExcel/Style/Alignment.php

Lines changed: 438 additions & 433 deletions
Large diffs are not rendered by default.

Classes/PHPExcel/Style/Border.php

Lines changed: 240 additions & 252 deletions
Large diffs are not rendered by default.

Classes/PHPExcel/Style/Borders.php

Lines changed: 291 additions & 286 deletions
Large diffs are not rendered by default.

Classes/PHPExcel/Style/Color.php

Lines changed: 389 additions & 375 deletions
Large diffs are not rendered by default.

Classes/PHPExcel/Style/Conditional.php

Lines changed: 144 additions & 128 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
* @category PHPExcel
2222
* @package PHPExcel_Style
2323
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
24-
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
24+
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
2525
* @version ##VERSION##, ##DATE##
2626
*/
2727

@@ -35,121 +35,126 @@
3535
*/
3636
class PHPExcel_Style_Conditional implements PHPExcel_IComparable
3737
{
38-
/* Condition types */
39-
const CONDITION_NONE = 'none';
40-
const CONDITION_CELLIS = 'cellIs';
41-
const CONDITION_CONTAINSTEXT = 'containsText';
42-
const CONDITION_EXPRESSION = 'expression';
38+
/* Condition types */
39+
const CONDITION_NONE = 'none';
40+
const CONDITION_CELLIS = 'cellIs';
41+
const CONDITION_CONTAINSTEXT = 'containsText';
42+
const CONDITION_EXPRESSION = 'expression';
4343

44-
/* Operator types */
45-
const OPERATOR_NONE = '';
46-
const OPERATOR_BEGINSWITH = 'beginsWith';
47-
const OPERATOR_ENDSWITH = 'endsWith';
48-
const OPERATOR_EQUAL = 'equal';
49-
const OPERATOR_GREATERTHAN = 'greaterThan';
50-
const OPERATOR_GREATERTHANOREQUAL = 'greaterThanOrEqual';
51-
const OPERATOR_LESSTHAN = 'lessThan';
52-
const OPERATOR_LESSTHANOREQUAL = 'lessThanOrEqual';
53-
const OPERATOR_NOTEQUAL = 'notEqual';
54-
const OPERATOR_CONTAINSTEXT = 'containsText';
55-
const OPERATOR_NOTCONTAINS = 'notContains';
56-
const OPERATOR_BETWEEN = 'between';
44+
/* Operator types */
45+
const OPERATOR_NONE = '';
46+
const OPERATOR_BEGINSWITH = 'beginsWith';
47+
const OPERATOR_ENDSWITH = 'endsWith';
48+
const OPERATOR_EQUAL = 'equal';
49+
const OPERATOR_GREATERTHAN = 'greaterThan';
50+
const OPERATOR_GREATERTHANOREQUAL = 'greaterThanOrEqual';
51+
const OPERATOR_LESSTHAN = 'lessThan';
52+
const OPERATOR_LESSTHANOREQUAL = 'lessThanOrEqual';
53+
const OPERATOR_NOTEQUAL = 'notEqual';
54+
const OPERATOR_CONTAINSTEXT = 'containsText';
55+
const OPERATOR_NOTCONTAINS = 'notContains';
56+
const OPERATOR_BETWEEN = 'between';
5757

58-
/**
59-
* Condition type
60-
*
61-
* @var int
62-
*/
63-
private $_conditionType;
58+
/**
59+
* Condition type
60+
*
61+
* @var int
62+
*/
63+
private $conditionType;
6464

65-
/**
66-
* Operator type
67-
*
68-
* @var int
69-
*/
70-
private $_operatorType;
65+
/**
66+
* Operator type
67+
*
68+
* @var int
69+
*/
70+
private $operatorType;
7171

72-
/**
73-
* Text
74-
*
75-
* @var string
76-
*/
77-
private $_text;
72+
/**
73+
* Text
74+
*
75+
* @var string
76+
*/
77+
private $text;
7878

79-
/**
80-
* Condition
81-
*
82-
* @var string[]
83-
*/
84-
private $_condition = array();
79+
/**
80+
* Condition
81+
*
82+
* @var string[]
83+
*/
84+
private $condition = array();
8585

86-
/**
87-
* Style
88-
*
89-
* @var PHPExcel_Style
90-
*/
91-
private $_style;
86+
/**
87+
* Style
88+
*
89+
* @var PHPExcel_Style
90+
*/
91+
private $style;
9292

9393
/**
9494
* Create a new PHPExcel_Style_Conditional
9595
*/
9696
public function __construct()
9797
{
98-
// Initialise values
99-
$this->_conditionType = PHPExcel_Style_Conditional::CONDITION_NONE;
100-
$this->_operatorType = PHPExcel_Style_Conditional::OPERATOR_NONE;
101-
$this->_text = null;
102-
$this->_condition = array();
103-
$this->_style = new PHPExcel_Style(FALSE, TRUE);
98+
// Initialise values
99+
$this->conditionType = PHPExcel_Style_Conditional::CONDITION_NONE;
100+
$this->operatorType = PHPExcel_Style_Conditional::OPERATOR_NONE;
101+
$this->text = null;
102+
$this->condition = array();
103+
$this->style = new PHPExcel_Style(false, true);
104104
}
105105

106106
/**
107107
* Get Condition type
108108
*
109109
* @return string
110110
*/
111-
public function getConditionType() {
112-
return $this->_conditionType;
111+
public function getConditionType()
112+
{
113+
return $this->conditionType;
113114
}
114115

115116
/**
116117
* Set Condition type
117118
*
118-
* @param string $pValue PHPExcel_Style_Conditional condition type
119+
* @param string $pValue PHPExcel_Style_Conditional condition type
119120
* @return PHPExcel_Style_Conditional
120121
*/
121-
public function setConditionType($pValue = PHPExcel_Style_Conditional::CONDITION_NONE) {
122-
$this->_conditionType = $pValue;
123-
return $this;
122+
public function setConditionType($pValue = PHPExcel_Style_Conditional::CONDITION_NONE)
123+
{
124+
$this->conditionType = $pValue;
125+
return $this;
124126
}
125127

126128
/**
127129
* Get Operator type
128130
*
129131
* @return string
130132
*/
131-
public function getOperatorType() {
132-
return $this->_operatorType;
133+
public function getOperatorType()
134+
{
135+
return $this->operatorType;
133136
}
134137

135138
/**
136139
* Set Operator type
137140
*
138-
* @param string $pValue PHPExcel_Style_Conditional operator type
141+
* @param string $pValue PHPExcel_Style_Conditional operator type
139142
* @return PHPExcel_Style_Conditional
140143
*/
141-
public function setOperatorType($pValue = PHPExcel_Style_Conditional::OPERATOR_NONE) {
142-
$this->_operatorType = $pValue;
143-
return $this;
144+
public function setOperatorType($pValue = PHPExcel_Style_Conditional::OPERATOR_NONE)
145+
{
146+
$this->operatorType = $pValue;
147+
return $this;
144148
}
145149

146150
/**
147151
* Get text
148152
*
149153
* @return string
150154
*/
151-
public function getText() {
152-
return $this->_text;
155+
public function getText()
156+
{
157+
return $this->text;
153158
}
154159

155160
/**
@@ -158,9 +163,10 @@ public function getText() {
158163
* @param string $value
159164
* @return PHPExcel_Style_Conditional
160165
*/
161-
public function setText($value = null) {
162-
$this->_text = $value;
163-
return $this;
166+
public function setText($value = null)
167+
{
168+
$this->text = $value;
169+
return $this;
164170
}
165171

166172
/**
@@ -169,109 +175,119 @@ public function setText($value = null) {
169175
* @deprecated Deprecated, use getConditions instead
170176
* @return string
171177
*/
172-
public function getCondition() {
173-
if (isset($this->_condition[0])) {
174-
return $this->_condition[0];
175-
}
178+
public function getCondition()
179+
{
180+
if (isset($this->condition[0])) {
181+
return $this->condition[0];
182+
}
176183

177-
return '';
184+
return '';
178185
}
179186

180187
/**
181188
* Set Condition
182189
*
183190
* @deprecated Deprecated, use setConditions instead
184-
* @param string $pValue Condition
191+
* @param string $pValue Condition
185192
* @return PHPExcel_Style_Conditional
186193
*/
187-
public function setCondition($pValue = '') {
188-
if (!is_array($pValue))
189-
$pValue = array($pValue);
194+
public function setCondition($pValue = '')
195+
{
196+
if (!is_array($pValue)) {
197+
$pValue = array($pValue);
198+
}
190199

191-
return $this->setConditions($pValue);
200+
return $this->setConditions($pValue);
192201
}
193202

194203
/**
195204
* Get Conditions
196205
*
197206
* @return string[]
198207
*/
199-
public function getConditions() {
200-
return $this->_condition;
208+
public function getConditions()
209+
{
210+
return $this->condition;
201211
}
202212

203213
/**
204214
* Set Conditions
205215
*
206-
* @param string[] $pValue Condition
216+
* @param string[] $pValue Condition
207217
* @return PHPExcel_Style_Conditional
208218
*/
209-
public function setConditions($pValue) {
210-
if (!is_array($pValue))
211-
$pValue = array($pValue);
212-
213-
$this->_condition = $pValue;
214-
return $this;
219+
public function setConditions($pValue)
220+
{
221+
if (!is_array($pValue)) {
222+
$pValue = array($pValue);
223+
}
224+
$this->condition = $pValue;
225+
return $this;
215226
}
216227

217228
/**
218229
* Add Condition
219230
*
220-
* @param string $pValue Condition
231+
* @param string $pValue Condition
221232
* @return PHPExcel_Style_Conditional
222233
*/
223-
public function addCondition($pValue = '') {
224-
$this->_condition[] = $pValue;
225-
return $this;
234+
public function addCondition($pValue = '')
235+
{
236+
$this->condition[] = $pValue;
237+
return $this;
226238
}
227239

228240
/**
229241
* Get Style
230242
*
231243
* @return PHPExcel_Style
232244
*/
233-
public function getStyle() {
234-
return $this->_style;
245+
public function getStyle()
246+
{
247+
return $this->style;
235248
}
236249

237250
/**
238251
* Set Style
239252
*
240-
* @param PHPExcel_Style $pValue
241-
* @throws PHPExcel_Exception
253+
* @param PHPExcel_Style $pValue
254+
* @throws PHPExcel_Exception
242255
* @return PHPExcel_Style_Conditional
243256
*/
244-
public function setStyle(PHPExcel_Style $pValue = null) {
245-
$this->_style = $pValue;
246-
return $this;
257+
public function setStyle(PHPExcel_Style $pValue = null)
258+
{
259+
$this->style = $pValue;
260+
return $this;
247261
}
248262

249-
/**
250-
* Get hash code
251-
*
252-
* @return string Hash code
253-
*/
254-
public function getHashCode() {
255-
return md5(
256-
$this->_conditionType
257-
. $this->_operatorType
258-
. implode(';', $this->_condition)
259-
. $this->_style->getHashCode()
260-
. __CLASS__
261-
);
263+
/**
264+
* Get hash code
265+
*
266+
* @return string Hash code
267+
*/
268+
public function getHashCode()
269+
{
270+
return md5(
271+
$this->conditionType .
272+
$this->operatorType .
273+
implode(';', $this->condition) .
274+
$this->style->getHashCode() .
275+
__CLASS__
276+
);
262277
}
263278

264-
/**
265-
* Implement PHP __clone to create a deep clone, not just a shallow copy.
266-
*/
267-
public function __clone() {
268-
$vars = get_object_vars($this);
269-
foreach ($vars as $key => $value) {
270-
if (is_object($value)) {
271-
$this->$key = clone $value;
272-
} else {
273-
$this->$key = $value;
274-
}
275-
}
276-
}
279+
/**
280+
* Implement PHP __clone to create a deep clone, not just a shallow copy.
281+
*/
282+
public function __clone()
283+
{
284+
$vars = get_object_vars($this);
285+
foreach ($vars as $key => $value) {
286+
if (is_object($value)) {
287+
$this->$key = clone $value;
288+
} else {
289+
$this->$key = $value;
290+
}
291+
}
292+
}
277293
}

0 commit comments

Comments
 (0)