Applied fixes from StyleCI

This commit is contained in:
Manish Verma
2016-10-17 12:28:49 +00:00
committed by StyleCI Bot
parent ec61ab6c7a
commit 00d9c1b82a
4 changed files with 17 additions and 15 deletions

View File

@@ -411,8 +411,8 @@ class UserController extends Controller
$users = User::where('id', '=', $id)->first(); $users = User::where('id', '=', $id)->first();
if ($users->role == 'user') { if ($users->role == 'user') {
if ($delete_all == null || $delete_all == 1) { if ($delete_all == null || $delete_all == 1) {
$tickets = Tickets::where('user_id', '=' ,$id)->get(); $tickets = Tickets::where('user_id', '=', $id)->get();
if(count($tickets) > 0) { if (count($tickets) > 0) {
foreach ($tickets as $ticket) { foreach ($tickets as $ticket) {
$notification = Notification::select('id')->where('model_id', '=', $ticket->id)->get(); $notification = Notification::select('id')->where('model_id', '=', $ticket->id)->get();
foreach ($notification as $id) { foreach ($notification as $id) {
@@ -428,7 +428,7 @@ class UserController extends Controller
$attachment = Ticket_attachments::where('thread_id', '=', $th_id->id)->get(); $attachment = Ticket_attachments::where('thread_id', '=', $th_id->id)->get();
if (count($attachment)) { if (count($attachment)) {
foreach ($attachment as $a_id) { foreach ($attachment as $a_id) {
Ticket_attachments::where('id','=', $a_id->id) Ticket_attachments::where('id', '=', $a_id->id)
->delete(); ->delete();
} }
// echo "<br>"; // echo "<br>";
@@ -454,7 +454,6 @@ class UserController extends Controller
->delete(); ->delete();
return redirect('user')->with('success', Lang::get('lang.user_delete_successfully')); return redirect('user')->with('success', Lang::get('lang.user_delete_successfully'));
} }
} }

View File

@@ -179,12 +179,12 @@ class PhpMailController extends Controller
$port = $from_address->sending_port; $port = $from_address->sending_port;
$protocol = $from_address->sending_protocol; $protocol = $from_address->sending_protocol;
$this->setServices($from_address->id, $protocol); $this->setServices($from_address->id, $protocol);
if($protocol=='mail'){ if ($protocol == 'mail') {
$username = ""; $username = '';
$fromname=""; $fromname = '';
$host=""; $host = '';
$smtpsecure =""; $smtpsecure = '';
$port=""; $port = '';
} }
$configs = [ $configs = [
'username' => $username, 'username' => $username,

View File

@@ -156,18 +156,21 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
return $this->user_name; return $this->user_name;
} }
/** /**
* @category function to check profile pic source srting ends with profilepic or not * @category function to check profile pic source srting ends with profilepic or not
*
* @param string $haystack, $needle * @param string $haystack, $needle
* @return boolean true/false *
* @return bool true/false
*/ */
function endsWith($haystack, $needle) public function endsWith($haystack, $needle)
{ {
$length = strlen($needle); $length = strlen($needle);
if ($length == 0) { if ($length == 0) {
return true; return true;
} }
return (substr($haystack, -$length) === $needle); return substr($haystack, -$length) === $needle;
} }
} }