Passed
Push — master ( feee53...6160a4 )
by Innocent
10:45
created
src/Events/Commenter/TypingRegistered.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -40,14 +40,14 @@
 block discarded – undo
40 40
      */
41 41
     public function broadcastOn()
42 42
     {
43
-        return new PrivateChannel('comments-'.$this->data['category'].'-'.$this->data['item_id']);
43
+        return new PrivateChannel('comments-' . $this->data[ 'category' ] . '-' . $this->data[ 'item_id' ]);
44 44
     }
45 45
 
46 46
     public function broadcastWith()
47 47
     {
48 48
         return [
49 49
             'user'   => $this->user,
50
-            'status' => $this->name.' is typing',
50
+            'status' => $this->name . ' is typing',
51 51
         ];
52 52
     }
53 53
 
Please login to merge, or discard this patch.
src/Events/CommentCreated.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@
 block discarded – undo
38 38
         $requiredName = Str::lower(Arr::last($namePieces));
39 39
         $requiredName = Str::plural($requiredName);
40 40
 
41
-        return new PrivateChannel('comments-'.$requiredName.'-'.$this->comment->commentable_id);
41
+        return new PrivateChannel('comments-' . $requiredName . '-' . $this->comment->commentable_id);
42 42
     }
43 43
 
44 44
     public function broadcastWith()
Please login to merge, or discard this patch.
src/Helpers/Helper.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@
 block discarded – undo
9 9
     public static $hexColorRegex = 'regex:/^#([a-fA-F0-9]{6})$/i';
10 10
 
11 11
     public static $freeMessagesCount = 10;
12
-    public static $reviewTypes = ['feedback', 'report'];
12
+    public static $reviewTypes = [ 'feedback', 'report' ];
13 13
 
14 14
     public static $weekDays = [
15 15
         'Monday',
Please login to merge, or discard this patch.
src/Helpers/ImageHelper.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -42,9 +42,9 @@
 block discarded – undo
42 42
             $protocol = 'https://';
43 43
 
44 44
         return (object)[
45
-            '_50' => $protocol . $_SERVER['HTTP_HOST'] . '/images/logo-50.png',
46
-            '_100' => $protocol . $_SERVER['HTTP_HOST'] . '/images/logo-100.png',
47
-            'original' => $protocol . $_SERVER['HTTP_HOST'] . '/images/logo-original.png',
45
+            '_50' => $protocol . $_SERVER[ 'HTTP_HOST' ] . '/images/logo-50.png',
46
+            '_100' => $protocol . $_SERVER[ 'HTTP_HOST' ] . '/images/logo-100.png',
47
+            'original' => $protocol . $_SERVER[ 'HTTP_HOST' ] . '/images/logo-original.png',
48 48
         ];
49 49
     }
50 50
 
Please login to merge, or discard this patch.
Braces   +11 added lines, -7 removed lines patch added patch discarded remove patch
@@ -18,9 +18,11 @@  discard block
 block discarded – undo
18 18
      */
19 19
     private static function getImages(string $server, string $folder, ?Image $image): object
20 20
     {
21
-        if ($image)
22
-            $imageName = $image->name;
23
-        else return static::getDefaultImage();
21
+        if ($image) {
22
+                    $imageName = $image->name;
23
+        } else {
24
+            return static::getDefaultImage();
25
+        }
24 26
 
25 27
         return (object)[
26 28
             '_50' => $server . '/storage/' . $folder . '/50-50/' . $imageName,
@@ -38,8 +40,9 @@  discard block
 block discarded – undo
38 40
     {
39 41
         $protocol = 'http://';
40 42
 
41
-        if (Str::of(URL::current())->startsWith('https'))
42
-            $protocol = 'https://';
43
+        if (Str::of(URL::current())->startsWith('https')) {
44
+                    $protocol = 'https://';
45
+        }
43 46
 
44 47
         return (object)[
45 48
             '_50' => $protocol . $_SERVER['HTTP_HOST'] . '/images/logo-50.png',
@@ -58,8 +61,9 @@  discard block
 block discarded – undo
58 61
      */
59 62
     public static function getImage(string $folder, ?Image $image, ?string $server = null)
60 63
     {
61
-        if (!$server)
62
-            $server = config('faithgen-sdk.ministries-server');
64
+        if (!$server) {
65
+                    $server = config('faithgen-sdk.ministries-server');
66
+        }
63 67
 
64 68
         return static::getImages($server, $folder, $image);
65 69
     }
Please login to merge, or discard this patch.
src/Helpers/CommentHelper.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@
 block discarded – undo
58 58
     {
59 59
         $comments = $model->comments()
60 60
             ->latest()
61
-            ->with(['creatable.image'])
61
+            ->with([ 'creatable.image' ])
62 62
             ->paginate(Helper::getLimit($request));
63 63
 
64 64
         CommentsResource::wrap('comments');
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,9 @@
 block discarded – undo
27 27
                         'creatable_id'   => auth('web')->user()->id,
28 28
                         'creatable_type' => get_class(auth('web')->user()),
29 29
                     ]);
30
-                } else abort(403, 'You are not permitted to comment on this');
30
+                } else {
31
+                    abort(403, 'You are not permitted to comment on this');
32
+                }
31 33
             } else {
32 34
                 $comment = $model->comments()->create([
33 35
                     'comment'        => $request->comment,
Please login to merge, or discard this patch.
src/Traits/ExcludesColumns.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
      * @param array $columns
12 12
      * @return mixed
13 13
      */
14
-    public function scopeExclude($query, array $columns = [])
14
+    public function scopeExclude($query, array $columns = [ ])
15 15
     {
16 16
         $tableColumns = $this->getConnection()->getSchemaBuilder()->getColumnListing($this->getTable());
17 17
 
Please login to merge, or discard this patch.
src/Traits/ConfigTrait.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
      */
22 22
     protected function registerRoutes($primaryRoute, $secondaryRoute)
23 23
     {
24
-        Route::group($this->routeConfiguration(), function () use ($primaryRoute, $secondaryRoute) {
24
+        Route::group($this->routeConfiguration(), function() use ($primaryRoute, $secondaryRoute) {
25 25
             $this->loadRoutes($primaryRoute);
26 26
             if (config('faithgen-sdk.source')) {
27 27
                 $this->loadRoutes($secondaryRoute);
Please login to merge, or discard this patch.
Braces   +8 added lines, -6 removed lines patch added patch discarded remove patch
@@ -31,12 +31,13 @@  discard block
 block discarded – undo
31 31
 
32 32
     private function loadRoutes($routes)
33 33
     {
34
-        if ($routes)
35
-            if (is_string($routes))
34
+        if ($routes) {
35
+                    if (is_string($routes))
36 36
                 $this->loadRoutesFrom($routes);
37
-            else if (is_array($routes))
38
-                foreach ($routes as $route) {
37
+        } else if (is_array($routes)) {
38
+                            foreach ($routes as $route) {
39 39
                     $this->loadRoutesFrom($route);
40
+            }
40 41
                 }
41 42
     }
42 43
 
@@ -45,8 +46,9 @@  discard block
 block discarded – undo
45 46
      */
46 47
     protected function setUpSourceFiles(\Closure $closure)
47 48
     {
48
-        if ($this->app->runningInConsole())
49
-            if (config('faithgen-sdk.source'))
49
+        if ($this->app->runningInConsole()) {
50
+                    if (config('faithgen-sdk.source'))
50 51
                 $closure->call($this);
52
+        }
51 53
     }
52 54
 }
Please login to merge, or discard this patch.
src/Traits/FileTraits.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
     function getFileName(string $path)
10 10
     {
11 11
         $pieces = explode('/', $path);
12
-        return $pieces[sizeof($pieces) - 1];
12
+        return $pieces[ sizeof($pieces) - 1 ];
13 13
     }
14 14
 
15 15
     function getImage(string $dir, string $imageName, int $dimen = 0)
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 
33 33
     function deleteFiles($model)
34 34
     {
35
-        $images = [];
35
+        $images = [ ];
36 36
         foreach ($model->getImageDimensions() as $imageDimension) {
37 37
             if (is_string($model->getFileName()))
38 38
                 array_push($images, $this->getImage($model->filesDir(), $model->getFileName(), $imageDimension));
Please login to merge, or discard this patch.
Braces   +13 added lines, -10 removed lines patch added patch discarded remove patch
@@ -14,10 +14,11 @@  discard block
 block discarded – undo
14 14
 
15 15
     function getImage(string $dir, string $imageName, int $dimen = 0)
16 16
     {
17
-        if ($dimen)
18
-            $dimen = $dimen . '-' . $dimen . '/';
19
-        else
20
-            $dimen = 'original/';
17
+        if ($dimen) {
18
+                    $dimen = $dimen . '-' . $dimen . '/';
19
+        } else {
20
+                    $dimen = 'original/';
21
+        }
21 22
         return storage_path('app/public/' . $dir . '/' . $dimen . $imageName);
22 23
     }
23 24
 
@@ -34,13 +35,15 @@  discard block
 block discarded – undo
34 35
     {
35 36
         $images = [];
36 37
         foreach ($model->getImageDimensions() as $imageDimension) {
37
-            if (is_string($model->getFileName()))
38
-                array_push($images, $this->getImage($model->filesDir(), $model->getFileName(), $imageDimension));
39
-            else if (is_array($model->getFileName()))
40
-                foreach ($model->getFileName() as $filename) {
38
+            if (is_string($model->getFileName())) {
39
+                            array_push($images, $this->getImage($model->filesDir(), $model->getFileName(), $imageDimension));
40
+            } else if (is_array($model->getFileName())) {
41
+                            foreach ($model->getFileName() as $filename) {
41 42
                     array_push($images, $this->getImage($model->filesDir(), $filename, $imageDimension));
42
-                }
43
-            else throw new \InvalidArgumentException('The file name is invalid, string or array required', 500);
43
+            }
44
+                } else {
45
+                throw new \InvalidArgumentException('The file name is invalid, string or array required', 500);
46
+            }
44 47
         }
45 48
         try {
46 49
             foreach ($images as $file) {
Please login to merge, or discard this patch.
src/Models/Ministry/Review.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,5 +9,5 @@
 block discarded – undo
9 9
 {
10 10
     use BelongsToMinistryTrait;
11 11
 
12
-    protected $guarded = ['id'];
12
+    protected $guarded = [ 'id' ];
13 13
 }
Please login to merge, or discard this patch.