Passed
Branch php-cs-fixer (b9836a)
by Fabio
15:58
created
framework/I18N/TTranslateParameter.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 	 */
60 60
 	public function getKey()
61 61
 	{
62
-		if(empty($this->key))
62
+		if (empty($this->key))
63 63
 			throw new TException('The Key property must be specified.');
64 64
 		return $this->key;
65 65
 	}
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 	public function getParameter()
108 108
 	{
109 109
 		$value = $this->getValue();
110
-		if(strlen($value) > 0)
110
+		if (strlen($value) > 0)
111 111
 			return $value;
112 112
 		$htmlWriter = Prado::createComponent($this->GetResponse()->getHtmlWriterType(), new TTextWriter());
113 113
 		$this->renderControl($htmlWriter);
Please login to merge, or discard this patch.
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -59,8 +59,9 @@  discard block
 block discarded – undo
59 59
 	 */
60 60
 	public function getKey()
61 61
 	{
62
-		if(empty($this->key))
63
-			throw new TException('The Key property must be specified.');
62
+		if(empty($this->key)) {
63
+					throw new TException('The Key property must be specified.');
64
+		}
64 65
 		return $this->key;
65 66
 	}
66 67
 
@@ -107,8 +108,9 @@  discard block
 block discarded – undo
107 108
 	public function getParameter()
108 109
 	{
109 110
 		$value = $this->getValue();
110
-		if(strlen($value) > 0)
111
-			return $value;
111
+		if(strlen($value) > 0) {
112
+					return $value;
113
+		}
112 114
 		$htmlWriter = Prado::createComponent($this->GetResponse()->getHtmlWriterType(), new TTextWriter());
113 115
 		$this->renderControl($htmlWriter);
114 116
 		return $this->getTrim() ?
Please login to merge, or discard this patch.
framework/Caching/TAPCCache.php 2 patches
Braces   +9 added lines, -6 removed lines patch added patch discarded remove patch
@@ -53,14 +53,17 @@
 block discarded – undo
53 53
     */
54 54
 	public function init($config)
55 55
 	{
56
-		if(!extension_loaded('apc'))
57
-			throw new TConfigurationException('apccache_extension_required');
56
+		if(!extension_loaded('apc')) {
57
+					throw new TConfigurationException('apccache_extension_required');
58
+		}
58 59
 
59
-		if(ini_get('apc.enabled') == false)
60
-			throw new TConfigurationException('apccache_extension_not_enabled');
60
+		if(ini_get('apc.enabled') == false) {
61
+					throw new TConfigurationException('apccache_extension_not_enabled');
62
+		}
61 63
 
62
-		if(substr(php_sapi_name(), 0, 3) === 'cli' and ini_get('apc.enable_cli') == false)
63
-			throw new TConfigurationException('apccache_extension_not_enabled_cli');
64
+		if(substr(php_sapi_name(), 0, 3) === 'cli' and ini_get('apc.enable_cli') == false) {
65
+					throw new TConfigurationException('apccache_extension_not_enabled_cli');
66
+		}
64 67
 
65 68
 		parent::init($config);
66 69
 	}
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -57,13 +57,13 @@
 block discarded – undo
57 57
     */
58 58
 	public function init($config)
59 59
 	{
60
-		if(!extension_loaded('apc'))
60
+		if (!extension_loaded('apc'))
61 61
 			throw new TConfigurationException('apccache_extension_required');
62 62
 
63
-		if(ini_get('apc.enabled') == false)
63
+		if (ini_get('apc.enabled') == false)
64 64
 			throw new TConfigurationException('apccache_extension_not_enabled');
65 65
 
66
-		if(substr(php_sapi_name(), 0, 3) === 'cli' and ini_get('apc.enable_cli') == false)
66
+		if (substr(php_sapi_name(), 0, 3) === 'cli' and ini_get('apc.enable_cli') == false)
67 67
 			throw new TConfigurationException('apccache_extension_not_enabled_cli');
68 68
 
69 69
 		parent::init($config);
Please login to merge, or discard this patch.
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/Web/UI/ActiveControls/TCallback.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@
 block discarded – undo
79 79
 	 */
80 80
 	public function raiseCallbackEvent($param)
81 81
 	{
82
-		if($this->getActiveControl()->canCauseValidation())
82
+		if ($this->getActiveControl()->canCauseValidation())
83 83
 			$this->getPage()->validate($this->getActiveControl()->getValidationGroup());
84 84
 		$this->onCallback($param);
85 85
 	}
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -79,8 +79,9 @@
 block discarded – undo
79 79
 	 */
80 80
 	public function raiseCallbackEvent($param)
81 81
 	{
82
-		if($this->getActiveControl()->canCauseValidation())
83
-			$this->getPage()->validate($this->getActiveControl()->getValidationGroup());
82
+		if($this->getActiveControl()->canCauseValidation()) {
83
+					$this->getPage()->validate($this->getActiveControl()->getValidationGroup());
84
+		}
84 85
 		$this->onCallback($param);
85 86
 	}
86 87
 
Please login to merge, or discard this patch.
framework/Web/UI/ActiveControls/TValueTriggeredCallback.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -80,7 +80,7 @@
 block discarded – undo
80 80
 	public function setDecayRate($value)
81 81
 	{
82 82
 		$decay = TPropertyValue::ensureFloat($value);
83
-		if($decay < 0)
83
+		if ($decay < 0)
84 84
 			throw new TConfigurationException('callback_decay_be_not_negative', $this->getID());
85 85
 		$this->setViewState('Decay', $decay);
86 86
 	}
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -80,8 +80,9 @@
 block discarded – undo
80 80
 	public function setDecayRate($value)
81 81
 	{
82 82
 		$decay = TPropertyValue::ensureFloat($value);
83
-		if($decay < 0)
84
-			throw new TConfigurationException('callback_decay_be_not_negative', $this->getID());
83
+		if($decay < 0) {
84
+					throw new TConfigurationException('callback_decay_be_not_negative', $this->getID());
85
+		}
85 86
 		$this->setViewState('Decay', $decay);
86 87
 	}
87 88
 
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/Relations/TActiveRecordHasOne.php 2 patches
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -122,8 +122,9 @@  discard block
 block discarded – undo
122 122
 		$prop = $this->getContext()->getProperty();
123 123
 		if(isset($collections[$hash]) && count($collections[$hash]) > 0)
124 124
 		{
125
-			if(count($collections[$hash]) > 1)
126
-				throw new TActiveRecordException('ar_belongs_to_multiple_result');
125
+			if(count($collections[$hash]) > 1) {
126
+							throw new TActiveRecordException('ar_belongs_to_multiple_result');
127
+			}
127 128
 			$source->setColumnValue($prop, $collections[$hash][0]);
128 129
 		}
129 130
 	}
@@ -137,8 +138,9 @@  discard block
 block discarded – undo
137 138
 		$fkObject = $this->getContext()->getPropertyValue();
138 139
 		$source = $this->getSourceRecord();
139 140
 		$fkeys = $this->findForeignKeys($fkObject, $source);
140
-		foreach($fkeys as $fKey => $srcKey)
141
-			$fkObject->setColumnValue($fKey, $source->getColumnValue($srcKey));
141
+		foreach($fkeys as $fKey => $srcKey) {
142
+					$fkObject->setColumnValue($fKey, $source->getColumnValue($srcKey));
143
+		}
142 144
 		return $fkObject->save();
143 145
 	}
144 146
 }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -122,9 +122,9 @@  discard block
 block discarded – undo
122 122
 	{
123 123
 		$hash = $this->getObjectHash($source, $properties);
124 124
 		$prop = $this->getContext()->getProperty();
125
-		if(isset($collections[$hash]) && count($collections[$hash]) > 0)
125
+		if (isset($collections[$hash]) && count($collections[$hash]) > 0)
126 126
 		{
127
-			if(count($collections[$hash]) > 1)
127
+			if (count($collections[$hash]) > 1)
128 128
 				throw new TActiveRecordException('ar_belongs_to_multiple_result');
129 129
 			$source->setColumnValue($prop, $collections[$hash][0]);
130 130
 		}
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
 		$fkObject = $this->getContext()->getPropertyValue();
140 140
 		$source = $this->getSourceRecord();
141 141
 		$fkeys = $this->findForeignKeys($fkObject, $source);
142
-		foreach($fkeys as $fKey => $srcKey)
142
+		foreach ($fkeys as $fKey => $srcKey)
143 143
 			$fkObject->setColumnValue($fKey, $source->getColumnValue($srcKey));
144 144
 		return $fkObject->save();
145 145
 	}
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.