Completed
Push — intl ( b391f2...20c33e )
by Fabio
08:04
created
framework/Web/UI/ActiveControls/TActiveRatingList.php 2 patches
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -99,6 +99,7 @@
 block discarded – undo
99 99
 	 * Calls the client-side static method for this control class.
100 100
 	 * @param string static method name
101 101
 	 * @param mixed method parmaeter
102
+	 * @param string $func
102 103
 	 */
103 104
 	protected function callClientFunction($func,$value)
104 105
 	{
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -80,12 +80,12 @@  discard block
 block discarded – undo
80 80
 	 */
81 81
 	public function setReadOnly($value)
82 82
 	{
83
-		if(parent::getReadOnly() === $value)
83
+		if(parent::getReadOnly()===$value)
84 84
 			return;
85 85
 
86 86
 		parent::setReadOnly($value);
87
-		$value = $this->getReadOnly();
88
-		$this->callClientFunction('setReadOnly',$value);
87
+		$value=$this->getReadOnly();
88
+		$this->callClientFunction('setReadOnly', $value);
89 89
 	}
90 90
 
91 91
 	/**
@@ -93,12 +93,12 @@  discard block
 block discarded – undo
93 93
 	 */
94 94
 	public function setRating($value)
95 95
 	{
96
-		if(parent::getRating() === $value)
96
+		if(parent::getRating()===$value)
97 97
 			return;
98 98
 
99 99
 		parent::setRating($value);
100
-		$value = $this->getRating();
101
-		$this->callClientFunction('setRating',$value);
100
+		$value=$this->getRating();
101
+		$this->callClientFunction('setRating', $value);
102 102
 	}
103 103
 
104 104
 	/**
@@ -106,13 +106,13 @@  discard block
 block discarded – undo
106 106
 	 * @param string static method name
107 107
 	 * @param mixed method parmaeter
108 108
 	 */
109
-	protected function callClientFunction($func,$value)
109
+	protected function callClientFunction($func, $value)
110 110
 	{
111 111
 		if($this->getActiveControl()->canUpdateClientSide())
112 112
 		{
113
-			$client = $this->getPage()->getCallbackClient();
114
-			$code = 'Prado.Registry[\''.$this->ClientID.'\'].'.$func.'('.$value.')';
115
-			$client->evaluateScript($code,array($value));
113
+			$client=$this->getPage()->getCallbackClient();
114
+			$code='Prado.Registry[\''.$this->ClientID.'\'].'.$func.'('.$value.')';
115
+			$client->evaluateScript($code, array($value));
116 116
 		}
117 117
 	}
118 118
 
@@ -121,12 +121,12 @@  discard block
 block discarded – undo
121 121
 	 */
122 122
 	public function setCaption($value)
123 123
 	{
124
-		if(parent::getCaption() === $value)
124
+		if(parent::getCaption()===$value)
125 125
 			return;
126 126
 
127 127
 		parent::setCaption($value);
128 128
 		// if it's an active control, this should not be needed.
129
-		$this->callClientFunction('setCaption',$value);
129
+		$this->callClientFunction('setCaption', $value);
130 130
 	}
131 131
 
132 132
 	/**
Please login to merge, or discard this patch.
framework/Web/UI/ActiveControls/TInPlaceTextBox.php 3 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -92,6 +92,8 @@  discard block
 block discarded – undo
92 92
 	 * Calls the client-side static method for this control class.
93 93
 	 * @param string static method name
94 94
 	 * @param mixed method parmaeter
95
+	 * @param string $func
96
+	 * @param boolean $value
95 97
 	 */
96 98
 	protected function callClientFunction($func,$value)
97 99
 	{
@@ -239,6 +241,7 @@  discard block
 block discarded – undo
239 241
 	 * Raised when editing the content is requsted to be loaded from the
240 242
 	 * server side.
241 243
 	 * @param TCallbackEventParameter event parameter to be passed to the event handlers
244
+	 * @param TCallbackEventParameter $param
242 245
 	 */
243 246
 	public function onLoadingText($param)
244 247
 	{
Please login to merge, or discard this patch.
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -74,10 +74,10 @@  discard block
 block discarded – undo
74 74
 	 */
75 75
 	public function setDisplayTextBox($value)
76 76
 	{
77
-		$value = TPropertyValue::ensureBoolean($value);
78
-		$this->setViewState('DisplayTextBox', $value,false);
77
+		$value=TPropertyValue::ensureBoolean($value);
78
+		$this->setViewState('DisplayTextBox', $value, false);
79 79
 		if($this->getActiveControl()->canUpdateClientSide())
80
-			$this->callClientFunction('setDisplayTextBox',$value);
80
+			$this->callClientFunction('setDisplayTextBox', $value);
81 81
 	}
82 82
 
83 83
 	/**
@@ -93,11 +93,11 @@  discard block
 block discarded – undo
93 93
 	 * @param string static method name
94 94
 	 * @param mixed method parmaeter
95 95
 	 */
96
-	protected function callClientFunction($func,$value)
96
+	protected function callClientFunction($func, $value)
97 97
 	{
98
-		$client = $this->getPage()->getCallbackClient();
99
-		$code = $this->getClientClassName().'.'.$func;
100
-		$client->callClientFunction($code,array($this,$value));
98
+		$client=$this->getPage()->getCallbackClient();
99
+		$code=$this->getClientClassName().'.'.$func;
100
+		$client->callClientFunction($code, array($this, $value));
101 101
 	}
102 102
 
103 103
 	/**
@@ -121,9 +121,9 @@  discard block
 block discarded – undo
121 121
 	 */
122 122
 	protected function getExternalControlID()
123 123
 	{
124
-		$extID = $this->getEditTriggerControlID();
124
+		$extID=$this->getEditTriggerControlID();
125 125
 		if($extID===null) return '';
126
-		if(($control = $this->findControl($extID))!==null)
126
+		if(($control=$this->findControl($extID))!==null)
127 127
 			return $control->getClientID();
128 128
 		return $extID;
129 129
 	}
@@ -135,13 +135,13 @@  discard block
 block discarded – undo
135 135
 	 */
136 136
 	public function setText($value)
137 137
 	{
138
-		if(TTextBox::getText() === $value)
138
+		if(TTextBox::getText()===$value)
139 139
 			return;
140 140
 
141 141
 		TTextBox::setText($value);
142 142
 		if($this->getActiveControl()->canUpdateClientSide())
143 143
 		{
144
-			$client = $this->getPage()->getCallbackClient();
144
+			$client=$this->getPage()->getCallbackClient();
145 145
 			$client->update($this->getLabelClientID(), $value);
146 146
 			$client->setValue($this, $value);
147 147
 		}
@@ -152,14 +152,14 @@  discard block
 block discarded – undo
152 152
 	 * @param boolean value
153 153
 	 * @since 3.1.2
154 154
 	 */
155
-	public function setReadOnly ($value)
155
+	public function setReadOnly($value)
156 156
 	{
157 157
 		$value=TPropertyValue::ensureBoolean($value);
158
-		if(TTextBox::getReadOnly() === $value)
158
+		if(TTextBox::getReadOnly()===$value)
159 159
 			return;
160 160
 
161 161
 		TTextBox::setReadOnly($value);
162
-		if ($this->getActiveControl()->canUpdateClientSide())
162
+		if($this->getActiveControl()->canUpdateClientSide())
163 163
 		{
164 164
 			$this->callClientFunction('setReadOnly', $value);
165 165
 		}
@@ -202,10 +202,10 @@  discard block
 block discarded – undo
202 202
 	 */
203 203
 	public function onCallback($param)
204 204
 	{
205
-		$action = $param->getCallbackParameter();
206
-		if(is_array($action) && $action[0] === '__InlineEditor_loadExternalText__')
205
+		$action=$param->getCallbackParameter();
206
+		if(is_array($action) && $action[0]==='__InlineEditor_loadExternalText__')
207 207
 		{
208
-			$parameter = new TCallbackEventParameter($this->getResponse(), $action[1]);
208
+			$parameter=new TCallbackEventParameter($this->getResponse(), $action[1]);
209 209
 			$this->onLoadingText($parameter);
210 210
 		}
211 211
 		$this->raiseEvent('OnCallback', $this, $param);
@@ -216,26 +216,26 @@  discard block
 block discarded – undo
216 216
 	 */
217 217
 	protected function getPostBackOptions()
218 218
 	{
219
-		$options = parent::getPostBackOptions();
220
-		$options['ID'] = $this->getLabelClientID();
221
-		$options['TextBoxID'] = $this->getClientID();
222
-		$options['ExternalControl'] = $this->getExternalControlID();
223
-		$options['AutoHide'] = $this->getAutoHideTextBox() == false ? '' : true;
224
-		$options['AutoPostBack'] = $this->getAutoPostBack() == false ? '' : true;
225
-		$options['Columns'] = $this->getColumns();
219
+		$options=parent::getPostBackOptions();
220
+		$options['ID']=$this->getLabelClientID();
221
+		$options['TextBoxID']=$this->getClientID();
222
+		$options['ExternalControl']=$this->getExternalControlID();
223
+		$options['AutoHide']=$this->getAutoHideTextBox()==false ? '' : true;
224
+		$options['AutoPostBack']=$this->getAutoPostBack()==false ? '' : true;
225
+		$options['Columns']=$this->getColumns();
226 226
 		if($this->getTextMode()==='MultiLine')
227 227
 		{
228
-			$options['Rows'] = $this->getRows();
229
-			$options['Wrap'] = $this->getWrap()== false ? '' : true;
228
+			$options['Rows']=$this->getRows();
229
+			$options['Wrap']=$this->getWrap()==false ? '' : true;
230 230
 		}
231 231
 		else
232 232
 		{
233
-			$length = $this->getMaxLength();
234
-			$options['MaxLength'] = $length > 0 ? $length : '';
233
+			$length=$this->getMaxLength();
234
+			$options['MaxLength']=$length > 0 ? $length : '';
235 235
 		}
236 236
 
237 237
 		if($this->hasEventHandler('OnLoadingText'))
238
-			$options['LoadTextOnEdit'] = true;
238
+			$options['LoadTextOnEdit']=true;
239 239
 
240 240
 		$options['ReadOnly']=$this->getReadOnly();
241 241
 		return $options;
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
 	 */
249 249
 	public function onLoadingText($param)
250 250
 	{
251
-		$this->raiseEvent('OnLoadingText',$this,$param);
251
+		$this->raiseEvent('OnLoadingText', $this, $param);
252 252
 	}
253 253
 
254 254
 	/**
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
 	{
268 268
 		//calls the TWebControl to avoid rendering other attribute normally render for a textbox.
269 269
 		TWebControl::addAttributesToRender($writer);
270
-		$writer->addAttribute('id',$this->getLabelClientID());
270
+		$writer->addAttribute('id', $this->getLabelClientID());
271 271
 		$this->getActiveControl()->registerCallbackClientScript(
272 272
 			$this->getClientClassName(), $this->getPostBackOptions());
273 273
 	}
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -233,8 +233,7 @@
 block discarded – undo
233 233
 		{
234 234
 			$options['Rows'] = $this->getRows();
235 235
 			$options['Wrap'] = $this->getWrap()== false ? '' : true;
236
-		}
237
-		else
236
+		} else
238 237
 		{
239 238
 			$length = $this->getMaxLength();
240 239
 			$options['MaxLength'] = $length > 0 ? $length : '';
Please login to merge, or discard this patch.
framework/Web/UI/ActiveControls/TTriggeredCallback.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@
 block discarded – undo
56 56
 	}
57 57
 
58 58
 	/**
59
-	 * @return array list of trigger callback options.
59
+	 * @return string list of trigger callback options.
60 60
 	 */
61 61
 	protected function getTriggerOptions()
62 62
 	{
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 	 */
45 45
 	protected function getTargetControl()
46 46
 	{
47
-		$id = $this->getControlID();
47
+		$id=$this->getControlID();
48 48
 		if(($control=$this->findControl($id)) instanceof TControl)
49 49
 			return $control->getClientID();
50 50
 		if($id==='')
@@ -60,9 +60,9 @@  discard block
 block discarded – undo
60 60
 	 */
61 61
 	protected function getTriggerOptions()
62 62
 	{
63
-		$options['ID'] = $this->getClientID();
64
-		$options['EventTarget'] = $this->getUniqueID();
65
-		$options['ControlID'] = $this->getTargetControl();
63
+		$options['ID']=$this->getClientID();
64
+		$options['EventTarget']=$this->getUniqueID();
65
+		$options['ControlID']=$this->getTargetControl();
66 66
 		return $options;
67 67
 	}
68 68
 }
Please login to merge, or discard this patch.
framework/Web/UI/JuiControls/TJuiDialog.php 3 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -158,6 +158,9 @@
 block discarded – undo
158 158
 		$this->triggerClientMethod('close');
159 159
 	}
160 160
 
161
+	/**
162
+	 * @param string $method
163
+	 */
161 164
 	private function triggerClientMethod($method)
162 165
 	{
163 166
 		$cs = $this->getPage()->getClientScript();
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 	 */
73 73
 	public function getOptions()
74 74
 	{
75
-		if (($options=$this->getViewState('JuiOptions'))===null)
75
+		if(($options=$this->getViewState('JuiOptions'))===null)
76 76
 		{
77 77
 		  $options=new TJuiControlOptions($this);
78 78
 		  $this->setViewState('JuiOptions', $options);
@@ -103,14 +103,14 @@  discard block
 block discarded – undo
103 103
 	 */
104 104
 	protected function getPostBackOptions()
105 105
 	{
106
-		$options = $this->getOptions()->toArray();
106
+		$options=$this->getOptions()->toArray();
107 107
 		// always make the dialog a child of the form, or its inner inputs won't be collected
108 108
 		if(!isset($options['appendTo']))
109
-			$options['appendTo'] = 'form:first';
109
+			$options['appendTo']='form:first';
110 110
 
111 111
 		foreach($this->getControls() as $control)
112 112
 			if($control instanceof TJuiDialogButton)
113
-				$options['buttons'][] = $control->getPostBackOptions();
113
+				$options['buttons'][]=$control->getPostBackOptions();
114 114
 
115 115
 		return $options;
116 116
 	}
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
 	{
124 124
 		parent::addAttributesToRender($writer);
125 125
 
126
-		$writer->addAttribute('id',$this->getClientID());
126
+		$writer->addAttribute('id', $this->getClientID());
127 127
 		$options=TJavaScript::encode($this->getPostBackOptions());
128 128
 		$cs=$this->getPage()->getClientScript();
129 129
 		$code="jQuery('#".$this->getWidgetID()."').".$this->getWidget()."(".$options.");";
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
 	 * Raises the OnCreate event
145 145
 	 * @param object $params event parameters
146 146
 	 */
147
-	public function onOpen ($params)
147
+	public function onOpen($params)
148 148
 	{
149 149
 		$this->raiseEvent('OnOpen', $this, $params);
150 150
 	}
@@ -167,8 +167,8 @@  discard block
 block discarded – undo
167 167
 
168 168
 	private function triggerClientMethod($method)
169 169
 	{
170
-		$cs = $this->getPage()->getClientScript();
171
-		$code = "jQuery(document).ready(function() { jQuery('#".$this->getClientId()."').dialog('".$method."'); })";
170
+		$cs=$this->getPage()->getClientScript();
171
+		$code="jQuery(document).ready(function() { jQuery('#".$this->getClientId()."').dialog('".$method."'); })";
172 172
 		$cs->registerEndScript(sprintf('%08X', crc32($code)), $code);
173 173
 	}
174 174
 
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -193,8 +193,7 @@
 block discarded – undo
193 193
 		{
194 194
 		  parent::renderContents($writer);
195 195
 			$this->getPage()->getCallbackClient()->replaceContent($this, $writer, false);
196
-		}
197
-		else
196
+		} else
198 197
 			parent::render($writer);
199 198
 	}
200 199
 }
Please login to merge, or discard this patch.
framework/Web/UI/TTemplateControlInheritable.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@
 block discarded – undo
76 76
 	/**
77 77
 	 * This method creates the template object for the given class
78 78
 	 *
79
-	 * @param string $p_class The class to create the template from
79
+	 * @param string $parentClass
80 80
 	 * @return void
81 81
 	 * @throws TConfigurationException if a template control directive is invalid
82 82
 	 */
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 	 */	
44 44
 	public function createChildControls()
45 45
 	{
46
-		if(null === ($_template = $this->getTemplate())) {
46
+		if(null===($_template=$this->getTemplate())) {
47 47
 			return $this->doCreateChildControlsFor(get_class($this));
48 48
 		}
49 49
 
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 	 */
67 67
 	public function doCreateChildControlsFor($parentClass)
68 68
 	{
69
-		if(false !== ($_parentClass = get_parent_class($parentClass)) && 'TTemplateControl' != $_parentClass) {
69
+		if(false!==($_parentClass=get_parent_class($parentClass)) && 'TTemplateControl'!=$_parentClass) {
70 70
 			$this->doCreateChildControlsFor($_parentClass);
71 71
 		}
72 72
 
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 	 */
83 83
 	public function doTemplateForClass($parentClass)
84 84
 	{
85
-		if(null !== ($_template = $this->getService()->getTemplateManager()->getTemplateByClassName($parentClass))) {
85
+		if(null!==($_template=$this->getService()->getTemplateManager()->getTemplateByClassName($parentClass))) {
86 86
 			foreach($_template->getDirective() as $_name => $_value) {
87 87
 				if(!is_string($_value)) {
88 88
 					throw new TConfigurationException('templatecontrol_directive_invalid', get_class(this), $_name);
@@ -105,11 +105,11 @@  discard block
 block discarded – undo
105 105
 	 */
106 106
 	public function getIsSourceTemplateControl()
107 107
 	{
108
-		if(null !== ($_template = $this->getTemplate())) {
108
+		if(null!==($_template=$this->getTemplate())) {
109 109
 			return $_template->getIsSourceTemplate();
110 110
 		}
111 111
 
112
-		return ($_template = $this->getService()->getTemplateManager()->getTemplateByClassName(get_parent_class($this)))
112
+		return ($_template=$this->getService()->getTemplateManager()->getTemplateByClassName(get_parent_class($this)))
113 113
 			? $_template->getIsSourceTemplate()
114 114
 			: false;
115 115
 	}
Please login to merge, or discard this patch.
framework/Web/UI/WebControls/TBaseDataList.php 2 patches
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -166,6 +166,7 @@
 block discarded – undo
166 166
 	 * Otherwise, an exception will be raised.
167 167
 	 * @param mixed data item
168 168
 	 * @param mixed field name
169
+	 * @param string $field
169 170
 	 * @return mixed data value at the specified field
170 171
 	 * @throws TInvalidDataValueException if the data is invalid
171 172
 	 */
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
 	 */
135 135
 	public function getDataKeyField()
136 136
 	{
137
-		return $this->getViewState('DataKeyField','');
137
+		return $this->getViewState('DataKeyField', '');
138 138
 	}
139 139
 
140 140
 	/**
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
 	 */
143 143
 	public function setDataKeyField($value)
144 144
 	{
145
-		$this->setViewState('DataKeyField',$value,'');
145
+		$this->setViewState('DataKeyField', $value, '');
146 146
 	}
147 147
 
148 148
 	/**
@@ -150,10 +150,10 @@  discard block
 block discarded – undo
150 150
 	 */
151 151
 	public function getDataKeys()
152 152
 	{
153
-		if(($dataKeys=$this->getViewState('DataKeys',null))===null)
153
+		if(($dataKeys=$this->getViewState('DataKeys', null))===null)
154 154
 		{
155 155
 			$dataKeys=new TList;
156
-			$this->setViewState('DataKeys',$dataKeys,null);
156
+			$this->setViewState('DataKeys', $dataKeys, null);
157 157
 		}
158 158
 		return $dataKeys;
159 159
 	}
@@ -169,9 +169,9 @@  discard block
 block discarded – undo
169 169
 	 * @return mixed data value at the specified field
170 170
 	 * @throws TInvalidDataValueException if the data is invalid
171 171
 	 */
172
-	protected function getDataFieldValue($data,$field)
172
+	protected function getDataFieldValue($data, $field)
173 173
 	{
174
-		return TDataFieldAccessor::getDataFieldValue($data,$field);
174
+		return TDataFieldAccessor::getDataFieldValue($data, $field);
175 175
 	}
176 176
 
177 177
 	/**
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
 	 */
183 183
 	public function onSelectedIndexChanged($param)
184 184
 	{
185
-		$this->raiseEvent('OnSelectedIndexChanged',$this,$param);
185
+		$this->raiseEvent('OnSelectedIndexChanged', $this, $param);
186 186
 	}
187 187
 }
188 188
 
Please login to merge, or discard this patch.
framework/Web/UI/WebControls/TCaptcha.php 2 patches
Doc Comments   +8 added lines patch added patch discarded remove patch
@@ -267,6 +267,7 @@  discard block
 block discarded – undo
267 267
 
268 268
 	/**
269 269
 	 * @param string the public key used for generating the token. A random one will be generated if this is not set.
270
+	 * @param string $value
270 271
 	 */
271 272
 	public function setPublicKey($value)
272 273
 	{
@@ -322,6 +323,7 @@  discard block
 block discarded – undo
322 323
 	/**
323 324
 	 * Validates a user input with the token.
324 325
 	 * @param string user input
326
+	 * @param string $input
325 327
 	 * @return boolean if the user input is not the same as the token.
326 328
 	 */
327 329
 	public function validate($input)
@@ -447,6 +449,11 @@  discard block
 block discarded – undo
447 449
 	 * @param string private key
448 450
 	 * @param integer the length of the token
449 451
 	 * @param boolean whether the token is case sensitive
452
+	 * @param string $publicKey
453
+	 * @param string $privateKey
454
+	 * @param string $alphabet
455
+	 * @param integer $tokenLength
456
+	 * @param boolean $caseSensitive
450 457
 	 * @return string the token generated.
451 458
 	 */
452 459
 	protected function generateToken($publicKey,$privateKey,$alphabet,$tokenLength,$caseSensitive)
@@ -459,6 +466,7 @@  discard block
 block discarded – undo
459 466
 	 * Converts a hash string into a string with characters consisting of alphanumeric characters.
460 467
 	 * @param string the hexadecimal representation of the hash string
461 468
 	 * @param string the alphabet used to represent the converted string. If empty, it means '234578adefhijmnrtwyABDEFGHIJLMNQRTWY', which excludes those confusing characters.
469
+	 * @param string $hex
462 470
 	 * @return string the converted string
463 471
 	 */
464 472
 	protected function hash2string($hex,$alphabet='')
Please login to merge, or discard this patch.
Spacing   +60 added lines, -60 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 	 */
74 74
 	public function getTokenImageTheme()
75 75
 	{
76
-		return $this->getViewState('TokenImageTheme',0);
76
+		return $this->getViewState('TokenImageTheme', 0);
77 77
 	}
78 78
 
79 79
 	/**
@@ -92,10 +92,10 @@  discard block
 block discarded – undo
92 92
 	public function setTokenImageTheme($value)
93 93
 	{
94 94
 		$value=TPropertyValue::ensureInteger($value);
95
-		if($value>=0 && $value<=63)
96
-			$this->setViewState('TokenImageTheme',$value,0);
95
+		if($value >= 0 && $value <= 63)
96
+			$this->setViewState('TokenImageTheme', $value, 0);
97 97
 		else
98
-			throw new TConfigurationException('captcha_tokenimagetheme_invalid',0,63);
98
+			throw new TConfigurationException('captcha_tokenimagetheme_invalid', 0, 63);
99 99
 	}
100 100
 
101 101
 	/**
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
 	 */
104 104
 	public function getTokenFontSize()
105 105
 	{
106
-		return $this->getViewState('TokenFontSize',30);
106
+		return $this->getViewState('TokenFontSize', 30);
107 107
 	}
108 108
 
109 109
 	/**
@@ -115,10 +115,10 @@  discard block
 block discarded – undo
115 115
 	public function setTokenFontSize($value)
116 116
 	{
117 117
 		$value=TPropertyValue::ensureInteger($value);
118
-		if($value>=20 && $value<=100)
119
-			$this->setViewState('TokenFontSize',$value,30);
118
+		if($value >= 20 && $value <= 100)
119
+			$this->setViewState('TokenFontSize', $value, 30);
120 120
 		else
121
-			throw new TConfigurationException('captcha_tokenfontsize_invalid',20,100);
121
+			throw new TConfigurationException('captcha_tokenfontsize_invalid', 20, 100);
122 122
 	}
123 123
 
124 124
 	/**
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
 	 */
127 127
 	public function getMinTokenLength()
128 128
 	{
129
-		return $this->getViewState('MinTokenLength',4);
129
+		return $this->getViewState('MinTokenLength', 4);
130 130
 	}
131 131
 
132 132
 	/**
@@ -135,10 +135,10 @@  discard block
 block discarded – undo
135 135
 	public function setMinTokenLength($value)
136 136
 	{
137 137
 		$length=TPropertyValue::ensureInteger($value);
138
-		if($length>=self::MIN_TOKEN_LENGTH && $length<=self::MAX_TOKEN_LENGTH)
139
-			$this->setViewState('MinTokenLength',$length,4);
138
+		if($length >= self::MIN_TOKEN_LENGTH && $length <= self::MAX_TOKEN_LENGTH)
139
+			$this->setViewState('MinTokenLength', $length, 4);
140 140
 		else
141
-			throw new TConfigurationException('captcha_mintokenlength_invalid',self::MIN_TOKEN_LENGTH,self::MAX_TOKEN_LENGTH);
141
+			throw new TConfigurationException('captcha_mintokenlength_invalid', self::MIN_TOKEN_LENGTH, self::MAX_TOKEN_LENGTH);
142 142
 	}
143 143
 
144 144
 	/**
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
 	 */
147 147
 	public function getMaxTokenLength()
148 148
 	{
149
-		return $this->getViewState('MaxTokenLength',6);
149
+		return $this->getViewState('MaxTokenLength', 6);
150 150
 	}
151 151
 
152 152
 	/**
@@ -155,10 +155,10 @@  discard block
 block discarded – undo
155 155
 	public function setMaxTokenLength($value)
156 156
 	{
157 157
 		$length=TPropertyValue::ensureInteger($value);
158
-		if($length>=self::MIN_TOKEN_LENGTH && $length<=self::MAX_TOKEN_LENGTH)
159
-			$this->setViewState('MaxTokenLength',$length,6);
158
+		if($length >= self::MIN_TOKEN_LENGTH && $length <= self::MAX_TOKEN_LENGTH)
159
+			$this->setViewState('MaxTokenLength', $length, 6);
160 160
 		else
161
-			throw new TConfigurationException('captcha_maxtokenlength_invalid',self::MIN_TOKEN_LENGTH,self::MAX_TOKEN_LENGTH);
161
+			throw new TConfigurationException('captcha_maxtokenlength_invalid', self::MIN_TOKEN_LENGTH, self::MAX_TOKEN_LENGTH);
162 162
 	}
163 163
 
164 164
 	/**
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
 	 */
167 167
 	public function getCaseSensitive()
168 168
 	{
169
-		return $this->getViewState('CaseSensitive',true);
169
+		return $this->getViewState('CaseSensitive', true);
170 170
 	}
171 171
 
172 172
 	/**
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
 	 */
175 175
 	public function setCaseSensitive($value)
176 176
 	{
177
-		$this->setViewState('CaseSensitive',TPropertyValue::ensureBoolean($value),true);
177
+		$this->setViewState('CaseSensitive', TPropertyValue::ensureBoolean($value), true);
178 178
 	}
179 179
 
180 180
 	/**
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
 	 */
183 183
 	public function getTokenAlphabet()
184 184
 	{
185
-		return $this->getViewState('TokenAlphabet','234578adefhijmnrtABDEFGHJLMNRT');
185
+		return $this->getViewState('TokenAlphabet', '234578adefhijmnrtABDEFGHJLMNRT');
186 186
 	}
187 187
 
188 188
 	/**
@@ -190,9 +190,9 @@  discard block
 block discarded – undo
190 190
 	 */
191 191
 	public function setTokenAlphabet($value)
192 192
 	{
193
-		if(strlen($value)<2)
193
+		if(strlen($value) < 2)
194 194
 			throw new TConfigurationException('captcha_tokenalphabet_invalid');
195
-		$this->setViewState('TokenAlphabet',$value,'234578adefhijmnrtABDEFGHJLMNRT');
195
+		$this->setViewState('TokenAlphabet', $value, '234578adefhijmnrtABDEFGHJLMNRT');
196 196
 	}
197 197
 
198 198
 	/**
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
 	 */
201 201
 	public function getTokenExpiry()
202 202
 	{
203
-		return $this->getViewState('TokenExpiry',600);
203
+		return $this->getViewState('TokenExpiry', 600);
204 204
 	}
205 205
 
206 206
 	/**
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
 	 */
209 209
 	public function setTokenExpiry($value)
210 210
 	{
211
-		$this->setViewState('TokenExpiry',TPropertyValue::ensureInteger($value),600);
211
+		$this->setViewState('TokenExpiry', TPropertyValue::ensureInteger($value), 600);
212 212
 	}
213 213
 
214 214
 	/**
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
 	 */
217 217
 	public function getChangingTokenBackground()
218 218
 	{
219
-		return $this->getViewState('ChangingTokenBackground',false);
219
+		return $this->getViewState('ChangingTokenBackground', false);
220 220
 	}
221 221
 
222 222
 	/**
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
 	 */
225 225
 	public function setChangingTokenBackground($value)
226 226
 	{
227
-		$this->setViewState('ChangingTokenBackground',TPropertyValue::ensureBoolean($value),false);
227
+		$this->setViewState('ChangingTokenBackground', TPropertyValue::ensureBoolean($value), false);
228 228
 	}
229 229
 
230 230
 	/**
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
 	 */
233 233
 	public function getTestLimit()
234 234
 	{
235
-		return $this->getViewState('TestLimit',5);
235
+		return $this->getViewState('TestLimit', 5);
236 236
 	}
237 237
 
238 238
 	/**
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
 	 */
241 241
 	public function setTestLimit($value)
242 242
 	{
243
-		$this->setViewState('TestLimit',TPropertyValue::ensureInteger($value),5);
243
+		$this->setViewState('TestLimit', TPropertyValue::ensureInteger($value), 5);
244 244
 	}
245 245
 
246 246
 	/**
@@ -248,8 +248,8 @@  discard block
 block discarded – undo
248 248
 	 */
249 249
 	public function getIsTokenExpired()
250 250
 	{
251
-		if(($expiry=$this->getTokenExpiry())>0 && ($start=$this->getViewState('TokenGenerated',0))>0)
252
-			return $expiry+$start<time();
251
+		if(($expiry=$this->getTokenExpiry()) > 0 && ($start=$this->getViewState('TokenGenerated', 0)) > 0)
252
+			return $expiry + $start < time();
253 253
 		else
254 254
 			return false;
255 255
 	}
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
259 259
 	 */
260 260
 	public function getPublicKey()
261 261
 	{
262
-		if(($publicKey=$this->getViewState('PublicKey',''))==='')
262
+		if(($publicKey=$this->getViewState('PublicKey', ''))==='')
263 263
 		{
264 264
 			$publicKey=$this->generateRandomKey();
265 265
 			$this->setPublicKey($publicKey);
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
 	 */
273 273
 	public function setPublicKey($value)
274 274
 	{
275
-		$this->setViewState('PublicKey',$value,'');
275
+		$this->setViewState('PublicKey', $value, '');
276 276
 	}
277 277
 
278 278
 	/**
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
 	 */
281 281
 	public function getToken()
282 282
 	{
283
-		return $this->generateToken($this->getPublicKey(),$this->getPrivateKey(),$this->getTokenAlphabet(),$this->getTokenLength(),$this->getCaseSensitive());
283
+		return $this->generateToken($this->getPublicKey(), $this->getPrivateKey(), $this->getTokenAlphabet(), $this->getTokenLength(), $this->getCaseSensitive());
284 284
 	}
285 285
 
286 286
 	/**
@@ -292,13 +292,13 @@  discard block
 block discarded – undo
292 292
 		{
293 293
 			$minLength=$this->getMinTokenLength();
294 294
 			$maxLength=$this->getMaxTokenLength();
295
-			if($minLength>$maxLength)
296
-				$tokenLength=rand($maxLength,$minLength);
297
-			else if($minLength<$maxLength)
298
-				$tokenLength=rand($minLength,$maxLength);
295
+			if($minLength > $maxLength)
296
+				$tokenLength=rand($maxLength, $minLength);
297
+			else if($minLength < $maxLength)
298
+				$tokenLength=rand($minLength, $maxLength);
299 299
 			else
300 300
 				$tokenLength=$minLength;
301
-			$this->setViewState('TokenLength',$tokenLength);
301
+			$this->setViewState('TokenLength', $tokenLength);
302 302
 		}
303 303
 		return $tokenLength;
304 304
 	}
@@ -313,7 +313,7 @@  discard block
 block discarded – undo
313 313
 			$fileName=$this->generatePrivateKeyFile();
314 314
 			$content=file_get_contents($fileName);
315 315
 			$matches=array();
316
-			if(preg_match("/privateKey='(.*?)'/ms",$content,$matches)>0)
316
+			if(preg_match("/privateKey='(.*?)'/ms", $content, $matches) > 0)
317 317
 				$this->_privateKey=$matches[1];
318 318
 			else
319 319
 				throw new TConfigurationException('captcha_privatekey_unknown');
@@ -328,18 +328,18 @@  discard block
 block discarded – undo
328 328
 	 */
329 329
 	public function validate($input)
330 330
 	{
331
-		$number=$this->getViewState('TestNumber',0);
331
+		$number=$this->getViewState('TestNumber', 0);
332 332
 		if(!$this->_validated)
333 333
 		{
334
-			$this->setViewState('TestNumber',++$number);
334
+			$this->setViewState('TestNumber', ++$number);
335 335
 			$this->_validated=true;
336 336
 		}
337
-		if($this->getIsTokenExpired() || (($limit=$this->getTestLimit())>0 && $number>$limit))
337
+		if($this->getIsTokenExpired() || (($limit=$this->getTestLimit()) > 0 && $number > $limit))
338 338
 		{
339 339
 			$this->regenerateToken();
340 340
 			return false;
341 341
 		}
342
-		return ($this->getToken()===($this->getCaseSensitive()?$input:strtoupper($input)));
342
+		return ($this->getToken()===($this->getCaseSensitive() ? $input : strtoupper($input)));
343 343
 	}
344 344
 
345 345
 	/**
@@ -353,7 +353,7 @@  discard block
 block discarded – undo
353 353
 		$this->setPublicKey('');
354 354
 		$this->clearViewState('TokenGenerated');
355 355
 		$this->clearViewState('RandomSeed');
356
-		$this->clearViewState('TestNumber',0);
356
+		$this->clearViewState('TestNumber', 0);
357 357
 	}
358 358
 
359 359
 	/**
@@ -365,7 +365,7 @@  discard block
 block discarded – undo
365 365
 		parent::onPreRender($param);
366 366
 		if(!self::checkRequirements())
367 367
 			throw new TConfigurationException('captcha_imagettftext_required');
368
-		if(!$this->getViewState('TokenGenerated',0))
368
+		if(!$this->getViewState('TokenGenerated', 0))
369 369
 		{
370 370
 			$manager=$this->getApplication()->getAssetManager();
371 371
 			$manager->publishFilePath($this->getFontFile());
@@ -373,7 +373,7 @@  discard block
 block discarded – undo
373 373
 			$url.='?options='.urlencode($this->getTokenImageOptions());
374 374
 			$this->setImageUrl($url);
375 375
 
376
-			$this->setViewState('TokenGenerated',time());
376
+			$this->setViewState('TokenGenerated', time());
377 377
 		}
378 378
 	}
379 379
 
@@ -382,7 +382,7 @@  discard block
 block discarded – undo
382 382
 	 */
383 383
 	protected function getTokenImageOptions()
384 384
 	{
385
-		$privateKey=$this->getPrivateKey();  // call this method to ensure private key is generated
385
+		$privateKey=$this->getPrivateKey(); // call this method to ensure private key is generated
386 386
 		$token=$this->getToken();
387 387
 		$options=array();
388 388
 		$options['publicKey']=$this->getPublicKey();
@@ -391,12 +391,12 @@  discard block
 block discarded – undo
391 391
 		$options['alphabet']=$this->getTokenAlphabet();
392 392
 		$options['fontSize']=$this->getTokenFontSize();
393 393
 		$options['theme']=$this->getTokenImageTheme();
394
-		if(($randomSeed=$this->getViewState('RandomSeed',0))===0)
394
+		if(($randomSeed=$this->getViewState('RandomSeed', 0))===0)
395 395
 		{
396
-			$randomSeed=(int)(microtime(true)*1000000);
397
-			$this->setViewState('RandomSeed',$randomSeed);
396
+			$randomSeed=(int) (microtime(true) * 1000000);
397
+			$this->setViewState('RandomSeed', $randomSeed);
398 398
 		}
399
-		$options['randomSeed']=$this->getChangingTokenBackground()?0:$randomSeed;
399
+		$options['randomSeed']=$this->getChangingTokenBackground() ? 0 : $randomSeed;
400 400
 		$str=serialize($options);
401 401
 		return base64_encode(md5($privateKey.$str).$str);
402 402
 	}
@@ -430,7 +430,7 @@  discard block
 block discarded – undo
430 430
 			$content="<?php
431 431
 \$privateKey='$key';
432 432
 ?>";
433
-			file_put_contents($fileName,$content);
433
+			file_put_contents($fileName, $content);
434 434
 		}
435 435
 		return $fileName;
436 436
 	}
@@ -451,10 +451,10 @@  discard block
 block discarded – undo
451 451
 	 * @param boolean whether the token is case sensitive
452 452
 	 * @return string the token generated.
453 453
 	 */
454
-	protected function generateToken($publicKey,$privateKey,$alphabet,$tokenLength,$caseSensitive)
454
+	protected function generateToken($publicKey, $privateKey, $alphabet, $tokenLength, $caseSensitive)
455 455
 	{
456
-		$token=substr($this->hash2string(md5($publicKey.$privateKey),$alphabet).$this->hash2string(md5($privateKey.$publicKey),$alphabet),0,$tokenLength);
457
-		return $caseSensitive?$token:strtoupper($token);
456
+		$token=substr($this->hash2string(md5($publicKey.$privateKey), $alphabet).$this->hash2string(md5($privateKey.$publicKey), $alphabet), 0, $tokenLength);
457
+		return $caseSensitive ? $token : strtoupper($token);
458 458
 	}
459 459
 
460 460
 	/**
@@ -463,20 +463,20 @@  discard block
 block discarded – undo
463 463
 	 * @param string the alphabet used to represent the converted string. If empty, it means '234578adefhijmnrtwyABDEFGHIJLMNQRTWY', which excludes those confusing characters.
464 464
 	 * @return string the converted string
465 465
 	 */
466
-	protected function hash2string($hex,$alphabet='')
466
+	protected function hash2string($hex, $alphabet='')
467 467
 	{
468
-		if(strlen($alphabet)<2)
468
+		if(strlen($alphabet) < 2)
469 469
 			$alphabet='234578adefhijmnrtABDEFGHJLMNQRT';
470 470
 		$hexLength=strlen($hex);
471 471
 		$base=strlen($alphabet);
472 472
 		$result='';
473
-		for($i=0;$i<$hexLength;$i+=6)
473
+		for($i=0; $i < $hexLength; $i+=6)
474 474
 		{
475
-			$number=hexdec(substr($hex,$i,6));
475
+			$number=hexdec(substr($hex, $i, 6));
476 476
 			while($number)
477 477
 			{
478
-				$result.=$alphabet[$number%$base];
479
-				$number=floor($number/$base);
478
+				$result.=$alphabet[$number % $base];
479
+				$number=floor($number / $base);
480 480
 			}
481 481
 		}
482 482
 		return $result;
Please login to merge, or discard this patch.
framework/Web/UI/WebControls/TCaptchaValidator.php 3 patches
Doc Comments   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 	}
80 80
 
81 81
 	/**
82
-	 * @return TCaptchaControl the CAPTCHA control to be validated against
82
+	 * @return TCaptcha the CAPTCHA control to be validated against
83 83
 	 * @throws TConfigurationException if the CAPTCHA cannot be found according to {@link setCaptchaControl CaptchaControl}
84 84
 	 */
85 85
 	protected function findCaptchaControl()
@@ -115,6 +115,9 @@  discard block
 block discarded – undo
115 115
 		return $options;
116 116
 	}
117 117
 
118
+	/**
119
+	 * @param string $token
120
+	 */
118 121
 	private function generateTokenHash($token)
119 122
 	{
120 123
 		for($h=0,$i=strlen($token)-1;$i>=0;--$i)
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 	 */
51 51
 	public function getCaptchaControl()
52 52
 	{
53
-		return $this->getViewState('CaptchaControl','');
53
+		return $this->getViewState('CaptchaControl', '');
54 54
 	}
55 55
 
56 56
 	/**
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 	 */
62 62
 	public function setCaptchaControl($value)
63 63
 	{
64
-		$this->setViewState('CaptchaControl',TPropertyValue::ensureString($value),'');
64
+		$this->setViewState('CaptchaControl', TPropertyValue::ensureString($value), '');
65 65
 	}
66 66
 
67 67
 	/**
@@ -87,9 +87,9 @@  discard block
 block discarded – undo
87 87
 		if(($id=$this->getCaptchaControl())==='')
88 88
 			throw new TConfigurationException('captchavalidator_captchacontrol_required');
89 89
 		else if(($control=$this->findControl($id))===null)
90
-			throw new TConfigurationException('captchavalidator_captchacontrol_inexistent',$id);
90
+			throw new TConfigurationException('captchavalidator_captchacontrol_inexistent', $id);
91 91
 		else if(!($control instanceof TCaptcha))
92
-			throw new TConfigurationException('captchavalidator_captchacontrol_invalid',$id);
92
+			throw new TConfigurationException('captchavalidator_captchacontrol_invalid', $id);
93 93
 		else
94 94
 			return $control;
95 95
 	}
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 
118 118
 	private function generateTokenHash($token)
119 119
 	{
120
-		for($h=0,$i=strlen($token)-1;$i>=0;--$i)
120
+		for($h=0, $i=strlen($token) - 1; $i >= 0; --$i)
121 121
 			$h+=ord($token[$i]);
122 122
 		return $h;
123 123
 	}
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -107,8 +107,7 @@
 block discarded – undo
107 107
 		{
108 108
 			$options['TokenHash']=$this->generateTokenHash($control->getToken());
109 109
 			$options['CaseSensitive']=true;
110
-		}
111
-		else
110
+		} else
112 111
 		{
113 112
 			$options['TokenHash']=$this->generateTokenHash(strtoupper($control->getToken()));
114 113
 			$options['CaseSensitive']=false;
Please login to merge, or discard this patch.
framework/Web/UI/WebControls/TCheckBox.php 4 patches
Doc Comments   +6 added lines, -1 removed lines patch added patch discarded remove patch
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 
118 118
 	/**
119 119
 	 * Returns the value of the property that needs validation.
120
-	 * @return mixed the property value to be validated
120
+	 * @return boolean the property value to be validated
121 121
 	 */
122 122
 	public function getValidationPropertyValue()
123 123
 	{
@@ -184,6 +184,7 @@  discard block
 block discarded – undo
184 184
 
185 185
 	/**
186 186
 	 * @param TTextAlign the alignment of the text caption. Valid values include Left and Right.
187
+	 * @param TTextAlign $value
187 188
 	 */
188 189
 	public function setTextAlign($value)
189 190
 	{
@@ -244,6 +245,7 @@  discard block
 block discarded – undo
244 245
 	/**
245 246
 	 * Sets a value indicating whether clicking on the checkbox will post the page.
246 247
 	 * @param boolean whether clicking on the checkbox will post the page.
248
+	 * @param boolean $value
247 249
 	 */
248 250
 	public function setAutoPostBack($value)
249 251
 	{
@@ -261,6 +263,7 @@  discard block
 block discarded – undo
261 263
 	/**
262 264
 	 * Sets the value indicating whether postback event trigger by this checkbox will cause input validation.
263 265
 	 * @param boolean whether postback event trigger by this checkbox will cause input validation.
266
+	 * @param boolean $value
264 267
 	 */
265 268
 	public function setCausesValidation($value)
266 269
 	{
@@ -277,6 +280,7 @@  discard block
 block discarded – undo
277 280
 
278 281
 	/**
279 282
 	 * @param string the group of validators which the checkbox causes validation upon postback
283
+	 * @param string $value
280 284
 	 */
281 285
 	public function setValidationGroup($value)
282 286
 	{
@@ -410,6 +414,7 @@  discard block
 block discarded – undo
410 414
 
411 415
 	/**
412 416
 	 * @param boolean whether to render javascript.
417
+	 * @param boolean $value
413 418
 	 */
414 419
 	public function setEnableClientScript($value)
415 420
 	{
Please login to merge, or discard this patch.
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -131,14 +131,14 @@  discard block
 block discarded – undo
131 131
 	 */
132 132
 	public function getIsValid()
133 133
 	{
134
-	    return $this->_isValid;
134
+		return $this->_isValid;
135 135
 	}
136 136
 	/**
137 137
 	 * @param bool wether this control is valid.
138 138
 	 */
139 139
 	public function setIsValid($value)
140 140
 	{
141
-	    $this->_isValid=TPropertyValue::ensureBoolean($value);
141
+		$this->_isValid=TPropertyValue::ensureBoolean($value);
142 142
 	}
143 143
 
144 144
 	/**
@@ -288,7 +288,7 @@  discard block
 block discarded – undo
288 288
 	 */
289 289
 	public function getSurroundingTag()
290 290
 	{
291
-    return 'span';
291
+	return 'span';
292 292
 	}
293 293
 
294 294
 	/**
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
 	 */
297 297
 	public function getSurroundingTagID()
298 298
 	{
299
-    return $this->getSpanNeeded() ? $this->getClientID().'_parent' : $this->getClientID();
299
+	return $this->getSpanNeeded() ? $this->getClientID().'_parent' : $this->getClientID();
300 300
 	}
301 301
 
302 302
 	/**
@@ -326,11 +326,11 @@  discard block
 block discarded – undo
326 326
 		}
327 327
 		else
328 328
 			$onclick='';
329
-    if($needspan=$this->getSpanNeeded())
330
-    {
331
-      $writer->addAttribute('id',$this->getSurroundingTagID());
332
-      $writer->renderBeginTag($this->getSurroundingTag());
333
-    }
329
+	if($needspan=$this->getSpanNeeded())
330
+	{
331
+	  $writer->addAttribute('id',$this->getSurroundingTagID());
332
+	  $writer->renderBeginTag($this->getSurroundingTag());
333
+	}
334 334
 		$clientID=$this->getClientID();
335 335
 		if(($text=$this->getText())!=='')
336 336
 		{
@@ -416,15 +416,15 @@  discard block
 block discarded – undo
416 416
 		$this->setViewState('EnableClientScript',TPropertyValue::ensureBoolean($value),true);
417 417
 	}
418 418
 
419
-    /**
420
-     * Check if we need a span tag to surround this control. The span tag will be created if
421
-     * the Text property is set for this control.
422
-     *
423
-     * @return bool wether this control needs a surrounding span tag
424
-     */
425
-    protected function getSpanNeeded() {
426
-        return $this->getText()!=='';
427
-    }
419
+	/**
420
+	 * Check if we need a span tag to surround this control. The span tag will be created if
421
+	 * the Text property is set for this control.
422
+	 *
423
+	 * @return bool wether this control needs a surrounding span tag
424
+	 */
425
+	protected function getSpanNeeded() {
426
+		return $this->getText()!=='';
427
+	}
428 428
 
429 429
 	/**
430 430
 	 * Renders a label beside the checkbox.
Please login to merge, or discard this patch.
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -323,8 +323,7 @@  discard block
 block discarded – undo
323 323
 				$writer->addAttributes($attributes);
324 324
 			if($value!==null)
325 325
 				$attributes->add('value',$value);
326
-		}
327
-		else
326
+		} else
328 327
 			$onclick='';
329 328
     if($needspan=$this->getSpanNeeded())
330 329
     {
@@ -338,14 +337,12 @@  discard block
 block discarded – undo
338 337
 			{
339 338
 				$this->renderLabel($writer,$clientID,$text);
340 339
 				$this->renderInputTag($writer,$clientID,$onclick);
341
-			}
342
-			else
340
+			} else
343 341
 			{
344 342
 				$this->renderInputTag($writer,$clientID,$onclick);
345 343
 				$this->renderLabel($writer,$clientID,$text);
346 344
 			}
347
-		}
348
-		else
345
+		} else
349 346
 			$this->renderInputTag($writer,$clientID,$onclick);
350 347
 		if($needspan)
351 348
 			$writer->renderEndTag();
Please login to merge, or discard this patch.
Spacing   +52 added lines, -52 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 	 * @param array the input data collection
63 63
 	 * @return boolean whether the data of the control has been changed
64 64
 	 */
65
-	public function loadPostData($key,$values)
65
+	public function loadPostData($key, $values)
66 66
 	{
67 67
 		$checked=$this->getChecked();
68 68
 		if($newChecked=isset($values[$key]))
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 	 */
92 92
 	public function onCheckedChanged($param)
93 93
 	{
94
-		$this->raiseEvent('OnCheckedChanged',$this,$param);
94
+		$this->raiseEvent('OnCheckedChanged', $this, $param);
95 95
 	}
96 96
 
97 97
 	/**
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
 	 */
151 151
 	public function getText()
152 152
 	{
153
-		return $this->getViewState('Text','');
153
+		return $this->getViewState('Text', '');
154 154
 	}
155 155
 
156 156
 	/**
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
 	 */
160 160
 	public function setText($value)
161 161
 	{
162
-		$this->setViewState('Text',$value,'');
162
+		$this->setViewState('Text', $value, '');
163 163
 	}
164 164
 
165 165
 	/**
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
 	 */
168 168
 	public function getValue()
169 169
 	{
170
-		return $this->getViewState('Value','');
170
+		return $this->getViewState('Value', '');
171 171
 	}
172 172
 
173 173
 	/**
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
 	 */
176 176
 	public function setValue($value)
177 177
 	{
178
-		$this->setViewState('Value',TPropertyValue::ensureString($value),'');
178
+		$this->setViewState('Value', TPropertyValue::ensureString($value), '');
179 179
 	}
180 180
 
181 181
 	/**
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
 	 */
184 184
 	public function getTextAlign()
185 185
 	{
186
-		return $this->getViewState('TextAlign',TTextAlign::Right);
186
+		return $this->getViewState('TextAlign', TTextAlign::Right);
187 187
 	}
188 188
 
189 189
 	/**
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
 	 */
192 192
 	public function setTextAlign($value)
193 193
 	{
194
-		$this->setViewState('TextAlign',TPropertyValue::ensureEnum($value,'Prado\\Web\\UI\\WebControls\\TTextAlign'),TTextAlign::Right);
194
+		$this->setViewState('TextAlign', TPropertyValue::ensureEnum($value, 'Prado\\Web\\UI\\WebControls\\TTextAlign'), TTextAlign::Right);
195 195
 	}
196 196
 
197 197
 	/**
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
 	 */
200 200
 	public function getChecked()
201 201
 	{
202
-		return $this->getViewState('Checked',false);
202
+		return $this->getViewState('Checked', false);
203 203
 	}
204 204
 
205 205
 	/**
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
 	 */
209 209
 	public function setChecked($value)
210 210
 	{
211
-		$this->setViewState('Checked',TPropertyValue::ensureBoolean($value),false);
211
+		$this->setViewState('Checked', TPropertyValue::ensureBoolean($value), false);
212 212
 	}
213 213
 
214 214
 	/**
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
 	 */
243 243
 	public function getAutoPostBack()
244 244
 	{
245
-		return $this->getViewState('AutoPostBack',false);
245
+		return $this->getViewState('AutoPostBack', false);
246 246
 	}
247 247
 
248 248
 	/**
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
 	 */
252 252
 	public function setAutoPostBack($value)
253 253
 	{
254
-		$this->setViewState('AutoPostBack',TPropertyValue::ensureBoolean($value),false);
254
+		$this->setViewState('AutoPostBack', TPropertyValue::ensureBoolean($value), false);
255 255
 	}
256 256
 
257 257
 	/**
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
259 259
 	 */
260 260
 	public function getCausesValidation()
261 261
 	{
262
-		return $this->getViewState('CausesValidation',true);
262
+		return $this->getViewState('CausesValidation', true);
263 263
 	}
264 264
 
265 265
 	/**
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
 	 */
269 269
 	public function setCausesValidation($value)
270 270
 	{
271
-		$this->setViewState('CausesValidation',TPropertyValue::ensureBoolean($value),true);
271
+		$this->setViewState('CausesValidation', TPropertyValue::ensureBoolean($value), true);
272 272
 	}
273 273
 
274 274
 	/**
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
 	 */
277 277
 	public function getValidationGroup()
278 278
 	{
279
-		return $this->getViewState('ValidationGroup','');
279
+		return $this->getViewState('ValidationGroup', '');
280 280
 	}
281 281
 
282 282
 	/**
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
 	 */
285 285
 	public function setValidationGroup($value)
286 286
 	{
287
-		$this->setViewState('ValidationGroup',$value,'');
287
+		$this->setViewState('ValidationGroup', $value, '');
288 288
 	}
289 289
 
290 290
 	/**
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
 		if($this->getHasStyle())
316 316
 			$this->getStyle()->addAttributesToRender($writer);
317 317
 		if(($tooltip=$this->getToolTip())!=='')
318
-			$writer->addAttribute('title',$tooltip);
318
+			$writer->addAttribute('title', $tooltip);
319 319
 		if($this->getHasAttributes())
320 320
 		{
321 321
 			$attributes=$this->getAttributes();
@@ -326,13 +326,13 @@  discard block
 block discarded – undo
326 326
 			if($attributes->getCount())
327 327
 				$writer->addAttributes($attributes);
328 328
 			if($value!==null)
329
-				$attributes->add('value',$value);
329
+				$attributes->add('value', $value);
330 330
 		}
331 331
 		else
332 332
 			$onclick='';
333 333
     if($needspan=$this->getSpanNeeded())
334 334
     {
335
-      $writer->addAttribute('id',$this->getSurroundingTagID());
335
+      $writer->addAttribute('id', $this->getSurroundingTagID());
336 336
       $writer->renderBeginTag($this->getSurroundingTag());
337 337
     }
338 338
 		$clientID=$this->getClientID();
@@ -340,17 +340,17 @@  discard block
 block discarded – undo
340 340
 		{
341 341
 			if($this->getTextAlign()===TTextAlign::Left)
342 342
 			{
343
-				$this->renderLabel($writer,$clientID,$text);
344
-				$this->renderInputTag($writer,$clientID,$onclick);
343
+				$this->renderLabel($writer, $clientID, $text);
344
+				$this->renderInputTag($writer, $clientID, $onclick);
345 345
 			}
346 346
 			else
347 347
 			{
348
-				$this->renderInputTag($writer,$clientID,$onclick);
349
-				$this->renderLabel($writer,$clientID,$text);
348
+				$this->renderInputTag($writer, $clientID, $onclick);
349
+				$this->renderLabel($writer, $clientID, $text);
350 350
 			}
351 351
 		}
352 352
 		else
353
-			$this->renderInputTag($writer,$clientID,$onclick);
353
+			$this->renderInputTag($writer, $clientID, $onclick);
354 354
 		if($needspan)
355 355
 			$writer->renderEndTag();
356 356
 	}
@@ -360,12 +360,12 @@  discard block
 block discarded – undo
360 360
 	 */
361 361
 	public function getLabelAttributes()
362 362
 	{
363
-		if($attributes=$this->getViewState('LabelAttributes',null))
363
+		if($attributes=$this->getViewState('LabelAttributes', null))
364 364
 			return $attributes;
365 365
 		else
366 366
 		{
367 367
 			$attributes=new TAttributeCollection;
368
-			$this->setViewState('LabelAttributes',$attributes,null);
368
+			$this->setViewState('LabelAttributes', $attributes, null);
369 369
 			return $attributes;
370 370
 		}
371 371
 	}
@@ -375,12 +375,12 @@  discard block
 block discarded – undo
375 375
 	 */
376 376
 	public function getInputAttributes()
377 377
 	{
378
-		if($attributes=$this->getViewState('InputAttributes',null))
378
+		if($attributes=$this->getViewState('InputAttributes', null))
379 379
 			return $attributes;
380 380
 		else
381 381
 		{
382 382
 			$attributes=new TAttributeCollection;
383
-			$this->setViewState('InputAttributes',$attributes,null);
383
+			$this->setViewState('InputAttributes', $attributes, null);
384 384
 			return $attributes;
385 385
 		}
386 386
 	}
@@ -394,7 +394,7 @@  discard block
 block discarded – undo
394 394
 			return $value;
395 395
 		else
396 396
 		{
397
-			$attributes=$this->getViewState('InputAttributes',null);
397
+			$attributes=$this->getViewState('InputAttributes', null);
398 398
 			if($attributes && $attributes->contains('value'))
399 399
 				return $attributes->itemAt('value');
400 400
 			else if($this->hasAttribute('value'))
@@ -409,7 +409,7 @@  discard block
 block discarded – undo
409 409
 	 */
410 410
 	public function getEnableClientScript()
411 411
 	{
412
-		return $this->getViewState('EnableClientScript',true);
412
+		return $this->getViewState('EnableClientScript', true);
413 413
 	}
414 414
 
415 415
 	/**
@@ -417,7 +417,7 @@  discard block
 block discarded – undo
417 417
 	 */
418 418
 	public function setEnableClientScript($value)
419 419
 	{
420
-		$this->setViewState('EnableClientScript',TPropertyValue::ensureBoolean($value),true);
420
+		$this->setViewState('EnableClientScript', TPropertyValue::ensureBoolean($value), true);
421 421
 	}
422 422
 
423 423
     /**
@@ -436,10 +436,10 @@  discard block
 block discarded – undo
436 436
 	 * @param string checkbox id
437 437
 	 * @param string label text
438 438
 	 */
439
-	protected function renderLabel($writer,$clientID,$text)
439
+	protected function renderLabel($writer, $clientID, $text)
440 440
 	{
441
-		$writer->addAttribute('for',$clientID);
442
-		if($attributes=$this->getViewState('LabelAttributes',null))
441
+		$writer->addAttribute('for', $clientID);
442
+		if($attributes=$this->getViewState('LabelAttributes', null))
443 443
 			$writer->addAttributes($attributes);
444 444
 		$writer->renderBeginTag('label');
445 445
 		$writer->write($text);
@@ -452,21 +452,21 @@  discard block
 block discarded – undo
452 452
 	 * @param string checkbox id
453 453
 	 * @param string onclick js
454 454
 	 */
455
-	protected function renderInputTag($writer,$clientID,$onclick)
455
+	protected function renderInputTag($writer, $clientID, $onclick)
456 456
 	{
457 457
 		if($clientID!=='')
458
-			$writer->addAttribute('id',$clientID);
459
-		$writer->addAttribute('type','checkbox');
458
+			$writer->addAttribute('id', $clientID);
459
+		$writer->addAttribute('type', 'checkbox');
460 460
 		if(($value=$this->getValueAttribute())!=='')
461
-			$writer->addAttribute('value',$value);
461
+			$writer->addAttribute('value', $value);
462 462
 		if(!empty($onclick))
463
-			$writer->addAttribute('onclick',$onclick);
463
+			$writer->addAttribute('onclick', $onclick);
464 464
 		if(($uniqueID=$this->getUniqueID())!=='')
465
-			$writer->addAttribute('name',$uniqueID);
465
+			$writer->addAttribute('name', $uniqueID);
466 466
 		if($this->getChecked())
467
-			$writer->addAttribute('checked','checked');
467
+			$writer->addAttribute('checked', 'checked');
468 468
 		if(!$this->getEnabled(true))
469
-			$writer->addAttribute('disabled','disabled');
469
+			$writer->addAttribute('disabled', 'disabled');
470 470
 
471 471
 		$page=$this->getPage();
472 472
 		if($this->getEnabled(true)
@@ -478,10 +478,10 @@  discard block
 block discarded – undo
478 478
 		}
479 479
 
480 480
 		if(($accesskey=$this->getAccessKey())!=='')
481
-			$writer->addAttribute('accesskey',$accesskey);
482
-		if(($tabindex=$this->getTabIndex())>0)
483
-			$writer->addAttribute('tabindex',"$tabindex");
484
-		if($attributes=$this->getViewState('InputAttributes',null))
481
+			$writer->addAttribute('accesskey', $accesskey);
482
+		if(($tabindex=$this->getTabIndex()) > 0)
483
+			$writer->addAttribute('tabindex', "$tabindex");
484
+		if($attributes=$this->getViewState('InputAttributes', null))
485 485
 			$writer->addAttributes($attributes);
486 486
 		$writer->renderBeginTag('input');
487 487
 		$writer->renderEndTag();
@@ -492,8 +492,8 @@  discard block
 block discarded – undo
492 492
 	 */
493 493
 	protected function renderClientControlScript($writer)
494 494
 	{
495
-		$cs = $this->getPage()->getClientScript();
496
-		$cs->registerPostBackControl($this->getClientClassName(),$this->getPostBackOptions());
495
+		$cs=$this->getPage()->getClientScript();
496
+		$cs->registerPostBackControl($this->getClientClassName(), $this->getPostBackOptions());
497 497
 	}
498 498
 
499 499
 	/**
@@ -512,10 +512,10 @@  discard block
 block discarded – undo
512 512
 	 */
513 513
 	protected function getPostBackOptions()
514 514
 	{
515
-		$options['ID'] = $this->getClientID();
516
-		$options['ValidationGroup'] = $this->getValidationGroup();
517
-		$options['CausesValidation'] = $this->getCausesValidation();
518
-		$options['EventTarget'] = $this->getUniqueID();
515
+		$options['ID']=$this->getClientID();
516
+		$options['ValidationGroup']=$this->getValidationGroup();
517
+		$options['CausesValidation']=$this->getCausesValidation();
518
+		$options['EventTarget']=$this->getUniqueID();
519 519
 		return $options;
520 520
 	}
521 521
 }
522 522
\ No newline at end of file
Please login to merge, or discard this patch.