]> BookStack Code Mirror - bookstack/commitdiff
PHPCS related fixes. 1237/head
authorabijeet <redacted>
Sun, 27 Jan 2019 10:29:23 +0000 (15:59 +0530)
committerabijeet <redacted>
Sun, 27 Jan 2019 10:29:23 +0000 (15:59 +0530)
app/Auth/Access/LdapService.php
app/Auth/Permissions/PermissionService.php
app/Entities/EntityProvider.php
app/Entities/Repos/PageRepo.php
app/Exceptions/HttpFetchException.php
app/Exceptions/UserUpdateException.php
app/Notifications/MailNotification.php
app/Notifications/ResetPassword.php
app/Providers/TranslationServiceProvider.php
app/Translation/Translator.php
app/Uploads/HttpFetcher.php

index 1e95ac513a340705d251d394045d39f1d0cdbe93..654ea2f995c34494f86e54ebc28420464f58b4ca 100644 (file)
@@ -176,8 +176,8 @@ class LdapService
          * the LDAP_OPT_X_TLS_REQUIRE_CERT option. It can only be set globally and not
          * per handle.
          */
          * 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);
         }
 
         $ldapConnection = $this->ldap->connect($hostName, count($ldapServer) > 2 ? intval($ldapServer[2]) : $defaultPort);
index d0e6ccceab56640ddbee6b48a5b99b4cf14f815f..af2a5e1fd8c694ee36d2e5e25134e0b3f5ec991d 100644 (file)
@@ -190,10 +190,10 @@ class PermissionService
     {
         return $this->entityProvider->book->newQuery()
             ->select(['id', 'restricted', 'created_by'])->with(['chapters' => function ($query) {
     {
         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) {
         $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);
         $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);
index 46a883ec408927661479c5d84fc8bab7cc5d5fed..04939a14a411d9b344faad349ba8dd59195273cf 100644 (file)
@@ -84,6 +84,4 @@ class EntityProvider
         $type = strtolower($type);
         return $this->all()[$type];
     }
         $type = strtolower($type);
         return $this->all()[$type];
     }
-
-
-}
\ No newline at end of file
+}
index 3558b29b3d2e109d6b901ee7adc641856c8876fc..148ae8459e088f15f0a55ad483add20acc77004a 100644 (file)
@@ -505,4 +505,4 @@ class PageRepo extends EntityRepo
 
         return $this->publishPageDraft($copyPage, $pageData);
     }
 
         return $this->publishPageDraft($copyPage, $pageData);
     }
-}
\ No newline at end of file
+}
index 48e30e1e6a2fd564c3a7b55790fefa77b9259995..2a34bbc626b7c91c44b1bd8d17f6e39db4fcb5df 100644 (file)
@@ -2,4 +2,6 @@
 
 use Exception;
 
 
 use Exception;
 
-class HttpFetchException extends Exception {}
+class HttpFetchException extends Exception
+{
+}
index eb41dece6d626a93c13c85b72ff2b7ac35f31d50..81e95b16fd201a3ae7ccd1d58ea8dac242823323 100644 (file)
@@ -1,3 +1,5 @@
 <?php namespace BookStack\Exceptions;
 
 <?php namespace BookStack\Exceptions;
 
-class UserUpdateException extends NotifyException {}
+class UserUpdateException extends NotifyException
+{
+}
index 413ac6d73f3cb32e13152211ebd1b1b967e0264d..5aa9b1e4a6296de1fe9557649a2d7401d877c52c 100644 (file)
@@ -31,5 +31,4 @@ class MailNotification extends Notification implements ShouldQueue
             'text' => 'vendor.notifications.email-plain'
         ]);
     }
             'text' => 'vendor.notifications.email-plain'
         ]);
     }
-
-}
\ No newline at end of file
+}
index 282aa335a07aed35b52c4ad2520565d567ca217f..305a7da72dc50236dd82cc8bbd935f891cf8fb27 100644 (file)
@@ -1,6 +1,5 @@
 <?php namespace BookStack\Notifications;
 
 <?php namespace BookStack\Notifications;
 
-
 class ResetPassword extends MailNotification
 {
     /**
 class ResetPassword extends MailNotification
 {
     /**
index 0e628c7da746a825188f351248649cce0fa74533..7d51cc73d0a7af9b303a8112292d3ac18a81f432 100644 (file)
@@ -1,6 +1,5 @@
 <?php namespace BookStack\Providers;
 
 <?php namespace BookStack\Providers;
 
-
 use BookStack\Translation\Translator;
 
 class TranslationServiceProvider extends \Illuminate\Translation\TranslationServiceProvider
 use BookStack\Translation\Translator;
 
 class TranslationServiceProvider extends \Illuminate\Translation\TranslationServiceProvider
@@ -29,4 +28,4 @@ class TranslationServiceProvider extends \Illuminate\Translation\TranslationServ
             return $trans;
         });
     }
             return $trans;
         });
     }
-}
\ No newline at end of file
+}
index 2edfecf7368413559303884081c9d455ba17219d..032f43ff7255162f8c942939657f87a7868e13b9 100644 (file)
@@ -1,6 +1,5 @@
 <?php namespace BookStack\Translation;
 
 <?php namespace BookStack\Translation;
 
-
 class Translator extends \Illuminate\Translation\Translator
 {
 
 class Translator extends \Illuminate\Translation\Translator
 {
 
@@ -70,5 +69,4 @@ class Translator extends \Illuminate\Translation\Translator
     {
         return $this->baseLocaleMap[$locale] ?? null;
     }
     {
         return $this->baseLocaleMap[$locale] ?? null;
     }
-
-}
\ No newline at end of file
+}
index 3ebe17eee4c25f86839e6de47128db17881f16f9..5e8115637dbbe23abf78dd5a9eb52959d9e75fe8 100644 (file)
@@ -30,5 +30,4 @@ class HttpFetcher
 
         return $data;
     }
 
         return $data;
     }
-
-}
\ No newline at end of file
+}