From 00d9c1b82ac3e60bb74420b0126a295ab4920446 Mon Sep 17 00:00:00 2001 From: Manish Verma Date: Mon, 17 Oct 2016 12:28:49 +0000 Subject: [PATCH] Applied fixes from StyleCI --- .../Controllers/Agent/helpdesk/UserController.php | 7 +++---- app/Http/Controllers/Common/PhpMailController.php | 12 ++++++------ app/User.php | 11 +++++++---- resources/lang/en/lang.php | 2 +- 4 files changed, 17 insertions(+), 15 deletions(-) diff --git a/app/Http/Controllers/Agent/helpdesk/UserController.php b/app/Http/Controllers/Agent/helpdesk/UserController.php index 3bd1309b2..569ab1866 100644 --- a/app/Http/Controllers/Agent/helpdesk/UserController.php +++ b/app/Http/Controllers/Agent/helpdesk/UserController.php @@ -411,8 +411,8 @@ class UserController extends Controller $users = User::where('id', '=', $id)->first(); if ($users->role == 'user') { if ($delete_all == null || $delete_all == 1) { - $tickets = Tickets::where('user_id', '=' ,$id)->get(); - if(count($tickets) > 0) { + $tickets = Tickets::where('user_id', '=', $id)->get(); + if (count($tickets) > 0) { foreach ($tickets as $ticket) { $notification = Notification::select('id')->where('model_id', '=', $ticket->id)->get(); foreach ($notification as $id) { @@ -428,7 +428,7 @@ class UserController extends Controller $attachment = Ticket_attachments::where('thread_id', '=', $th_id->id)->get(); if (count($attachment)) { foreach ($attachment as $a_id) { - Ticket_attachments::where('id','=', $a_id->id) + Ticket_attachments::where('id', '=', $a_id->id) ->delete(); } // echo "
"; @@ -454,7 +454,6 @@ class UserController extends Controller ->delete(); return redirect('user')->with('success', Lang::get('lang.user_delete_successfully')); - } } diff --git a/app/Http/Controllers/Common/PhpMailController.php b/app/Http/Controllers/Common/PhpMailController.php index 614fc6b58..faee32ff1 100644 --- a/app/Http/Controllers/Common/PhpMailController.php +++ b/app/Http/Controllers/Common/PhpMailController.php @@ -179,12 +179,12 @@ class PhpMailController extends Controller $port = $from_address->sending_port; $protocol = $from_address->sending_protocol; $this->setServices($from_address->id, $protocol); - if($protocol=='mail'){ - $username = ""; - $fromname=""; - $host=""; - $smtpsecure =""; - $port=""; + if ($protocol == 'mail') { + $username = ''; + $fromname = ''; + $host = ''; + $smtpsecure = ''; + $port = ''; } $configs = [ 'username' => $username, diff --git a/app/User.php b/app/User.php index aaf946661..03fd636ae 100644 --- a/app/User.php +++ b/app/User.php @@ -51,7 +51,7 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon if ($this->endsWith($pic, 'profilepic')) { $pic = \Gravatar::src($this->attributes['email']); } - + return $pic; } @@ -156,18 +156,21 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon return $this->user_name; } + /** * @category function to check profile pic source srting ends with profilepic or not + * * @param string $haystack, $needle - * @return boolean true/false + * + * @return bool true/false */ - function endsWith($haystack, $needle) + public function endsWith($haystack, $needle) { $length = strlen($needle); if ($length == 0) { return true; } - return (substr($haystack, -$length) === $needle); + return substr($haystack, -$length) === $needle; } } diff --git a/resources/lang/en/lang.php b/resources/lang/en/lang.php index b1cf78102..25260c1fb 100644 --- a/resources/lang/en/lang.php +++ b/resources/lang/en/lang.php @@ -1518,7 +1518,7 @@ return [ 'password_generator' => 'Password Generator', 'depertment' => 'Depertment', 'duetoday' => 'Due Today', - 'today-due_tickets' => 'Today\'s due ticekts', + 'today-due_tickets' => 'Today\'s due ticekts', 'password_change_successfully' => 'Password Change Successfully', 'role_change_successfully' => 'Role Change Successfully', 'user_delete_successfully' => 'User Delete Successfully',