Passed
Branch php-cs-fixer (b9836a)
by Fabio
15:58
created
framework/Web/UI/WebControls/TBaseDataList.php 2 patches
Braces   +20 added lines, -16 removed lines patch added patch discarded remove patch
@@ -56,10 +56,11 @@  discard block
 block discarded – undo
56 56
 	 */
57 57
 	public function getCellSpacing()
58 58
 	{
59
-		if($this->getHasStyle())
60
-			return $this->getStyle()->getCellSpacing();
61
-		else
62
-			return -1;
59
+		if($this->getHasStyle()) {
60
+					return $this->getStyle()->getCellSpacing();
61
+		} else {
62
+					return -1;
63
+		}
63 64
 	}
64 65
 
65 66
 	/**
@@ -75,10 +76,11 @@  discard block
 block discarded – undo
75 76
 	 */
76 77
 	public function getCellPadding()
77 78
 	{
78
-		if($this->getHasStyle())
79
-			return $this->getStyle()->getCellPadding();
80
-		else
81
-			return -1;
79
+		if($this->getHasStyle()) {
80
+					return $this->getStyle()->getCellPadding();
81
+		} else {
82
+					return -1;
83
+		}
82 84
 	}
83 85
 
84 86
 	/**
@@ -94,10 +96,11 @@  discard block
 block discarded – undo
94 96
 	 */
95 97
 	public function getHorizontalAlign()
96 98
 	{
97
-		if($this->getHasStyle())
98
-			return $this->getStyle()->getHorizontalAlign();
99
-		else
100
-			return THorizontalAlign::NotSet;
99
+		if($this->getHasStyle()) {
100
+					return $this->getStyle()->getHorizontalAlign();
101
+		} else {
102
+					return THorizontalAlign::NotSet;
103
+		}
101 104
 	}
102 105
 
103 106
 	/**
@@ -113,10 +116,11 @@  discard block
 block discarded – undo
113 116
 	 */
114 117
 	public function getGridLines()
115 118
 	{
116
-		if($this->getHasStyle())
117
-			return $this->getStyle()->getGridLines();
118
-		else
119
-			return TTableGridLines::None;
119
+		if($this->getHasStyle()) {
120
+					return $this->getStyle()->getGridLines();
121
+		} else {
122
+					return TTableGridLines::None;
123
+		}
120 124
 	}
121 125
 
122 126
 	/**
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 	 */
56 56
 	public function getCellSpacing()
57 57
 	{
58
-		if($this->getHasStyle())
58
+		if ($this->getHasStyle())
59 59
 			return $this->getStyle()->getCellSpacing();
60 60
 		else
61 61
 			return -1;
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 	 */
75 75
 	public function getCellPadding()
76 76
 	{
77
-		if($this->getHasStyle())
77
+		if ($this->getHasStyle())
78 78
 			return $this->getStyle()->getCellPadding();
79 79
 		else
80 80
 			return -1;
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 	 */
94 94
 	public function getHorizontalAlign()
95 95
 	{
96
-		if($this->getHasStyle())
96
+		if ($this->getHasStyle())
97 97
 			return $this->getStyle()->getHorizontalAlign();
98 98
 		else
99 99
 			return THorizontalAlign::NotSet;
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
 	 */
113 113
 	public function getGridLines()
114 114
 	{
115
-		if($this->getHasStyle())
115
+		if ($this->getHasStyle())
116 116
 			return $this->getStyle()->getGridLines();
117 117
 		else
118 118
 			return TTableGridLines::None;
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
 	 */
150 150
 	public function getDataKeys()
151 151
 	{
152
-		if(($dataKeys = $this->getViewState('DataKeys', null)) === null)
152
+		if (($dataKeys = $this->getViewState('DataKeys', null)) === null)
153 153
 		{
154 154
 			$dataKeys = new TList;
155 155
 			$this->setViewState('DataKeys', $dataKeys, null);
Please login to merge, or discard this patch.
framework/Data/SqlMap/Configuration/TDiscriminator.php 2 patches
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -144,8 +144,9 @@
 block discarded – undo
144 144
 	 */
145 145
 	public function getSubMap($value)
146 146
 	{
147
-		if(isset($this->_resultMaps[$value]))
148
-			return $this->_resultMaps[$value];
147
+		if(isset($this->_resultMaps[$value])) {
148
+					return $this->_resultMaps[$value];
149
+		}
149 150
 	}
150 151
 
151 152
 	/**
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
 	 */
149 149
 	public function getSubMap($value)
150 150
 	{
151
-		if(isset($this->_resultMaps[$value]))
151
+		if (isset($this->_resultMaps[$value]))
152 152
 			return $this->_resultMaps[$value];
153 153
 	}
154 154
 
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
 	 */
173 173
 	public function initialize($manager)
174 174
 	{
175
-		foreach($this->_subMaps as $subMap)
175
+		foreach ($this->_subMaps as $subMap)
176 176
 		{
177 177
 			$this->_resultMaps[$subMap->getValue()] =
178 178
 				$manager->getResultMap($subMap->getResultMapping());
Please login to merge, or discard this patch.
framework/Data/SqlMap/DataMapper/TFastSqlMapApplicationCache.php 2 patches
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -75,8 +75,9 @@
 block discarded – undo
75 75
 
76 76
 	protected function getCache()
77 77
 	{
78
-		if (!$this->_cache)
79
-			$this->_cache = Prado::getApplication()->getCache();
78
+		if (!$this->_cache) {
79
+					$this->_cache = Prado::getApplication()->getCache();
80
+		}
80 81
 		return $this->_cache;
81 82
 	}
82 83
 
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 
37 37
 	protected function getBaseKeyKeyName()
38 38
 	{
39
-		return 'SqlMapCacheBaseKey::' . $this->_cacheModel->getId();
39
+		return 'SqlMapCacheBaseKey::'.$this->_cacheModel->getId();
40 40
 	}
41 41
 
42 42
 	protected function getBaseKey()
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 
55 55
 	protected function getCacheKey($key)
56 56
 	{
57
-		return $this->getBaseKey() . '###' . $key;
57
+		return $this->getBaseKey().'###'.$key;
58 58
 	}
59 59
 
60 60
 	public function delete($key)
Please login to merge, or discard this patch.
framework/Data/ActiveRecord/TActiveRecordConfig.php 2 patches
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -108,8 +108,9 @@  discard block
 block discarded – undo
108 108
 	{
109 109
 		parent::init($xml);
110 110
 		$manager = $this -> getManager();
111
-		if($this->getEnableCache())
112
-			$manager->setCache($this->getApplication()->getCache());
111
+		if($this->getEnableCache()) {
112
+					$manager->setCache($this->getApplication()->getCache());
113
+		}
113 114
 		$manager->setDbConnection($this->getDbConnection());
114 115
 		$manager->setInvalidFinderResult($this->getInvalidFinderResult());
115 116
 		$manager->setGatewayClass($this->getGatewayClass());
@@ -119,8 +120,9 @@  discard block
 block discarded – undo
119 120
 	 * @return TActiveRecordManager
120 121
 	 */
121 122
 	public function getManager() {
122
-		if($this->_manager === null)
123
-			$this->_manager = Prado::createComponent($this -> getManagerClass());
123
+		if($this->_manager === null) {
124
+					$this->_manager = Prado::createComponent($this -> getManagerClass());
125
+		}
124 126
 		return TActiveRecordManager::getInstance($this->_manager);
125 127
 	}
126 128
 
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
 	{
113 113
 		parent::init($xml);
114 114
 		$manager = $this -> getManager();
115
-		if($this->getEnableCache())
115
+		if ($this->getEnableCache())
116 116
 			$manager->setCache($this->getApplication()->getCache());
117 117
 		$manager->setDbConnection($this->getDbConnection());
118 118
 		$manager->setInvalidFinderResult($this->getInvalidFinderResult());
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
 	 * @return TActiveRecordManager
124 124
 	 */
125 125
 	public function getManager() {
126
-		if($this->_manager === null)
126
+		if ($this->_manager === null)
127 127
 			$this->_manager = Prado::createComponent($this -> getManagerClass());
128 128
 		return TActiveRecordManager::getInstance($this->_manager);
129 129
 	}
Please login to merge, or discard this patch.
framework/Data/Common/Oracle/TOracleTableColumn.php 2 patches
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -39,8 +39,9 @@
 block discarded – undo
39 39
 		$dbtype = strtolower($this->getDbType());
40 40
 		foreach(self::$types as $type => $dbtypes)
41 41
 		{
42
-			if(in_array($dbtype, $dbtypes))
43
-				return $type;
42
+			if(in_array($dbtype, $dbtypes)) {
43
+							return $type;
44
+			}
44 45
 		}
45 46
 		return 'string';
46 47
 	}
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 class TOracleTableColumn extends TDbTableColumn
29 29
 {
30 30
 	private static $types = [
31
-		'numeric' => [ 'numeric' ]
31
+		'numeric' => ['numeric']
32 32
 //		'integer' => array('bit', 'bit varying', 'real', 'serial', 'int', 'integer'),
33 33
 //		'boolean' => array('boolean'),
34 34
 //		'float' => array('bigint', 'bigserial', 'double precision', 'money', 'numeric')
@@ -41,9 +41,9 @@  discard block
 block discarded – undo
41 41
 	public function getPHPType()
42 42
 	{
43 43
 		$dbtype = strtolower($this->getDbType());
44
-		foreach(self::$types as $type => $dbtypes)
44
+		foreach (self::$types as $type => $dbtypes)
45 45
 		{
46
-			if(in_array($dbtype, $dbtypes))
46
+			if (in_array($dbtype, $dbtypes))
47 47
 				return $type;
48 48
 		}
49 49
 		return 'string';
Please login to merge, or discard this patch.
framework/Web/UI/ActiveControls/TActiveLabel.php 2 patches
Braces   +9 added lines, -6 removed lines patch added patch discarded remove patch
@@ -55,12 +55,14 @@  discard block
 block discarded – undo
55 55
 	 */
56 56
 	public function setText($value)
57 57
 	{
58
-		if(parent::getText() === $value)
59
-			return;
58
+		if(parent::getText() === $value) {
59
+					return;
60
+		}
60 61
 
61 62
 		parent::setText($value);
62
-		if($this->getActiveControl()->canUpdateClientSide())
63
-			$this->getPage()->getCallbackClient()->update($this, $value);
63
+		if($this->getActiveControl()->canUpdateClientSide()) {
64
+					$this->getPage()->getCallbackClient()->update($this, $value);
65
+		}
64 66
 	}
65 67
 
66 68
 	/**
@@ -71,8 +73,9 @@  discard block
 block discarded – undo
71 73
 	 */
72 74
 	public function setForControl($value)
73 75
 	{
74
-		if(parent::getForControl() === $value)
75
-			return;
76
+		if(parent::getForControl() === $value) {
77
+					return;
78
+		}
76 79
 
77 80
 		parent::setForControl($value);
78 81
 		if($this->getActiveControl()->canUpdateClientSide())
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -59,11 +59,11 @@  discard block
 block discarded – undo
59 59
 	 */
60 60
 	public function setText($value)
61 61
 	{
62
-		if(parent::getText() === $value)
62
+		if (parent::getText() === $value)
63 63
 			return;
64 64
 
65 65
 		parent::setText($value);
66
-		if($this->getActiveControl()->canUpdateClientSide())
66
+		if ($this->getActiveControl()->canUpdateClientSide())
67 67
 			$this->getPage()->getCallbackClient()->update($this, $value);
68 68
 	}
69 69
 
@@ -75,11 +75,11 @@  discard block
 block discarded – undo
75 75
 	 */
76 76
 	public function setForControl($value)
77 77
 	{
78
-		if(parent::getForControl() === $value)
78
+		if (parent::getForControl() === $value)
79 79
 			return;
80 80
 
81 81
 		parent::setForControl($value);
82
-		if($this->getActiveControl()->canUpdateClientSide())
82
+		if ($this->getActiveControl()->canUpdateClientSide())
83 83
 		{
84 84
 			$id = $this->findControl($value)->getClientID();
85 85
 			$this->getPage()->getCallbackClient()->setAttribute($this, 'for', $id);
Please login to merge, or discard this patch.
framework/Web/UI/ActiveControls/TActiveDatePicker.php 2 patches
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -89,8 +89,9 @@
 block discarded – undo
89 89
 	 * @param string text content for the textbox
90 90
 	 */
91 91
 	public function setText($value){
92
-		if(parent::getText() === $value)
93
-			return;
92
+		if(parent::getText() === $value) {
93
+					return;
94
+		}
94 95
 
95 96
 		parent::setText($value);
96 97
 		if($this->getActiveControl()->canUpdateClientSide() && $this->getHasLoadedPostData()){
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 	/**
88 88
 	 * @return TBaseActiveCallbackControl standard callback control options.
89 89
 	 */
90
-	public function getActiveControl(){
90
+	public function getActiveControl() {
91 91
 		return $this->getAdapter()->getBaseActiveControl();
92 92
 	}
93 93
 
@@ -95,12 +95,12 @@  discard block
 block discarded – undo
95 95
 	 * Client-side Text property can only be updated after the OnLoad stage.
96 96
 	 * @param string text content for the textbox
97 97
 	 */
98
-	public function setText($value){
99
-		if(parent::getText() === $value)
98
+	public function setText($value) {
99
+		if (parent::getText() === $value)
100 100
 			return;
101 101
 
102 102
 		parent::setText($value);
103
-		if($this->getActiveControl()->canUpdateClientSide() && $this->getHasLoadedPostData()){
103
+		if ($this->getActiveControl()->canUpdateClientSide() && $this->getHasLoadedPostData()) {
104 104
 			$cb = $this->getPage()->getCallbackClient();
105 105
 			$cb->setValue($this, $value);
106 106
 			if ($this->getInputMode() == TDatePickerInputMode::DropDownList)
@@ -108,9 +108,9 @@  discard block
 block discarded – undo
108 108
 				$dt = new \DateTime;
109 109
 				$dt->setTimeStamp($this->getTimeStampFromText());
110 110
 				$id = $this->getClientID();
111
-				$cb->select($id . TControl::CLIENT_ID_SEPARATOR . 'day', 'Value', $dt->format('j'), 'select');
112
-				$cb->select($id . TControl::CLIENT_ID_SEPARATOR . 'month', 'Value', $dt->format('n') - 1, 'select');
113
-				$cb->select($id . TControl::CLIENT_ID_SEPARATOR . 'year', 'Value', $dt->format('Y'), 'select');
111
+				$cb->select($id.TControl::CLIENT_ID_SEPARATOR.'day', 'Value', $dt->format('j'), 'select');
112
+				$cb->select($id.TControl::CLIENT_ID_SEPARATOR.'month', 'Value', $dt->format('n') - 1, 'select');
113
+				$cb->select($id.TControl::CLIENT_ID_SEPARATOR.'year', 'Value', $dt->format('Y'), 'select');
114 114
 
115 115
 			}
116 116
 		}
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
 	 * This method is mainly used by framework and control developers.
123 123
 	 * @param TCallbackEventParameter the event parameter
124 124
 	 */
125
-	public function raiseCallbackEvent($param){
125
+	public function raiseCallbackEvent($param) {
126 126
 		$this->onCallback($param);
127 127
 	}
128 128
 
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
 	 * handler can be invoked.
134 134
 	 * @param TCallbackEventParameter event parameter to be passed to the event handlers
135 135
 	 */
136
-	public function onCallback($param){
136
+	public function onCallback($param) {
137 137
 		$this->raiseEvent('OnCallback', $this, $param);
138 138
 	}
139 139
 
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
 	protected function renderClientControlScript($writer)
151 151
 	{
152 152
 		$cs = $this->getPage()->getClientScript();
153
-		if(!$cs->isEndScriptRegistered('TDatePicker.spacer'))
153
+		if (!$cs->isEndScriptRegistered('TDatePicker.spacer'))
154 154
 		{
155 155
 			$spacer = $this->getAssetUrl('spacer.gif');
156 156
 			$code = "Prado.WebUI.TDatePicker.spacer = '$spacer';";
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
 
160 160
 		$options = TJavaScript::encode($this->getDatePickerOptions());
161 161
 		$code = "new Prado.WebUI.TActiveDatePicker($options);";
162
-		$cs->registerEndScript("prado:" . $this->getClientID(), $code);
162
+		$cs->registerEndScript("prado:".$this->getClientID(), $code);
163 163
 	}
164 164
 
165 165
 	/**
Please login to merge, or discard this patch.
framework/Web/UI/ActiveControls/TActiveCustomValidator.php 2 patches
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -145,8 +145,9 @@
 block discarded – undo
145 145
 	 */
146 146
 	public function setErrorMessage($value)
147 147
 	{
148
-		if(parent::getErrorMessage() === $value)
149
-			return;
148
+		if(parent::getErrorMessage() === $value) {
149
+					return;
150
+		}
150 151
 
151 152
 
152 153
 		parent::setErrorMessage($value);
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
 		// it could have been changed by the clientside validation.
115 115
 
116 116
 		parent::setIsValid($value);
117
-		if($this->getActiveControl()->canUpdateClientSide())
117
+		if ($this->getActiveControl()->canUpdateClientSide())
118 118
 		{
119 119
 			$client = $this->getPage()->getCallbackClient();
120 120
 			$func = 'Prado.Validation.updateActiveCustomValidator';
@@ -151,12 +151,12 @@  discard block
 block discarded – undo
151 151
 	 */
152 152
 	public function setErrorMessage($value)
153 153
 	{
154
-		if(parent::getErrorMessage() === $value)
154
+		if (parent::getErrorMessage() === $value)
155 155
 			return;
156 156
 
157 157
 
158 158
 		parent::setErrorMessage($value);
159
-		if($this->getActiveControl()->canUpdateClientSide())
159
+		if ($this->getActiveControl()->canUpdateClientSide())
160 160
 		{
161 161
 			$client = $this->getPage()->getCallbackClient();
162 162
 			$func = 'Prado.Validation.setErrorMessage';
Please login to merge, or discard this patch.
framework/Web/UI/ActiveControls/TTimeTriggeredCallback.php 2 patches
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -44,11 +44,13 @@
 block discarded – undo
44 44
 	public function setInterval($value)
45 45
 	{
46 46
 		$interval = TPropertyValue::ensureFloat($value);
47
-		if($interval <= 0)
48
-			throw new TConfigurationException('callback_interval_be_positive', $this->getID());
47
+		if($interval <= 0) {
48
+					throw new TConfigurationException('callback_interval_be_positive', $this->getID());
49
+		}
49 50
 
50
-		if($this->getInterval() === $value)
51
-			return;
51
+		if($this->getInterval() === $value) {
52
+					return;
53
+		}
52 54
 
53 55
 		$this->setViewState('Interval', $interval, 1);
54 56
 		if ($this->getActiveControl()->canUpdateClientSide()){
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -49,14 +49,14 @@  discard block
 block discarded – undo
49 49
 	public function setInterval($value)
50 50
 	{
51 51
 		$interval = TPropertyValue::ensureFloat($value);
52
-		if($interval <= 0)
52
+		if ($interval <= 0)
53 53
 			throw new TConfigurationException('callback_interval_be_positive', $this->getID());
54 54
 
55
-		if($this->getInterval() === $value)
55
+		if ($this->getInterval() === $value)
56 56
 			return;
57 57
 
58 58
 		$this->setViewState('Interval', $interval, 1);
59
-		if ($this->getActiveControl()->canUpdateClientSide()){
59
+		if ($this->getActiveControl()->canUpdateClientSide()) {
60 60
 			$client = $this->getPage()->getCallbackClient();
61 61
 			$client->callClientFunction('Prado.WebUI.TTimeTriggeredCallback.setTimerInterval', [$this, $interval]);
62 62
 		}
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 		parent::render($writer);
118 118
 		$this->getActiveControl()->registerCallbackClientScript(
119 119
 			$this->getClientClassName(), $this->getTriggerOptions());
120
-		if($this->getStartTimerOnLoad()){
120
+		if ($this->getStartTimerOnLoad()) {
121 121
 			$id = $this->getClientID();
122 122
 			$code = "Prado.WebUI.TTimeTriggeredCallback.start('{$id}');";
123 123
 			$cs = $this->getPage()->getClientScript();
Please login to merge, or discard this patch.