Test Failed
Push — master ( 8f3679...551a31 )
by Nur
06:48 queued 03:23
created
database/migrations/0000_00_00_000000_create_counters_tables.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
     public function up()
15 15
     {
16 16
 
17
-        Schema::create('counters', function (Blueprint $table) {
17
+        Schema::create('counters', function(Blueprint $table) {
18 18
             $table->id();
19 19
             $table->string('key')->unique();
20 20
             $table->string('name');
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
             $table->timestamps();
26 26
         });
27 27
 
28
-        Schema::create('counterables', function (Blueprint $table) {
28
+        Schema::create('counterables', function(Blueprint $table) {
29 29
             $table->id();
30 30
             $table->morphs('counterable');
31 31
             $table->unsignedBigInteger('counter_id');
Please login to merge, or discard this patch.
src/Classes/Counters.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
         $counter = Counter::query()->where('key', $key)->first();
59 59
         if ($counter) {
60 60
             return $counter->value;
61
-        } elseif (! is_null($default)) {
61
+        } elseif (!is_null($default)) {
62 62
             return $default;
63 63
         } else {
64 64
             throw CounterDoesNotExist::create($key);
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
     public function incrementIfNotHasCookies($key, $step = null)
141 141
     {
142 142
         $cookieName = $this->getCookieName($key);
143
-        if (! array_key_exists($cookieName, $_COOKIE)) {
143
+        if (!array_key_exists($cookieName, $_COOKIE)) {
144 144
             $this->increment($key, $step);
145 145
             setcookie($cookieName, 1);
146 146
         }
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
     public function decrementIfNotHasCookies($key, $step = null)
156 156
     {
157 157
         $cookieName = $this->getCookieName($key);
158
-        if (! array_key_exists($cookieName, $_COOKIE)) {
158
+        if (!array_key_exists($cookieName, $_COOKIE)) {
159 159
             $this->decrement($key, $step);
160 160
             setcookie($cookieName, 1);
161 161
         }
Please login to merge, or discard this patch.
src/CountersServiceProvider.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
      */
16 16
     public function boot()
17 17
     {
18
-        $this->app->booted(function () {
18
+        $this->app->booted(function() {
19 19
             $loader = AliasLoader::getInstance();
20 20
             $loader->alias('Counters', Counters::class);
21 21
         });
Please login to merge, or discard this patch.
src/Traits/HasCounter.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 //        dd($this->counters);
35 35
         $counter = $this->counters->where('key', $key)->first();
36 36
         //connect the counter to the object if it's not exist
37
-        if (! $counter) {
37
+        if (!$counter) {
38 38
             $this->addCounter($key);
39 39
             $counter = $this->counters->where('key', $key)->first();
40 40
         }
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
      */
50 50
     public function hasCounter($key)
51 51
     {
52
-        return ! is_null($this->counters()->where('counters.key', $key)->first());
52
+        return !is_null($this->counters()->where('counters.key', $key)->first());
53 53
     }
54 54
 
55 55
     /**
@@ -77,11 +77,11 @@  discard block
 block discarded – undo
77 77
     {
78 78
         $counter = Counters::get($key);
79 79
         if ($counter) {
80
-            if (! $this->hasCounter($key)) { // not to add the counter twice
80
+            if (!$this->hasCounter($key)) { // not to add the counter twice
81 81
                 $this->counters()->attach(
82 82
                     $counter->id,
83 83
                     [
84
-                        'value' => ! is_null($initialValue) ? $initialValue : $counter->initial_value,
84
+                        'value' => !is_null($initialValue) ? $initialValue : $counter->initial_value,
85 85
                     ]
86 86
                 );
87 87
             } else {
Please login to merge, or discard this patch.
tests/TestCase.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@
 block discarded – undo
40 40
 
41 41
     protected function setUpDatabase()
42 42
     {
43
-        $this->app['db']->connection()->getSchemaBuilder()->create('posts', function (Blueprint $table) {
43
+        $this->app['db']->connection()->getSchemaBuilder()->create('posts', function(Blueprint $table) {
44 44
             $table->increments('id');
45 45
             $table->string('name');
46 46
             $table->timestamps();
Please login to merge, or discard this patch.