@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | */ |
32 | 32 | public function isRateable($model): bool |
33 | 33 | { |
34 | - if (! $model instanceof Rateable && ! $model instanceof Rating) { |
|
34 | + if (!$model instanceof Rateable && !$model instanceof Rating) { |
|
35 | 35 | throw ModelNotRateable::create($model); |
36 | 36 | } |
37 | 37 | |
@@ -46,11 +46,11 @@ discard block |
||
46 | 46 | */ |
47 | 47 | public function hasRated($model): bool |
48 | 48 | { |
49 | - if (! $this->isRateable($model)) { |
|
49 | + if (!$this->isRateable($model)) { |
|
50 | 50 | return false; |
51 | 51 | } |
52 | 52 | |
53 | - return (bool) ! is_null($this->ratings($model->getMorphClass())->find($model->getKey())); |
|
53 | + return (bool) !is_null($this->ratings($model->getMorphClass())->find($model->getKey())); |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | /** |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | */ |
63 | 63 | public function addRatingFor($model, $rating): bool |
64 | 64 | { |
65 | - if (! $this->isRateable($model)) { |
|
65 | + if (!$this->isRateable($model)) { |
|
66 | 66 | return false; |
67 | 67 | } |
68 | 68 | |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | */ |
90 | 90 | public function updateRatingFor($model, $rating): bool |
91 | 91 | { |
92 | - if (! $this->isRateable($model)) { |
|
92 | + if (!$this->isRateable($model)) { |
|
93 | 93 | return false; |
94 | 94 | } |
95 | 95 | |
@@ -125,11 +125,11 @@ discard block |
||
125 | 125 | */ |
126 | 126 | public function deleteRatingFor($model): bool |
127 | 127 | { |
128 | - if (! $this->isRateable($model)) { |
|
128 | + if (!$this->isRateable($model)) { |
|
129 | 129 | return false; |
130 | 130 | } |
131 | 131 | |
132 | - if (! $this->hasRated($model)) { |
|
132 | + if (!$this->hasRated($model)) { |
|
133 | 133 | return false; |
134 | 134 | } |
135 | 135 |
@@ -8,7 +8,7 @@ |
||
8 | 8 | { |
9 | 9 | public function __construct(array $attributes = []) |
10 | 10 | { |
11 | - if (! isset($this->table)) { |
|
11 | + if (!isset($this->table)) { |
|
12 | 12 | $this->setTable(config('rating.table_name')); |
13 | 13 | } |
14 | 14 |
@@ -10,7 +10,7 @@ |
||
10 | 10 | | |
11 | 11 | */ |
12 | 12 | |
13 | -$factory->define(\Canylmz\Rating\Test\Models\SimplePage::class, function () { |
|
13 | +$factory->define(\Canylmz\Rating\Test\Models\SimplePage::class, function() { |
|
14 | 14 | return [ |
15 | 15 | 'name' => 'Page'.str_random(5), |
16 | 16 | ]; |
@@ -10,7 +10,7 @@ |
||
10 | 10 | | |
11 | 11 | */ |
12 | 12 | |
13 | -$factory->define(\Canylmz\Rating\Test\Models\User::class, function () { |
|
13 | +$factory->define(\Canylmz\Rating\Test\Models\User::class, function() { |
|
14 | 14 | return [ |
15 | 15 | 'name' => 'Name'.str_random(5), |
16 | 16 | 'email' => str_random(5).'@gmail.com', |
@@ -10,7 +10,7 @@ |
||
10 | 10 | | |
11 | 11 | */ |
12 | 12 | |
13 | -$factory->define(\Canylmz\Rating\Test\Models\Page::class, function () { |
|
13 | +$factory->define(\Canylmz\Rating\Test\Models\Page::class, function() { |
|
14 | 14 | return [ |
15 | 15 | 'name' => 'Page'.str_random(5), |
16 | 16 | ]; |
@@ -11,7 +11,7 @@ |
||
11 | 11 | */ |
12 | 12 | public function up() |
13 | 13 | { |
14 | - Schema::create(config('rating.table_name', 'ratings'), function (Blueprint $table) { |
|
14 | + Schema::create(config('rating.table_name', 'ratings'), function(Blueprint $table) { |
|
15 | 15 | $table->increments('id'); |
16 | 16 | $table->string('rater_type')->nullable(); |
17 | 17 | $table->integer('rater_id')->nullable(); |
@@ -14,7 +14,7 @@ |
||
14 | 14 | | |
15 | 15 | */ |
16 | 16 | |
17 | -$factory->define(Post::class, function () { |
|
17 | +$factory->define(Post::class, function() { |
|
18 | 18 | return [ |
19 | 19 | 'name' => 'Post '.Str::random(5), |
20 | 20 | ]; |
@@ -13,7 +13,7 @@ |
||
13 | 13 | */ |
14 | 14 | public function up() |
15 | 15 | { |
16 | - Schema::create('posts', function (Blueprint $table) { |
|
16 | + Schema::create('posts', function(Blueprint $table) { |
|
17 | 17 | $table->increments('id'); |
18 | 18 | $table->string('name'); |
19 | 19 | $table->timestamps(); |
@@ -13,7 +13,7 @@ |
||
13 | 13 | */ |
14 | 14 | public function up() |
15 | 15 | { |
16 | - Schema::create('members', function (Blueprint $table) { |
|
16 | + Schema::create('members', function(Blueprint $table) { |
|
17 | 17 | $table->increments('id'); |
18 | 18 | $table->string('name'); |
19 | 19 | $table->timestamps(); |