From 5ef0992d5b771f6348e131023eaa3a8be7fac646 Mon Sep 17 00:00:00 2001 From: abijeet Date: Sun, 27 Jan 2019 15:59:23 +0530 Subject: [PATCH] PHPCS related fixes. --- app/Auth/Access/LdapService.php | 4 ++-- app/Auth/Permissions/PermissionService.php | 22 ++++++++++---------- app/Entities/EntityProvider.php | 4 +--- app/Entities/Repos/PageRepo.php | 2 +- app/Exceptions/HttpFetchException.php | 4 +++- app/Exceptions/UserUpdateException.php | 4 +++- app/Notifications/MailNotification.php | 3 +-- app/Notifications/ResetPassword.php | 1 - app/Providers/TranslationServiceProvider.php | 3 +-- app/Translation/Translator.php | 4 +--- app/Uploads/HttpFetcher.php | 3 +-- 11 files changed, 25 insertions(+), 29 deletions(-) diff --git a/app/Auth/Access/LdapService.php b/app/Auth/Access/LdapService.php index 1e95ac513..654ea2f99 100644 --- a/app/Auth/Access/LdapService.php +++ b/app/Auth/Access/LdapService.php @@ -176,8 +176,8 @@ class LdapService * the LDAP_OPT_X_TLS_REQUIRE_CERT option. It can only be set globally and not * per handle. */ - if($this->config['tls_insecure']) { - $this->ldap->setOption(NULL, LDAP_OPT_X_TLS_REQUIRE_CERT, LDAP_OPT_X_TLS_NEVER); + if ($this->config['tls_insecure']) { + $this->ldap->setOption(null, LDAP_OPT_X_TLS_REQUIRE_CERT, LDAP_OPT_X_TLS_NEVER); } $ldapConnection = $this->ldap->connect($hostName, count($ldapServer) > 2 ? intval($ldapServer[2]) : $defaultPort); diff --git a/app/Auth/Permissions/PermissionService.php b/app/Auth/Permissions/PermissionService.php index d0e6cccea..af2a5e1fd 100644 --- a/app/Auth/Permissions/PermissionService.php +++ b/app/Auth/Permissions/PermissionService.php @@ -190,10 +190,10 @@ class PermissionService { return $this->entityProvider->book->newQuery() ->select(['id', 'restricted', 'created_by'])->with(['chapters' => function ($query) { - $query->select(['id', 'restricted', 'created_by', 'book_id']); - }, 'pages' => function ($query) { - $query->select(['id', 'restricted', 'created_by', 'book_id', 'chapter_id']); - }]); + $query->select(['id', 'restricted', 'created_by', 'book_id']); + }, 'pages' => function ($query) { + $query->select(['id', 'restricted', 'created_by', 'book_id', 'chapter_id']); + }]); } /** @@ -612,13 +612,13 @@ class PermissionService $entities = $this->entityProvider; $pageSelect = $this->db->table('pages')->selectRaw($entities->page->entityRawQuery($fetchPageContent)) ->where('book_id', '=', $book_id)->where(function ($query) use ($filterDrafts) { - $query->where('draft', '=', 0); - if (!$filterDrafts) { - $query->orWhere(function ($query) { - $query->where('draft', '=', 1)->where('created_by', '=', $this->currentUser()->id); - }); - } - }); + $query->where('draft', '=', 0); + if (!$filterDrafts) { + $query->orWhere(function ($query) { + $query->where('draft', '=', 1)->where('created_by', '=', $this->currentUser()->id); + }); + } + }); $chapterSelect = $this->db->table('chapters')->selectRaw($entities->chapter->entityRawQuery())->where('book_id', '=', $book_id); $query = $this->db->query()->select('*')->from($this->db->raw("({$pageSelect->toSql()} UNION {$chapterSelect->toSql()}) AS U")) ->mergeBindings($pageSelect)->mergeBindings($chapterSelect); diff --git a/app/Entities/EntityProvider.php b/app/Entities/EntityProvider.php index 46a883ec4..04939a14a 100644 --- a/app/Entities/EntityProvider.php +++ b/app/Entities/EntityProvider.php @@ -84,6 +84,4 @@ class EntityProvider $type = strtolower($type); return $this->all()[$type]; } - - -} \ No newline at end of file +} diff --git a/app/Entities/Repos/PageRepo.php b/app/Entities/Repos/PageRepo.php index 3558b29b3..148ae8459 100644 --- a/app/Entities/Repos/PageRepo.php +++ b/app/Entities/Repos/PageRepo.php @@ -505,4 +505,4 @@ class PageRepo extends EntityRepo return $this->publishPageDraft($copyPage, $pageData); } -} \ No newline at end of file +} diff --git a/app/Exceptions/HttpFetchException.php b/app/Exceptions/HttpFetchException.php index 48e30e1e6..2a34bbc62 100644 --- a/app/Exceptions/HttpFetchException.php +++ b/app/Exceptions/HttpFetchException.php @@ -2,4 +2,6 @@ use Exception; -class HttpFetchException extends Exception {} +class HttpFetchException extends Exception +{ +} diff --git a/app/Exceptions/UserUpdateException.php b/app/Exceptions/UserUpdateException.php index eb41dece6..81e95b16f 100644 --- a/app/Exceptions/UserUpdateException.php +++ b/app/Exceptions/UserUpdateException.php @@ -1,3 +1,5 @@ 'vendor.notifications.email-plain' ]); } - -} \ No newline at end of file +} diff --git a/app/Notifications/ResetPassword.php b/app/Notifications/ResetPassword.php index 282aa335a..305a7da72 100644 --- a/app/Notifications/ResetPassword.php +++ b/app/Notifications/ResetPassword.php @@ -1,6 +1,5 @@ baseLocaleMap[$locale] ?? null; } - -} \ No newline at end of file +} diff --git a/app/Uploads/HttpFetcher.php b/app/Uploads/HttpFetcher.php index 3ebe17eee..5e8115637 100644 --- a/app/Uploads/HttpFetcher.php +++ b/app/Uploads/HttpFetcher.php @@ -30,5 +30,4 @@ class HttpFetcher return $data; } - -} \ No newline at end of file +}