Passed
Branch php-cs-fixer (b9836a)
by Fabio
15:58
created
framework/Web/UI/ActiveControls/TActivePanel.php 1 patch
Braces   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -80,10 +80,10 @@
 block discarded – undo
80 80
 		if($this->getHasPreRendered())
81 81
 		{
82 82
 			parent::render($writer);
83
-			if($this->getActiveControl()->canUpdateClientSide())
84
-				$this->getPage()->getCallbackClient()->replaceContent($this, $writer);
85
-		}
86
-		else
83
+			if($this->getActiveControl()->canUpdateClientSide()) {
84
+							$this->getPage()->getCallbackClient()->replaceContent($this, $writer);
85
+			}
86
+		} else
87 87
 		{
88 88
 			$this->getPage()->getAdapter()->registerControlToRender($this, $writer);
89 89
 			if ($this->getHasControls())
Please login to merge, or discard this patch.
framework/Web/UI/ActiveControls/TActiveDataGridPager.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -31,8 +31,9 @@
 block discarded – undo
31 31
 	 */
32 32
 	public function getClientSide()
33 33
 	{
34
-		if($this->_callbackoptions === null)
35
-			$this->_callbackoptions = new TCallbackOptions;
34
+		if($this->_callbackoptions === null) {
35
+					$this->_callbackoptions = new TCallbackOptions;
36
+		}
36 37
 		return $this->_callbackoptions->getClientSide();
37 38
 	}
38 39
 }
39 40
\ No newline at end of file
Please login to merge, or discard this patch.
framework/Web/UI/ActiveControls/TTriggeredCallback.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -50,8 +50,9 @@
 block discarded – undo
50 50
 	protected function getTargetControl()
51 51
 	{
52 52
 		$id = $this->getControlID();
53
-		if(($control = $this->findControl($id)) instanceof TControl)
54
-			return $control->getClientID();
53
+		if(($control = $this->findControl($id)) instanceof TControl) {
54
+					return $control->getClientID();
55
+		}
55 56
 		if($id === '')
56 57
 		{
57 58
 			throw new TConfigurationException(
Please login to merge, or discard this patch.
framework/Web/UI/ActiveControls/TActiveHyperLinkColumn.php 1 patch
Braces   +15 added lines, -16 removed lines patch added patch discarded remove patch
@@ -51,8 +51,7 @@  discard block
 block discarded – undo
51 51
 				$control->setData($text);
52 52
 			}
53 53
 			$cell->getControls()->add($control);
54
-		}
55
-		elseif($this->getAllowSorting())
54
+		} elseif($this->getAllowSorting())
56 55
 		{
57 56
 			$sortExpression = $this->getSortExpression();
58 57
 			if(($url = $this->getHeaderImageUrl()) !== '')
@@ -61,12 +60,12 @@  discard block
 block discarded – undo
61 60
 				$button->setImageUrl($url);
62 61
 				$button->setCommandName(TDataGrid::CMD_SORT);
63 62
 				$button->setCommandParameter($sortExpression);
64
-				if($text !== '')
65
-					$button->setAlternateText($text);
63
+				if($text !== '') {
64
+									$button->setAlternateText($text);
65
+				}
66 66
 				$button->setCausesValidation(false);
67 67
 				$cell->getControls()->add($button);
68
-			}
69
-			elseif($text !== '')
68
+			} elseif($text !== '')
70 69
 			{
71 70
 				$button = new TActiveLinkButton;
72 71
 				$button->setText($text);
@@ -74,24 +73,24 @@  discard block
 block discarded – undo
74 73
 				$button->setCommandParameter($sortExpression);
75 74
 				$button->setCausesValidation(false);
76 75
 				$cell->getControls()->add($button);
76
+			} else {
77
+							$cell->setText(' ');
77 78
 			}
78
-			else
79
-				$cell->setText(' ');
80
-		}
81
-		else
79
+		} else
82 80
 		{
83 81
 			if(($url = $this->getHeaderImageUrl()) !== '')
84 82
 			{
85 83
 				$image = new TActiveImage;
86 84
 				$image->setImageUrl($url);
87
-				if($text !== '')
88
-					$image->setAlternateText($text);
85
+				if($text !== '') {
86
+									$image->setAlternateText($text);
87
+				}
89 88
 				$cell->getControls()->add($image);
89
+			} elseif($text !== '') {
90
+							$cell->setText($text);
91
+			} else {
92
+							$cell->setText(' ');
90 93
 			}
91
-			elseif($text !== '')
92
-				$cell->setText($text);
93
-			else
94
-				$cell->setText(' ');
95 94
 		}
96 95
 	}
97 96
 }
98 97
\ No newline at end of file
Please login to merge, or discard this patch.
framework/Web/UI/ActiveControls/TActiveTableCell.php 1 patch
Braces   +18 added lines, -12 removed lines patch added patch discarded remove patch
@@ -129,8 +129,9 @@  discard block
 block discarded – undo
129 129
 	{
130 130
 		parent::addAttributesToRender($writer);
131 131
 		$writer->addAttribute('id', $this->getClientID());
132
-		if ($this->hasEventHandler('OnCellSelected'))
133
-			$this->getActiveControl()->registerCallbackClientScript($this->getClientClassName(), $this->getPostBackOptions());
132
+		if ($this->hasEventHandler('OnCellSelected')) {
133
+					$this->getActiveControl()->registerCallbackClientScript($this->getClientClassName(), $this->getPostBackOptions());
134
+		}
134 135
 	}
135 136
 
136 137
 	/**
@@ -145,17 +146,18 @@  discard block
 block discarded – undo
145 146
 		if ($this->getHasPreRendered())
146 147
 		{
147 148
 			parent::render($writer);
148
-			if ($this->getActiveControl()->canUpdateClientSide())
149
-				$this->getPage()->getCallbackClient()->replaceContent($this, $writer);
150
-		}
151
-		else {
149
+			if ($this->getActiveControl()->canUpdateClientSide()) {
150
+							$this->getPage()->getCallbackClient()->replaceContent($this, $writer);
151
+			}
152
+		} else {
152 153
 			$this->getPage()->getAdapter()->registerControlToRender($this, $writer);
153 154
 			// If we update a TActiveTableCell on callback, we shouldn't update all childs,
154 155
 			// because the whole content will be replaced by the parent.
155 156
 			if ($this->getHasControls())
156 157
 			{
157
-				foreach ($this->findControlsByType('Prado\Web\UI\ActiveControls\IActiveControl', false) as $control)
158
-					$control->getActiveControl()->setEnableUpdate(false);
158
+				foreach ($this->findControlsByType('Prado\Web\UI\ActiveControls\IActiveControl', false) as $control) {
159
+									$control->getActiveControl()->setEnableUpdate(false);
160
+				}
159 161
 			}
160 162
 		}
161 163
 	}
@@ -180,8 +182,9 @@  discard block
 block discarded – undo
180 182
 	 */
181 183
 	public function getCellIndex()
182 184
 	{
183
-		foreach ($this->getRow()->getCells() as $key => $row)
184
-			if ($row == $this) return $key;
185
+		foreach ($this->getRow()->getCells() as $key => $row) {
186
+					if ($row == $this) return $key;
187
+		}
185 188
 		throw new TConfigurationException('tactivetablecell_control_notincollection', get_class($this), $this->getUniqueID());
186 189
 	}
187 190
 
@@ -199,8 +202,11 @@  discard block
 block discarded – undo
199 202
 			{
200 203
 				$row = $row->getParent();
201 204
 			}
202
-			if ($row instanceof TTableRow) $this->_row = $row;
203
-			else throw new TConfigurationException('tactivetablecell_control_outoftable', get_class($this), $this->getUniqueID());
205
+			if ($row instanceof TTableRow) {
206
+				$this->_row = $row;
207
+			} else {
208
+				throw new TConfigurationException('tactivetablecell_control_outoftable', get_class($this), $this->getUniqueID());
209
+			}
204 210
 		}
205 211
 		return $this->_row;
206 212
 	}
Please login to merge, or discard this patch.
framework/Web/UI/ActiveControls/TActiveClientScript.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -51,8 +51,9 @@
 block discarded – undo
51 51
 			{
52 52
 				$cs = $this->getPage()->getClientScript();
53 53
 				$uniqueid = $this->ClientID . '_custom';
54
-				if(!$cs->isScriptFileRegistered($uniqueid))
55
-					$cs->registerScriptFile($uniqueid, $scriptUrl);
54
+				if(!$cs->isScriptFileRegistered($uniqueid)) {
55
+									$cs->registerScriptFile($uniqueid, $scriptUrl);
56
+				}
56 57
 			} else {
57 58
 				$writer->write("<script type=\"text/javascript\" src=\"$scriptUrl\"></script>\n");
58 59
 			}
Please login to merge, or discard this patch.
framework/Web/UI/ActiveControls/TActiveMultiView.php 1 patch
Braces   +11 added lines, -8 removed lines patch added patch discarded remove patch
@@ -70,11 +70,12 @@  discard block
 block discarded – undo
70 70
 	{
71 71
 		if($this->getHasPreRendered()) {
72 72
 			$this->renderMultiView($writer);
73
-			if($this->getActiveControl()->canUpdateClientSide())
74
-				$this->getPage()->getCallbackClient()->replaceContent($this->getContainerID(), $writer);
73
+			if($this->getActiveControl()->canUpdateClientSide()) {
74
+							$this->getPage()->getCallbackClient()->replaceContent($this->getContainerID(), $writer);
75
+			}
76
+		} else {
77
+					$this->getPage()->getAdapter()->registerControlToRender($this, $writer);
75 78
 		}
76
-		else
77
-			$this->getPage()->getAdapter()->registerControlToRender($this, $writer);
78 79
 	}
79 80
 
80 81
 	/**
@@ -97,8 +98,9 @@  discard block
 block discarded – undo
97 98
 	public function setActiveViewIndex($value)
98 99
 	{
99 100
 		parent::setActiveViewIndex($value);
100
-		if($this->getActiveControl()->canUpdateClientSide())
101
-			$this->getPage()->getAdapter()->registerControlToRender($this, $this->getResponse()->createHtmlWriter());
101
+		if($this->getActiveControl()->canUpdateClientSide()) {
102
+					$this->getPage()->getAdapter()->registerControlToRender($this, $this->getResponse()->createHtmlWriter());
103
+		}
102 104
 	}
103 105
 
104 106
 	/**
@@ -108,7 +110,8 @@  discard block
 block discarded – undo
108 110
 	public function setActiveView($value)
109 111
 	{
110 112
 		parent::setActiveView($value);
111
-		if($this->getActiveControl()->canUpdateClientSide())
112
-			$this->getPage()->getAdapter()->registerControlToRender($this, $this->getResponse()->createHtmlWriter());
113
+		if($this->getActiveControl()->canUpdateClientSide()) {
114
+					$this->getPage()->getAdapter()->registerControlToRender($this, $this->getResponse()->createHtmlWriter());
115
+		}
113 116
 	}
114 117
 }
Please login to merge, or discard this patch.
framework/Web/UI/ActiveControls/TBaseActiveCallbackControl.php 1 patch
Braces   +27 added lines, -22 removed lines patch added patch discarded remove patch
@@ -63,11 +63,12 @@  discard block
 block discarded – undo
63 63
 	 */
64 64
 	public function setClientSide($client)
65 65
 	{
66
-		if($this->getOption('ClientSide') === null)
67
-			$this->setOption('ClientSide', $client);
68
-		else
69
-			throw new TConfigurationException(
66
+		if($this->getOption('ClientSide') === null) {
67
+					$this->setOption('ClientSide', $client);
68
+		} else {
69
+					throw new TConfigurationException(
70 70
 				'active_controls_client_side_exists', $this->getControl()->getID());
71
+		}
71 72
 	}
72 73
 
73 74
 	/**
@@ -114,20 +115,21 @@  discard block
 block discarded – undo
114 115
 			{
115 116
 				$control = $this->getControl()->getSubProperty(substr($id, 0, $pos));
116 117
 				$newid = substr($id, $pos + 1);
117
-				if ($control !== null)
118
-					$control = $control->$newid;
119
-			}
120
-			else
118
+				if ($control !== null) {
119
+									$control = $control->$newid;
120
+				}
121
+			} else
121 122
 			{
122 123
 				// TCheckBoxList overrides findControl() with a fake implementation
123 124
 				// but accepts a second parameter to use the standard one
124 125
 				$control = $this->getControl()->findControl($id, true);
125 126
 			}
126 127
 
127
-			if($control instanceof TCallbackOptions)
128
-				return $control->getClientSide()->getOptions()->toArray();
129
-			else
130
-				throw new TConfigurationException('callback_invalid_callback_options', $this->getControl()->getID(), $id);
128
+			if($control instanceof TCallbackOptions) {
129
+							return $control->getClientSide()->getOptions()->toArray();
130
+			} else {
131
+							throw new TConfigurationException('callback_invalid_callback_options', $this->getControl()->getID(), $id);
132
+			}
131 133
 		}
132 134
 
133 135
 		return [];
@@ -179,9 +181,9 @@  discard block
 block discarded – undo
179 181
 		{
180 182
 			$group = $this->getValidationGroup();
181 183
 			return $this->getPage()->getValidators($group)->getCount() > 0;
184
+		} else {
185
+					return false;
182 186
 		}
183
-		else
184
-			return false;
185 187
 	}
186 188
 
187 189
 	/**
@@ -213,8 +215,9 @@  discard block
 block discarded – undo
213 215
 		$options['ValidationGroup'] = $this->getValidationGroup();
214 216
 		$options['CallbackParameter'] = $this->getCallbackParameter();
215 217
 		// needed for TCallback
216
-		if(!isset($options['EventTarget']))
217
-			$options['EventTarget'] = $this->getControl()->getUniqueID();
218
+		if(!isset($options['EventTarget'])) {
219
+					$options['EventTarget'] = $this->getControl()->getUniqueID();
220
+		}
218 221
 		return $options;
219 222
 	}
220 223
 
@@ -230,14 +233,16 @@  discard block
 block discarded – undo
230 233
 	public function registerCallbackClientScript($class, $options = null)
231 234
 	{
232 235
 		$cs = $this->getPage()->getClientScript();
233
-		if(is_array($options))
234
-			$options = array_merge($this->getClientSideOptions(), $options);
235
-		else
236
-			$options = $this->getClientSideOptions();
236
+		if(is_array($options)) {
237
+					$options = array_merge($this->getClientSideOptions(), $options);
238
+		} else {
239
+					$options = $this->getClientSideOptions();
240
+		}
237 241
 
238 242
 		//remove true as default to save bytes
239
-		if($options['CausesValidation'] === true)
240
-			$options['CausesValidation'] = '';
243
+		if($options['CausesValidation'] === true) {
244
+					$options['CausesValidation'] = '';
245
+		}
241 246
 		$cs->registerCallbackControl($class, $options);
242 247
 	}
243 248
 
Please login to merge, or discard this patch.
framework/Web/UI/ActiveControls/TCallbackResponseWriter.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -68,8 +68,9 @@
 block discarded – undo
68 68
 	public function flush()
69 69
 	{
70 70
 		$content = parent::flush();
71
-		if(empty($content))
72
-			return "";
71
+		if(empty($content)) {
72
+					return "";
73
+		}
73 74
 		return '<!--' . $this->getBoundary() . '-->' . $content . '<!--//' . $this->getBoundary() . '-->';
74 75
 	}
75 76
 }
Please login to merge, or discard this patch.