From 3f83c548f8bf67d3c670083f255a21897ef803d9 Mon Sep 17 00:00:00 2001 From: Dan Brown Date: Sun, 5 May 2019 14:54:37 +0100 Subject: [PATCH] Ran phpcbf --- app/Auth/UserRepo.php | 2 +- app/Entities/BreadcrumbsViewComposer.php | 2 +- app/Entities/EntityContextManager.php | 4 +--- app/Entities/PageRevision.php | 1 - app/Http/Controllers/Controller.php | 2 +- app/Http/Controllers/Images/DrawioImageController.php | 1 - .../Controllers/Images/GalleryImageController.php | 1 - app/Http/Controllers/UserController.php | 1 - app/Uploads/ImageRepo.php | 11 ++++------- app/Uploads/ImageService.php | 3 +-- app/helpers.php | 3 ++- 11 files changed, 11 insertions(+), 20 deletions(-) diff --git a/app/Auth/UserRepo.php b/app/Auth/UserRepo.php index 94ebb27ab..dec973f6c 100644 --- a/app/Auth/UserRepo.php +++ b/app/Auth/UserRepo.php @@ -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); }; diff --git a/app/Entities/BreadcrumbsViewComposer.php b/app/Entities/BreadcrumbsViewComposer.php index 7745d9aee..97ddbc2dc 100644 --- a/app/Entities/BreadcrumbsViewComposer.php +++ b/app/Entities/BreadcrumbsViewComposer.php @@ -31,4 +31,4 @@ class BreadcrumbsViewComposer } } } -} \ No newline at end of file +} diff --git a/app/Entities/EntityContextManager.php b/app/Entities/EntityContextManager.php index 23ffed0d2..20be0de2b 100644 --- a/app/Entities/EntityContextManager.php +++ b/app/Entities/EntityContextManager.php @@ -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); } - -} \ No newline at end of file +} diff --git a/app/Entities/PageRevision.php b/app/Entities/PageRevision.php index acdec2802..d30147bfc 100644 --- a/app/Entities/PageRevision.php +++ b/app/Entities/PageRevision.php @@ -62,5 +62,4 @@ class PageRevision extends Model { return $type === 'revision'; } - } diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php index fc4f184fc..5bc62c601 100644 --- a/app/Http/Controllers/Controller.php +++ b/app/Http/Controllers/Controller.php @@ -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; }); } diff --git a/app/Http/Controllers/Images/DrawioImageController.php b/app/Http/Controllers/Images/DrawioImageController.php index 2deb64d96..3595790f7 100644 --- a/app/Http/Controllers/Images/DrawioImageController.php +++ b/app/Http/Controllers/Images/DrawioImageController.php @@ -85,5 +85,4 @@ class DrawioImageController extends Controller 'content' => base64_encode($imageData) ]); } - } diff --git a/app/Http/Controllers/Images/GalleryImageController.php b/app/Http/Controllers/Images/GalleryImageController.php index 35087463b..fd52ffd3f 100644 --- a/app/Http/Controllers/Images/GalleryImageController.php +++ b/app/Http/Controllers/Images/GalleryImageController.php @@ -61,5 +61,4 @@ class GalleryImageController extends Controller return response()->json($image); } - } diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php index 1367f631b..8191fbfe2 100644 --- a/app/Http/Controllers/UserController.php +++ b/app/Http/Controllers/UserController.php @@ -368,5 +368,4 @@ class UserController extends Controller return redirect()->back(302, [], "/settings/users/$userId"); } - } diff --git a/app/Uploads/ImageRepo.php b/app/Uploads/ImageRepo.php index 16d1bb3d1..38dd3066b 100644 --- a/app/Uploads/ImageRepo.php +++ b/app/Uploads/ImageRepo.php @@ -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') { diff --git a/app/Uploads/ImageService.php b/app/Uploads/ImageService.php index eaf787c9c..8eefbaf9d 100644 --- a/app/Uploads/ImageService.php +++ b/app/Uploads/ImageService.php @@ -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()); diff --git a/app/helpers.php b/app/helpers.php index 3f7b5e1b1..65b61c9f0 100644 --- a/app/helpers.php +++ b/app/helpers.php @@ -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'); }