Completed
Pull Request — master (#68)
by Anton
03:37
created
database/migrations/2018_07_22_002000_create_love_reactions_table.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
      */
25 25
     public function up(): void
26 26
     {
27
-        Schema::create('love_reactions', function (Blueprint $table) {
27
+        Schema::create('love_reactions', function(Blueprint $table) {
28 28
             $table->bigIncrements('id');
29 29
             $table->unsignedBigInteger('reactant_id');
30 30
             $table->unsignedBigInteger('reacter_id');
Please login to merge, or discard this patch.
2018_07_25_000000_create_love_reactant_reaction_counters_table.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
      */
25 25
     public function up(): void
26 26
     {
27
-        Schema::create('love_reactant_reaction_counters', function (Blueprint $table) {
27
+        Schema::create('love_reactant_reaction_counters', function(Blueprint $table) {
28 28
             $table->bigIncrements('id');
29 29
             $table->unsignedBigInteger('reactant_id');
30 30
             $table->unsignedBigInteger('reaction_type_id');
Please login to merge, or discard this patch.
database/migrations/2018_07_22_001500_create_love_reaction_types_table.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
      */
25 25
     public function up(): void
26 26
     {
27
-        Schema::create('love_reaction_types', function (Blueprint $table) {
27
+        Schema::create('love_reaction_types', function(Blueprint $table) {
28 28
             $table->bigIncrements('id');
29 29
             $table->string('name');
30 30
             $table->tinyInteger('weight');
Please login to merge, or discard this patch.
database/migrations/2018_07_22_000100_create_love_reacters_table.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
      */
25 25
     public function up(): void
26 26
     {
27
-        Schema::create('love_reacters', function (Blueprint $table) {
27
+        Schema::create('love_reacters', function(Blueprint $table) {
28 28
             $table->bigIncrements('id');
29 29
             $table->string('type');
30 30
             $table->timestamps();
Please login to merge, or discard this patch.
database/migrations/2018_07_22_001000_create_love_reactants_table.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
      */
25 25
     public function up(): void
26 26
     {
27
-        Schema::create('love_reactants', function (Blueprint $table) {
27
+        Schema::create('love_reactants', function(Blueprint $table) {
28 28
             $table->bigIncrements('id');
29 29
             $table->string('type');
30 30
             $table->timestamps();
Please login to merge, or discard this patch.
migrations/2018_07_25_001000_create_love_reactant_reaction_totals_table.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
      */
25 25
     public function up(): void
26 26
     {
27
-        Schema::create('love_reactant_reaction_totals', function (Blueprint $table) {
27
+        Schema::create('love_reactant_reaction_totals', function(Blueprint $table) {
28 28
             $table->bigIncrements('id');
29 29
             $table->unsignedBigInteger('reactant_id');
30 30
             $table->unsignedBigInteger('count')->default(0);
Please login to merge, or discard this patch.
src/Reactable/Models/Traits/Reactable.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
         Builder $query,
77 77
         ReacterContract $reacter
78 78
     ): Builder {
79
-        return $query->whereHas('loveReactant.reactions', function (Builder $reactionsQuery) use ($reacter) {
79
+        return $query->whereHas('loveReactant.reactions', function(Builder $reactionsQuery) use ($reacter) {
80 80
             $reactionsQuery->where('reacter_id', $reacter->getId());
81 81
         });
82 82
     }
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
         ReacterContract $reacter,
87 87
         ReactionTypeContract $reactionType
88 88
     ): Builder {
89
-        return $query->whereHas('loveReactant.reactions', function (Builder $reactionsQuery) use ($reacter, $reactionType) {
89
+        return $query->whereHas('loveReactant.reactions', function(Builder $reactionsQuery) use ($reacter, $reactionType) {
90 90
             $reactionsQuery->where('reacter_id', $reacter->getId());
91 91
             $reactionsQuery->where('reaction_type_id', $reactionType->getId());
92 92
         });
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
         $select[] = DB::raw('COALESCE(lrrc.weight, 0) as reactions_weight');
102 102
 
103 103
         return $query
104
-            ->leftJoin((new ReactionCounter())->getTable() . ' as lrrc', function (JoinClause $join) use ($reactionType) {
104
+            ->leftJoin((new ReactionCounter())->getTable() . ' as lrrc', function(JoinClause $join) use ($reactionType) {
105 105
                 $join->on('lrrc.reactant_id', '=', "{$this->getTable()}.love_reactant_id");
106 106
                 $join->where('lrrc.reaction_type_id', $reactionType->getId());
107 107
             })
Please login to merge, or discard this patch.
src/Reactant/Models/Reactant.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
         if ($this->relationLoaded('reactions')) {
127 127
             return $this
128 128
                 ->getAttribute('reactions')
129
-                ->contains(function (ReactionContract $reaction) use ($reacter) {
129
+                ->contains(function(ReactionContract $reaction) use ($reacter) {
130 130
                     return $reaction->isByReacter($reacter);
131 131
                 });
132 132
         }
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
         if ($this->relationLoaded('reactions')) {
155 155
             return $this
156 156
                 ->getAttribute('reactions')
157
-                ->contains(function (ReactionContract $reaction) use ($reacter, $reactionType) {
157
+                ->contains(function(ReactionContract $reaction) use ($reacter, $reactionType) {
158 158
                     return $reaction->isByReacter($reacter)
159 159
                         && $reaction->isOfType($reactionType);
160 160
                 });
Please login to merge, or discard this patch.
src/ReactionType/Models/ReactionType.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -40,11 +40,11 @@
 block discarded – undo
40 40
     {
41 41
         parent::boot();
42 42
 
43
-        self::saved(function (ReactionTypeContract $reactionType) {
43
+        self::saved(function(ReactionTypeContract $reactionType) {
44 44
             self::$nameCache[$reactionType->getName()] = $reactionType;
45 45
         });
46 46
 
47
-        self::deleted(function (ReactionTypeContract $reactionType) {
47
+        self::deleted(function(ReactionTypeContract $reactionType) {
48 48
             unset(self::$nameCache[$reactionType->getName()]);
49 49
         });
50 50
     }
Please login to merge, or discard this patch.