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:
@@ -124,7 +124,6 @@ class SettingsController extends Controller
|
||||
*
|
||||
* @param type Footer $footer
|
||||
* @param type Request $request
|
||||
*
|
||||
* @return type response
|
||||
*/
|
||||
public function edit_widget($id, Widgets $widgets, Request $request)
|
||||
@@ -202,7 +201,6 @@ class SettingsController extends Controller
|
||||
*
|
||||
* @param type Footer $footer
|
||||
* @param type Request $request
|
||||
*
|
||||
* @return type response
|
||||
*/
|
||||
public function edit_social_buttons($id, Widgets $widgets, Request $request)
|
||||
@@ -262,7 +260,6 @@ class SettingsController extends Controller
|
||||
*
|
||||
* @param type Settings $set
|
||||
* @param type Request $request
|
||||
*
|
||||
* @return type view
|
||||
*/
|
||||
public function PostSettings(Settings $set, Request $request)
|
||||
@@ -373,8 +370,7 @@ class SettingsController extends Controller
|
||||
/**
|
||||
* After plugin post.
|
||||
*
|
||||
* @param Request $request
|
||||
*
|
||||
* @param Request $request
|
||||
* @return type
|
||||
*/
|
||||
public function PostPlugins(Request $request)
|
||||
@@ -382,7 +378,7 @@ class SettingsController extends Controller
|
||||
$this->validate($request, ['plugin' => 'required|mimes:application/zip,zip,Zip']);
|
||||
|
||||
try {
|
||||
if (!extension_loaded('zip')) {
|
||||
if (! extension_loaded('zip')) {
|
||||
throw new Exception('Please enable zip extension in your php');
|
||||
}
|
||||
$plug = new Plugin();
|
||||
@@ -452,16 +448,15 @@ class SettingsController extends Controller
|
||||
/**
|
||||
* Delete the directory.
|
||||
*
|
||||
* @param type $dir
|
||||
*
|
||||
* @param type $dir
|
||||
* @return bool
|
||||
*/
|
||||
public function deleteDirectory($dir)
|
||||
{
|
||||
if (!file_exists($dir)) {
|
||||
if (! file_exists($dir)) {
|
||||
return true;
|
||||
}
|
||||
if (!is_dir($dir)) {
|
||||
if (! is_dir($dir)) {
|
||||
return unlink($dir);
|
||||
}
|
||||
foreach (scandir($dir) as $item) {
|
||||
@@ -469,7 +464,7 @@ class SettingsController extends Controller
|
||||
continue;
|
||||
}
|
||||
chmod($dir.DIRECTORY_SEPARATOR.$item, 0777);
|
||||
if (!$this->deleteDirectory($dir.DIRECTORY_SEPARATOR.$item)) {
|
||||
if (! $this->deleteDirectory($dir.DIRECTORY_SEPARATOR.$item)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -582,7 +577,7 @@ class SettingsController extends Controller
|
||||
{
|
||||
$plugs = new Plugin();
|
||||
$plug = $plugs->where('name', $slug)->first();
|
||||
if (!$plug) {
|
||||
if (! $plug) {
|
||||
$plugs->create(['name' => $slug, 'path' => $slug, 'status' => 1]);
|
||||
|
||||
return redirect()->back()->with('success', 'Status has changed');
|
||||
|
Reference in New Issue
Block a user