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-07 19:53:40 +00:00
parent 6307afde3d
commit 74bd29e1ee
235 changed files with 14443 additions and 14830 deletions

View File

@@ -41,13 +41,12 @@ class LanguageController extends Controller
* Switch language at runtime.
*
* @param type "" $lang
*
* @return type response
*/
public function switchLanguage($lang)
{
$changed = UnAuth::changeLanguage($lang);
if (!$changed) {
if (! $changed) {
return \Redirect::back()->with('fails', Lang::get('lang.language-error'));
} else {
return \Redirect::back();
@@ -135,16 +134,16 @@ class LanguageController extends Controller
try {
// getting all of the post data
$file = [
'File' => Request::file('File'),
'File' => Request::file('File'),
'language-name' => Request::input('language-name'),
'iso-code' => Request::input('iso-code'),
'iso-code' => Request::input('iso-code'),
];
// setting up rules
$rules = [
'File' => 'required|mimes:zip|max:30000',
'File' => 'required|mimes:zip|max:30000',
'language-name' => 'required',
'iso-code' => 'required|max:2',
'iso-code' => 'required|max:2',
]; // and for max size
// doing the validation, passing post data, rules and the messages
$validator = Validator::make($file, $rules);
@@ -163,7 +162,7 @@ class LanguageController extends Controller
Session::flash('link', 'change-language/'.strtolower(Request::get('iso-code')));
return Redirect::back()->withInput();
} elseif (!array_key_exists(strtolower(Request::get('iso-code')), Config::get('languages'))) {//Checking Valid ISO code form Languages.php
} elseif (! array_key_exists(strtolower(Request::get('iso-code')), Config::get('languages'))) {//Checking Valid ISO code form Languages.php
//sending back with error message
Session::flash('fails', Lang::get('lang.iso-code-error'));
@@ -182,7 +181,7 @@ class LanguageController extends Controller
//check if Zip extract foldercontains any subfolder
$directories = File::directories($extractpath);
//$directories = glob($extractpath. '/*' , GLOB_ONLYDIR);
if (!empty($directories)) { //if extract folder contains subfolder
if (! empty($directories)) { //if extract folder contains subfolder
$success = File::deleteDirectory($extractpath); //remove extracted folder and it's subfolder from lang
//$success2 = File::delete($destinationPath.'/'.$name);
if ($success) {
@@ -229,8 +228,7 @@ class LanguageController extends Controller
/**
* This function is used to delete languages.
*
* @param type $lang
*
* @param type $lang
* @return type response
*/
public function deleteLanguage($lang)