Completed
Push — php-cs-fixer ( b6f93e...b9836a )
by Fabio
07:15
created
framework/Web/Services/TFeedService.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
  */
65 65
 class TFeedService extends \Prado\TService
66 66
 {
67
-	private $_feeds = [];
67
+	private $_feeds=[];
68 68
 
69 69
 	/**
70 70
 	 * Initializes this module.
@@ -73,20 +73,20 @@  discard block
 block discarded – undo
73 73
 	 */
74 74
 	public function init($config)
75 75
 	{
76
-		if($this->getApplication()->getConfigurationType() == TApplication::CONFIG_TYPE_PHP)
76
+		if($this->getApplication()->getConfigurationType()==TApplication::CONFIG_TYPE_PHP)
77 77
 		{
78 78
 			if(is_array($config))
79 79
 			{
80 80
 				foreach($config as $id => $feed)
81
-					$this->_feeds[$id] = $feed;
81
+					$this->_feeds[$id]=$feed;
82 82
 			}
83 83
 		}
84 84
 		else
85 85
 		{
86 86
 			foreach($config->getElementsByTagName('feed') as $feed)
87 87
 			{
88
-				if(($id = $feed->getAttributes()->remove('id')) !== null)
89
-					$this->_feeds[$id] = $feed;
88
+				if(($id=$feed->getAttributes()->remove('id'))!==null)
89
+					$this->_feeds[$id]=$feed;
90 90
 				else
91 91
 					throw new TConfigurationException('feedservice_id_required');
92 92
 			}
@@ -107,19 +107,19 @@  discard block
 block discarded – undo
107 107
 	 */
108 108
 	public function run()
109 109
 	{
110
-		$id = $this->getRequest()->getServiceParameter();
110
+		$id=$this->getRequest()->getServiceParameter();
111 111
 		if(isset($this->_feeds[$id]))
112 112
 		{
113
-			$feedConfig = $this->_feeds[$id];
114
-			$properties = [];
115
-			$feed = null;
116
-			if($this->getApplication()->getConfigurationType() == TApplication::CONFIG_TYPE_PHP)
113
+			$feedConfig=$this->_feeds[$id];
114
+			$properties=[];
115
+			$feed=null;
116
+			if($this->getApplication()->getConfigurationType()==TApplication::CONFIG_TYPE_PHP)
117 117
 			{
118 118
 				if(isset($feedConfig['class']))
119 119
 				{
120
-					$feed = Prado::createComponent($feedConfig['class']);
120
+					$feed=Prado::createComponent($feedConfig['class']);
121 121
 					if($service instanceof IFeedContentProvider)
122
-						$properties = isset($feedConfig['properties'])?$feedConfig['properties']:[];
122
+						$properties=isset($feedConfig['properties']) ? $feedConfig['properties'] : [];
123 123
 					else
124 124
 						throw new TConfigurationException('jsonservice_response_type_invalid', $id);
125 125
 				}
@@ -128,10 +128,10 @@  discard block
 block discarded – undo
128 128
 			}
129 129
 			else
130 130
 			{
131
-				$properties = $feedConfig->getAttributes();
132
-				if(($class = $properties->remove('class')) !== null)
131
+				$properties=$feedConfig->getAttributes();
132
+				if(($class=$properties->remove('class'))!==null)
133 133
 				{
134
-					$feed = Prado::createComponent($class);
134
+					$feed=Prado::createComponent($class);
135 135
 					if(!($feed instanceof IFeedContentProvider))
136 136
 						throw new TConfigurationException('feedservice_feedtype_invalid', $id);
137 137
 				}
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
 				$feed->setSubproperty($name, $value);
145 145
 			$feed->init($feedConfig);
146 146
 
147
-			$content = $feed->getFeedContent();
147
+			$content=$feed->getFeedContent();
148 148
 			//$this->getResponse()->setContentType('application/rss+xml');
149 149
 			$this->getResponse()->setContentType($feed->getContentType());
150 150
 			$this->getResponse()->write($content);
Please login to merge, or discard this patch.
framework/Web/Services/TJsonRpcProtocol.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 class TJsonRpcProtocol extends TRpcProtocol
28 28
 {
29 29
 	protected $_id;
30
-	protected $_specificationVersion = 1.0;
30
+	protected $_specificationVersion=1.0;
31 31
 
32 32
 	/**
33 33
 	 * Handles the RPC request
@@ -38,33 +38,33 @@  discard block
 block discarded – undo
38 38
 	{
39 39
 		try
40 40
 		{
41
-			$_request = $this->decode($requestPayload);
41
+			$_request=$this->decode($requestPayload);
42 42
 
43 43
 			if(isset($_request['jsonrpc']))
44 44
 			{
45
-				$this->_specificationVersion = $_request['jsonrpc'];
45
+				$this->_specificationVersion=$_request['jsonrpc'];
46 46
 				if($this->_specificationVersion > 2.0)
47 47
 					throw new TRpcException('Unsupported specification version', '-32600');
48 48
 			}
49 49
 
50 50
 			if(isset($_request['id']))
51
-				$this->_id = $_request['id'];
51
+				$this->_id=$_request['id'];
52 52
 
53 53
 			if(!isset($_request['method']))
54 54
 					throw new TRpcException('Missing request method', '-32600');
55 55
 
56 56
 			if(!isset($_request['params']))
57
-				$parameters = [];
57
+				$parameters=[];
58 58
 			else
59
-				$parameters = $_request['params'];
59
+				$parameters=$_request['params'];
60 60
 
61 61
 			if(!is_array($parameters))
62
-				$parameters = [$parameters];
62
+				$parameters=[$parameters];
63 63
 
64 64
 			// a request without an id is a notification that doesn't need a response
65
-			if($this->_id !== null)
65
+			if($this->_id!==null)
66 66
 			{
67
-				if($this->_specificationVersion == 2.0)
67
+				if($this->_specificationVersion==2.0)
68 68
 				{
69 69
 					return $this->encode([
70 70
 						'jsonrpc' => '2.0',
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 	 */
102 102
 	public function createErrorResponse(TRpcException $exception)
103 103
 	{
104
-		if($this->_specificationVersion == 2.0)
104
+		if($this->_specificationVersion==2.0)
105 105
 		{
106 106
 			return $this->encode([
107 107
 				'id' => $this->_id,
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
 	 */
142 142
 	public function decode($data)
143 143
 	{
144
-		$s = json_decode($data, true);
144
+		$s=json_decode($data, true);
145 145
 		self::checkJsonError();
146 146
 		return $s;
147 147
 	}
@@ -153,15 +153,15 @@  discard block
 block discarded – undo
153 153
 	 */
154 154
 	public function encode($data)
155 155
 	{
156
-		$s = json_encode($data);
156
+		$s=json_encode($data);
157 157
 		self::checkJsonError();
158 158
 		return $s;
159 159
 	}
160 160
 
161 161
 	private static function checkJsonError()
162 162
 	{
163
-		$errnum = json_last_error();
164
-		if($errnum != JSON_ERROR_NONE)
163
+		$errnum=json_last_error();
164
+		if($errnum!=JSON_ERROR_NONE)
165 165
 			throw new \Exception("JSON error: $msg", $err);
166 166
 	}
167 167
 
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
 	public function callApiMethod($methodName, $parameters)
176 176
 	{
177 177
 		if(!isset($this->rpcMethods[$methodName]))
178
-			throw new TRpcException('Method "' . $methodName . '" not found', '-32601');
178
+			throw new TRpcException('Method "'.$methodName.'" not found', '-32601');
179 179
 
180 180
 		return call_user_func_array($this->rpcMethods[$methodName]['method'], $parameters);
181 181
 	}
Please login to merge, or discard this patch.
framework/Web/Services/TSoapService.php 1 patch
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -96,10 +96,10 @@  discard block
 block discarded – undo
96 96
  */
97 97
 class TSoapService extends \Prado\TService
98 98
 {
99
-	const DEFAULT_SOAP_SERVER = 'Prado\Web\Services\TSoapServer';
100
-	private $_servers = [];
99
+	const DEFAULT_SOAP_SERVER='Prado\Web\Services\TSoapServer';
100
+	private $_servers=[];
101 101
 	private $_configFile;
102
-	private $_wsdlRequest = false;
102
+	private $_wsdlRequest=false;
103 103
 	private $_serverID;
104 104
 
105 105
 	/**
@@ -119,11 +119,11 @@  discard block
 block discarded – undo
119 119
 	 */
120 120
 	public function init($config)
121 121
 	{
122
-		if($this->_configFile !== null)
122
+		if($this->_configFile!==null)
123 123
 		{
124 124
 			if(is_file($this->_configFile))
125 125
 			{
126
-				$dom = new TXmlDocument;
126
+				$dom=new TXmlDocument;
127 127
 				$dom->loadFromFile($this->_configFile);
128 128
 				$this->loadConfig($dom);
129 129
 			}
@@ -144,15 +144,15 @@  discard block
 block discarded – undo
144 144
 	 */
145 145
 	protected function resolveRequest()
146 146
 	{
147
-		$serverID = $this->getRequest()->getServiceParameter();
148
-		if(($pos = strrpos($serverID, '.wsdl')) === strlen($serverID) - 5)
147
+		$serverID=$this->getRequest()->getServiceParameter();
148
+		if(($pos=strrpos($serverID, '.wsdl'))===strlen($serverID) - 5)
149 149
 		{
150
-			$serverID = substr($serverID, 0, $pos);
151
-			$this->_wsdlRequest = true;
150
+			$serverID=substr($serverID, 0, $pos);
151
+			$this->_wsdlRequest=true;
152 152
 		}
153 153
 		else
154
-			$this->_wsdlRequest = false;
155
-		$this->_serverID = $serverID;
154
+			$this->_wsdlRequest=false;
155
+		$this->_serverID=$serverID;
156 156
 		if(!isset($this->_servers[$serverID]))
157 157
 			throw new THttpException(400, 'soapservice_request_invalid', $serverID);
158 158
 	}
@@ -164,16 +164,16 @@  discard block
 block discarded – undo
164 164
 	 */
165 165
 	private function loadConfig($config)
166 166
 	{
167
-		if($this->getApplication()->getConfigurationType() == TApplication::CONFIG_TYPE_PHP)
167
+		if($this->getApplication()->getConfigurationType()==TApplication::CONFIG_TYPE_PHP)
168 168
 		{
169 169
 			if(is_array($config))
170 170
 			{
171 171
 				foreach($config['soap'] as $id => $server)
172 172
 				{
173
-					$properties = isset($server['properties'])?$server['properties']:[];
173
+					$properties=isset($server['properties']) ? $server['properties'] : [];
174 174
 					if(isset($this->_servers[$id]))
175 175
 						throw new TConfigurationException('soapservice_serverid_duplicated', $id);
176
-					$this->_servers[$id] = $properties;
176
+					$this->_servers[$id]=$properties;
177 177
 				}
178 178
 			}
179 179
 		}
@@ -181,12 +181,12 @@  discard block
 block discarded – undo
181 181
 		{
182 182
 			foreach($config->getElementsByTagName('soap') as $serverXML)
183 183
 			{
184
-				$properties = $serverXML->getAttributes();
185
-				if(($id = $properties->remove('id')) === null)
184
+				$properties=$serverXML->getAttributes();
185
+				if(($id=$properties->remove('id'))===null)
186 186
 					throw new TConfigurationException('soapservice_serverid_required');
187 187
 				if(isset($this->_servers[$id]))
188 188
 					throw new TConfigurationException('soapservice_serverid_duplicated', $id);
189
-				$this->_servers[$id] = $properties;
189
+				$this->_servers[$id]=$properties;
190 190
 			}
191 191
 		}
192 192
 	}
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
 	 */
207 207
 	public function setConfigFile($value)
208 208
 	{
209
-		if(($this->_configFile = Prado::getPathOfNamespace($value, Prado::getApplication()->getConfigurationFileExt())) === null)
209
+		if(($this->_configFile=Prado::getPathOfNamespace($value, Prado::getApplication()->getConfigurationFileExt()))===null)
210 210
 			throw new TConfigurationException('soapservice_configfile_invalid', $value);
211 211
 	}
212 212
 
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
 	 * @param boolean whether to encode the GET parameters (their names and values), defaults to true.
219 219
 	 * @return string URL for the page and GET parameters
220 220
 	 */
221
-	public function constructUrl($serverID, $getParams = null, $encodeAmpersand = true, $encodeGetItems = true)
221
+	public function constructUrl($serverID, $getParams=null, $encodeAmpersand=true, $encodeGetItems=true)
222 222
 	{
223 223
 		return $this->getRequest()->constructUrl($this->getID(), $serverID, $getParams, $encodeAmpersand, $encodeGetItems);
224 224
 	}
@@ -247,19 +247,19 @@  discard block
 block discarded – undo
247 247
 	 */
248 248
 	protected function createServer()
249 249
 	{
250
-		$properties = $this->_servers[$this->_serverID];
251
-		$serverClass = null;
252
-		if($this->getApplication()->getConfigurationType() == TApplication::CONFIG_TYPE_PHP && isset($config['class']))
253
-			$serverClass = $config['class'];
254
-		elseif($this->getApplication()->getConfigurationType() == TApplication::CONFIG_TYPE_XML)
255
-			$serverClass = $properties->remove('class');
256
-		if($serverClass === null)
257
-			$serverClass = self::DEFAULT_SOAP_SERVER;
250
+		$properties=$this->_servers[$this->_serverID];
251
+		$serverClass=null;
252
+		if($this->getApplication()->getConfigurationType()==TApplication::CONFIG_TYPE_PHP && isset($config['class']))
253
+			$serverClass=$config['class'];
254
+		elseif($this->getApplication()->getConfigurationType()==TApplication::CONFIG_TYPE_XML)
255
+			$serverClass=$properties->remove('class');
256
+		if($serverClass===null)
257
+			$serverClass=self::DEFAULT_SOAP_SERVER;
258 258
 		Prado::using($serverClass);
259
-		$className = ($pos = strrpos($serverClass, '.')) !== false?substr($serverClass, $pos + 1):$serverClass;
260
-		if($className !== self::DEFAULT_SOAP_SERVER && !is_subclass_of($className, self::DEFAULT_SOAP_SERVER))
259
+		$className=($pos=strrpos($serverClass, '.'))!==false ?substr($serverClass, $pos + 1) : $serverClass;
260
+		if($className!==self::DEFAULT_SOAP_SERVER && !is_subclass_of($className, self::DEFAULT_SOAP_SERVER))
261 261
 			throw new TConfigurationException('soapservice_server_invalid', $serverClass);
262
-		$server = new $className;
262
+		$server=new $className;
263 263
 		$server->setID($this->_serverID);
264 264
 		foreach($properties as $name => $value)
265 265
 			$server->setSubproperty($name, $value);
@@ -275,7 +275,7 @@  discard block
 block discarded – undo
275 275
 	public function run()
276 276
 	{
277 277
 		Prado::trace("Running SOAP service", 'Prado\Web\Services\TSoapService');
278
-		$server = $this->createServer();
278
+		$server=$this->createServer();
279 279
 		$this->getResponse()->setContentType('text/xml');
280 280
 		$this->getResponse()->setCharset($server->getEncoding());
281 281
 		if($this->getIsWsdlRequest())
Please login to merge, or discard this patch.
framework/Web/Services/TSoapServer.php 1 patch
Spacing   +55 added lines, -55 removed lines patch added patch discarded remove patch
@@ -31,18 +31,18 @@  discard block
 block discarded – undo
31 31
  */
32 32
 class TSoapServer extends \Prado\TApplicationComponent
33 33
 {
34
-	const WSDL_CACHE_PREFIX = 'wsdl.';
34
+	const WSDL_CACHE_PREFIX='wsdl.';
35 35
 
36 36
 	private $_id;
37 37
 	private $_provider;
38 38
 
39
-	private $_version = '';
40
-	private $_actor = '';
41
-	private $_encoding = '';
42
-	private $_uri = '';
39
+	private $_version='';
40
+	private $_actor='';
41
+	private $_encoding='';
42
+	private $_uri='';
43 43
 	private $_classMap;
44
-	private $_persistent = false;
45
-	private $_wsdlUri = '';
44
+	private $_persistent=false;
45
+	private $_wsdlUri='';
46 46
 
47 47
 	private $_requestedMethod;
48 48
 
@@ -62,9 +62,9 @@  discard block
 block discarded – undo
62 62
 	 */
63 63
 	public function setID($id)
64 64
 	{
65
-		if(strrpos($this->_id, '.wsdl') === strlen($this->_id) - 5)
65
+		if(strrpos($this->_id, '.wsdl')===strlen($this->_id) - 5)
66 66
 			throw new TInvalidDataValueException('soapserver_id_invalid', $id);
67
-		$this->_id = $id;
67
+		$this->_id=$id;
68 68
 	}
69 69
 
70 70
 	/**
@@ -72,25 +72,25 @@  discard block
 block discarded – undo
72 72
 	 */
73 73
 	public function run()
74 74
 	{
75
-		if(($provider = $this->getProvider()) !== null)
75
+		if(($provider=$this->getProvider())!==null)
76 76
 		{
77 77
 			Prado::using($provider);
78
-			$providerClass = ($pos = strrpos($provider, '.')) !== false?substr($provider, $pos + 1):$provider;
78
+			$providerClass=($pos=strrpos($provider, '.'))!==false ?substr($provider, $pos + 1) : $provider;
79 79
 			$this->guessMethodCallRequested($providerClass);
80
-			$server = $this->createServer();
80
+			$server=$this->createServer();
81 81
 			$server->setClass($providerClass, $this);
82 82
 			if($this->_persistent)
83 83
 				$server->setPersistence(SOAP_PERSISTENCE_SESSION);
84 84
 		}
85 85
 		else
86
-			$server = $this->createServer();
86
+			$server=$this->createServer();
87 87
 		try
88 88
 		{
89 89
 			$server->handle();
90 90
 		}
91
-		catch (\Exception $e)
91
+		catch(\Exception $e)
92 92
 		{
93
-			if($this->getApplication()->getMode() === TApplicationMode::Debug)
93
+			if($this->getApplication()->getMode()===TApplicationMode::Debug)
94 94
 				$this->fault($e->getMessage(), $e->__toString());
95 95
 			else
96 96
 				$this->fault($e->getMessage());
@@ -105,9 +105,9 @@  discard block
 block discarded – undo
105 105
 	 * @param string actors
106 106
 	 * @param string message name
107 107
 	 */
108
-	public function fault($title, $details = '', $code = 'SERVER', $actor = '', $name = '')
108
+	public function fault($title, $details='', $code='SERVER', $actor='', $name='')
109 109
 	{
110
-		Prado::trace('SOAP-Fault ' . $code . ' ' . $title . ' : ' . $details, 'Prado\Web\Services\TSoapService');
110
+		Prado::trace('SOAP-Fault '.$code.' '.$title.' : '.$details, 'Prado\Web\Services\TSoapService');
111 111
 		$this->_server->fault($code, $title, $actor, $details, $name);
112 112
 	}
113 113
 
@@ -118,14 +118,14 @@  discard block
 block discarded – undo
118 118
 	 */
119 119
 	protected function guessMethodCallRequested($class)
120 120
 	{
121
-		$namespace = $class . 'wsdl';
122
-		$message = file_get_contents("php://input");
123
-		$matches = [];
124
-		if(preg_match('/xmlns:([^=]+)="urn:' . $namespace . '"/', $message, $matches))
121
+		$namespace=$class.'wsdl';
122
+		$message=file_get_contents("php://input");
123
+		$matches=[];
124
+		if(preg_match('/xmlns:([^=]+)="urn:'.$namespace.'"/', $message, $matches))
125 125
 		{
126
-			if(preg_match('/<' . $matches[1] . ':([a-zA-Z_]+[a-zA-Z0-9_]+)/', $message, $method))
126
+			if(preg_match('/<'.$matches[1].':([a-zA-Z_]+[a-zA-Z0-9_]+)/', $message, $method))
127 127
 			{
128
-				$this->_requestedMethod = $method[1];
128
+				$this->_requestedMethod=$method[1];
129 129
 			}
130 130
 		}
131 131
 	}
@@ -145,11 +145,11 @@  discard block
 block discarded – undo
145 145
 	 */
146 146
 	protected function createServer()
147 147
 	{
148
-		if($this->_server === null)
148
+		if($this->_server===null)
149 149
 		{
150
-			if($this->getApplication()->getMode() === TApplicationMode::Debug)
150
+			if($this->getApplication()->getMode()===TApplicationMode::Debug)
151 151
 				ini_set("soap.wsdl_cache_enabled", 0);
152
-			$this->_server = new \SoapServer($this->getWsdlUri(), $this->getOptions());
152
+			$this->_server=new \SoapServer($this->getWsdlUri(), $this->getOptions());
153 153
 		}
154 154
 		return $this->_server;
155 155
 	}
@@ -159,21 +159,21 @@  discard block
 block discarded – undo
159 159
 	 */
160 160
 	protected function getOptions()
161 161
 	{
162
-		$options = [];
163
-		if($this->_version === '1.1')
164
-			$options['soap_version'] = SOAP_1_1;
165
-		elseif($this->_version === '1.2')
166
-			$options['soap_version'] = SOAP_1_2;
162
+		$options=[];
163
+		if($this->_version==='1.1')
164
+			$options['soap_version']=SOAP_1_1;
165
+		elseif($this->_version==='1.2')
166
+			$options['soap_version']=SOAP_1_2;
167 167
 		if(!empty($this->_actor))
168
-			$options['actor'] = $this->_actor;
168
+			$options['actor']=$this->_actor;
169 169
 		if(!empty($this->_encoding))
170
-			$options['encoding'] = $this->_encoding;
170
+			$options['encoding']=$this->_encoding;
171 171
 		if(!empty($this->_uri))
172
-			$options['uri'] = $this->_uri;
172
+			$options['uri']=$this->_uri;
173 173
 		if(is_string($this->_classMap))
174 174
 		{
175 175
 			foreach(preg_split('/\s*,\s*/', $this->_classMap) as $className)
176
-				$options['classmap'][$className] = $className; //complex type uses the class name in the wsdl
176
+				$options['classmap'][$className]=$className; //complex type uses the class name in the wsdl
177 177
 		}
178 178
 		return $options;
179 179
 	}
@@ -187,18 +187,18 @@  discard block
 block discarded – undo
187 187
 	 */
188 188
 	public function getWsdl()
189 189
 	{
190
-		if($this->_wsdlUri === '')
190
+		if($this->_wsdlUri==='')
191 191
 		{
192
-			$provider = $this->getProvider();
193
-			$providerClass = ($pos = strrpos($provider, '.')) !== false?substr($provider, $pos + 1):$provider;
192
+			$provider=$this->getProvider();
193
+			$providerClass=($pos=strrpos($provider, '.'))!==false ?substr($provider, $pos + 1) : $provider;
194 194
 			Prado::using($provider);
195
-			if($this->getApplication()->getMode() === TApplicationMode::Performance && ($cache = $this->getApplication()->getCache()) !== null)
195
+			if($this->getApplication()->getMode()===TApplicationMode::Performance && ($cache=$this->getApplication()->getCache())!==null)
196 196
 			{
197
-				$wsdl = $cache->get(self::WSDL_CACHE_PREFIX . $providerClass);
197
+				$wsdl=$cache->get(self::WSDL_CACHE_PREFIX.$providerClass);
198 198
 				if(is_string($wsdl))
199 199
 					return $wsdl;
200
-				$wsdl = WsdlGenerator::generate($providerClass, $this->getUri(), $this->getEncoding());
201
-				$cache->set(self::WSDL_CACHE_PREFIX . $providerClass, $wsdl);
200
+				$wsdl=WsdlGenerator::generate($providerClass, $this->getUri(), $this->getEncoding());
201
+				$cache->set(self::WSDL_CACHE_PREFIX.$providerClass, $wsdl);
202 202
 				return $wsdl;
203 203
 			}
204 204
 			else
@@ -215,8 +215,8 @@  discard block
 block discarded – undo
215 215
 	 */
216 216
 	public function getWsdlUri()
217 217
 	{
218
-		if($this->_wsdlUri === '')
219
-			return $this->getRequest()->getBaseUrl() . $this->getService()->constructUrl($this->getID() . '.wsdl', false);
218
+		if($this->_wsdlUri==='')
219
+			return $this->getRequest()->getBaseUrl().$this->getService()->constructUrl($this->getID().'.wsdl', false);
220 220
 		else
221 221
 			return $this->_wsdlUri;
222 222
 	}
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
 	 */
227 227
 	public function setWsdlUri($value)
228 228
 	{
229
-		$this->_wsdlUri = $value;
229
+		$this->_wsdlUri=$value;
230 230
 	}
231 231
 
232 232
 	/**
@@ -234,8 +234,8 @@  discard block
 block discarded – undo
234 234
 	 */
235 235
 	public function getUri()
236 236
 	{
237
-		if($this->_uri === '')
238
-			return $this->getRequest()->getBaseUrl() . $this->getService()->constructUrl($this->getID(), false);
237
+		if($this->_uri==='')
238
+			return $this->getRequest()->getBaseUrl().$this->getService()->constructUrl($this->getID(), false);
239 239
 		else
240 240
 			return $this->_uri;
241 241
 	}
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
 	 */
246 246
 	public function setUri($uri)
247 247
 	{
248
-		$this->_uri = $uri;
248
+		$this->_uri=$uri;
249 249
 	}
250 250
 
251 251
 	/**
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
 	 */
262 262
 	public function setProvider($provider)
263 263
 	{
264
-		$this->_provider = $provider;
264
+		$this->_provider=$provider;
265 265
 	}
266 266
 
267 267
 	/**
@@ -278,8 +278,8 @@  discard block
 block discarded – undo
278 278
 	 */
279 279
 	public function setVersion($value)
280 280
 	{
281
-		if($value === '1.1' || $value === '1.2' || $value === '')
282
-			$this->_version = $value;
281
+		if($value==='1.1' || $value==='1.2' || $value==='')
282
+			$this->_version=$value;
283 283
 		else
284 284
 			throw new TInvalidDataValueException('soapserver_version_invalid', $value);
285 285
 	}
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
 	 */
298 298
 	public function setActor($value)
299 299
 	{
300
-		$this->_actor = $value;
300
+		$this->_actor=$value;
301 301
 	}
302 302
 
303 303
 	/**
@@ -313,7 +313,7 @@  discard block
 block discarded – undo
313 313
 	 */
314 314
 	public function setEncoding($value)
315 315
 	{
316
-		$this->_encoding = $value;
316
+		$this->_encoding=$value;
317 317
 	}
318 318
 
319 319
 	/**
@@ -329,7 +329,7 @@  discard block
 block discarded – undo
329 329
 	 */
330 330
 	public function setSessionPersistent($value)
331 331
 	{
332
-		$this->_persistent = TPropertyValue::ensureBoolean($value);
332
+		$this->_persistent=TPropertyValue::ensureBoolean($value);
333 333
 	}
334 334
 
335 335
 	/**
@@ -345,6 +345,6 @@  discard block
 block discarded – undo
345 345
 	 */
346 346
 	public function setClassMaps($classes)
347 347
 	{
348
-		$this->_classMap = $classes;
348
+		$this->_classMap=$classes;
349 349
 	}
350 350
 }
351 351
\ No newline at end of file
Please login to merge, or discard this patch.
framework/Web/Services/TPageConfiguration.php 1 patch
Spacing   +91 added lines, -91 removed lines patch added patch discarded remove patch
@@ -36,23 +36,23 @@  discard block
 block discarded – undo
36 36
 	/**
37 37
 	 * @var array list of application configurations
38 38
 	 */
39
-	private $_appConfigs = [];
39
+	private $_appConfigs=[];
40 40
 	/**
41 41
 	 * @var array list of page initial property values
42 42
 	 */
43
-	private $_properties = [];
43
+	private $_properties=[];
44 44
 	/**
45 45
 	 * @var TAuthorizationRuleCollection list of authorization rules
46 46
 	 */
47
-	private $_rules = [];
47
+	private $_rules=[];
48 48
 	/**
49 49
 	 * @var array list of included configurations
50 50
 	 */
51
-	private $_includes = [];
51
+	private $_includes=[];
52 52
 	/**
53 53
 	 * @var string the currently request page in the format of Path.To.PageName
54 54
 	 */
55
-	private $_pagePath = '';
55
+	private $_pagePath='';
56 56
 
57 57
 	/**
58 58
 	 * Constructor.
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 	 */
61 61
 	public function __construct($pagePath)
62 62
 	{
63
-		$this->_pagePath = $pagePath;
63
+		$this->_pagePath=$pagePath;
64 64
 	}
65 65
 
66 66
 	/**
@@ -107,24 +107,24 @@  discard block
 block discarded – undo
107 107
 	 */
108 108
 	public function loadFromFiles($basePath)
109 109
 	{
110
-		$paths = explode('.', $this->_pagePath);
111
-		$page = array_pop($paths);
112
-		$path = $basePath;
113
-		$configPagePath = '';
114
-		$fileName = Prado::getApplication()->getConfigurationType() == TApplication::CONFIG_TYPE_PHP
110
+		$paths=explode('.', $this->_pagePath);
111
+		$page=array_pop($paths);
112
+		$path=$basePath;
113
+		$configPagePath='';
114
+		$fileName=Prado::getApplication()->getConfigurationType()==TApplication::CONFIG_TYPE_PHP
115 115
 			? TPageService::CONFIG_FILE_PHP
116 116
 			: TPageService::CONFIG_FILE_XML;
117 117
 		foreach($paths as $p)
118 118
 		{
119
-			$this->loadFromFile($path . DIRECTORY_SEPARATOR . $fileName, $configPagePath);
120
-			$path .= DIRECTORY_SEPARATOR . $p;
121
-			if($configPagePath === '')
122
-				$configPagePath = $p;
119
+			$this->loadFromFile($path.DIRECTORY_SEPARATOR.$fileName, $configPagePath);
120
+			$path.=DIRECTORY_SEPARATOR.$p;
121
+			if($configPagePath==='')
122
+				$configPagePath=$p;
123 123
 			else
124
-				$configPagePath .= '.' . $p;
124
+				$configPagePath.='.'.$p;
125 125
 		}
126
-		$this->loadFromFile($path . DIRECTORY_SEPARATOR . $fileName, $configPagePath);
127
-		$this->_rules = new TAuthorizationRuleCollection($this->_rules);
126
+		$this->loadFromFile($path.DIRECTORY_SEPARATOR.$fileName, $configPagePath);
127
+		$this->_rules=new TAuthorizationRuleCollection($this->_rules);
128 128
 	}
129 129
 
130 130
 	/**
@@ -138,14 +138,14 @@  discard block
 block discarded – undo
138 138
 		if(empty($fname) || !is_file($fname))
139 139
 			return;
140 140
 
141
-		if(Prado::getApplication()->getConfigurationType() == TApplication::CONFIG_TYPE_PHP)
141
+		if(Prado::getApplication()->getConfigurationType()==TApplication::CONFIG_TYPE_PHP)
142 142
 		{
143
-			$fcontent = include $fname;
143
+			$fcontent=include $fname;
144 144
 			$this->loadFromPhp($fcontent, dirname($fname), $configPagePath);
145 145
 		}
146 146
 		else
147 147
 		{
148
-			$dom = new TXmlDocument;
148
+			$dom=new TXmlDocument;
149 149
 			if($dom->loadFromFile($fname))
150 150
 				$this->loadFromXml($dom, dirname($fname), $configPagePath);
151 151
 			else
@@ -175,9 +175,9 @@  discard block
 block discarded – undo
175 175
 
176 176
 	public function loadApplicationConfigurationFromPhp($config, $configPath)
177 177
 	{
178
-		$appConfig = new TApplicationConfiguration;
178
+		$appConfig=new TApplicationConfiguration;
179 179
 		$appConfig->loadFromPhp($config, $configPath);
180
-		$this->_appConfigs[] = $appConfig;
180
+		$this->_appConfigs[]=$appConfig;
181 181
 	}
182 182
 
183 183
 	/**
@@ -187,9 +187,9 @@  discard block
 block discarded – undo
187 187
 	 */
188 188
 	public function loadApplicationConfigurationFromXml($dom, $configPath)
189 189
 	{
190
-		$appConfig = new TApplicationConfiguration;
190
+		$appConfig=new TApplicationConfiguration;
191 191
 		$appConfig->loadFromXml($dom, $configPath);
192
-		$this->_appConfigs[] = $appConfig;
192
+		$this->_appConfigs[]=$appConfig;
193 193
 	}
194 194
 
195 195
 	public function loadPageConfigurationFromPhp($config, $configPath, $configPagePath)
@@ -197,32 +197,32 @@  discard block
 block discarded – undo
197 197
 		// authorization
198 198
 		if(isset($config['authorization']) && is_array($config['authorization']))
199 199
 		{
200
-			$rules = [];
200
+			$rules=[];
201 201
 			foreach($config['authorization'] as $authorization)
202 202
 			{
203
-				$patterns = isset($authorization['pages'])?$authorization['pages']:'';
204
-				$ruleApplies = false;
205
-				if(empty($patterns) || trim($patterns) === '*') // null or empty string
206
-					$ruleApplies = true;
203
+				$patterns=isset($authorization['pages']) ? $authorization['pages'] : '';
204
+				$ruleApplies=false;
205
+				if(empty($patterns) || trim($patterns)==='*') // null or empty string
206
+					$ruleApplies=true;
207 207
 				else
208 208
 				{
209 209
 					foreach(explode(',', $patterns) as $pattern)
210 210
 					{
211
-						if(($pattern = trim($pattern)) !== '')
211
+						if(($pattern=trim($pattern))!=='')
212 212
 						{
213 213
 							// we know $configPagePath and $this->_pagePath
214
-							if($configPagePath !== '')  // prepend the pattern with ConfigPagePath
215
-								$pattern = $configPagePath . '.' . $pattern;
216
-							if(strcasecmp($pattern, $this->_pagePath) === 0)
214
+							if($configPagePath!=='')  // prepend the pattern with ConfigPagePath
215
+								$pattern=$configPagePath.'.'.$pattern;
216
+							if(strcasecmp($pattern, $this->_pagePath)===0)
217 217
 							{
218
-								$ruleApplies = true;
218
+								$ruleApplies=true;
219 219
 								break;
220 220
 							}
221
-							if($pattern[strlen($pattern) - 1] === '*') // try wildcard matching
221
+							if($pattern[strlen($pattern) - 1]==='*') // try wildcard matching
222 222
 							{
223
-								if(strncasecmp($this->_pagePath, $pattern, strlen($pattern) - 1) === 0)
223
+								if(strncasecmp($this->_pagePath, $pattern, strlen($pattern) - 1)===0)
224 224
 								{
225
-									$ruleApplies = true;
225
+									$ruleApplies=true;
226 226
 									break;
227 227
 								}
228 228
 							}
@@ -231,40 +231,40 @@  discard block
 block discarded – undo
231 231
 				}
232 232
 				if($ruleApplies)
233 233
 				{
234
-					$action = isset($authorization['action'])?$authorization['action']:'';
235
-					$users = isset($authorization['users'])?$authorization['users']:'';
236
-					$roles = isset($authorization['roles'])?$authorization['roles']:'';
237
-					$verb = isset($authorization['verb'])?$authorization['verb']:'';
238
-					$ips = isset($authorization['ips'])?$authorization['ips']:'';
239
-					$rules[] = new TAuthorizationRule($action, $users, $roles, $verb, $ips);
234
+					$action=isset($authorization['action']) ? $authorization['action'] : '';
235
+					$users=isset($authorization['users']) ? $authorization['users'] : '';
236
+					$roles=isset($authorization['roles']) ? $authorization['roles'] : '';
237
+					$verb=isset($authorization['verb']) ? $authorization['verb'] : '';
238
+					$ips=isset($authorization['ips']) ? $authorization['ips'] : '';
239
+					$rules[]=new TAuthorizationRule($action, $users, $roles, $verb, $ips);
240 240
 				}
241 241
 			}
242
-			$this->_rules = array_merge($rules, $this->_rules);
242
+			$this->_rules=array_merge($rules, $this->_rules);
243 243
 		}
244 244
 		// pages
245 245
 		if(isset($config['pages']) && is_array($config['pages']))
246 246
 		{
247 247
 			if(isset($config['pages']['properties']))
248 248
 			{
249
-				$this->_properties = array_merge($this->_properties, $config['pages']['properties']);
249
+				$this->_properties=array_merge($this->_properties, $config['pages']['properties']);
250 250
 				unset($config['pages']['properties']);
251 251
 			}
252 252
 			foreach($config['pages'] as $id => $page)
253 253
 			{
254
-				$properties = [];
254
+				$properties=[];
255 255
 				if(isset($page['properties']))
256 256
 				{
257
-					$properties = $page['properties'];
257
+					$properties=$page['properties'];
258 258
 					unset($page['properties']);
259 259
 				}
260
-				$matching = false;
261
-				$id = ($configPagePath === '')?$id:$configPagePath . '.' . $id;
262
-				if(strcasecmp($id, $this->_pagePath) === 0)
263
-					$matching = true;
264
-				elseif($id[strlen($id) - 1] === '*') // try wildcard matching
265
-					$matching = strncasecmp($this->_pagePath, $id, strlen($id) - 1) === 0;
260
+				$matching=false;
261
+				$id=($configPagePath==='') ? $id : $configPagePath.'.'.$id;
262
+				if(strcasecmp($id, $this->_pagePath)===0)
263
+					$matching=true;
264
+				elseif($id[strlen($id) - 1]==='*') // try wildcard matching
265
+					$matching=strncasecmp($this->_pagePath, $id, strlen($id) - 1)===0;
266 266
 				if($matching)
267
-					$this->_properties = array_merge($this->_properties, $properties);
267
+					$this->_properties=array_merge($this->_properties, $properties);
268 268
 			}
269 269
 		}
270 270
 
@@ -273,14 +273,14 @@  discard block
 block discarded – undo
273 273
 		{
274 274
 			foreach($config['includes'] as $include)
275 275
 			{
276
-				$when = isset($include['when'])?true:false;
276
+				$when=isset($include['when']) ?true:false;
277 277
 				if(!isset($include['file']))
278 278
 					throw new TConfigurationException('pageserviceconf_includefile_required');
279
-				$filePath = $include['file'];
279
+				$filePath=$include['file'];
280 280
 				if(isset($this->_includes[$filePath]))
281
-					$this->_includes[$filePath] = [$configPagePath,'(' . $this->_includes[$filePath][1] . ') || (' . $when . ')'];
281
+					$this->_includes[$filePath]=[$configPagePath, '('.$this->_includes[$filePath][1].') || ('.$when.')'];
282 282
 				else
283
-					$this->_includes[$filePath] = [$configPagePath,$when];
283
+					$this->_includes[$filePath]=[$configPagePath, $when];
284 284
 			}
285 285
 		}
286 286
 	}
@@ -294,34 +294,34 @@  discard block
 block discarded – undo
294 294
 	public function loadPageConfigurationFromXml($dom, $configPath, $configPagePath)
295 295
 	{
296 296
 		// authorization
297
-		if(($authorizationNode = $dom->getElementByTagName('authorization')) !== null)
297
+		if(($authorizationNode=$dom->getElementByTagName('authorization'))!==null)
298 298
 		{
299
-			$rules = [];
299
+			$rules=[];
300 300
 			foreach($authorizationNode->getElements() as $node)
301 301
 			{
302
-				$patterns = $node->getAttribute('pages');
303
-				$ruleApplies = false;
304
-				if(empty($patterns) || trim($patterns) === '*') // null or empty string
305
-					$ruleApplies = true;
302
+				$patterns=$node->getAttribute('pages');
303
+				$ruleApplies=false;
304
+				if(empty($patterns) || trim($patterns)==='*') // null or empty string
305
+					$ruleApplies=true;
306 306
 				else
307 307
 				{
308 308
 					foreach(explode(',', $patterns) as $pattern)
309 309
 					{
310
-						if(($pattern = trim($pattern)) !== '')
310
+						if(($pattern=trim($pattern))!=='')
311 311
 						{
312 312
 							// we know $configPagePath and $this->_pagePath
313
-							if($configPagePath !== '')  // prepend the pattern with ConfigPagePath
314
-								$pattern = $configPagePath . '.' . $pattern;
315
-							if(strcasecmp($pattern, $this->_pagePath) === 0)
313
+							if($configPagePath!=='')  // prepend the pattern with ConfigPagePath
314
+								$pattern=$configPagePath.'.'.$pattern;
315
+							if(strcasecmp($pattern, $this->_pagePath)===0)
316 316
 							{
317
-								$ruleApplies = true;
317
+								$ruleApplies=true;
318 318
 								break;
319 319
 							}
320
-							if($pattern[strlen($pattern) - 1] === '*') // try wildcard matching
320
+							if($pattern[strlen($pattern) - 1]==='*') // try wildcard matching
321 321
 							{
322
-								if(strncasecmp($this->_pagePath, $pattern, strlen($pattern) - 1) === 0)
322
+								if(strncasecmp($this->_pagePath, $pattern, strlen($pattern) - 1)===0)
323 323
 								{
324
-									$ruleApplies = true;
324
+									$ruleApplies=true;
325 325
 									break;
326 326
 								}
327 327
 							}
@@ -329,44 +329,44 @@  discard block
 block discarded – undo
329 329
 					}
330 330
 				}
331 331
 				if($ruleApplies)
332
-					$rules[] = new TAuthorizationRule($node->getTagName(), $node->getAttribute('users'), $node->getAttribute('roles'), $node->getAttribute('verb'), $node->getAttribute('ips'));
332
+					$rules[]=new TAuthorizationRule($node->getTagName(), $node->getAttribute('users'), $node->getAttribute('roles'), $node->getAttribute('verb'), $node->getAttribute('ips'));
333 333
 			}
334
-			$this->_rules = array_merge($rules, $this->_rules);
334
+			$this->_rules=array_merge($rules, $this->_rules);
335 335
 		}
336 336
 
337 337
 		// pages
338
-		if(($pagesNode = $dom->getElementByTagName('pages')) !== null)
338
+		if(($pagesNode=$dom->getElementByTagName('pages'))!==null)
339 339
 		{
340
-			$this->_properties = array_merge($this->_properties, $pagesNode->getAttributes()->toArray());
340
+			$this->_properties=array_merge($this->_properties, $pagesNode->getAttributes()->toArray());
341 341
 			// at the page folder
342 342
 			foreach($pagesNode->getElementsByTagName('page') as $node)
343 343
 			{
344
-				$properties = $node->getAttributes();
345
-				$id = $properties->remove('id');
344
+				$properties=$node->getAttributes();
345
+				$id=$properties->remove('id');
346 346
 				if(empty($id))
347 347
 					throw new TConfigurationException('pageserviceconf_page_invalid', $configPath);
348
-				$matching = false;
349
-				$id = ($configPagePath === '')?$id:$configPagePath . '.' . $id;
350
-				if(strcasecmp($id, $this->_pagePath) === 0)
351
-					$matching = true;
352
-				elseif($id[strlen($id) - 1] === '*') // try wildcard matching
353
-					$matching = strncasecmp($this->_pagePath, $id, strlen($id) - 1) === 0;
348
+				$matching=false;
349
+				$id=($configPagePath==='') ? $id : $configPagePath.'.'.$id;
350
+				if(strcasecmp($id, $this->_pagePath)===0)
351
+					$matching=true;
352
+				elseif($id[strlen($id) - 1]==='*') // try wildcard matching
353
+					$matching=strncasecmp($this->_pagePath, $id, strlen($id) - 1)===0;
354 354
 				if($matching)
355
-					$this->_properties = array_merge($this->_properties, $properties->toArray());
355
+					$this->_properties=array_merge($this->_properties, $properties->toArray());
356 356
 			}
357 357
 		}
358 358
 
359 359
 		// external configurations
360 360
 		foreach($dom->getElementsByTagName('include') as $node)
361 361
 		{
362
-			if(($when = $node->getAttribute('when')) === null)
363
-				$when = true;
364
-			if(($filePath = $node->getAttribute('file')) === null)
362
+			if(($when=$node->getAttribute('when'))===null)
363
+				$when=true;
364
+			if(($filePath=$node->getAttribute('file'))===null)
365 365
 				throw new TConfigurationException('pageserviceconf_includefile_required');
366 366
 			if(isset($this->_includes[$filePath]))
367
-				$this->_includes[$filePath] = [$configPagePath,'(' . $this->_includes[$filePath][1] . ') || (' . $when . ')'];
367
+				$this->_includes[$filePath]=[$configPagePath, '('.$this->_includes[$filePath][1].') || ('.$when.')'];
368 368
 			else
369
-				$this->_includes[$filePath] = [$configPagePath,$when];
369
+				$this->_includes[$filePath]=[$configPagePath, $when];
370 370
 		}
371 371
 	}
372 372
 }
373 373
\ No newline at end of file
Please login to merge, or discard this patch.
framework/Web/Services/TJsonService.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 	/**
63 63
 	 * @var array registered services
64 64
 	 */
65
-	private $_services = [];
65
+	private $_services=[];
66 66
 
67 67
 	/**
68 68
 	 * Initializes this module.
@@ -80,20 +80,20 @@  discard block
 block discarded – undo
80 80
 	 */
81 81
 	protected function loadJsonServices($config)
82 82
 	{
83
-		if($this->getApplication()->getConfigurationType() == TApplication::CONFIG_TYPE_PHP)
83
+		if($this->getApplication()->getConfigurationType()==TApplication::CONFIG_TYPE_PHP)
84 84
 		{
85 85
 			if(is_array($config))
86 86
 			{
87 87
 				foreach($config['json'] as $id => $json)
88
-					$this->_services[$id] = $json;
88
+					$this->_services[$id]=$json;
89 89
 			}
90 90
 		}
91 91
 		else
92 92
 		{
93 93
 			foreach($config->getElementsByTagName('json') as $json)
94 94
 			{
95
-				if(($id = $json->getAttribute('id')) !== null)
96
-					$this->_services[$id] = $json;
95
+				if(($id=$json->getAttribute('id'))!==null)
96
+					$this->_services[$id]=$json;
97 97
 				else
98 98
 					throw new TConfigurationException('jsonservice_id_required');
99 99
 			}
@@ -106,18 +106,18 @@  discard block
 block discarded – undo
106 106
 	 */
107 107
 	public function run()
108 108
 	{
109
-		$id = $this->getRequest()->getServiceParameter();
109
+		$id=$this->getRequest()->getServiceParameter();
110 110
 		if(isset($this->_services[$id]))
111 111
 		{
112
-			$serviceConfig = $this->_services[$id];
113
-			if($this->getApplication()->getConfigurationType() == TApplication::CONFIG_TYPE_PHP)
112
+			$serviceConfig=$this->_services[$id];
113
+			if($this->getApplication()->getConfigurationType()==TApplication::CONFIG_TYPE_PHP)
114 114
 			{
115 115
 				if(isset($serviceConfig['class']))
116 116
 				{
117
-					$service = Prado::createComponent($serviceConfig['class']);
117
+					$service=Prado::createComponent($serviceConfig['class']);
118 118
 					if($service instanceof TJsonResponse)
119 119
 					{
120
-						$properties = isset($serviceConfig['properties'])?$serviceConfig['properties']:[];
120
+						$properties=isset($serviceConfig['properties']) ? $serviceConfig['properties'] : [];
121 121
 						$this->createJsonResponse($service, $properties, $serviceConfig);
122 122
 					}
123 123
 					else
@@ -128,10 +128,10 @@  discard block
 block discarded – undo
128 128
 			}
129 129
 			else
130 130
 			{
131
-				$properties = $serviceConfig->getAttributes();
132
-				if(($class = $properties->remove('class')) !== null)
131
+				$properties=$serviceConfig->getAttributes();
132
+				if(($class=$properties->remove('class'))!==null)
133 133
 				{
134
-					$service = Prado::createComponent($class);
134
+					$service=Prado::createComponent($class);
135 135
 					if($service instanceof TJsonResponse)
136 136
 						$this->createJsonResponse($service, $properties, $serviceConfig);
137 137
 					else
@@ -157,9 +157,9 @@  discard block
 block discarded – undo
157 157
 		$service->init($config);
158 158
 
159 159
 		//send content if not null
160
-		if(($content = $service->getJsonContent()) !== null)
160
+		if(($content=$service->getJsonContent())!==null)
161 161
 		{
162
-			$response = $this->getResponse();
162
+			$response=$this->getResponse();
163 163
 			$response->setContentType('application/json');
164 164
 			$response->setCharset('UTF-8');
165 165
 			//send content
Please login to merge, or discard this patch.
framework/Web/THttpCookie.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 	/**
29 29
 	 * @var string domain of the cookie
30 30
 	 */
31
-	private $_domain = '';
31
+	private $_domain='';
32 32
 	/**
33 33
 	 * @var string name of the cookie
34 34
 	 */
@@ -36,23 +36,23 @@  discard block
 block discarded – undo
36 36
 	/**
37 37
 	 * @var string value of the cookie
38 38
 	 */
39
-	private $_value = '';
39
+	private $_value='';
40 40
 	/**
41 41
 	 * @var integer expire of the cookie
42 42
 	 */
43
-	private $_expire = 0;
43
+	private $_expire=0;
44 44
 	/**
45 45
 	 * @var string path of the cookie
46 46
 	 */
47
-	private $_path = '/';
47
+	private $_path='/';
48 48
 	/**
49 49
 	 * @var boolean whether cookie should be sent via secure connection
50 50
 	 */
51
-	private $_secure = false;
51
+	private $_secure=false;
52 52
 	/**
53 53
 	 * @var boolean if true the cookie value will be unavailable to JavaScript
54 54
 	 */
55
-	private $_httpOnly = false;
55
+	private $_httpOnly=false;
56 56
 
57 57
 	/**
58 58
 	 * Constructor.
@@ -61,8 +61,8 @@  discard block
 block discarded – undo
61 61
 	 */
62 62
 	public function __construct($name, $value)
63 63
 	{
64
-		$this->_name = $name;
65
-		$this->_value = $value;
64
+		$this->_name=$name;
65
+		$this->_value=$value;
66 66
 	}
67 67
 
68 68
 	/**
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 	 */
79 79
 	public function setDomain($value)
80 80
 	{
81
-		$this->_domain = $value;
81
+		$this->_domain=$value;
82 82
 	}
83 83
 
84 84
 	/**
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
 	 */
95 95
 	public function setExpire($value)
96 96
 	{
97
-		$this->_expire = TPropertyValue::ensureInteger($value);
97
+		$this->_expire=TPropertyValue::ensureInteger($value);
98 98
 	}
99 99
 
100 100
 	/**
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
 	 */
111 111
 	public function setHttpOnly($value)
112 112
 	{
113
-		$this->_httpOnly = TPropertyValue::ensureBoolean($value);
113
+		$this->_httpOnly=TPropertyValue::ensureBoolean($value);
114 114
 	}
115 115
 
116 116
 	/**
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
 	 */
127 127
 	public function setName($value)
128 128
 	{
129
-		$this->_name = $value;
129
+		$this->_name=$value;
130 130
 	}
131 131
 
132 132
 	/**
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
 	 */
143 143
 	public function setValue($value)
144 144
 	{
145
-		$this->_value = $value;
145
+		$this->_value=$value;
146 146
 	}
147 147
 
148 148
 	/**
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
 	 */
159 159
 	public function setPath($value)
160 160
 	{
161
-		$this->_path = $value;
161
+		$this->_path=$value;
162 162
 	}
163 163
 
164 164
 	/**
@@ -174,6 +174,6 @@  discard block
 block discarded – undo
174 174
 	 */
175 175
 	public function setSecure($value)
176 176
 	{
177
-		$this->_secure = TPropertyValue::ensureBoolean($value);
177
+		$this->_secure=TPropertyValue::ensureBoolean($value);
178 178
 	}
179 179
 }
180 180
\ No newline at end of file
Please login to merge, or discard this patch.
framework/Web/Javascripts/TJavaScript.php 1 patch
Spacing   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -33,9 +33,9 @@  discard block
 block discarded – undo
33 33
 	 */
34 34
 	public static function renderScriptFiles($files)
35 35
 	{
36
-		$str = '';
36
+		$str='';
37 37
 		foreach($files as $file)
38
-			$str .= self::renderScriptFile($file);
38
+			$str.=self::renderScriptFile($file);
39 39
 		return $str;
40 40
 	}
41 41
 
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 	 */
47 47
 	public static function renderScriptFile($file)
48 48
 	{
49
-		return '<script type="text/javascript" src="' . THttpUtility::htmlEncode($file) . "\"></script>\n";
49
+		return '<script type="text/javascript" src="'.THttpUtility::htmlEncode($file)."\"></script>\n";
50 50
 	}
51 51
 
52 52
 	/**
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 	public static function renderScriptBlocks($scripts)
58 58
 	{
59 59
 		if(count($scripts))
60
-			return "<script type=\"text/javascript\">\n/*<![CDATA[*/\n" . implode("\n", $scripts) . "\n/*]]>*/\n</script>\n";
60
+			return "<script type=\"text/javascript\">\n/*<![CDATA[*/\n".implode("\n", $scripts)."\n/*]]>*/\n</script>\n";
61 61
 		else
62 62
 			return '';
63 63
 	}
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 	public static function renderScriptBlocksCallback($scripts)
71 71
 	{
72 72
 		if(count($scripts))
73
-			return implode("\n", $scripts) . "\n";
73
+			return implode("\n", $scripts)."\n";
74 74
 		else
75 75
 			return '';
76 76
 	}
@@ -139,40 +139,40 @@  discard block
 block discarded – undo
139 139
 	 * @param boolean wether to encode empty strings too. Default to false for BC.
140 140
 	 * @return string the encoded string
141 141
 	 */
142
-	public static function encode($value, $toMap = true, $encodeEmptyStrings = false)
142
+	public static function encode($value, $toMap=true, $encodeEmptyStrings=false)
143 143
 	{
144 144
 		if(is_string($value))
145 145
 			return self::quoteString($value);
146 146
 		elseif(is_bool($value))
147
-			return $value?'true':'false';
147
+			return $value ? 'true' : 'false';
148 148
 		elseif(is_array($value))
149 149
 		{
150
-			$results = '';
151
-			if(($n = count($value)) > 0 && array_keys($value) !== range(0, $n - 1))
150
+			$results='';
151
+			if(($n=count($value)) > 0 && array_keys($value)!==range(0, $n - 1))
152 152
 			{
153 153
 				foreach($value as $k => $v)
154 154
 				{
155
-					if($v !== '' || $encodeEmptyStrings)
155
+					if($v!=='' || $encodeEmptyStrings)
156 156
 					{
157
-						if($results !== '')
158
-							$results .= ',';
159
-						$results .= "'$k':" . self::encode($v, $toMap, $encodeEmptyStrings);
157
+						if($results!=='')
158
+							$results.=',';
159
+						$results.="'$k':".self::encode($v, $toMap, $encodeEmptyStrings);
160 160
 					}
161 161
 				}
162
-				return '{' . $results . '}';
162
+				return '{'.$results.'}';
163 163
 			}
164 164
 			else
165 165
 			{
166 166
 				foreach($value as $v)
167 167
 				{
168
-					if($v !== '' || $encodeEmptyStrings)
168
+					if($v!=='' || $encodeEmptyStrings)
169 169
 					{
170
-						if($results !== '')
171
-							$results .= ',';
172
-						$results .= self::encode($v, $toMap, $encodeEmptyStrings);
170
+						if($results!=='')
171
+							$results.=',';
172
+						$results.=self::encode($v, $toMap, $encodeEmptyStrings);
173 173
 					}
174 174
 				}
175
-				return '[' . $results . ']';
175
+				return '['.$results.']';
176 176
 			}
177 177
 		}
178 178
 		elseif(is_int($value))
@@ -188,8 +188,8 @@  discard block
 block discarded – undo
188 188
 					return 'Number.POSITIVE_INFINITY';
189 189
 					break;
190 190
 				default:
191
-					$locale = localeConv();
192
-					if($locale['decimal_point'] == '.')
191
+					$locale=localeConv();
192
+					if($locale['decimal_point']=='.')
193 193
 						return "$value";
194 194
 					else
195 195
 						return str_replace($locale['decimal_point'], '.', "$value");
@@ -197,11 +197,11 @@  discard block
 block discarded – undo
197 197
 			}
198 198
 		}
199 199
 		elseif(is_object($value))
200
-			if ($value instanceof TJavaScriptLiteral)
200
+			if($value instanceof TJavaScriptLiteral)
201 201
 				return $value->toJavaScriptLiteral();
202 202
 			else
203 203
 				return self::encode(get_object_vars($value), $toMap);
204
-		elseif($value === null)
204
+		elseif($value===null)
205 205
 			return 'null';
206 206
 		else
207 207
 			return '';
@@ -212,14 +212,14 @@  discard block
 block discarded – undo
212 212
 	 * @param mixed variable to be encoded
213 213
 	 * @return string encoded string
214 214
 	 */
215
-	public static function jsonEncode($value, $options = 0)
215
+	public static function jsonEncode($value, $options=0)
216 216
 	{
217
-		if (($g = Prado::getApplication()->getGlobalization(false)) !== null &&
218
-			strtoupper($enc = $g->getCharset()) != 'UTF-8') {
217
+		if(($g=Prado::getApplication()->getGlobalization(false))!==null &&
218
+			strtoupper($enc=$g->getCharset())!='UTF-8') {
219 219
 			self::convertToUtf8($value, $enc);
220 220
 		}
221 221
 
222
-		$s = @json_encode($value, $options);
222
+		$s=@json_encode($value, $options);
223 223
 		self::checkJsonError();
224 224
 		return $s;
225 225
 	}
@@ -231,8 +231,8 @@  discard block
 block discarded – undo
231 231
 	 */
232 232
 	private static function convertToUtf8(&$value, $sourceEncoding) {
233 233
 		if(is_string($value))
234
-			$value = iconv($sourceEncoding, 'UTF-8', $value);
235
-		elseif (is_array($value))
234
+			$value=iconv($sourceEncoding, 'UTF-8', $value);
235
+		elseif(is_array($value))
236 236
 		{
237 237
 			foreach($value as &$element)
238 238
 				self::convertToUtf8($element, $sourceEncoding);
@@ -247,37 +247,37 @@  discard block
 block discarded – undo
247 247
 	 * @param int recursion depth
248 248
 	 * @return mixed decoded variable
249 249
 	 */
250
-	public static function jsonDecode($value, $assoc = false, $depth = 512)
250
+	public static function jsonDecode($value, $assoc=false, $depth=512)
251 251
 	{
252
-		$s = @json_decode($value, $assoc, $depth);
252
+		$s=@json_decode($value, $assoc, $depth);
253 253
 		self::checkJsonError();
254 254
 		return $s;
255 255
 	}
256 256
 
257 257
 	private static function checkJsonError()
258 258
 	{
259
-		switch ($err = json_last_error())
259
+		switch($err=json_last_error())
260 260
 		{
261 261
 			case JSON_ERROR_NONE:
262 262
 				return;
263 263
 				break;
264 264
 			case JSON_ERROR_DEPTH:
265
-				$msg = 'Maximum stack depth exceeded';
265
+				$msg='Maximum stack depth exceeded';
266 266
 				break;
267 267
 			case JSON_ERROR_STATE_MISMATCH:
268
-				$msg = 'Underflow or the modes mismatch';
268
+				$msg='Underflow or the modes mismatch';
269 269
 				break;
270 270
 			case JSON_ERROR_CTRL_CHAR:
271
-				$msg = 'Unexpected control character found';
271
+				$msg='Unexpected control character found';
272 272
 				break;
273 273
 			case JSON_ERROR_SYNTAX:
274
-				$msg = 'Syntax error, malformed JSON';
274
+				$msg='Syntax error, malformed JSON';
275 275
 				break;
276 276
 			case JSON_ERROR_UTF8:
277
-				$msg = 'Malformed UTF-8 characters, possibly incorrectly encoded';
277
+				$msg='Malformed UTF-8 characters, possibly incorrectly encoded';
278 278
 				break;
279 279
 			default:
280
-				$msg = 'Unknown error';
280
+				$msg='Unknown error';
281 281
 				break;
282 282
 		}
283 283
 		throw new \Exception("JSON error ($err): $msg");
Please login to merge, or discard this patch.
framework/Web/Javascripts/packages.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 //package base folder in prado alias notation
4
-$folders = [
4
+$folders=[
5 5
 	'prado' => 'Prado\\Web\\Javascripts\\source\\prado',
6 6
 	'jquery' => 'Vendor\\bower-asset\\jquery\\dist',
7 7
 	'jquery-ui' => 'Vendor\\bower-asset\\jquery-ui',
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
 ];
14 14
 
15 15
 //package names and its contents (files relative to the current directory)
16
-$packages = [
16
+$packages=[
17 17
 	// base prado scripts
18 18
 	'prado' => [
19 19
 		'prado/prado.js',
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
 ];
113 113
 
114 114
 //package names and their dependencies
115
-$dependencies = [
115
+$dependencies=[
116 116
 	'jquery' => ['jquery'],
117 117
 	'prado' => ['jquery', 'prado'],
118 118
 	'bootstrap' => ['jquery', 'bootstrap'],
Please login to merge, or discard this patch.