Completed
Push — intl ( 51e284 )
by Fabio
06:51
created
framework/Security/TAuthManager.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -289,7 +289,7 @@
 block discarded – undo
289 289
 
290 290
 		// check for authentication expiration
291 291
 		$isAuthExpired = $this->_authExpire>0 && !$user->getIsGuest() &&
292
-        ($expiretime=$session->itemAt('AuthExpireTime')) && $expiretime<time();
292
+		($expiretime=$session->itemAt('AuthExpireTime')) && $expiretime<time();
293 293
 
294 294
 		// try authenticating through cookie if possible
295 295
 		if($this->getAllowAutoLogin() && ($user->getIsGuest() || $isAuthExpired))
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -430,8 +430,7 @@
 block discarded – undo
430 430
 				$this->getResponse()->getCookies()->add($cookie);
431 431
 			}
432 432
 			return true;
433
-		}
434
-		else
433
+		} else
435 434
 			return false;
436 435
 	}
437 436
 
Please login to merge, or discard this patch.
framework/I18N/core/DateFormat.php 2 patches
Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 
80 80
 	/**
81 81
 	 * The DateTimeFormatInfo, containing culture specific patterns and names.
82
- 	 * @var DateTimeFormatInfo
82
+	 * @var DateTimeFormatInfo
83 83
 	 */
84 84
 	protected $formatInfo;
85 85
 
@@ -308,8 +308,8 @@  discard block
 block discarded – undo
308 308
 
309 309
 	/**
310 310
 	 * Get the year.
311
- 	 * "yy" will return the last two digits of year.
312
- 	 * "yyyy" will return the full integer year.
311
+	 * "yy" will return the last two digits of year.
312
+	 * "yyyy" will return the full integer year.
313 313
 	 * @param array getdate format.
314 314
 	 * @param string a pattern.
315 315
 	 * @return string year
@@ -330,10 +330,10 @@  discard block
 block discarded – undo
330 330
 
331 331
 	/**
332 332
 	 * Get the month.
333
- 	 * "M" will return integer 1 through 12
334
- 	 * "MM" will return the narrow month name, e.g. "J"
335
- 	 * "MMM" will return the abrreviated month name, e.g. "Jan"
336
- 	 * "MMMM" will return the month name, e.g. "January"
333
+	 * "M" will return integer 1 through 12
334
+	 * "MM" will return the narrow month name, e.g. "J"
335
+	 * "MMM" will return the abrreviated month name, e.g. "Jan"
336
+	 * "MMMM" will return the month name, e.g. "January"
337 337
 	 * @param array getdate format.
338 338
 	 * @param string a pattern.
339 339
 	 * @return string month name
@@ -361,10 +361,10 @@  discard block
 block discarded – undo
361 361
 
362 362
 	/**
363 363
 	 * Get the day of the week.
364
- 	 * "E" will return integer 0 (for Sunday) through 6 (for Saturday).
365
- 	 * "EE" will return the narrow day of the week, e.g. "M"
366
- 	 * "EEE" will return the abrreviated day of the week, e.g. "Mon"
367
- 	 * "EEEE" will return the day of the week, e.g. "Monday"
364
+	 * "E" will return integer 0 (for Sunday) through 6 (for Saturday).
365
+	 * "EE" will return the narrow day of the week, e.g. "M"
366
+	 * "EEE" will return the abrreviated day of the week, e.g. "Mon"
367
+	 * "EEEE" will return the day of the week, e.g. "Monday"
368 368
 	 * @param array getdate format.
369 369
 	 * @param string a pattern.
370 370
 	 * @return string day of the week.
@@ -394,7 +394,7 @@  discard block
 block discarded – undo
394 394
 
395 395
 	/**
396 396
 	 * Get the day of the month.
397
- 	 * "d" for non-padding, "dd" will always return 2 characters.
397
+	 * "d" for non-padding, "dd" will always return 2 characters.
398 398
 	 * @param array getdate format.
399 399
 	 * @param string a pattern.
400 400
 	 * @return string day of the month
@@ -581,14 +581,14 @@  discard block
 block discarded – undo
581 581
 	protected function getDayInMonth($date, $pattern='FF')
582 582
 	{
583 583
 		switch ($pattern) {
584
-		    case 'F':
585
-		      return @date('j', @mktime(0, 0, 0, $date['mon'], $date['mday'], $date['year']));
586
-		      break;
587
-		    case 'FF':
588
-		      return @date('d', @mktime(0, 0, 0, $date['mon'], $date['mday'], $date['year']));
589
-		      break;
590
-		    default:
591
-		      throw new Exception('The pattern for day in month is "F" or "FF".');
584
+			case 'F':
585
+			  return @date('j', @mktime(0, 0, 0, $date['mon'], $date['mday'], $date['year']));
586
+			  break;
587
+			case 'FF':
588
+			  return @date('d', @mktime(0, 0, 0, $date['mon'], $date['mday'], $date['year']));
589
+			  break;
590
+			default:
591
+			  throw new Exception('The pattern for day in month is "F" or "FF".');
592 592
 		}
593 593
 	}
594 594
 
Please login to merge, or discard this patch.
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -134,12 +134,10 @@  discard block
 block discarded – undo
134 134
 			{
135 135
 				$sub = preg_replace('/(^\')|(\'$)/','',$pattern);
136 136
 				$tokens[$i] =  str_replace('``````','\'',$sub);
137
-			}
138
-			else if($pattern == '``````')
137
+			} else if($pattern == '``````')
139 138
 			{
140 139
 				$tokens[$i] = '\'';
141
-			}
142
-			else
140
+			} else
143 141
 			{
144 142
 				$function = $this->getFunctionName($pattern);
145 143
 				if($function != null)
@@ -149,8 +147,7 @@  discard block
 block discarded – undo
149 147
 					{
150 148
 						$rs = $this->$fName($date, $pattern);
151 149
 						$tokens[$i] = $rs;
152
-					}
153
-					else
150
+					} else
154 151
 						throw new
155 152
 						Exception('function '.$function.' not found.');
156 153
 				}
@@ -285,8 +282,7 @@  discard block
 block discarded – undo
285 282
 			if($char==null || $pattern{$i} == $char || $text)
286 283
 			{
287 284
 				$token .= $pattern{$i};
288
-			}
289
-			else
285
+			} else
290 286
 			{
291 287
 				$tokens[] = str_replace("","'",$token);
292 288
 				$token = $pattern{$i};
Please login to merge, or discard this patch.
framework/I18N/core/NumberFormat.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 
77 77
 	/**
78 78
 	 * The DateTimeFormatInfo, containing culture specific patterns and names.
79
- 	 * @var DateTimeFormatInfo
79
+	 * @var DateTimeFormatInfo
80 80
 	 */
81 81
 	protected $formatInfo;
82 82
 
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
 	function format($number, $pattern='d', $currency='USD', $charset='UTF-8')
117 117
 	{
118 118
 		$oldLocale=setLocale(LC_NUMERIC, '0');
119
-	    setlocale(LC_NUMERIC, 'C');
119
+		setlocale(LC_NUMERIC, 'C');
120 120
 
121 121
 		$this->setPattern($pattern);
122 122
 
Please login to merge, or discard this patch.
Braces   +7 added lines, -14 removed lines patch added patch discarded remove patch
@@ -203,16 +203,14 @@  discard block
 block discarded – undo
203 203
 						$integer = $groupSeparator . $integer;
204 204
 						$count++;
205 205
 					}
206
-				}
207
-				else if($multiGroup && $count >= 1)
206
+				} else if($multiGroup && $count >= 1)
208 207
 				{
209 208
 					if($i != 0 && ($i-$groupSize[0])%$groupSize[1] == 0)
210 209
 					{
211 210
 						$integer = $groupSeparator . $integer;
212 211
 						$count++;
213 212
 					}
214
-				}
215
-				else
213
+				} else
216 214
 				{
217 215
 					if($i != 0 && $i%$groupSize[0] == 0)
218 216
 					{
@@ -223,8 +221,7 @@  discard block
 block discarded – undo
223 221
 
224 222
 				$integer = $char . $integer;
225 223
 			}
226
-		}
227
-		else
224
+		} else
228 225
 			$integer = $string;
229 226
 
230 227
 		return $integer;
@@ -250,27 +247,23 @@  discard block
 block discarded – undo
250 247
 			if($decimalDigits == -1)
251 248
 			{
252 249
 				$decimal = substr($string, $dp+1);
253
-			}
254
-			else if(is_int($decimalDigits))
250
+			} else if(is_int($decimalDigits))
255 251
 			{
256 252
 				$float = round((float)$string, $decimalDigits);
257 253
 				if(strpos((string)$float, '.') === false)
258 254
 				{
259 255
 					$decimal = str_pad($decimal,$decimalDigits,'0');
260
-				}
261
-				else
256
+				} else
262 257
 				{
263 258
 					$decimal = substr($float, strpos($float,'.')+1);
264 259
 					if(strlen($decimal)<$decimalDigits)
265 260
 						$decimal = str_pad($decimal,$decimalDigits,'0');
266 261
 				}
267
-			}
268
-			else
262
+			} else
269 263
 				return $decimal;
270 264
 
271 265
 			return $decimalSeparator.$decimal;
272
-		}
273
-		else if ($decimalDigits > 0)
266
+		} else if ($decimalDigits > 0)
274 267
 			return $decimalSeparator.str_pad($decimal,$decimalDigits,'0');
275 268
 
276 269
 		return $decimal;
Please login to merge, or discard this patch.
framework/I18N/core/MessageSource_XLIFF.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -290,7 +290,7 @@
 block discarded – undo
290 290
 
291 291
 		//find the body element
292 292
 		$xpath = new DomXPath($dom);
293
-    	$body = $xpath->query('//body')->item(0);
293
+		$body = $xpath->query('//body')->item(0);
294 294
 
295 295
 		$lastNodes = $xpath->query('//trans-unit[last()]');
296 296
 		if(($last=$lastNodes->item(0))!==null) {
Please login to merge, or discard this patch.
framework/I18N/core/CultureInfo.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -199,9 +199,9 @@
 block discarded – undo
199 199
 	}
200 200
 
201 201
 	/**
202
-	* Gets the CultureInfo that for this culture string
203
-	* @return CultureInfo invariant culture info is "en".
204
-	*/
202
+	 * Gets the CultureInfo that for this culture string
203
+	 * @return CultureInfo invariant culture info is "en".
204
+	 */
205 205
 	public static function getInstance($culture)
206 206
 	{
207 207
 		static $instances = array();
Please login to merge, or discard this patch.
framework/I18N/core/Gettext/TGettext.php 1 patch
Indentation   +209 added lines, -209 removed lines patch added patch discarded remove patch
@@ -58,229 +58,229 @@
 block discarded – undo
58 58
  */
59 59
 class TGettext
60 60
 {
61
-    /**
62
-     * strings
63
-     *
64
-     * associative array with all [msgid => msgstr] entries
65
-     *
66
-     * @access  protected
67
-     * @var     array
68
-    */
69
-    protected $strings = array();
61
+	/**
62
+	 * strings
63
+	 *
64
+	 * associative array with all [msgid => msgstr] entries
65
+	 *
66
+	 * @access  protected
67
+	 * @var     array
68
+	 */
69
+	protected $strings = array();
70 70
 
71
-    /**
72
-     * meta
73
-     *
74
-     * associative array containing meta
75
-     * information like project name or content type
76
-     *
77
-     * @access  protected
78
-     * @var     array
79
-     */
80
-    protected $meta = array();
71
+	/**
72
+	 * meta
73
+	 *
74
+	 * associative array containing meta
75
+	 * information like project name or content type
76
+	 *
77
+	 * @access  protected
78
+	 * @var     array
79
+	 */
80
+	protected $meta = array();
81 81
 
82
-    /**
83
-     * file path
84
-     *
85
-     * @access  protected
86
-     * @var     string
87
-     */
88
-    protected $file = '';
82
+	/**
83
+	 * file path
84
+	 *
85
+	 * @access  protected
86
+	 * @var     string
87
+	 */
88
+	protected $file = '';
89 89
 
90
-    /**
91
-     * Factory
92
-     *
93
-     * @static
94
-     * @access  public
95
-     * @return  object  Returns File_Gettext_PO or File_Gettext_MO on success
96
-     *                  or PEAR_Error on failure.
97
-     * @param   string  $format MO or PO
98
-     * @param   string  $file   path to GNU gettext file
99
-     */
100
-    static function factory($format, $file = '')
101
-    {
102
-        $format = strToUpper($format);
103
-        $filename = dirname(__FILE__).'/'.$format.'.php';
104
-        if(is_file($filename) == false)
105
-        	throw new Exception ("Class file $file not found");
90
+	/**
91
+	 * Factory
92
+	 *
93
+	 * @static
94
+	 * @access  public
95
+	 * @return  object  Returns File_Gettext_PO or File_Gettext_MO on success
96
+	 *                  or PEAR_Error on failure.
97
+	 * @param   string  $format MO or PO
98
+	 * @param   string  $file   path to GNU gettext file
99
+	 */
100
+	static function factory($format, $file = '')
101
+	{
102
+		$format = strToUpper($format);
103
+		$filename = dirname(__FILE__).'/'.$format.'.php';
104
+		if(is_file($filename) == false)
105
+			throw new Exception ("Class file $file not found");
106 106
 
107
-        include_once $filename;
108
-        $class = 'TGettext_' . $format;
107
+		include_once $filename;
108
+		$class = 'TGettext_' . $format;
109 109
 
110
-        return new $class($file);
111
-    }
110
+		return new $class($file);
111
+	}
112 112
 
113
-    /**
114
-     * poFile2moFile
115
-     *
116
-     * That's a simple fake of the 'msgfmt' console command.  It reads the
117
-     * contents of a GNU PO file and saves them to a GNU MO file.
118
-     *
119
-     * @static
120
-     * @access  public
121
-     * @return  mixed   Returns true on success or PEAR_Error on failure.
122
-     * @param   string  $pofile path to GNU PO file
123
-     * @param   string  $mofile path to GNU MO file
124
-     */
125
-    static function poFile2moFile($pofile, $mofile)
126
-    {
127
-        if (!is_file($pofile)) {
128
-            throw new Exception("File $pofile doesn't exist.");
129
-        }
113
+	/**
114
+	 * poFile2moFile
115
+	 *
116
+	 * That's a simple fake of the 'msgfmt' console command.  It reads the
117
+	 * contents of a GNU PO file and saves them to a GNU MO file.
118
+	 *
119
+	 * @static
120
+	 * @access  public
121
+	 * @return  mixed   Returns true on success or PEAR_Error on failure.
122
+	 * @param   string  $pofile path to GNU PO file
123
+	 * @param   string  $mofile path to GNU MO file
124
+	 */
125
+	static function poFile2moFile($pofile, $mofile)
126
+	{
127
+		if (!is_file($pofile)) {
128
+			throw new Exception("File $pofile doesn't exist.");
129
+		}
130 130
 
131
-        include_once dirname(__FILE__).'/PO.php';
131
+		include_once dirname(__FILE__).'/PO.php';
132 132
 
133
-        $PO = new TGettext_PO($pofile);
134
-        if (true !== ($e = $PO->load())) {
135
-            return $e;
136
-        }
133
+		$PO = new TGettext_PO($pofile);
134
+		if (true !== ($e = $PO->load())) {
135
+			return $e;
136
+		}
137 137
 
138
-        $MO = $PO->toMO();
139
-        if (true !== ($e = $MO->save($mofile))) {
140
-            return $e;
141
-        }
142
-        unset($PO, $MO);
138
+		$MO = $PO->toMO();
139
+		if (true !== ($e = $MO->save($mofile))) {
140
+			return $e;
141
+		}
142
+		unset($PO, $MO);
143 143
 
144
-        return true;
145
-    }
144
+		return true;
145
+	}
146 146
 
147
-    /**
148
-     * prepare
149
-     *
150
-     * @static
151
-     * @access  protected
152
-     * @return  string
153
-     * @param   string  $string
154
-     * @param   bool    $reverse
155
-     */
156
-    static function prepare($string, $reverse = false)
157
-    {
158
-        if ($reverse) {
159
-            $smap = array('"', "\n", "\t", "\r");
160
-            $rmap = array('\"', '\\n"' . "\n" . '"', '\\t', '\\r');
161
-            return (string) str_replace($smap, $rmap, $string);
162
-        } else {
163
-        	$string = preg_replace('/"\s+"/', '', $string);
164
-            $smap = array('\\n', '\\r', '\\t', '\"');
165
-            $rmap = array("\n", "\r", "\t", '"');
166
-            return (string) str_replace($smap, $rmap, $string);
167
-        }
168
-    }
147
+	/**
148
+	 * prepare
149
+	 *
150
+	 * @static
151
+	 * @access  protected
152
+	 * @return  string
153
+	 * @param   string  $string
154
+	 * @param   bool    $reverse
155
+	 */
156
+	static function prepare($string, $reverse = false)
157
+	{
158
+		if ($reverse) {
159
+			$smap = array('"', "\n", "\t", "\r");
160
+			$rmap = array('\"', '\\n"' . "\n" . '"', '\\t', '\\r');
161
+			return (string) str_replace($smap, $rmap, $string);
162
+		} else {
163
+			$string = preg_replace('/"\s+"/', '', $string);
164
+			$smap = array('\\n', '\\r', '\\t', '\"');
165
+			$rmap = array("\n", "\r", "\t", '"');
166
+			return (string) str_replace($smap, $rmap, $string);
167
+		}
168
+	}
169 169
 
170
-    /**
171
-     * meta2array
172
-     *
173
-     * @static
174
-     * @access  public
175
-     * @return  array
176
-     * @param   string  $meta
177
-     */
178
-    static function meta2array($meta)
179
-    {
180
-        $array = array();
181
-        foreach (explode("\n", $meta) as $info) {
182
-            if ($info = trim($info)) {
183
-                list($key, $value) = explode(':', $info, 2);
184
-                $array[trim($key)] = trim($value);
185
-            }
186
-        }
187
-        return $array;
188
-    }
170
+	/**
171
+	 * meta2array
172
+	 *
173
+	 * @static
174
+	 * @access  public
175
+	 * @return  array
176
+	 * @param   string  $meta
177
+	 */
178
+	static function meta2array($meta)
179
+	{
180
+		$array = array();
181
+		foreach (explode("\n", $meta) as $info) {
182
+			if ($info = trim($info)) {
183
+				list($key, $value) = explode(':', $info, 2);
184
+				$array[trim($key)] = trim($value);
185
+			}
186
+		}
187
+		return $array;
188
+	}
189 189
 
190
-    /**
191
-     * toArray
192
-     *
193
-     * Returns meta info and strings as an array of a structure like that:
194
-     * <code>
195
-     *   array(
196
-     *       'meta' => array(
197
-     *           'Content-Type'      => 'text/plain; charset=iso-8859-1',
198
-     *           'Last-Translator'   => 'Michael Wallner <[email protected]>',
199
-     *           'PO-Revision-Date'  => '2004-07-21 17:03+0200',
200
-     *           'Language-Team'     => 'German <[email protected]>',
201
-     *       ),
202
-     *       'strings' => array(
203
-     *           'All rights reserved'   => 'Alle Rechte vorbehalten',
204
-     *           'Welcome'               => 'Willkommen',
205
-     *           // ...
206
-     *       )
207
-     *   )
208
-     * </code>
209
-     *
210
-     * @see     fromArray()
211
-     * @access  protected
212
-     * @return  array
213
-     */
214
-    function toArray()
215
-    {
216
-    	return array('meta' => $this->meta, 'strings' => $this->strings);
217
-    }
190
+	/**
191
+	 * toArray
192
+	 *
193
+	 * Returns meta info and strings as an array of a structure like that:
194
+	 * <code>
195
+	 *   array(
196
+	 *       'meta' => array(
197
+	 *           'Content-Type'      => 'text/plain; charset=iso-8859-1',
198
+	 *           'Last-Translator'   => 'Michael Wallner <[email protected]>',
199
+	 *           'PO-Revision-Date'  => '2004-07-21 17:03+0200',
200
+	 *           'Language-Team'     => 'German <[email protected]>',
201
+	 *       ),
202
+	 *       'strings' => array(
203
+	 *           'All rights reserved'   => 'Alle Rechte vorbehalten',
204
+	 *           'Welcome'               => 'Willkommen',
205
+	 *           // ...
206
+	 *       )
207
+	 *   )
208
+	 * </code>
209
+	 *
210
+	 * @see     fromArray()
211
+	 * @access  protected
212
+	 * @return  array
213
+	 */
214
+	function toArray()
215
+	{
216
+		return array('meta' => $this->meta, 'strings' => $this->strings);
217
+	}
218 218
 
219
-    /**
220
-     * fromArray
221
-     *
222
-     * Assigns meta info and strings from an array of a structure like that:
223
-     * <code>
224
-     *   array(
225
-     *       'meta' => array(
226
-     *           'Content-Type'      => 'text/plain; charset=iso-8859-1',
227
-     *           'Last-Translator'   => 'Michael Wallner <[email protected]>',
228
-     *           'PO-Revision-Date'  => date('Y-m-d H:iO'),
229
-     *           'Language-Team'     => 'German <[email protected]>',
230
-     *       ),
231
-     *       'strings' => array(
232
-     *           'All rights reserved'   => 'Alle Rechte vorbehalten',
233
-     *           'Welcome'               => 'Willkommen',
234
-     *           // ...
235
-     *       )
236
-     *   )
237
-     * </code>
238
-     *
239
-     * @see     toArray()
240
-     * @access  protected
241
-     * @return  bool
242
-     * @param   array       $array
243
-     */
244
-    function fromArray($array)
245
-    {
246
-    	if (!array_key_exists('strings', $array)) {
247
-    	    if (count($array) != 2) {
248
-                return false;
249
-    	    } else {
250
-    	        list($this->meta, $this->strings) = $array;
251
-            }
252
-    	} else {
253
-            $this->meta = @$array['meta'];
254
-            $this->strings = @$array['strings'];
255
-        }
256
-        return true;
257
-    }
219
+	/**
220
+	 * fromArray
221
+	 *
222
+	 * Assigns meta info and strings from an array of a structure like that:
223
+	 * <code>
224
+	 *   array(
225
+	 *       'meta' => array(
226
+	 *           'Content-Type'      => 'text/plain; charset=iso-8859-1',
227
+	 *           'Last-Translator'   => 'Michael Wallner <[email protected]>',
228
+	 *           'PO-Revision-Date'  => date('Y-m-d H:iO'),
229
+	 *           'Language-Team'     => 'German <[email protected]>',
230
+	 *       ),
231
+	 *       'strings' => array(
232
+	 *           'All rights reserved'   => 'Alle Rechte vorbehalten',
233
+	 *           'Welcome'               => 'Willkommen',
234
+	 *           // ...
235
+	 *       )
236
+	 *   )
237
+	 * </code>
238
+	 *
239
+	 * @see     toArray()
240
+	 * @access  protected
241
+	 * @return  bool
242
+	 * @param   array       $array
243
+	 */
244
+	function fromArray($array)
245
+	{
246
+		if (!array_key_exists('strings', $array)) {
247
+			if (count($array) != 2) {
248
+				return false;
249
+			} else {
250
+				list($this->meta, $this->strings) = $array;
251
+			}
252
+		} else {
253
+			$this->meta = @$array['meta'];
254
+			$this->strings = @$array['strings'];
255
+		}
256
+		return true;
257
+	}
258 258
 
259
-    /**
260
-     * toMO
261
-     *
262
-     * @access  protected
263
-     * @return  object  File_Gettext_MO
264
-     */
265
-    function toMO()
266
-    {
267
-        include_once dirname(__FILE__).'/MO.php';
268
-        $MO = new TGettext_MO;
269
-        $MO->fromArray($this->toArray());
270
-        return $MO;
271
-    }
259
+	/**
260
+	 * toMO
261
+	 *
262
+	 * @access  protected
263
+	 * @return  object  File_Gettext_MO
264
+	 */
265
+	function toMO()
266
+	{
267
+		include_once dirname(__FILE__).'/MO.php';
268
+		$MO = new TGettext_MO;
269
+		$MO->fromArray($this->toArray());
270
+		return $MO;
271
+	}
272 272
 
273
-    /**
274
-     * toPO
275
-     *
276
-     * @access  protected
277
-     * @return  object      File_Gettext_PO
278
-     */
279
-    function toPO()
280
-    {
281
-        include_once dirname(__FILE__).'/PO.php';
282
-        $PO = new TGettext_PO;
283
-        $PO->fromArray($this->toArray());
284
-        return $PO;
285
-    }
273
+	/**
274
+	 * toPO
275
+	 *
276
+	 * @access  protected
277
+	 * @return  object      File_Gettext_PO
278
+	 */
279
+	function toPO()
280
+	{
281
+		include_once dirname(__FILE__).'/PO.php';
282
+		$PO = new TGettext_PO;
283
+		$PO->fromArray($this->toArray());
284
+		return $PO;
285
+	}
286 286
 }
Please login to merge, or discard this patch.
framework/I18N/core/MessageSource_MySQL.php 2 patches
Indentation   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -92,43 +92,43 @@
 block discarded – undo
92 92
 		*/
93 93
 		$dsninfo = $this->dns;
94 94
 
95
-     	if (isset($dsninfo['protocol']) && $dsninfo['protocol'] == 'unix')
96
-            $dbhost = ':' . $dsninfo['socket'];
97
-        else
98
-        {
95
+	 	if (isset($dsninfo['protocol']) && $dsninfo['protocol'] == 'unix')
96
+			$dbhost = ':' . $dsninfo['socket'];
97
+		else
98
+		{
99 99
 			$dbhost = $dsninfo['hostspec'] ? $dsninfo['hostspec'] : 'localhost';
100
-            if (!empty($dsninfo['port']))
101
-                $dbhost .= ':' . $dsninfo['port'];
102
-        }
103
-        $user = $dsninfo['username'];
104
-        $pw = $dsninfo['password'];
105
-
106
-        $connect_function = 'mysql_connect';
107
-
108
-        if ($dbhost && $user && $pw)
109
-            $conn = @$connect_function($dbhost, $user, $pw);
110
-        elseif ($dbhost && $user)
111
-            $conn = @$connect_function($dbhost, $user);
112
-        elseif ($dbhost)
113
-            $conn = @$connect_function($dbhost);
114
-        else
115
-            $conn = false;
116
-
117
-        if (empty($conn))
118
-        {
119
-        	throw new Exception('Error in connecting to '.$dsninfo);
120
-        }
121
-
122
-        if ($dsninfo['database'])
123
-        {
124
-        	if (!@mysql_select_db($dsninfo['database'], $conn))
125
-        		throw new Exception('Error in connecting database, dns:'.
126
-        							$dsninfo);
127
-        }
128
-        else
129
-        	throw new Exception('Please provide a database for message'.
130
-        						' translation.');
131
-       return $conn;
100
+			if (!empty($dsninfo['port']))
101
+				$dbhost .= ':' . $dsninfo['port'];
102
+		}
103
+		$user = $dsninfo['username'];
104
+		$pw = $dsninfo['password'];
105
+
106
+		$connect_function = 'mysql_connect';
107
+
108
+		if ($dbhost && $user && $pw)
109
+			$conn = @$connect_function($dbhost, $user, $pw);
110
+		elseif ($dbhost && $user)
111
+			$conn = @$connect_function($dbhost, $user);
112
+		elseif ($dbhost)
113
+			$conn = @$connect_function($dbhost);
114
+		else
115
+			$conn = false;
116
+
117
+		if (empty($conn))
118
+		{
119
+			throw new Exception('Error in connecting to '.$dsninfo);
120
+		}
121
+
122
+		if ($dsninfo['database'])
123
+		{
124
+			if (!@mysql_select_db($dsninfo['database'], $conn))
125
+				throw new Exception('Error in connecting database, dns:'.
126
+									$dsninfo);
127
+		}
128
+		else
129
+			throw new Exception('Please provide a database for message'.
130
+								' translation.');
131
+	   return $conn;
132 132
 	}
133 133
 
134 134
 	/**
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -124,8 +124,7 @@
 block discarded – undo
124 124
         	if (!@mysql_select_db($dsninfo['database'], $conn))
125 125
         		throw new Exception('Error in connecting database, dns:'.
126 126
         							$dsninfo);
127
-        }
128
-        else
127
+        } else
129 128
         	throw new Exception('Please provide a database for message'.
130 129
         						' translation.');
131 130
        return $conn;
Please login to merge, or discard this patch.
framework/Util/TDataFieldAccessor.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@
 block discarded – undo
59 59
 
60 60
 				$tmp = $data;
61 61
 				foreach (explode(".", $field) as $f)
62
-				    $tmp = $tmp[$f];
62
+					$tmp = $tmp[$f];
63 63
 				return $tmp;
64 64
 			}
65 65
 			else if(is_object($data))
Please login to merge, or discard this patch.
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -61,8 +61,7 @@  discard block
 block discarded – undo
61 61
 				foreach (explode(".", $field) as $f)
62 62
 				    $tmp = $tmp[$f];
63 63
 				return $tmp;
64
-			}
65
-			else if(is_object($data))
64
+			} else if(is_object($data))
66 65
 			{
67 66
 				if(strpos($field,'.')===false)  // simple field
68 67
 				{
@@ -70,8 +69,7 @@  discard block
 block discarded – undo
70 69
 						return call_user_func(array($data,'get'.$field));
71 70
 					else
72 71
 						return $data->{$field};
73
-				}
74
-				else // field in the format of xxx.yyy.zzz
72
+				} else // field in the format of xxx.yyy.zzz
75 73
 				{
76 74
 					$object=$data;
77 75
 					foreach(explode('.',$field) as $f)
@@ -79,8 +77,7 @@  discard block
 block discarded – undo
79 77
 					return $object;
80 78
 				}
81 79
 			}
82
-		}
83
-		catch(Exception $e)
80
+		} catch(Exception $e)
84 81
 		{
85 82
 			throw new TInvalidDataValueException('datafieldaccessor_datafield_invalid',$field,$e->getMessage());
86 83
 		}
Please login to merge, or discard this patch.
framework/Web/Javascripts/JSMin.php 2 patches
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -191,8 +191,7 @@  discard block
 block discarded – undo
191 191
             default:
192 192
               if ($this->isAlphaNum($this->b)) {
193 193
                 $this->action(1);
194
-              }
195
-              else {
194
+              } else {
196 195
                 $this->action(2);
197 196
               }
198 197
           }
@@ -224,8 +223,7 @@  discard block
 block discarded – undo
224 223
                 default:
225 224
                   if ($this->isAlphaNum($this->a)) {
226 225
                     $this->action(1);
227
-                  }
228
-                  else {
226
+                  } else {
229 227
                     $this->action(3);
230 228
                   }
231 229
               }
Please login to merge, or discard this patch.
Indentation   +198 added lines, -198 removed lines patch added patch discarded remove patch
@@ -59,228 +59,228 @@
 block discarded – undo
59 59
   // -- Public Static Methods --------------------------------------------------
60 60
 
61 61
   public static function minify($js) {
62
-    $jsmin = new JSMin($js);
63
-    return $jsmin->min();
62
+	$jsmin = new JSMin($js);
63
+	return $jsmin->min();
64 64
   }
65 65
 
66 66
   // -- Public Instance Methods ------------------------------------------------
67 67
 
68 68
   public function __construct($input) {
69
-    $this->input       = str_replace("\r\n", "\n", $input);
70
-    $this->inputLength = strlen($this->input);
69
+	$this->input       = str_replace("\r\n", "\n", $input);
70
+	$this->inputLength = strlen($this->input);
71 71
   }
72 72
 
73 73
   // -- Protected Instance Methods ---------------------------------------------
74 74
 
75 75
   protected function action($d) {
76
-    switch($d) {
77
-      case 1:
78
-        $this->output .= $this->a;
79
-
80
-      case 2:
81
-        $this->a = $this->b;
82
-
83
-        if ($this->a === "'" || $this->a === '"') {
84
-          for (;;) {
85
-            $this->output .= $this->a;
86
-            $this->a       = $this->get();
87
-
88
-            if ($this->a === $this->b) {
89
-              break;
90
-            }
91
-
92
-            if (ord($this->a) <= self::ORD_LF) {
93
-              throw new JSMinException('Unterminated string literal.');
94
-            }
95
-
96
-            if ($this->a === '\\') {
97
-              $this->output .= $this->a;
98
-              $this->a       = $this->get();
99
-            }
100
-          }
101
-        }
102
-
103
-      case 3:
104
-        $this->b = $this->next();
105
-
106
-        if ($this->b === '/' && (
107
-            $this->a === '(' || $this->a === ',' || $this->a === '=' ||
108
-            $this->a === ':' || $this->a === '[' || $this->a === '!' ||
109
-            $this->a === '&' || $this->a === '|' || $this->a === '?')) {
110
-
111
-          $this->output .= $this->a . $this->b;
112
-
113
-          for (;;) {
114
-            $this->a = $this->get();
115
-
116
-            if ($this->a === '/') {
117
-              break;
118
-            } elseif ($this->a === '\\') {
119
-              $this->output .= $this->a;
120
-              $this->a       = $this->get();
121
-            } elseif (ord($this->a) <= self::ORD_LF) {
122
-              throw new JSMinException('Unterminated regular expression '.
123
-                  'literal.');
124
-            }
125
-
126
-            $this->output .= $this->a;
127
-          }
128
-
129
-          $this->b = $this->next();
130
-        }
131
-    }
76
+	switch($d) {
77
+	  case 1:
78
+		$this->output .= $this->a;
79
+
80
+	  case 2:
81
+		$this->a = $this->b;
82
+
83
+		if ($this->a === "'" || $this->a === '"') {
84
+		  for (;;) {
85
+			$this->output .= $this->a;
86
+			$this->a       = $this->get();
87
+
88
+			if ($this->a === $this->b) {
89
+			  break;
90
+			}
91
+
92
+			if (ord($this->a) <= self::ORD_LF) {
93
+			  throw new JSMinException('Unterminated string literal.');
94
+			}
95
+
96
+			if ($this->a === '\\') {
97
+			  $this->output .= $this->a;
98
+			  $this->a       = $this->get();
99
+			}
100
+		  }
101
+		}
102
+
103
+	  case 3:
104
+		$this->b = $this->next();
105
+
106
+		if ($this->b === '/' && (
107
+			$this->a === '(' || $this->a === ',' || $this->a === '=' ||
108
+			$this->a === ':' || $this->a === '[' || $this->a === '!' ||
109
+			$this->a === '&' || $this->a === '|' || $this->a === '?')) {
110
+
111
+		  $this->output .= $this->a . $this->b;
112
+
113
+		  for (;;) {
114
+			$this->a = $this->get();
115
+
116
+			if ($this->a === '/') {
117
+			  break;
118
+			} elseif ($this->a === '\\') {
119
+			  $this->output .= $this->a;
120
+			  $this->a       = $this->get();
121
+			} elseif (ord($this->a) <= self::ORD_LF) {
122
+			  throw new JSMinException('Unterminated regular expression '.
123
+				  'literal.');
124
+			}
125
+
126
+			$this->output .= $this->a;
127
+		  }
128
+
129
+		  $this->b = $this->next();
130
+		}
131
+	}
132 132
   }
133 133
 
134 134
   protected function get() {
135
-    $c = $this->lookAhead;
136
-    $this->lookAhead = null;
137
-
138
-    if ($c === null) {
139
-      if ($this->inputIndex < $this->inputLength) {
140
-        $c = $this->input[$this->inputIndex];
141
-        $this->inputIndex += 1;
142
-      } else {
143
-        $c = null;
144
-      }
145
-    }
146
-
147
-    if ($c === "\r") {
148
-      return "\n";
149
-    }
150
-
151
-    if ($c === null || $c === "\n" || ord($c) >= self::ORD_SPACE) {
152
-      return $c;
153
-    }
154
-
155
-    return ' ';
135
+	$c = $this->lookAhead;
136
+	$this->lookAhead = null;
137
+
138
+	if ($c === null) {
139
+	  if ($this->inputIndex < $this->inputLength) {
140
+		$c = $this->input[$this->inputIndex];
141
+		$this->inputIndex += 1;
142
+	  } else {
143
+		$c = null;
144
+	  }
145
+	}
146
+
147
+	if ($c === "\r") {
148
+	  return "\n";
149
+	}
150
+
151
+	if ($c === null || $c === "\n" || ord($c) >= self::ORD_SPACE) {
152
+	  return $c;
153
+	}
154
+
155
+	return ' ';
156 156
   }
157 157
 
158 158
   protected function isAlphaNum($c) {
159
-    return ord($c) > 126 || $c === '\\' || preg_match('/^[\w\$]$/', $c) === 1;
159
+	return ord($c) > 126 || $c === '\\' || preg_match('/^[\w\$]$/', $c) === 1;
160 160
   }
161 161
 
162 162
   protected function min() {
163
-    $this->a = "\n";
164
-    $this->action(3);
165
-
166
-    while ($this->a !== null) {
167
-      switch ($this->a) {
168
-        case ' ':
169
-          if ($this->isAlphaNum($this->b)) {
170
-            $this->action(1);
171
-          } else {
172
-            $this->action(2);
173
-          }
174
-          break;
175
-
176
-        case "\n":
177
-          switch ($this->b) {
178
-            case '{':
179
-            case '[':
180
-            case '(':
181
-            case '+':
182
-            case '-':
183
-              $this->action(1);
184
-              break;
185
-
186
-            case ' ':
187
-              $this->action(3);
188
-              break;
189
-
190
-            default:
191
-              if ($this->isAlphaNum($this->b)) {
192
-                $this->action(1);
193
-              }
194
-              else {
195
-                $this->action(2);
196
-              }
197
-          }
198
-          break;
199
-
200
-        default:
201
-          switch ($this->b) {
202
-            case ' ':
203
-              if ($this->isAlphaNum($this->a)) {
204
-                $this->action(1);
205
-                break;
206
-              }
207
-
208
-              $this->action(3);
209
-              break;
210
-
211
-            case "\n":
212
-              switch ($this->a) {
213
-                case '}':
214
-                case ']':
215
-                case ')':
216
-                case '+':
217
-                case '-':
218
-                case '"':
219
-                case "'":
220
-                  $this->action(1);
221
-                  break;
222
-
223
-                default:
224
-                  if ($this->isAlphaNum($this->a)) {
225
-                    $this->action(1);
226
-                  }
227
-                  else {
228
-                    $this->action(3);
229
-                  }
230
-              }
231
-              break;
232
-
233
-            default:
234
-              $this->action(1);
235
-              break;
236
-          }
237
-      }
238
-    }
239
-
240
-    return $this->output;
163
+	$this->a = "\n";
164
+	$this->action(3);
165
+
166
+	while ($this->a !== null) {
167
+	  switch ($this->a) {
168
+		case ' ':
169
+		  if ($this->isAlphaNum($this->b)) {
170
+			$this->action(1);
171
+		  } else {
172
+			$this->action(2);
173
+		  }
174
+		  break;
175
+
176
+		case "\n":
177
+		  switch ($this->b) {
178
+			case '{':
179
+			case '[':
180
+			case '(':
181
+			case '+':
182
+			case '-':
183
+			  $this->action(1);
184
+			  break;
185
+
186
+			case ' ':
187
+			  $this->action(3);
188
+			  break;
189
+
190
+			default:
191
+			  if ($this->isAlphaNum($this->b)) {
192
+				$this->action(1);
193
+			  }
194
+			  else {
195
+				$this->action(2);
196
+			  }
197
+		  }
198
+		  break;
199
+
200
+		default:
201
+		  switch ($this->b) {
202
+			case ' ':
203
+			  if ($this->isAlphaNum($this->a)) {
204
+				$this->action(1);
205
+				break;
206
+			  }
207
+
208
+			  $this->action(3);
209
+			  break;
210
+
211
+			case "\n":
212
+			  switch ($this->a) {
213
+				case '}':
214
+				case ']':
215
+				case ')':
216
+				case '+':
217
+				case '-':
218
+				case '"':
219
+				case "'":
220
+				  $this->action(1);
221
+				  break;
222
+
223
+				default:
224
+				  if ($this->isAlphaNum($this->a)) {
225
+					$this->action(1);
226
+				  }
227
+				  else {
228
+					$this->action(3);
229
+				  }
230
+			  }
231
+			  break;
232
+
233
+			default:
234
+			  $this->action(1);
235
+			  break;
236
+		  }
237
+	  }
238
+	}
239
+
240
+	return $this->output;
241 241
   }
242 242
 
243 243
   protected function next() {
244
-    $c = $this->get();
245
-
246
-    if ($c === '/') {
247
-      switch($this->peek()) {
248
-        case '/':
249
-          for (;;) {
250
-            $c = $this->get();
251
-
252
-            if (ord($c) <= self::ORD_LF) {
253
-              return $c;
254
-            }
255
-          }
256
-
257
-        case '*':
258
-          $this->get();
259
-
260
-          for (;;) {
261
-            switch($this->get()) {
262
-              case '*':
263
-                if ($this->peek() === '/') {
264
-                  $this->get();
265
-                  return ' ';
266
-                }
267
-                break;
268
-
269
-              case null:
270
-                throw new JSMinException('Unterminated comment.');
271
-            }
272
-          }
273
-
274
-        default:
275
-          return $c;
276
-      }
277
-    }
278
-
279
-    return $c;
244
+	$c = $this->get();
245
+
246
+	if ($c === '/') {
247
+	  switch($this->peek()) {
248
+		case '/':
249
+		  for (;;) {
250
+			$c = $this->get();
251
+
252
+			if (ord($c) <= self::ORD_LF) {
253
+			  return $c;
254
+			}
255
+		  }
256
+
257
+		case '*':
258
+		  $this->get();
259
+
260
+		  for (;;) {
261
+			switch($this->get()) {
262
+			  case '*':
263
+				if ($this->peek() === '/') {
264
+				  $this->get();
265
+				  return ' ';
266
+				}
267
+				break;
268
+
269
+			  case null:
270
+				throw new JSMinException('Unterminated comment.');
271
+			}
272
+		  }
273
+
274
+		default:
275
+		  return $c;
276
+	  }
277
+	}
278
+
279
+	return $c;
280 280
   }
281 281
 
282 282
   protected function peek() {
283
-    $this->lookAhead = $this->get();
284
-    return $this->lookAhead;
283
+	$this->lookAhead = $this->get();
284
+	return $this->lookAhead;
285 285
   }
286 286
 }
287 287
\ No newline at end of file
Please login to merge, or discard this patch.