Completed
Push — master ( 48db42...dcc220 )
by Mike
13s queued 11s
created
tests/database/factories/AuthorFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@
 block discarded – undo
3 3
 use Faker\Generator as Faker;
4 4
 use GeneaLabs\LaravelModelCaching\Tests\Fixtures\Author;
5 5
 
6
-$factory->define(Author::class, function (Faker $faker) {
6
+$factory->define(Author::class, function(Faker $faker) {
7 7
     return [
8 8
         'name' => $faker->name,
9 9
         'email' => $faker->unique()->safeEmail,
Please login to merge, or discard this patch.
tests/database/migrations/2017_09_21_202000_create_book_store.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@
 block discarded – undo
7 7
 {
8 8
     public function up()
9 9
     {
10
-        Schema::create('book_store', function (Blueprint $table) {
10
+        Schema::create('book_store', function(Blueprint $table) {
11 11
             $table->increments('id');
12 12
             $table->unsignedInteger('book_id');
13 13
             $table->unsignedInteger('store_id');
Please login to merge, or discard this patch.
tests/database/migrations/2017_09_21_200000_create_profiles.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@
 block discarded – undo
7 7
 {
8 8
     public function up()
9 9
     {
10
-        Schema::create('profiles', function (Blueprint $table) {
10
+        Schema::create('profiles', function(Blueprint $table) {
11 11
             $table->increments('id');
12 12
             $table->unsignedInteger('author_id');
13 13
             $table->timestamps();
Please login to merge, or discard this patch.
tests/database/migrations/2017_09_21_201000_create_stores.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@
 block discarded – undo
7 7
 {
8 8
     public function up()
9 9
     {
10
-        Schema::create('stores', function (Blueprint $table) {
10
+        Schema::create('stores', function(Blueprint $table) {
11 11
             $table->increments('id');
12 12
             $table->timestamps();
13 13
 
Please login to merge, or discard this patch.
tests/database/factories/StoreFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@
 block discarded – undo
3 3
 use Faker\Generator as Faker;
4 4
 use GeneaLabs\LaravelModelCaching\Tests\Fixtures\Store;
5 5
 
6
-$factory->define(Store::class, function (Faker $faker) {
6
+$factory->define(Store::class, function(Faker $faker) {
7 7
     return [
8 8
         'address' => $faker->address,
9 9
         'name' => $faker->company,
Please login to merge, or discard this patch.
src/Traits/BuilderCaching.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@
 block discarded – undo
6 6
 {
7 7
     public function all($columns = ['*']) : Collection
8 8
     {
9
-        if (! $this->isCachable()) {
9
+        if (!$this->isCachable()) {
10 10
             $this->model->disableModelCaching();
11 11
         }
12 12
 
Please login to merge, or discard this patch.
src/Console/Commands/Clear.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
     {
13 13
         $option = $this->option('model');
14 14
 
15
-        if (! $option) {
15
+        if (!$option) {
16 16
             return $this->flushEntireCache();
17 17
         }
18 18
 
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
         $usesCachableTrait = $this->getAllTraitsUsedByClass($option)
37 37
             ->contains("GeneaLabs\LaravelModelCaching\Traits\Cachable");
38 38
 
39
-        if (! $usesCachableTrait) {
39
+        if (!$usesCachableTrait) {
40 40
             $this->error("'{$option}' is not an instance of CachedModel.");
41 41
             $this->line("Only CachedModel instances can be flushed.");
42 42
 
Please login to merge, or discard this patch.
src/CacheTags.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
     {
29 29
         $tags = collect($this->eagerLoad)
30 30
             ->keys()
31
-            ->map(function ($relationName) {
31
+            ->map(function($relationName) {
32 32
                 $relation = $this->getRelation($relationName);
33 33
 
34 34
                 return $this->getCachePrefix()
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
     protected function getRelation(string $relationName) : Relation
54 54
     {
55 55
         return collect(explode('.', $relationName))
56
-            ->reduce(function ($carry, $name) {
56
+            ->reduce(function($carry, $name) {
57 57
                 $carry = $carry ?: $this->model;
58 58
                 $carry = $this->getRelatedModel($carry);
59 59
 
Please login to merge, or discard this patch.
src/Traits/ModelCaching.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -22,22 +22,22 @@  discard block
 block discarded – undo
22 22
         $key = $instance->makeCacheKey();
23 23
 
24 24
         return $instance->cache($tags)
25
-            ->rememberForever($key, function () use ($columns) {
25
+            ->rememberForever($key, function() use ($columns) {
26 26
                 return parent::all($columns);
27 27
             });
28 28
     }
29 29
 
30 30
     public static function bootCachable()
31 31
     {
32
-        static::created(function ($instance) {
32
+        static::created(function($instance) {
33 33
             $instance->checkCooldownAndFlushAfterPersisting($instance);
34 34
         });
35 35
 
36
-        static::deleted(function ($instance) {
36
+        static::deleted(function($instance) {
37 37
             $instance->checkCooldownAndFlushAfterPersisting($instance);
38 38
         });
39 39
 
40
-        static::saved(function ($instance) {
40
+        static::saved(function($instance) {
41 41
             $instance->checkCooldownAndFlushAfterPersisting($instance);
42 42
         });
43 43
 
@@ -46,15 +46,15 @@  discard block
 block discarded – undo
46 46
         //     $instance->checkCooldownAndFlushAfterPersisting($instance);
47 47
         // });
48 48
 
49
-        static::pivotAttached(function ($instance, $secondInstance, $relationship) {
49
+        static::pivotAttached(function($instance, $secondInstance, $relationship) {
50 50
             $instance->checkCooldownAndFlushAfterPersisting($instance, $relationship);
51 51
         });
52 52
 
53
-        static::pivotDetached(function ($instance, $secondInstance, $relationship) {
53
+        static::pivotDetached(function($instance, $secondInstance, $relationship) {
54 54
             $instance->checkCooldownAndFlushAfterPersisting($instance, $relationship);
55 55
         });
56 56
 
57
-        static::pivotUpdated(function ($instance, $secondInstance, $relationship) {
57
+        static::pivotUpdated(function($instance, $secondInstance, $relationship) {
58 58
             $instance->checkCooldownAndFlushAfterPersisting($instance, $relationship);
59 59
         });
60 60
     }
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 
71 71
     public function newEloquentBuilder($query)
72 72
     {
73
-        if (! $this->isCachable()) {
73
+        if (!$this->isCachable()) {
74 74
             $this->isCachable = false;
75 75
 
76 76
             return new EloquentBuilder($query);
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
         EloquentBuilder $query,
115 115
         int $seconds = null
116 116
     ) : EloquentBuilder {
117
-        if (! $seconds) {
117
+        if (!$seconds) {
118 118
             $seconds = $this->cacheCooldownSeconds;
119 119
         }
120 120
 
@@ -123,13 +123,13 @@  discard block
 block discarded – undo
123 123
         $cacheKey = "{$cachePrefix}:{$modelClassName}-cooldown:seconds";
124 124
 
125 125
         $this->cache()
126
-            ->rememberForever($cacheKey, function () use ($seconds) {
126
+            ->rememberForever($cacheKey, function() use ($seconds) {
127 127
                 return $seconds;
128 128
             });
129 129
 
130 130
         $cacheKey = "{$cachePrefix}:{$modelClassName}-cooldown:invalidated-at";
131 131
         $this->cache()
132
-            ->rememberForever($cacheKey, function () {
132
+            ->rememberForever($cacheKey, function() {
133 133
                 return (new Carbon)->now();
134 134
             });
135 135
 
Please login to merge, or discard this patch.