Merge pull request #5367 from carusogabriel/clean-elses

Clean elses
diff --git a/system/database/DB_forge.php b/system/database/DB_forge.php
index 3cb02ca..f1e0b14 100644
--- a/system/database/DB_forge.php
+++ b/system/database/DB_forge.php
@@ -382,10 +382,8 @@
 			{
 				return TRUE;
 			}
-			else
-			{
-				$if_not_exists = FALSE;
-			}
+
+			$if_not_exists = FALSE;
 		}
 
 		$sql = ($if_not_exists)
diff --git a/system/database/DB_result.php b/system/database/DB_result.php
index 98d8876..40b8fbb 100644
--- a/system/database/DB_result.php
+++ b/system/database/DB_result.php
@@ -163,10 +163,8 @@
 		{
 			return $this->result_object();
 		}
-		else
-		{
-			return $this->custom_result_object($type);
-		}
+
+		return $this->custom_result_object($type);
 	}
 
 	// --------------------------------------------------------------------
@@ -336,7 +334,8 @@
 
 		if ($type === 'object') return $this->row_object($n);
 		elseif ($type === 'array') return $this->row_array($n);
-		else return $this->custom_row_object($n, $type);
+
+		return $this->custom_row_object($n, $type);
 	}
 
 	// --------------------------------------------------------------------
diff --git a/system/libraries/Email.php b/system/libraries/Email.php
index 948cdb5..8fefcba 100644
--- a/system/libraries/Email.php
+++ b/system/libraries/Email.php
@@ -961,10 +961,8 @@
 		{
 			return 'plain-attach';
 		}
-		else
-		{
-			return 'plain';
-		}
+
+		return 'plain';
 	}
 
 	// --------------------------------------------------------------------
@@ -2267,10 +2265,8 @@
 				usleep(250000);
 				continue;
 			}
-			else
-			{
-				$timestamp = 0;
-			}
+
+			$timestamp = 0;
 		}
 
 		if ($result === FALSE)
diff --git a/system/libraries/Encryption.php b/system/libraries/Encryption.php
index c1e454d..9a21bae 100644
--- a/system/libraries/Encryption.php
+++ b/system/libraries/Encryption.php
@@ -682,10 +682,8 @@
 			{
 				return FALSE;
 			}
-			else
-			{
-				$params['mode'] = $this->_modes[$this->_driver][$params['mode']];
-			}
+
+			$params['mode'] = $this->_modes[$this->_driver][$params['mode']];
 		}
 
 		if (isset($params['hmac']) && $params['hmac'] === FALSE)
diff --git a/system/libraries/Session/Session.php b/system/libraries/Session/Session.php
index eb433de..bf22227 100644
--- a/system/libraries/Session/Session.php
+++ b/system/libraries/Session/Session.php
@@ -241,10 +241,8 @@
 			{
 				return $prefix.$class;
 			}
-			else
-			{
-				log_message('debug', 'Session: '.$prefix.$class.".php found but it doesn't declare class ".$prefix.$class.'.');
-			}
+
+			log_message('debug', 'Session: '.$prefix.$class.".php found but it doesn't declare class ".$prefix.$class.'.');
 		}
 
 		return 'CI_'.$class;
diff --git a/system/libraries/Upload.php b/system/libraries/Upload.php
index 0ad8dd3..3b450c5 100644
--- a/system/libraries/Upload.php
+++ b/system/libraries/Upload.php
@@ -678,10 +678,8 @@
 			$this->set_error('upload_bad_filename', 'debug');
 			return FALSE;
 		}
-		else
-		{
-			return $new_filename;
-		}
+
+		return $new_filename;
 	}
 
 	// --------------------------------------------------------------------
diff --git a/system/libraries/Xmlrpcs.php b/system/libraries/Xmlrpcs.php
index 0274f13..7f760a0 100644
--- a/system/libraries/Xmlrpcs.php
+++ b/system/libraries/Xmlrpcs.php
@@ -402,15 +402,11 @@
 			{
 				return get_instance()->{$method_parts[1]}($m);
 			}
-			else
-			{
-				return $this->object->{$method_parts[1]}($m);
-			}
+
+			return $this->object->{$method_parts[1]}($m);
 		}
-		else
-		{
-			return call_user_func($this->methods[$methName]['function'], $m);
-		}
+
+		return call_user_func($this->methods[$methName]['function'], $m);
 	}
 
 	// --------------------------------------------------------------------
@@ -499,10 +495,8 @@
 
 			return new XML_RPC_Response(new XML_RPC_Values($docstring, 'string'));
 		}
-		else
-		{
-			return new XML_RPC_Response(0, $this->xmlrpcerr['introspect_unknown'], $this->xmlrpcstr['introspect_unknown']);
-		}
+
+		return new XML_RPC_Response(0, $this->xmlrpcerr['introspect_unknown'], $this->xmlrpcstr['introspect_unknown']);
 	}
 
 	// --------------------------------------------------------------------
diff --git a/tests/mocks/ci_testcase.php b/tests/mocks/ci_testcase.php
index a2c37b9..e5c8632 100644
--- a/tests/mocks/ci_testcase.php
+++ b/tests/mocks/ci_testcase.php
@@ -377,10 +377,8 @@
 		{
 			return call_user_func_array($this->{$method},$args);
 		}
-		else
-		{
-			return parent::__call($method, $args);
-		}
+
+		return parent::__call($method, $args);
 	}
 
 }