Completed
Push — prado4-sauce ( 31ba42...77d75b )
by Fabio
16:20 queued 08:27
created
framework/Web/UI/WebControls/TFlushOutput.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 	public function __construct()
46 46
 	{
47 47
 		parent::__construct();
48
-		$this->EnableViewState = false;
48
+		$this->EnableViewState=false;
49 49
 	}
50 50
 
51 51
 	/**
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 	 */
62 62
 	public function setContinueBuffering($value)
63 63
 	{
64
-		$this->_continueBuffering = TPropertyValue::ensureBoolean($value);
64
+		$this->_continueBuffering=TPropertyValue::ensureBoolean($value);
65 65
 	}
66 66
 
67 67
 	/**
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 //$writer->write('<!-- flush -->');
74 74
 		// ajax responses can't be parsed by the client side before loaded and returned completely,
75 75
 		// so don't bother with flushing output somewhere mid-page if refreshing in a callback
76
-		if (!$this->Page->IsCallback)
76
+		if(!$this->Page->IsCallback)
77 77
 		{
78 78
 			$this->Page->flushWriter();
79 79
 //			$this->Application->flushOutput($this->ContinueBuffering);
Please login to merge, or discard this patch.
framework/Web/UI/WebControls/TDropDownListColumn.php 1 patch
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 		parent::loadState($state);
78 78
 		$this->_stateLoaded=true;
79 79
 		if(!$this->_dataBound)
80
-			$this->_listControl->getItems()->loadState($this->getViewState('Items',null));
80
+			$this->_listControl->getItems()->loadState($this->getViewState('Items', null));
81 81
 	}
82 82
 
83 83
 	/**
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 	 */
87 87
 	public function saveState()
88 88
 	{
89
-		$this->setViewState('Items',$this->_listControl->getItems()->saveState(),null);
89
+		$this->setViewState('Items', $this->_listControl->getItems()->saveState(), null);
90 90
 		return parent::saveState();
91 91
 	}
92 92
 
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
 	 */
112 112
 	public function getDataTextField()
113 113
 	{
114
-		return $this->getViewState('DataTextField','');
114
+		return $this->getViewState('DataTextField', '');
115 115
 	}
116 116
 
117 117
 	/**
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
 	 */
123 123
 	public function setDataTextField($value)
124 124
 	{
125
-		$this->setViewState('DataTextField',$value,'');
125
+		$this->setViewState('DataTextField', $value, '');
126 126
 	}
127 127
 
128 128
 	/**
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
 	 */
131 131
 	public function getDataTextFormatString()
132 132
 	{
133
-		return $this->getViewState('DataTextFormatString','');
133
+		return $this->getViewState('DataTextFormatString', '');
134 134
 	}
135 135
 
136 136
 	/**
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
 	 */
139 139
 	public function setDataTextFormatString($value)
140 140
 	{
141
-		$this->setViewState('DataTextFormatString',$value,'');
141
+		$this->setViewState('DataTextFormatString', $value, '');
142 142
 	}
143 143
 
144 144
 	/**
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
 	 */
147 147
 	public function getDataValueField()
148 148
 	{
149
-		return $this->getViewState('DataValueField','');
149
+		return $this->getViewState('DataValueField', '');
150 150
 	}
151 151
 
152 152
 	/**
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 	 */
158 158
 	public function setDataValueField($value)
159 159
 	{
160
-		$this->setViewState('DataValueField',$value,'');
160
+		$this->setViewState('DataValueField', $value, '');
161 161
 	}
162 162
 
163 163
 	/**
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
 	 */
166 166
 	public function getReadOnly()
167 167
 	{
168
-		return $this->getViewState('ReadOnly',false);
168
+		return $this->getViewState('ReadOnly', false);
169 169
 	}
170 170
 
171 171
 	/**
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
 	 */
174 174
 	public function setReadOnly($value)
175 175
 	{
176
-		$this->setViewState('ReadOnly',TPropertyValue::ensureBoolean($value),false);
176
+		$this->setViewState('ReadOnly', TPropertyValue::ensureBoolean($value), false);
177 177
 	}
178 178
 
179 179
 	/**
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
 	 */
198 198
 	public function getListValueField()
199 199
 	{
200
-		return $this->getViewState('ListValueField','');
200
+		return $this->getViewState('ListValueField', '');
201 201
 	}
202 202
 
203 203
 	/**
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
 	 */
206 206
 	public function setListValueField($value)
207 207
 	{
208
-		$this->setViewState('ListValueField',$value,'');
208
+		$this->setViewState('ListValueField', $value, '');
209 209
 	}
210 210
 
211 211
 	/**
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
 	 */
214 214
 	public function getListTextField()
215 215
 	{
216
-		return $this->getViewState('ListTextField','');
216
+		return $this->getViewState('ListTextField', '');
217 217
 	}
218 218
 
219 219
 	/**
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
 	 */
222 222
 	public function setListTextField($value)
223 223
 	{
224
-		$this->setViewState('ListTextField',$value,'');
224
+		$this->setViewState('ListTextField', $value, '');
225 225
 	}
226 226
 
227 227
 	/**
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
 	 */
230 230
 	public function getListTextFormatString()
231 231
 	{
232
-		return $this->getViewState('ListTextFormatString','');
232
+		return $this->getViewState('ListTextFormatString', '');
233 233
 	}
234 234
 
235 235
 	/**
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
 	 */
238 238
 	public function setListTextFormatString($value)
239 239
 	{
240
-		$this->setViewState('ListTextFormatString',$value,'');
240
+		$this->setViewState('ListTextFormatString', $value, '');
241 241
 	}
242 242
 
243 243
 	/**
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
 	 * @param integer the index to the Columns property that the cell resides in.
252 252
 	 * @param string the type of cell (Header,Footer,Item,AlternatingItem,EditItem,SelectedItem)
253 253
 	 */
254
-	public function initializeCell($cell,$columnIndex,$itemType)
254
+	public function initializeCell($cell, $columnIndex, $itemType)
255 255
 	{
256 256
 		if(!$this->_dataBound && $this->_listControl->getDataSource()!==null)
257 257
 		{
@@ -268,21 +268,21 @@  discard block
 block discarded – undo
268 268
 				{
269 269
 					$listControl=clone $this->_listControl;
270 270
 					$cell->getControls()->add($listControl);
271
-					$cell->registerObject('DropDownList',$listControl);
271
+					$cell->registerObject('DropDownList', $listControl);
272 272
 					$control=$listControl;
273 273
 				}
274 274
 				else
275 275
 					$control=$cell;
276
-				$control->attachEventHandler('OnDataBinding',array($this,'dataBindColumn'));
276
+				$control->attachEventHandler('OnDataBinding', array($this, 'dataBindColumn'));
277 277
 				break;
278 278
 			case TListItemType::Item:
279 279
 			case TListItemType::AlternatingItem:
280 280
 			case TListItemType::SelectedItem:
281 281
 				if($this->getDataTextField()!=='' || $this->getDataValueField()!=='')
282
-					$cell->attachEventHandler('OnDataBinding',array($this,'dataBindColumn'));
282
+					$cell->attachEventHandler('OnDataBinding', array($this, 'dataBindColumn'));
283 283
 				break;
284 284
 			default:
285
-				parent::initializeCell($cell,$columnIndex,$itemType);
285
+				parent::initializeCell($cell, $columnIndex, $itemType);
286 286
 				break;
287 287
 		}
288 288
 	}
@@ -292,21 +292,21 @@  discard block
 block discarded – undo
292 292
 	 * This method is invoked when datagrid performs databinding.
293 293
 	 * It populates the content of the cell with the relevant data from data source.
294 294
 	 */
295
-	public function dataBindColumn($sender,$param)
295
+	public function dataBindColumn($sender, $param)
296 296
 	{
297 297
 		$item=$sender->getNamingContainer();
298 298
 		$data=$item->getData();
299 299
 		if(($valueField=$this->getDataValueField())!=='')
300
-			$value=$this->getDataFieldValue($data,$valueField);
300
+			$value=$this->getDataFieldValue($data, $valueField);
301 301
 		else
302 302
 			$value='';
303 303
 		if(($textField=$this->getDataTextField())!=='')
304 304
 		{
305
-			$text=$this->getDataFieldValue($data,$textField);
305
+			$text=$this->getDataFieldValue($data, $textField);
306 306
 			if($valueField==='')
307 307
 				$value=$text;
308 308
 			$formatString=$this->getDataTextFormatString();
309
-			$text=$this->formatDataValue($formatString,$text);
309
+			$text=$this->formatDataValue($formatString, $text);
310 310
 		}
311 311
 		else
312 312
 			$text=$value;
Please login to merge, or discard this patch.
framework/Web/UI/WebControls/TDropDownList.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 	 */
53 53
 	protected function addAttributesToRender($writer)
54 54
 	{
55
-		$writer->addAttribute('name',$this->getUniqueID());
55
+		$writer->addAttribute('name', $this->getUniqueID());
56 56
 		parent::addAttributesToRender($writer);
57 57
 	}
58 58
 
@@ -73,15 +73,15 @@  discard block
 block discarded – undo
73 73
 	 * @param array the input data collection
74 74
 	 * @return boolean whether the data of the component has been changed
75 75
 	 */
76
-	public function loadPostData($key,$values)
76
+	public function loadPostData($key, $values)
77 77
 	{
78 78
 		if(!$this->getEnabled(true))
79 79
 			return false;
80 80
 		$this->ensureDataBound();
81
-		$selection=isset($values[$key])?$values[$key]:null;
81
+		$selection=isset($values[$key]) ? $values[$key] : null;
82 82
 		if($selection!==null)
83 83
 		{
84
-			$index=$this->getItems()->findIndexByValue($selection,false);
84
+			$index=$this->getItems()->findIndexByValue($selection, false);
85 85
 			if($this->getSelectedIndex()!==$index)
86 86
 			{
87 87
 				$this->setSelectedIndex($index);
Please login to merge, or discard this patch.
framework/Web/UI/WebControls/TFileUpload.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -76,11 +76,11 @@  discard block
 block discarded – undo
76 76
 	{
77 77
 		$this->getPage()->ensureRenderInForm($this);
78 78
 		parent::addAttributesToRender($writer);
79
-		$writer->addAttribute('type','file');
80
-		$writer->addAttribute('name',$this->getUniqueID());
79
+		$writer->addAttribute('type', 'file');
80
+		$writer->addAttribute('name', $this->getUniqueID());
81 81
 		$isEnabled=$this->getEnabled(true);
82 82
 		if(!$isEnabled && $this->getEnabled())  // in this case parent will not render 'disabled'
83
-			$writer->addAttribute('disabled','disabled');
83
+			$writer->addAttribute('disabled', 'disabled');
84 84
 	}
85 85
 
86 86
 	/**
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 		parent::onPreRender($param);
94 94
 		if(($form=$this->getPage()->getForm())!==null)
95 95
 			$form->setEnctype('multipart/form-data');
96
-		$this->getPage()->getClientScript()->registerHiddenField('MAX_FILE_SIZE',$this->getMaxFileSize());
96
+		$this->getPage()->getClientScript()->registerHiddenField('MAX_FILE_SIZE', $this->getMaxFileSize());
97 97
 		if($this->getEnabled(true))
98 98
 			$this->getPage()->registerRequiresPostData($this);
99 99
 	}
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
 	 */
105 105
 	public function getMaxFileSize()
106 106
 	{
107
-		return $this->getViewState('MaxFileSize',self::MAX_FILE_SIZE);
107
+		return $this->getViewState('MaxFileSize', self::MAX_FILE_SIZE);
108 108
 	}
109 109
 
110 110
 	/**
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 	 */
118 118
 	public function setMaxFileSize($size)
119 119
 	{
120
-		$this->setViewState('MaxFileSize',TPropertyValue::ensureInteger($size),self::MAX_FILE_SIZE);
120
+		$this->setViewState('MaxFileSize', TPropertyValue::ensureInteger($size), self::MAX_FILE_SIZE);
121 121
 	}
122 122
 
123 123
 	/**
@@ -179,14 +179,14 @@  discard block
 block discarded – undo
179 179
 	 * If true, you will not be able to save the uploaded file again.
180 180
 	 * @return boolean true if the file saving is successful
181 181
 	 */
182
-	public function saveAs($fileName,$deleteTempFile=true)
182
+	public function saveAs($fileName, $deleteTempFile=true)
183 183
 	{
184 184
 		if($this->_errorCode===UPLOAD_ERR_OK)
185 185
 		{
186 186
 			if($deleteTempFile)
187
-				return move_uploaded_file($this->_localName,$fileName);
187
+				return move_uploaded_file($this->_localName, $fileName);
188 188
 			else if(is_uploaded_file($this->_localName))
189
-				return file_put_contents($fileName,file_get_contents($this->_localName))!==false;
189
+				return file_put_contents($fileName, file_get_contents($this->_localName))!==false;
190 190
 			else
191 191
 				return false;
192 192
 		}
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
 	 * @param array the input data collection
202 202
 	 * @return boolean whether the data of the control has been changed
203 203
 	 */
204
-	public function loadPostData($key,$values)
204
+	public function loadPostData($key, $values)
205 205
 	{
206 206
 		if(isset($_FILES[$key]))
207 207
 		{
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
 	 */
236 236
 	public function onFileUpload($param)
237 237
 	{
238
-		$this->raiseEvent('OnFileUpload',$this,$param);
238
+		$this->raiseEvent('OnFileUpload', $this, $param);
239 239
 	}
240 240
 
241 241
 	/**
Please login to merge, or discard this patch.
framework/Web/UI/WebControls/TLiteral.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 	 */
37 37
 	public function getText()
38 38
 	{
39
-		return $this->getViewState('Text','');
39
+		return $this->getViewState('Text', '');
40 40
 	}
41 41
 
42 42
 	/**
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 	 */
46 46
 	public function setText($value)
47 47
 	{
48
-		$this->setViewState('Text',TPropertyValue::ensureString($value),'');
48
+		$this->setViewState('Text', TPropertyValue::ensureString($value), '');
49 49
 	}
50 50
 
51 51
 	/**
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 	 */
80 80
 	public function getEncode()
81 81
 	{
82
-		return $this->getViewState('Encode',false);
82
+		return $this->getViewState('Encode', false);
83 83
 	}
84 84
 
85 85
 	/**
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 	 */
88 88
 	public function setEncode($value)
89 89
 	{
90
-		$this->setViewState('Encode',TPropertyValue::ensureBoolean($value),false);
90
+		$this->setViewState('Encode', TPropertyValue::ensureBoolean($value), false);
91 91
 	}
92 92
 
93 93
 	/**
Please login to merge, or discard this patch.
framework/Web/UI/WebControls/TRegularExpressionValidator.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 	 */
63 63
 	public function getRegularExpression()
64 64
 	{
65
-		return $this->getViewState('RegularExpression','');
65
+		return $this->getViewState('RegularExpression', '');
66 66
 	}
67 67
 
68 68
 	/**
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 	 */
71 71
 	public function setRegularExpression($value)
72 72
 	{
73
-		$this->setViewState('RegularExpression',$value,'');
73
+		$this->setViewState('RegularExpression', $value, '');
74 74
 	}
75 75
 
76 76
 	/**
@@ -84,10 +84,10 @@  discard block
 block discarded – undo
84 84
 	{
85 85
 		if(($value=$this->getValidationValue($this->getValidationTarget()))==='')
86 86
 			return true;
87
-		if(($expression=addcslashes($this->getRegularExpression(),"/"))!=='')
87
+		if(($expression=addcslashes($this->getRegularExpression(), "/"))!=='')
88 88
 		{
89
-			$mods = $this->getPatternModifiers();
90
-			return preg_match("/^$expression\$/{$mods}",$value);
89
+			$mods=$this->getPatternModifiers();
90
+			return preg_match("/^$expression\$/{$mods}", $value);
91 91
 		}
92 92
 		else
93 93
 			return true;
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
 	 */
134 134
 	protected function getClientScriptOptions()
135 135
 	{
136
-		$options = parent::getClientScriptOptions();
136
+		$options=parent::getClientScriptOptions();
137 137
 		$options['ValidationExpression']=$this->getRegularExpression();
138 138
 		$options['PatternModifiers']=$this->getClientSidePatternModifiers();
139 139
 		return $options;
Please login to merge, or discard this patch.
framework/Web/UI/WebControls/TCaptchaValidator.php 1 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.
framework/Web/UI/TSessionPageStatePersister.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 	 */
80 80
 	public function setHistorySize($value)
81 81
 	{
82
-		if(($value=TPropertyValue::ensureInteger($value))>0)
82
+		if(($value=TPropertyValue::ensureInteger($value)) > 0)
83 83
 			$this->_historySize=$value;
84 84
 		else
85 85
 			throw new TInvalidDataValueException('sessionpagestatepersister_historysize_invalid');
@@ -93,19 +93,19 @@  discard block
 block discarded – undo
93 93
 		$session=$this->_page->getSession();
94 94
 		$session->open();
95 95
 		$data=serialize($state);
96
-		$timestamp=(string)microtime(true);
96
+		$timestamp=(string) microtime(true);
97 97
 		$key=self::STATE_SESSION_KEY.$timestamp;
98
-		$session->add($key,$data);
98
+		$session->add($key, $data);
99 99
 		if(($queue=$session->itemAt(self::QUEUE_SESSION_KEY))===null)
100 100
 			$queue=array();
101 101
 		$queue[]=$key;
102
-		if(count($queue)>$this->getHistorySize())
102
+		if(count($queue) > $this->getHistorySize())
103 103
 		{
104 104
 			$expiredKey=array_shift($queue);
105 105
 			$session->remove($expiredKey);
106 106
 		}
107
-		$session->add(self::QUEUE_SESSION_KEY,$queue);
108
-		$this->_page->setClientState(TPageStateFormatter::serialize($this->_page,$timestamp));
107
+		$session->add(self::QUEUE_SESSION_KEY, $queue);
108
+		$this->_page->setClientState(TPageStateFormatter::serialize($this->_page, $timestamp));
109 109
 	}
110 110
 
111 111
 	/**
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
 	 */
116 116
 	public function load()
117 117
 	{
118
-		if(($timestamp=TPageStateFormatter::unserialize($this->_page,$this->_page->getRequestClientState()))!==null)
118
+		if(($timestamp=TPageStateFormatter::unserialize($this->_page, $this->_page->getRequestClientState()))!==null)
119 119
 		{
120 120
 			$session=$this->_page->getSession();
121 121
 			$session->open();
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
 			if(($data=$session->itemAt($key))!==null)
124 124
 				return unserialize($data);
125 125
 		}
126
-		throw new THttpException(400,'sessionpagestatepersister_pagestate_corrupted');
126
+		throw new THttpException(400, 'sessionpagestatepersister_pagestate_corrupted');
127 127
 	}
128 128
 }
129 129
 
Please login to merge, or discard this patch.
framework/Web/UI/TControlAdapter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@
 block discarded – undo
48 48
 	 */
49 49
 	public function getPage()
50 50
 	{
51
-		return $this->_control?$this->_control->getPage():null;
51
+		return $this->_control ? $this->_control->getPage() : null;
52 52
 	}
53 53
 
54 54
 	/**
Please login to merge, or discard this patch.