Apply Laravel coding style

Shift automatically applies the Laravel coding style - which uses the PSR-12 coding style as a base with some minor additions.

You may customize the code style applied by configuring [Pint](https://laravel.com/docs/pint), [PHP CS Fixer](https://github.com/FriendsOfPHP/PHP-CS-Fixer), or [PHP CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer) for your project root.

For more information on customizing the code style applied by Shift, [watch this short video](https://laravelshift.com/videos/shift-code-style).
This commit is contained in:
Shift
2023-01-03 08:25:25 +00:00
parent b535aa90eb
commit 43386fd86d
357 changed files with 15021 additions and 15193 deletions

View File

@@ -46,13 +46,12 @@ 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 = '')
@@ -102,7 +101,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);
}
@@ -115,8 +114,7 @@ class TicketController extends Controller
/**
* store_collaborators.
*
* @param type $headers
*
* @param type $headers
* @return type
*/
public function storeCollaborators($headers, $id)
@@ -166,11 +164,10 @@ 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)
@@ -193,8 +190,7 @@ class TicketController extends Controller
/**
* Generates Ticket Number.
*
* @param type $ticket_number
*
* @param type $ticket_number
* @return type integer
*/
public function ticketNumber($ticket_number)
@@ -234,8 +230,7 @@ class TicketController extends Controller
/**
* Generate a random string for password.
*
* @param type $length
*
* @param type $length
* @return type string
*/
public function generateRandomString($length = 10)
@@ -259,7 +254,6 @@ class TicketController extends Controller
*
* @param type Ticket_Thread $thread
* @param type TicketRequest $request
*
* @return type bool
*/
public function reply($thread, $request, $ta, $attach = '')
@@ -305,7 +299,7 @@ class TicketController extends Controller
}
$thread->save();
if (!empty($attach)) {
if (! empty($attach)) {
$check_attachment = $this->attach($thread->id, $attach);
}
@@ -318,7 +312,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;
@@ -404,9 +398,8 @@ 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)
@@ -437,8 +430,7 @@ class TicketController extends Controller
/**
* function to assign ticket.
*
* @param type $id
*
* @param type $id
* @return type bool
*/
public function assign($id)
@@ -448,19 +440,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;
@@ -500,9 +492,8 @@ 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)
@@ -555,8 +546,7 @@ class TicketController extends Controller
/**
* check email for dublicate entry.
*
* @param type $email
*
* @param type $email
* @return type bool
*/
public function checkEmail($email)
@@ -597,9 +587,8 @@ 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)
@@ -634,7 +623,6 @@ class TicketController extends Controller
* useradd.
*
* @param type Image $image
*
* @return type json
*/
public function useradd()