Skip to content

Commit

Permalink
Merge pull request bcit-ci#5367 from carusogabriel/clean-elses
Browse files Browse the repository at this point in the history
Clean elses
  • Loading branch information
narfbg authored Dec 27, 2017
2 parents fbae310 + 7774e38 commit 3b470a6
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 45 deletions.
6 changes: 2 additions & 4 deletions system/database/DB_forge.php
Original file line number Diff line number Diff line change
Expand Up @@ -382,10 +382,8 @@ protected function _create_table($table, $if_not_exists, $attributes)
{
return TRUE;
}
else
{
$if_not_exists = FALSE;
}

$if_not_exists = FALSE;
}

$sql = ($if_not_exists)
Expand Down
9 changes: 4 additions & 5 deletions system/database/DB_result.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,8 @@ public function result($type = 'object')
{
return $this->result_object();
}
else
{
return $this->custom_result_object($type);
}

return $this->custom_result_object($type);
}

// --------------------------------------------------------------------
Expand Down Expand Up @@ -336,7 +334,8 @@ public function row($n = 0, $type = 'object')

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);
}

// --------------------------------------------------------------------
Expand Down
12 changes: 4 additions & 8 deletions system/libraries/Email.php
Original file line number Diff line number Diff line change
Expand Up @@ -941,10 +941,8 @@ protected function _get_content_type()
{
return 'plain-attach';
}
else
{
return 'plain';
}

return 'plain';
}

// --------------------------------------------------------------------
Expand Down Expand Up @@ -2209,10 +2207,8 @@ protected function _send_data($data)
usleep(250000);
continue;
}
else
{
$timestamp = 0;
}

$timestamp = 0;
}

if ($result === FALSE)
Expand Down
6 changes: 2 additions & 4 deletions system/libraries/Encryption.php
Original file line number Diff line number Diff line change
Expand Up @@ -682,10 +682,8 @@ protected function _get_params($params)
{
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)
Expand Down
6 changes: 2 additions & 4 deletions system/libraries/Session/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -222,10 +222,8 @@ protected function _ci_load_classes($driver)
{
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;
Expand Down
6 changes: 2 additions & 4 deletions system/libraries/Upload.php
Original file line number Diff line number Diff line change
Expand Up @@ -678,10 +678,8 @@ public function set_filename($path, $filename)
$this->set_error('upload_bad_filename', 'debug');
return FALSE;
}
else
{
return $new_filename;
}

return $new_filename;
}

// --------------------------------------------------------------------
Expand Down
18 changes: 6 additions & 12 deletions system/libraries/Xmlrpcs.php
Original file line number Diff line number Diff line change
Expand Up @@ -402,15 +402,11 @@ protected function _execute($m)
{
return get_instance()->{$method_parts[1]}($m);
}
else
{
return $this->object->{$method_parts[1]}($m);
}
}
else
{
return call_user_func($this->methods[$methName]['function'], $m);

return $this->object->{$method_parts[1]}($m);
}

return call_user_func($this->methods[$methName]['function'], $m);
}

// --------------------------------------------------------------------
Expand Down Expand Up @@ -499,10 +495,8 @@ public function methodHelp($m)

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']);
}

// --------------------------------------------------------------------
Expand Down
6 changes: 2 additions & 4 deletions tests/mocks/ci_testcase.php
Original file line number Diff line number Diff line change
Expand Up @@ -377,10 +377,8 @@ public function __call($method, $args)
{
return call_user_func_array($this->{$method},$args);
}
else
{
return parent::__call($method, $args);
}

return parent::__call($method, $args);
}

}

0 comments on commit 3b470a6

Please sign in to comment.