mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-10-01 01:36:00 -04:00
Ran phpcbf
This commit is contained in:
parent
adc866cb3d
commit
3f83c548f8
@ -224,7 +224,7 @@ class UserRepo
|
||||
*/
|
||||
public function getRecentlyCreated(User $user, $count = 20)
|
||||
{
|
||||
$createdByUserQuery = function(Builder $query) use ($user) {
|
||||
$createdByUserQuery = function (Builder $query) use ($user) {
|
||||
$query->where('created_by', '=', $user->id);
|
||||
};
|
||||
|
||||
|
@ -37,7 +37,6 @@ class EntityContextManager
|
||||
if ($shelf && $shelf->contains($book)) {
|
||||
return $shelf;
|
||||
}
|
||||
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@ -58,5 +57,4 @@ class EntityContextManager
|
||||
{
|
||||
$this->session->forget($this->KEY_SHELF_CONTEXT_ID);
|
||||
}
|
||||
|
||||
}
|
@ -62,5 +62,4 @@ class PageRevision extends Model
|
||||
{
|
||||
return $type === 'revision';
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -132,7 +132,7 @@ abstract class Controller extends BaseController
|
||||
*/
|
||||
protected function checkPermissionOrCurrentUser(string $permissionName, int $userId)
|
||||
{
|
||||
return $this->checkPermissionOr($permissionName, function() use ($userId) {
|
||||
return $this->checkPermissionOr($permissionName, function () use ($userId) {
|
||||
return $userId === $this->currentUser->id;
|
||||
});
|
||||
}
|
||||
|
@ -85,5 +85,4 @@ class DrawioImageController extends Controller
|
||||
'content' => base64_encode($imageData)
|
||||
]);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -61,5 +61,4 @@ class GalleryImageController extends Controller
|
||||
|
||||
return response()->json($image);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -368,5 +368,4 @@ class UserController extends Controller
|
||||
|
||||
return redirect()->back(302, [], "/settings/users/$userId");
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -25,8 +25,7 @@ class ImageRepo
|
||||
ImageService $imageService,
|
||||
PermissionService $permissionService,
|
||||
Page $page
|
||||
)
|
||||
{
|
||||
) {
|
||||
$this->image = $image;
|
||||
$this->imageService = $imageService;
|
||||
$this->restrictionService = $permissionService;
|
||||
@ -87,8 +86,7 @@ class ImageRepo
|
||||
int $uploadedTo = null,
|
||||
string $search = null,
|
||||
callable $whereClause = null
|
||||
)
|
||||
{
|
||||
) {
|
||||
$imageQuery = $this->image->newQuery()->where('type', '=', strtolower($type));
|
||||
|
||||
if ($uploadedTo !== null) {
|
||||
@ -126,13 +124,12 @@ class ImageRepo
|
||||
int $pageSize = 24,
|
||||
int $uploadedTo = null,
|
||||
string $search = null
|
||||
)
|
||||
{
|
||||
) {
|
||||
$contextPage = $this->page->findOrFail($uploadedTo);
|
||||
$parentFilter = null;
|
||||
|
||||
if ($filterType === 'book' || $filterType === 'page') {
|
||||
$parentFilter = function(Builder $query) use ($filterType, $contextPage) {
|
||||
$parentFilter = function (Builder $query) use ($filterType, $contextPage) {
|
||||
if ($filterType === 'page') {
|
||||
$query->where('uploaded_to', '=', $contextPage->id);
|
||||
} elseif ($filterType === 'book') {
|
||||
|
@ -73,8 +73,7 @@ class ImageService extends UploadService
|
||||
int $resizeWidth = null,
|
||||
int $resizeHeight = null,
|
||||
bool $keepRatio = true
|
||||
)
|
||||
{
|
||||
) {
|
||||
$imageName = $uploadedFile->getClientOriginalName();
|
||||
$imageData = file_get_contents($uploadedFile->getRealPath());
|
||||
|
||||
|
@ -52,7 +52,8 @@ function signedInUser() : bool
|
||||
* Check if the current user has general access.
|
||||
* @return bool
|
||||
*/
|
||||
function hasAppAccess() : bool {
|
||||
function hasAppAccess() : bool
|
||||
{
|
||||
return !auth()->guest() || setting('app-public');
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user