Apply fixes from StyleCI

This commit is contained in:
StyleCI Bot
2023-03-24 06:00:31 +00:00
committed by RafficMohammed
parent 0975cc5dd9
commit b3b057e0cc
33 changed files with 172 additions and 184 deletions

View File

@@ -32,6 +32,7 @@ use Illuminate\Support\Str;
*
* @author Vijay Sebastian <vijay.sebastian@ladybirdweb.com>
* @copyright (c) 2016, Ladybird Web Solution
*
* @name Faveo HELPDESK
*
* @version v1

View File

@@ -26,6 +26,7 @@ use Mail;
*
* @author Vijay Sebastian <vijay.sebastian@ladybirdweb.com>
* @copyright (c) 2016, Ladybird Web Solution
*
* @name Faveo HELPDESK
*
* @version v1

View File

@@ -19,6 +19,7 @@ use Tymon\JWTAuth\Exceptions\JWTException;
*
* @author Vijay Sebastian <vijay.sebastian@ladybirdweb.com>
* @copyright (c) 2016, Ladybird Web Solution
*
* @name Faveo HELPDESK
*
* @version v1

View File

@@ -70,7 +70,7 @@ class SecureFaveoAPPKey extends Command
}
$this->line("\r\nAPP_KEY has been updated in the environment.");
$this->line("\r\nNext you might want to check if your configured email is working fine or not. If it has any problem you can update the password and restart your queue workers if you are processing mail jobs in queue.\r\n");
exit();
exit;
}
$this->info('Alright, calm down we did not make any changes to your environment. But if you think your APP_KEY was compromised or you were using Faveo without generating APP_KEY explicitly(for version v1.10.* or older) we recommend you to run this command on priority basis.');
}

View File

@@ -29,6 +29,7 @@ class Sync extends Command
public function handle()
{
(new SyncFaveoToLatestVersion())->sync();
return Command::SUCCESS;
}
}

View File

@@ -25,7 +25,7 @@ class Kernel extends ConsoleKernel
\App\Console\Commands\InstallDB::class,
\App\Console\Commands\SetupTestEnv::class,
\App\Console\Commands\SecureFaveoAPPKey::class,
SyncFaveoToLatestVersion::class
SyncFaveoToLatestVersion::class,
];
/**

View File

@@ -9,7 +9,6 @@ use Illuminate\Database\Eloquent\ModelNotFoundException;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use Illuminate\Http\Exceptions\HttpResponseException;
use Illuminate\Session\TokenMismatchException;
use Illuminate\Support\Facades\App;
use Illuminate\Support\Facades\Config;
use Illuminate\Validation\ValidationException;
use Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException;

View File

@@ -3,7 +3,6 @@
namespace App\Exports;
use Maatwebsite\Excel\Concerns\FromArray;
use Maatwebsite\Excel\Concerns\FromCollection;
use Maatwebsite\Excel\Concerns\WithHeadings;
class UserExport implements FromArray, WithHeadings

View File

@@ -1,6 +1,5 @@
<?php
use App\Http\Controllers\App;
use Illuminate\Support\Facades\Route;
Breadcrumbs::register('logs', function ($breadcrumbs) {

View File

@@ -149,15 +149,12 @@ class LanguageController extends Controller
// doing the validation, passing post data, rules and the messages
$validator = Validator::make($file, $rules);
if ($validator->fails()) {
// send back to the page with the input data and errors
return Redirect::back()->withInput()->withErrors($validator);
} else {
//Checking if package already exists or not in lang folder
$path = base_path('lang');
if (in_array(strtolower(Request::get('iso-code')), scandir($path))) {
//sending back with error message
Session::flash('fails', Lang::get('lang.package_exist'));
Session::flash('link', 'change-language/'.strtolower(Request::get('iso-code')));
@@ -169,7 +166,6 @@ class LanguageController extends Controller
return Redirect::back()->withInput();
} else {
// checking file is valid.
if (Request::file('File')->isValid()) {
$name = Request::file('File')->getClientOriginalName(); //uploaded file's original name

View File

@@ -159,7 +159,7 @@ class PriorityController extends Controller
->update(['is_default' => 1]);
}
return \Redirect::route('priority.index')->with('success', (Lang::get('lang.priority_successfully_updated')));
return \Redirect::route('priority.index')->with('success', Lang::get('lang.priority_successfully_updated'));
}
/**
@@ -187,6 +187,6 @@ class PriorityController extends Controller
$tk_priority->delete();
return \Redirect::route('priority.index')->with('success', (Lang::get('lang.delete_successfully')));
return \Redirect::route('priority.index')->with('success', Lang::get('lang.delete_successfully'));
}
}

View File

@@ -952,6 +952,7 @@ class FilterController extends Controller
* @category function to filter tickets by SLA
*
* @param string array $value, builder $table
*
* @
*
* @return builder

View File

@@ -3,7 +3,6 @@
namespace App\Http\Controllers\Agent\helpdesk;
// controllers
use App\Http\Controllers\Agent\helpdesk\Filter\FilterControllerOld;
use App\Http\Controllers\Common\FileuploadController;
use App\Http\Controllers\Common\NotificationController as Notify;
use App\Http\Controllers\Common\PhpMailController;
@@ -51,7 +50,6 @@ use Illuminate\Support\Str;
use Lang;
use Mail;
use UTC;
use Vsmoraes\Pdf\Pdf;
use Vsmoraes\Pdf\PdfFacade;
use Yajra\DataTables\Facades\DataTables;

View File

@@ -640,7 +640,6 @@ class UserController extends Controller
public function edit($id, CountryCode $code)
{
try {
// dd('here');
$settings = CommonSettings::select('status')->where('option_name', '=', 'send_otp')->first();
$email_mandatory = CommonSettings::select('status')->where('option_name', '=', 'email_mandatory')->first();
@@ -996,6 +995,7 @@ class UserController extends Controller
$users = $this->getUsers($first_date, $second_date);
$excel_controller = new \App\Http\Controllers\Common\ExcelController();
$filename = 'users'.$date;
return $excel_controller->export($filename, $users);
} catch (Exception $ex) {
return redirect()->back()->with('fails', $ex->getMessage());
@@ -1046,7 +1046,7 @@ class UserController extends Controller
->first();
if ($otp != null) {
$otp_length = strlen(Input::get('otp'));
if (($otp_length == 6 && !preg_match('/[a-z]/i', Input::get('otp')))) {
if ($otp_length == 6 && !preg_match('/[a-z]/i', Input::get('otp'))) {
$otp2 = Hash::make(Input::get('otp'));
$date1 = date_format($otp->updated_at, 'Y-m-d h:i:sa');
$date2 = date('Y-m-d h:i:sa');

View File

@@ -184,7 +184,6 @@ class CategoryController extends Controller
*/
public function update($id, CategoryRequest $request)
{
/* Edit the selected category via id */
$category = Category::where('id', $id)->first();
$sl = $request->input('name');

View File

@@ -550,7 +550,7 @@ class AuthController extends Controller
$otp = Otp::select('otp', 'updated_at')->where('user_id', '=', $user->id)
->first();
if ($otp != null) {
if (($otp_length == 6 && !preg_match('/[a-z]/i', $request->input('otp')))) {
if ($otp_length == 6 && !preg_match('/[a-z]/i', $request->input('otp'))) {
$otp2 = Hash::make($request->input('otp'));
$date1 = date_format($otp->updated_at, 'Y-m-d h:i:sa');
$date2 = date('Y-m-d h:i:sa');

View File

@@ -188,7 +188,7 @@ class FormController extends Controller
// $priority = $ticket_settings->first()->priority;
$default_priority = Ticket_Priority::where('is_default', '=', 1)->first();
$user_priority = CommonSettings::where('option_name', '=', 'user_priority')->first();
if (!($request->input('priority'))) {
if (!$request->input('priority')) {
$priority = $default_priority->priority_id;
if ($helpTopicObj->exists() && ($helpTopicObj->value('status') == 1)) {
$priority = $helpTopicObj->value('priority');

View File

@@ -409,7 +409,7 @@ class GuestController extends Controller
->first();
if ($otp != null) {
$otp_length = strlen(Input::get('otp'));
if (($otp_length == 6 && !preg_match('/[a-z]/i', Input::get('otp')))) {
if ($otp_length == 6 && !preg_match('/[a-z]/i', Input::get('otp'))) {
$otp2 = Hash::make(Input::get('otp'));
$date1 = date_format($otp->updated_at, 'Y-m-d h:i:sa');
$date2 = date('Y-m-d h:i:sa');

View File

@@ -12,20 +12,20 @@ use App\Model\helpdesk\Settings\System;
use App\Model\helpdesk\Utility\Date_time_format;
use App\Model\helpdesk\Utility\Timezones;
use App\User;
Use Illuminate\Support\Facades\Artisan;
// classes
use Illuminate\Support\Facades\Cache;
use DB;
// classes
use Exception;
use Illuminate\Support\Facades\File;
use Hash;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\File;
use Illuminate\Support\Facades\Redirect;
use Illuminate\Support\Facades\Request as Input;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Facades\Redirect;
use Illuminate\Support\Facades\Session;
use UnAuth;
use Illuminate\Support\Facades\View;
use UnAuth;
/**
* |=======================================================================

View File

@@ -4,12 +4,8 @@ namespace App\Http\Controllers\Update;
use App\Http\Controllers\Controller;
use App\Model\helpdesk\Settings\System;
use Exception;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Str;
class SyncFaveoToLatestVersion extends Controller
{
@@ -55,6 +51,7 @@ class SyncFaveoToLatestVersion extends Controller
}
$version = System::value('version') ?: '0.0.0';
return $this->getPhpComaptibleVersion($version);
}

View File

@@ -98,7 +98,7 @@ class UpgradeController extends Controller
$dlHandler = fopen($this->dir.'/UPDATES/'.'/faveo-helpdesk-master.zip', 'w');
if (!fwrite($dlHandler, $newUpdate)) {
echo '<p>Could not save new update. Operation aborted.</p>';
exit();
exit;
}
fclose($dlHandler);
echo '<p>Update Downloaded And Saved</p>';
@@ -205,7 +205,7 @@ class UpgradeController extends Controller
echo "<li style='color:red;'>".$ex->getMessage().'</li>';
echo '</ul>';
}
exit();
exit;
}
public function deleteBarNotification($key)
@@ -293,7 +293,7 @@ class UpgradeController extends Controller
}
} else {
echo '<p>Latest code found. <a href='.url('file-upgrade?dodownload=true').'>&raquo; Download Now?</a></p>';
exit();
exit;
}
} else {
echo '<p>Update already downloaded.</p>';
@@ -302,7 +302,7 @@ class UpgradeController extends Controller
$updated = $this->doUpdate();
} else {
echo '<p>Update ready. <a href='.url('file-upgrade?doUpdate=true').'>&raquo; Install Now?</a></p>';
exit();
exit;
}
if ($updated == true) {

View File

@@ -4,7 +4,6 @@ namespace App\Http\Requests\helpdesk;
use App\Http\Requests\Request;
use App\Model\helpdesk\Settings\CommonSettings;
use Illuminate\Contracts\Validation\Validator;
/**
* AgentRequest.

View File

@@ -129,7 +129,7 @@ class ClientRequest extends Request
{
$settings = $settings->select('status')->where('option_name', '=', 'send_otp')->first();
$email_mandatory = $settings->select('status')->where('option_name', '=', 'email_mandatory')->first();
if (($email_mandatory->status == 0 || $email_mandatory->status == '0')) {
if ($email_mandatory->status == 0 || $email_mandatory->status == '0') {
if (!\Auth::check()) {
return [
'Name' => 'required',

View File

@@ -13,6 +13,6 @@ class System extends BaseModel
protected $fillable = [
'id', 'status', 'url', 'name', 'department', 'page_size', 'log_level', 'purge_log', 'name_format',
'time_farmat', 'date_format', 'date_time_format', 'day_date_time', 'time_zone', 'content', 'api_key', 'api_enable', 'api_key_mandatory', 'version'
'time_farmat', 'date_format', 'date_time_format', 'day_date_time', 'time_zone', 'content', 'api_key', 'api_enable', 'api_key_mandatory', 'version',
];
}

View File

@@ -2,10 +2,8 @@
namespace App\Providers;
use App\Model\helpdesk\Settings\System;
use App\Model\Update\BarNotification;
use Illuminate\Queue\Events\JobFailed;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\Route;
use Illuminate\Support\ServiceProvider;
use Laravel\Dusk\DuskServiceProvider;

View File

@@ -26,7 +26,6 @@ class EventServiceProvider extends ServiceProvider
*/
public function boot()
{
//
}