mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-07-28 17:02:04 +03:00
Apply fixes from StyleCI
This commit is contained in:
@ -4,7 +4,6 @@ namespace BookStack\Http\Controllers;
|
||||
|
||||
use BookStack\Facades\Activity;
|
||||
use BookStack\Interfaces\Loggable;
|
||||
use BookStack\HasCreatorAndUpdater;
|
||||
use BookStack\Model;
|
||||
use finfo;
|
||||
use Illuminate\Foundation\Bus\DispatchesJobs;
|
||||
@ -16,7 +15,8 @@ use Illuminate\Routing\Controller as BaseController;
|
||||
|
||||
abstract class Controller extends BaseController
|
||||
{
|
||||
use DispatchesJobs, ValidatesRequests;
|
||||
use DispatchesJobs;
|
||||
use ValidatesRequests;
|
||||
|
||||
/**
|
||||
* Check if the current user is signed in.
|
||||
@ -106,7 +106,7 @@ abstract class Controller extends BaseController
|
||||
/**
|
||||
* Send back a json error message.
|
||||
*/
|
||||
protected function jsonError(string $messageText = "", int $statusCode = 500): JsonResponse
|
||||
protected function jsonError(string $messageText = '', int $statusCode = 500): JsonResponse
|
||||
{
|
||||
return response()->json(['message' => $messageText, 'status' => 'error'], $statusCode);
|
||||
}
|
||||
@ -118,7 +118,7 @@ abstract class Controller extends BaseController
|
||||
{
|
||||
return response()->make($content, 200, [
|
||||
'Content-Type' => 'application/octet-stream',
|
||||
'Content-Disposition' => 'attachment; filename="' . $fileName . '"'
|
||||
'Content-Disposition' => 'attachment; filename="' . $fileName . '"',
|
||||
]);
|
||||
}
|
||||
|
||||
@ -130,9 +130,10 @@ abstract class Controller extends BaseController
|
||||
{
|
||||
$finfo = new finfo(FILEINFO_MIME_TYPE);
|
||||
$mime = $finfo->buffer($content) ?: 'application/octet-stream';
|
||||
|
||||
return response()->make($content, 200, [
|
||||
'Content-Type' => $mime,
|
||||
'Content-Disposition' => 'inline; filename="' . $fileName . '"'
|
||||
'Content-Disposition' => 'inline; filename="' . $fileName . '"',
|
||||
]);
|
||||
}
|
||||
|
||||
@ -162,6 +163,7 @@ abstract class Controller extends BaseController
|
||||
|
||||
/**
|
||||
* Log an activity in the system.
|
||||
*
|
||||
* @param string|Loggable
|
||||
*/
|
||||
protected function logActivity(string $type, $detail = ''): void
|
||||
|
Reference in New Issue
Block a user