@@ -3,7 +3,7 @@ |
||
| 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, |
@@ -7,7 +7,7 @@ |
||
| 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'); |
@@ -7,7 +7,7 @@ |
||
| 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(); |
@@ -7,7 +7,7 @@ |
||
| 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 | |
@@ -3,7 +3,7 @@ |
||
| 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, |
@@ -6,7 +6,7 @@ |
||
| 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 | |
@@ -12,7 +12,7 @@ discard block |
||
| 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 |
||
| 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 | |
@@ -28,7 +28,7 @@ discard block |
||
| 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 |
||
| 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 | |
@@ -12,8 +12,8 @@ discard block |
||
| 12 | 12 | ->get("laravel-model-caching.use-database-keying"); |
| 13 | 13 | |
| 14 | 14 | if ($useDatabaseKeying) { |
| 15 | - $cachePrefix .= $this->getConnectionName() . ":"; |
|
| 16 | - $cachePrefix .= $this->getDatabaseName() . ":"; |
|
| 15 | + $cachePrefix .= $this->getConnectionName().":"; |
|
| 16 | + $cachePrefix .= $this->getDatabaseName().":"; |
|
| 17 | 17 | } |
| 18 | 18 | |
| 19 | 19 | $cachePrefix .= Container::getInstance() |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | if ($this->model |
| 24 | 24 | && property_exists($this->model, "cachePrefix") |
| 25 | 25 | ) { |
| 26 | - $cachePrefix .= $this->model->cachePrefix . ":"; |
|
| 26 | + $cachePrefix .= $this->model->cachePrefix.":"; |
|
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | return $cachePrefix; |