Cleanup the core classes
diff --git a/system/core/URI.php b/system/core/URI.php
index cf82c58..e66cb6d 100755
--- a/system/core/URI.php
+++ b/system/core/URI.php
@@ -22,6 +22,7 @@
  * @license		http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
  * @link		http://codeigniter.com
  * @since		Version 1.0
+ * @filesource
  */
 
 /**
@@ -43,21 +44,21 @@
 	 * @var array
 	 */
 	public $keyval =	array();
-	
+
 	/**
 	 * Current uri string
 	 *
 	 * @var string
 	 */
 	public $uri_string;
-	
+
 	/**
 	 * List of uri segments
 	 *
 	 * @var array
 	 */
 	public $segments =	array();
-	
+
 	/**
 	 * Re-indexed list of uri segments
 	 * Starts at 1 instead of 0
@@ -72,6 +73,8 @@
 	 * Simply globalizes the $RTR object. The front
 	 * loads the Router class early on so it's not available
 	 * normally as other classes are.
+	 *
+	 * @return	void
 	 */
 	public function __construct()
 	{
@@ -148,7 +151,7 @@
 			return;
 		}
 
-		$path = (isset($_SERVER[$uri])) ? $_SERVER[$uri] : @getenv($uri);
+		$path = isset($_SERVER[$uri]) ? $_SERVER[$uri] : @getenv($uri);
 		$this->_set_uri_string($path);
 	}
 
@@ -181,7 +184,7 @@
 	 */
 	protected function _detect_uri()
 	{
-		if ( ! isset($_SERVER['REQUEST_URI']) OR ! isset($_SERVER['SCRIPT_NAME']))
+		if ( ! isset($_SERVER['REQUEST_URI'], $_SERVER['SCRIPT_NAME']))
 		{
 			return '';
 		}
@@ -227,20 +230,19 @@
 	}
 
 	// --------------------------------------------------------------------
-	
+
 	/**
 	 * Is cli Request?
 	 *
 	 * Duplicate of function from the Input class to test to see if a request was made from the command line
 	 *
-	 * @return 	boolean
+	 * @return 	bool
 	 */
 	protected function _is_cli_request()
 	{
-		return (php_sapi_name() == 'cli') OR defined('STDIN');
+		return (php_sapi_name() === 'cli') OR defined('STDIN');
 	}
 
-	
 	// --------------------------------------------------------------------
 
 	/**
@@ -253,7 +255,7 @@
 	protected function _parse_cli_args()
 	{
 		$args = array_slice($_SERVER['argv'], 1);
-		return $args ? '/' . implode('/', $args) : '';
+		return $args ? '/'.implode('/', $args) : '';
 	}
 
 	// --------------------------------------------------------------------
@@ -327,7 +329,7 @@
 	}
 
 	// --------------------------------------------------------------------
-	
+
 	/**
 	 * Re-index Segments
 	 *
@@ -355,13 +357,13 @@
 	 *
 	 * This function returns the URI segment based on the number provided.
 	 *
-	 * @param	integer
+	 * @param	int
 	 * @param	bool
 	 * @return	string
 	 */
 	public function segment($n, $no_result = FALSE)
 	{
-		return ( ! isset($this->segments[$n])) ? $no_result : $this->segments[$n];
+		return isset($this->segments[$n]) ? $this->segments[$n] : $no_result;
 	}
 
 	// --------------------------------------------------------------------
@@ -370,16 +372,16 @@
 	 * Fetch a URI "routed" Segment
 	 *
 	 * This function returns the re-routed URI segment (assuming routing rules are used)
-	 * based on the number provided.  If there is no routing this function returns the
+	 * based on the number provided. If there is no routing this function returns the
 	 * same result as $this->segment()
 	 *
-	 * @param	integer
+	 * @param	int
 	 * @param	bool
 	 * @return	string
 	 */
 	public function rsegment($n, $no_result = FALSE)
 	{
-		return ( ! isset($this->rsegments[$n])) ? $no_result : $this->rsegments[$n];
+		return isset($this->rsegments[$n]) ? $this->rsegments[$n] : $no_result;
 	}
 
 	// --------------------------------------------------------------------
@@ -400,7 +402,7 @@
 	 *			gender => male
 	 *		 )
 	 *
-	 * @param	integer	the starting segment number
+	 * @param	int	the starting segment number
 	 * @param	array	an array of default values
 	 * @return	array
 	 */
@@ -408,13 +410,13 @@
 	{
 		return $this->_uri_to_assoc($n, $default, 'segment');
 	}
-	
+
 	// --------------------------------------------------------------------
-	
+
 	/**
 	 * Identical to above only it uses the re-routed segment array
 	 *
-	 * @param 	integer	the starting segment number
+	 * @param 	int	the starting segment number
 	 * @param 	array	an array of default values
 	 * @return 	array
 	 */
@@ -428,7 +430,7 @@
 	/**
 	 * Generate a key value pair from the URI string or Re-routed URI string
 	 *
-	 * @param	integer	the starting segment number
+	 * @param	int	the starting segment number
 	 * @param	array	an array of default values
 	 * @param	string	which array we should use
 	 * @return	array
@@ -458,12 +460,9 @@
 
 		if ($this->$total_segments() < $n)
 		{
-			if (count($default) === 0)
-			{
-				return array();
-			}
-
-			return array_fill_keys($default, FALSE);
+			return (count($default) === 0)
+				? array()
+				: array_fill_keys($default, FALSE);
 		}
 
 		$segments = array_slice($this->$segment_array(), ($n - 1));
@@ -512,7 +511,7 @@
 	public function assoc_to_uri($array)
 	{
 		$temp = array();
-		foreach ((array)$array as $key => $val)
+		foreach ( (array) $array as $key => $val)
 		{
 			$temp[] = $key;
 			$temp[] = $val;
@@ -526,7 +525,7 @@
 	/**
 	 * Fetch a URI Segment and add a trailing slash
 	 *
-	 * @param	integer
+	 * @param	int
 	 * @param	string
 	 * @return	string
 	 */
@@ -540,7 +539,7 @@
 	/**
 	 * Fetch a URI Segment and add a trailing slash
 	 *
-	 * @param	integer
+	 * @param	int
 	 * @param	string
 	 * @return	string
 	 */
@@ -554,7 +553,7 @@
 	/**
 	 * Fetch a URI Segment and add a trailing slash - helper function
 	 *
-	 * @param	integer
+	 * @param	int
 	 * @param	string
 	 * @param	string
 	 * @return	string
@@ -604,7 +603,7 @@
 	/**
 	 * Total number of segments
 	 *
-	 * @return	integer
+	 * @return	int
 	 */
 	public function total_segments()
 	{
@@ -616,7 +615,7 @@
 	/**
 	 * Total number of routed segments
 	 *
-	 * @return	integer
+	 * @return	int
 	 */
 	public function total_rsegments()
 	{
@@ -651,4 +650,4 @@
 }
 
 /* End of file URI.php */
-/* Location: ./system/core/URI.php */
+/* Location: ./system/core/URI.php */
\ No newline at end of file