Completed
Push — master ( 3cc6f9...dcc039 )
by Joao
02:23
created
src/Traits/CaptchaTrait.php 1 patch
Braces   +5 added lines, -4 removed lines patch added patch discarded remove patch
@@ -15,10 +15,11 @@
 block discarded – undo
15 15
         $recaptcha = new ReCaptcha($secret);
16 16
         $resp = $recaptcha->verify($response, $remoteip);
17 17
 
18
-        if ($resp->isSuccess())
19
-            return true;
20
-        else
21
-            return false;
18
+        if ($resp->isSuccess()) {
19
+                    return true;
20
+        } else {
21
+                    return false;
22
+        }
22 23
     }
23 24
 
24 25
 }
25 26
\ No newline at end of file
Please login to merge, or discard this patch.
src/Helpers/ColorHelper.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
         // Normalize into a six character long hex string
10 10
         $hex = str_replace('#', '', $hex);
11 11
         if (strlen($hex) == 3) {
12
-            $hex = str_repeat(substr($hex,0,1), 2).str_repeat(substr($hex,1,1), 2).str_repeat(substr($hex,2,1), 2);
12
+            $hex = str_repeat(substr($hex, 0, 1), 2) . str_repeat(substr($hex, 1, 1), 2) . str_repeat(substr($hex, 2, 1), 2);
13 13
         }
14 14
 
15 15
         // Split into three parts: R, G and B
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 
19 19
         foreach ($color_parts as $color) {
20 20
             $color   = hexdec($color); // Convert to decimal
21
-            $color   = max(0,min(255,$color + $steps)); // Adjust color
21
+            $color   = max(0, min(255, $color + $steps)); // Adjust color
22 22
             $return .= str_pad(dechex($color), 2, '0', STR_PAD_LEFT); // Make two char hex code
23 23
         }
24 24
 
Please login to merge, or discard this patch.
src/Database/Blueprint.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -106,8 +106,9 @@
 block discarded – undo
106 106
         // If no name was specified for this index, we will create one using a basic
107 107
         // convention of the table name, followed by the columns, followed by an
108 108
         // index type, such as primary or index, which makes the index unique.
109
-        if (is_null($index))
110
-            $index = $this->createIndexName($type, $columns);
109
+        if (is_null($index)) {
110
+                    $index = $this->createIndexName($type, $columns);
111
+        }
111 112
         return $this->addCommand($type, compact('index', 'columns', 'length'));
112 113
     }
113 114
 
Please login to merge, or discard this patch.
src/Database/MySqlGrammar.php 2 patches
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -13,12 +13,12 @@  discard block
 block discarded – undo
13 13
 
14 14
     public function __construct()
15 15
     {
16
-        if ( ! in_array('Collate', $this->modifiers) )
16
+        if (!in_array('Collate', $this->modifiers))
17 17
         {
18 18
             array_splice($this->modifiers, array_search('Unsigned', $this->modifiers) + 1, 0, 'Collate');
19 19
         }
20 20
         // new versions of Laravel already have comment modifier
21
-        if ( ! in_array('Comment', $this->modifiers) )
21
+        if (!in_array('Comment', $this->modifiers))
22 22
         {
23 23
             array_splice($this->modifiers, array_search('After', $this->modifiers) - 1, 0, 'Comment');
24 24
         }
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
      */
34 34
     protected function modifyCollate(IlluminateBlueprint $blueprint, Fluent $column)
35 35
     {
36
-        if ( ! is_null($column->collate) )
36
+        if (!is_null($column->collate))
37 37
         {
38 38
             $characterSet = strtok($column->collate, '_');
39 39
             return " character set $characterSet collate {$column->collate}";
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
      */
50 50
     protected function modifyComment(IlluminateBlueprint $blueprint, Fluent $column)
51 51
     {
52
-        if ( ! is_null($column->comment) )
52
+        if (!is_null($column->comment))
53 53
         {
54 54
             $comment = str_replace("'", "\'", $column->comment);
55 55
             return " comment '$comment'";
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
     {
69 69
         $sql = parent::compileCreate($blueprint, $command, $connection);
70 70
         // Table annotation support
71
-        if ( isset($blueprint->comment) )
71
+        if (isset($blueprint->comment))
72 72
         {
73 73
             $comment = str_replace("'", "\'", $blueprint->comment);
74 74
             $sql .= " comment = '$comment'";
@@ -109,21 +109,21 @@  discard block
 block discarded – undo
109 109
     protected function compileKey(IlluminateBlueprint $blueprint, Fluent $command, $type)
110 110
     {
111 111
         $columns = [];
112
-        foreach($command->columns as $commandColumn)
112
+        foreach ($command->columns as $commandColumn)
113 113
         {
114
-            foreach($blueprint->getColumns() as $blueprintColumn)
114
+            foreach ($blueprint->getColumns() as $blueprintColumn)
115 115
             {
116
-                if ( $blueprintColumn->name != $commandColumn )
116
+                if ($blueprintColumn->name != $commandColumn)
117 117
                 {
118 118
                     continue;
119 119
                 }
120 120
 
121 121
                 $column = $this->wrap($commandColumn);
122
-                if ( isset($command->length) )
122
+                if (isset($command->length))
123 123
                 {
124 124
                     $column .= "({$command->length})";
125 125
                 }
126
-                elseif ( 'string' == $blueprintColumn->type && $blueprintColumn->length > 255 )
126
+                elseif ('string' == $blueprintColumn->type && $blueprintColumn->length > 255)
127 127
                 {
128 128
                     $column .= '(255)';
129 129
                 }
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -122,8 +122,7 @@
 block discarded – undo
122 122
                 if ( isset($command->length) )
123 123
                 {
124 124
                     $column .= "({$command->length})";
125
-                }
126
-                elseif ( 'string' == $blueprintColumn->type && $blueprintColumn->length > 255 )
125
+                } elseif ( 'string' == $blueprintColumn->type && $blueprintColumn->length > 255 )
127 126
                 {
128 127
                     $column .= '(255)';
129 128
                 }
Please login to merge, or discard this patch.
src/supportServiceProvider.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@
 block discarded – undo
66 66
     /**
67 67
      * Get the services provided by the provider.
68 68
      *
69
-     * @return array
69
+     * @return string[]
70 70
      */
71 71
     public function provides()
72 72
     {
Please login to merge, or discard this patch.
src/Commands/SetupCommand.php 3 patches
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -1,8 +1,6 @@
 block discarded – undo
1 1
 <?php namespace jlourenco\support\Commands;
2 2
 
3 3
 use Illuminate\Console\Command;
4
-use Symfony\Component\Console\Input\InputOption;
5
-use Symfony\Component\Console\Input\InputArgument;
6 4
 use File;
7 5
 
8 6
 class SetupCommand extends Command {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@
 block discarded – undo
55 55
         $mainFile = $path . '/jlourenco.php';
56 56
         $fileExists = file_exists($mainFile);
57 57
 
58
-        $files = array_filter(scandir($path), function ($var) {
58
+        $files = array_filter(scandir($path), function($var) {
59 59
             return (!(stripos($var, 'jlourenco.') === false) && $var != 'jlourenco.php');
60 60
         });
61 61
 
Please login to merge, or discard this patch.
Braces   +9 added lines, -6 removed lines patch added patch discarded remove patch
@@ -59,8 +59,9 @@  discard block
 block discarded – undo
59 59
             return (!(stripos($var, 'jlourenco.') === false) && $var != 'jlourenco.php');
60 60
         });
61 61
 
62
-        if ($fileExists)
63
-            unlink($mainFile);
62
+        if ($fileExists) {
63
+                    unlink($mainFile);
64
+        }
64 65
 
65 66
         touch($mainFile);
66 67
 
@@ -73,8 +74,9 @@  discard block
 block discarded – undo
73 74
 
74 75
             while ($line = fgets($in))
75 76
             {
76
-                if ((stripos($line, '<?php') === false) && (stripos($line, '];') === false) && (stripos($line, 'return [') === false))
77
-                    $content .= $line;
77
+                if ((stripos($line, '<?php') === false) && (stripos($line, '];') === false) && (stripos($line, 'return [') === false)) {
78
+                                    $content .= $line;
79
+                }
78 80
             }
79 81
 
80 82
             fclose($in);
@@ -85,8 +87,9 @@  discard block
 block discarded – undo
85 87
         $content .= "];\n";
86 88
 
87 89
         $bytesWritten = File::append($mainFile, $content);
88
-        if ($bytesWritten === false)
89
-            die("Couldn't write to config file.");
90
+        if ($bytesWritten === false) {
91
+                    die("Couldn't write to config file.");
92
+        }
90 93
 
91 94
         $this->info('Config files compiled');
92 95
     }
Please login to merge, or discard this patch.
src/Traits/Creation.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
     {
14 14
 
15 15
         // create a event to happen on deleting
16
-        static::deleting(function($table)  {
16
+        static::deleting(function($table) {
17 17
             if (class_exists('Cartalyst\Sentinel\Laravel\Facades\Sentinel'))
18 18
                 $table->deleted_by = Sentinel::getUser()->id;
19 19
             else
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
         });
22 22
 
23 23
         // create a event to happen on saving
24
-        static::saving(function($table)  {
24
+        static::saving(function($table) {
25 25
 
26 26
             if (class_exists('Cartalyst\Sentinel\Laravel\Facades\Sentinel'))
27 27
             {
Please login to merge, or discard this patch.
Braces   +12 added lines, -10 removed lines patch added patch discarded remove patch
@@ -14,10 +14,11 @@  discard block
 block discarded – undo
14 14
 
15 15
         // create a event to happen on deleting
16 16
         static::deleting(function($table)  {
17
-            if (class_exists('Cartalyst\Sentinel\Laravel\Facades\Sentinel'))
18
-                $table->deleted_by = Sentinel::getUser()->id;
19
-            else
20
-                $table->deleted_by = Auth::user()->id;
17
+            if (class_exists('Cartalyst\Sentinel\Laravel\Facades\Sentinel')) {
18
+                            $table->deleted_by = Sentinel::getUser()->id;
19
+            } else {
20
+                            $table->deleted_by = Auth::user()->id;
21
+            }
21 22
         });
22 23
 
23 24
         // create a event to happen on saving
@@ -27,15 +28,16 @@  discard block
 block discarded – undo
27 28
             {
28 29
                 $table->modified_by = Sentinel::getUser()->id;
29 30
 
30
-                if ($user = Sentinel::check() && ($table->created_by == null || !($table->created_by > 0)))
31
-                    $table->created_by = Sentinel::getUser()->id;
32
-            }
33
-            else
31
+                if ($user = Sentinel::check() && ($table->created_by == null || !($table->created_by > 0))) {
32
+                                    $table->created_by = Sentinel::getUser()->id;
33
+                }
34
+            } else
34 35
             {
35 36
                 $table->modified_by = Auth::user()->id;
36 37
 
37
-                if (!Auth::guest() && ($table->created_by == null || !($table->created_by > 0)))
38
-                    $table->created_by = Auth::user()->id;
38
+                if (!Auth::guest() && ($table->created_by == null || !($table->created_by > 0))) {
39
+                                    $table->created_by = Auth::user()->id;
40
+                }
39 41
             }
40 42
 
41 43
         });
Please login to merge, or discard this patch.