Apply fixes from StyleCI

This commit is contained in:
StyleCI Bot
2023-01-07 20:34:10 +00:00
parent 6066e82e9c
commit a5dde6a61a
232 changed files with 14828 additions and 14443 deletions

View File

@@ -46,12 +46,13 @@ class TicketController extends Controller
/**
* Create Ticket.
*
* @param type $user_id
* @param type $subject
* @param type $body
* @param type $helptopic
* @param type $sla
* @param type $priority
* @param type $user_id
* @param type $subject
* @param type $body
* @param type $helptopic
* @param type $sla
* @param type $priority
*
* @return type string
*/
public function createTicket($user_id, $subject, $body, $helptopic, $sla, $priority, $source, $headers, $dept, $assignto, $form_data, $attach = '')
@@ -101,7 +102,7 @@ class TicketController extends Controller
$this->storeCollaborators($headers, $id);
$thread = $this->ticketThread($subject, $body, $id, $user_id);
if (! empty($attach)) {
if (!empty($attach)) {
$this->attach($thread, $attach);
}
@@ -114,7 +115,8 @@ class TicketController extends Controller
/**
* store_collaborators.
*
* @param type $headers
* @param type $headers
*
* @return type
*/
public function storeCollaborators($headers, $id)
@@ -164,10 +166,11 @@ class TicketController extends Controller
/**
* Generate Ticket Thread.
*
* @param type $subject
* @param type $body
* @param type $id
* @param type $user_id
* @param type $subject
* @param type $body
* @param type $id
* @param type $user_id
*
* @return type
*/
public function ticketThread($subject, $body, $id, $user_id)
@@ -190,7 +193,8 @@ class TicketController extends Controller
/**
* Generates Ticket Number.
*
* @param type $ticket_number
* @param type $ticket_number
*
* @return type integer
*/
public function ticketNumber($ticket_number)
@@ -230,7 +234,8 @@ class TicketController extends Controller
/**
* Generate a random string for password.
*
* @param type $length
* @param type $length
*
* @return type string
*/
public function generateRandomString($length = 10)
@@ -254,6 +259,7 @@ class TicketController extends Controller
*
* @param type Ticket_Thread $thread
* @param type TicketRequest $request
*
* @return type bool
*/
public function reply($thread, $request, $ta, $attach = '')
@@ -299,7 +305,7 @@ class TicketController extends Controller
}
$thread->save();
if (! empty($attach)) {
if (!empty($attach)) {
$check_attachment = $this->attach($thread->id, $attach);
}
@@ -312,7 +318,7 @@ class TicketController extends Controller
$ticket_number = $tickets->ticket_number;
$company = $this->company();
$username = $ticket_user->user_name;
if (! empty(Auth::user()->agent_sign)) {
if (!empty(Auth::user()->agent_sign)) {
$agentsign = Auth::user()->agent_sign;
} else {
$agentsign = null;
@@ -398,8 +404,9 @@ class TicketController extends Controller
/**
* Ticket edit and save ticket data.
*
* @param type $ticket_id
* @param type $ticket_id
* @param type Ticket_Thread $thread
*
* @return type bool
*/
public function ticketEditPost($ticket_id, $thread, $ticket)
@@ -430,7 +437,8 @@ class TicketController extends Controller
/**
* function to assign ticket.
*
* @param type $id
* @param type $id
*
* @return type bool
*/
public function assign($id)
@@ -440,19 +448,19 @@ class TicketController extends Controller
//dd($UserEmail);
// $UserEmail = 'sujitprasad12@yahoo.in';
$user = User::where('email', '=', $UserEmail)->first();
if (! $user) {
if (!$user) {
return ['error' => 'No agent not found'];
}
$user_id = $user->id;
$ticket = Tickets::where('id', '=', $id)->first();
if (! $ticket) {
if (!$ticket) {
return ['error' => 'No ticket not found'];
}
$ticket_number = $ticket->ticket_number;
$ticket->assigned_to = $user_id;
$ticket->save();
$ticket_thread = Ticket_Thread::where('ticket_id', '=', $id)->first();
if (! $ticket_thread) {
if (!$ticket_thread) {
return ['error' => 'No thread not found'];
}
$ticket_subject = $ticket_thread->title;
@@ -492,8 +500,9 @@ class TicketController extends Controller
/**
* Function to delete ticket.
*
* @param type $id
* @param type $id
* @param type Tickets $ticket
*
* @return type string
*/
public function delete($ids, $ticket)
@@ -546,7 +555,8 @@ class TicketController extends Controller
/**
* check email for dublicate entry.
*
* @param type $email
* @param type $email
*
* @return type bool
*/
public function checkEmail($email)
@@ -587,8 +597,9 @@ class TicketController extends Controller
/**
* Create Attachment.
*
* @param type $thread
* @param type $attach
* @param type $thread
* @param type $attach
*
* @return int
*/
public function attach($thread, $attach)
@@ -623,6 +634,7 @@ class TicketController extends Controller
* useradd.
*
* @param type Image $image
*
* @return type json
*/
public function useradd()