@@ -14,7 +14,7 @@ discard block |
||
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 |
||
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'); |
@@ -58,7 +58,7 @@ discard block |
||
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 |
||
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 |
||
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 | } |
@@ -15,7 +15,7 @@ |
||
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 | }); |
@@ -34,7 +34,7 @@ discard block |
||
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 |
||
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 |
||
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 { |
@@ -40,7 +40,7 @@ |
||
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(); |