Completed
Push — master ( 96b04d...03bbfd )
by Oliver
02:41
created
src/BoxedCode/Eloquent/Meta/Metable.php 3 patches
Unused Use Statements   -3 removed lines patch added patch discarded remove patch
@@ -11,9 +11,6 @@
 block discarded – undo
11 11
 
12 12
 namespace BoxedCode\Eloquent\Meta;
13 13
 
14
-use BoxedCode\Eloquent\Meta\MetaCollection;
15
-use BoxedCode\Eloquent\Meta\Contracts\MetaItem as ItemContract;
16
-
17 14
 trait Metable
18 15
 {
19 16
     /**
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
      */
106 106
     public static function observeSaveAndCascade()
107 107
     {
108
-        $onSave = function ($model) {
108
+        $onSave = function($model) {
109 109
 
110 110
             /*
111 111
              * Remove any keys not present in the collection
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
      */
144 144
     public static function observeDeleteAndCascade()
145 145
     {
146
-        $onDelete = function ($model) {
146
+        $onDelete = function($model) {
147 147
             foreach ($model->meta as $meta) {
148 148
                 $meta->delete();
149 149
             }
Please login to merge, or discard this patch.
Braces   +1 added lines, -3 removed lines patch added patch discarded remove patch
@@ -48,9 +48,7 @@
 block discarded – undo
48 48
     {
49 49
         if (parent::isDirty($attributes)) {
50 50
             return true;
51
-        }
52
-
53
-        else {
51
+        } else {
54 52
             foreach ($this->meta as $item) {
55 53
                 if ($item->isDirty($attributes)) {
56 54
                     return true;
Please login to merge, or discard this patch.
src/BoxedCode/Eloquent/Meta/Types/Registry.php 1 patch
Braces   +1 added lines, -3 removed lines patch added patch discarded remove patch
@@ -25,9 +25,7 @@
 block discarded – undo
25 25
             $this->registerClass(get_class($mixed), $mixed);
26 26
 
27 27
             return true;
28
-        }
29
-
30
-        elseif (is_array($mixed)) {
28
+        } elseif (is_array($mixed)) {
31 29
             foreach ($mixed as $type) {
32 30
                 $this->register($type);
33 31
             }
Please login to merge, or discard this patch.
src/BoxedCode/Eloquent/Meta/Types/IntegerType.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@
 block discarded – undo
30 30
      */
31 31
     public function set($value)
32 32
     {
33
-       parent::set(intval($value));
33
+        parent::set(intval($value));
34 34
     }
35 35
 
36 36
     /**
Please login to merge, or discard this patch.
src/BoxedCode/Eloquent/Meta/MetaItemCollection.php 2 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
     {
92 92
         if ($item instanceof ItemContract) {
93 93
 
94
-            if (! is_null($this->find($item->key, $item->tag))) {
94
+            if (!is_null($this->find($item->key, $item->tag))) {
95 95
                 $tag = $item->tag ?: $this->default_tag;
96 96
 
97 97
                 $key = $item->key;
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
     {
119 119
         $collection = $this->whereKey($key);
120 120
 
121
-        if (! is_null($tag)) {
121
+        if (!is_null($tag)) {
122 122
             $collection = $collection->whereTag($tag);
123 123
         }
124 124
 
@@ -148,10 +148,10 @@  discard block
 block discarded – undo
148 148
      */
149 149
     protected function observeDeletion(ItemContract $item)
150 150
     {
151
-        $item::deleted(function ($model) {
151
+        $item::deleted(function($model) {
152 152
             $key = $this->find($model->key, $model->tag);
153 153
 
154
-            if (! is_null($key)) {
154
+            if (!is_null($key)) {
155 155
                 $this->forget($key);
156 156
             }
157 157
         });
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
      */
232 232
     public function __isset($name)
233 233
     {
234
-        return ! is_null($this->find($name, $this->default_tag));
234
+        return !is_null($this->find($name, $this->default_tag));
235 235
     }
236 236
 
237 237
     /**
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
     {
244 244
         $key = $this->find($name, $this->default_tag);
245 245
 
246
-        if (! is_null($key)) {
246
+        if (!is_null($key)) {
247 247
             $this->forget($key);
248 248
         }
249 249
     }
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
259 259
     {
260 260
         $key = $this->find($name, $this->default_tag);
261 261
 
262
-        if (! is_null($key)) {
262
+        if (!is_null($key)) {
263 263
             return $this->get($key)->value;
264 264
         }
265 265
 
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
     {
282 282
         $key = $this->find($name, $this->default_tag);
283 283
 
284
-        if (! is_null($key)) {
284
+        if (!is_null($key)) {
285 285
             $this->get($key)->value = $value;
286 286
         }
287 287
         else {
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -283,8 +283,7 @@
 block discarded – undo
283 283
 
284 284
         if (! is_null($key)) {
285 285
             $this->get($key)->value = $value;
286
-        }
287
-        else {
286
+        } else {
288 287
             $attr = [
289 288
                 'key'   => $name,
290 289
                 'value' => $value,
Please login to merge, or discard this patch.
src/BoxedCode/Eloquent/Meta/Migrations/CreateMetaMigrationCommand.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -56,8 +56,8 @@  discard block
 block discarded – undo
56 56
         return [
57 57
             'path'        => $this->getMigrationPath(),
58 58
             'name'        => $name,
59
-            'table_name'  => $name ? $name . '_meta' : 'meta',
60
-            'file_name'   => $name ? $name . '_meta_migration' : 'meta_migration',
59
+            'table_name'  => $name ? $name.'_meta' : 'meta',
60
+            'file_name'   => $name ? $name.'_meta_migration' : 'meta_migration',
61 61
         ];
62 62
     }
63 63
 
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
     protected function replacePlaceholders($template, $name, $table_name)
73 73
     {
74 74
         $replacements = [
75
-            'DummyClass' => ucfirst($name) . 'MetaMigration',
75
+            'DummyClass' => ucfirst($name).'MetaMigration',
76 76
             'DummyTable' => $table_name,
77 77
         ];
78 78
 
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
      */
87 87
     protected function getStub()
88 88
     {
89
-        return file_get_contents(__DIR__ . DIRECTORY_SEPARATOR);
89
+        return file_get_contents(__DIR__.DIRECTORY_SEPARATOR);
90 90
     }
91 91
 
92 92
     /**
Please login to merge, or discard this patch.
src/BoxedCode/Eloquent/Meta/MetaServiceProvider.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@
 block discarded – undo
47 47
      */
48 48
     public function registerTypeRegistry()
49 49
     {
50
-        $this->app->singleton(TypeRegistry::class, function () {
50
+        $this->app->singleton(TypeRegistry::class, function() {
51 51
             $registry = new TypeRegistry;
52 52
 
53 53
             $this->registerDefaultTypes($registry);
Please login to merge, or discard this patch.
src/BoxedCode/Eloquent/Meta/MetaItem.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -91,7 +91,7 @@
 block discarded – undo
91 91
      */
92 92
     public function setValueAttribute($value, $type = null)
93 93
     {
94
-        if (is_null($type) && ! isset($this->attributes['type'])) {
94
+        if (is_null($type) && !isset($this->attributes['type'])) {
95 95
             $registry = $this->getTypeRegistry();
96 96
             $this->attributes['type'] = $registry->findTypeFor($value)->getClass();
97 97
         }
Please login to merge, or discard this patch.
Braces   +1 added lines, -3 removed lines patch added patch discarded remove patch
@@ -94,9 +94,7 @@
 block discarded – undo
94 94
         if (is_null($type) && ! isset($this->attributes['type'])) {
95 95
             $registry = $this->getTypeRegistry();
96 96
             $this->attributes['type'] = $registry->findTypeFor($value)->getClass();
97
-        }
98
-
99
-        elseif (isset($type)) {
97
+        } elseif (isset($type)) {
100 98
             $this->attributes['type'] = $type;
101 99
         }
102 100
 
Please login to merge, or discard this patch.