Test Failed
Push — master ( cbb324...62a694 )
by Nur
12:10
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/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.
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.
src/Classes/Counters.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 
61 61
         if ($counter) {
62 62
             return $counter->value;
63
-        } elseif (! is_null($default)) {
63
+        } elseif (!is_null($default)) {
64 64
             return $default;
65 65
         }
66 66
 
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
     {
147 147
         $cookieName = $this->getCookieName($key);
148 148
 
149
-        if (! array_key_exists($cookieName, $_COOKIE)) {
149
+        if (!array_key_exists($cookieName, $_COOKIE)) {
150 150
             $this->increment($key, $step);
151 151
             setcookie($cookieName, 1);
152 152
         }
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
     {
163 163
         $cookieName = $this->getCookieName($key);
164 164
 
165
-        if (! array_key_exists($cookieName, $_COOKIE)) {
165
+        if (!array_key_exists($cookieName, $_COOKIE)) {
166 166
             $this->decrement($key, $step);
167 167
             setcookie($cookieName, 1);
168 168
         }
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
         $counter = $this->counters->where('key', $key)->first();
35 35
 
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
     /**
@@ -79,11 +79,11 @@  discard block
 block discarded – undo
79 79
         $counter = Counters::get($key);
80 80
 
81 81
         if ($counter) {
82
-            if (! $this->hasCounter($key)) { // not to add the counter twice
82
+            if (!$this->hasCounter($key)) { // not to add the counter twice
83 83
                 $this->counters()->attach(
84 84
                     $counter->id,
85 85
                     [
86
-                        'value' => ! is_null($initialValue) ? $initialValue : $counter->initial_value,
86
+                        'value' => !is_null($initialValue) ? $initialValue : $counter->initial_value,
87 87
                     ]
88 88
                 );
89 89
             } else {
Please login to merge, or discard this patch.