Completed
Branch master (cbd196)
by Rémi
08:54
created
src/System/Mapper.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
         }
115 115
 
116 116
         // First, we'll cast every single result to array
117
-        $results = array_map(function ($item) {
117
+        $results = array_map(function($item) {
118 118
             return (array) $item;
119 119
         }, $results);
120 120
 
@@ -394,7 +394,7 @@  discard block
 block discarded – undo
394 394
      */
395 395
     public function getGlobalScope($scope)
396 396
     {
397
-        return array_first($this->globalScopes, function ($key, $value) use ($scope) {
397
+        return array_first($this->globalScopes, function($key, $value) use ($scope) {
398 398
             return $scope instanceof $value;
399 399
         });
400 400
     }
Please login to merge, or discard this patch.
src/System/ResultBuilder.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
             // constraints have been specified for the eager load and we'll just put
128 128
             // an empty Closure with the loader so that we can treat all the same.
129 129
             if (is_numeric($name)) {
130
-                $f = function () {
130
+                $f = function() {
131 131
                 };
132 132
 
133 133
                 list($name, $constraints) = [$constraints, $f];
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
             $progress[] = $segment;
164 164
 
165 165
             if (!isset($results[$last = implode('.', $progress)])) {
166
-                $results[$last] = function () {
166
+                $results[$last] = function() {
167 167
                 };
168 168
             }
169 169
         }
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
         // We want to run a relationship query without any constrains so that we will
233 233
         // not have to remove these where clauses manually which gets really hacky
234 234
         // and is error prone while we remove the developer's own where clauses.
235
-        $query = Relationship::noConstraints(function () use ($relation) {
235
+        $query = Relationship::noConstraints(function() use ($relation) {
236 236
             return $this->entityMap->$relation($this->defaultMapper->newInstance());
237 237
         });
238 238
 
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
     {
299 299
         $builder = new EntityBuilder($this->defaultMapper, array_keys($this->eagerLoads));
300 300
 
301
-        return collect($results)->map(function ($item, $key) use ($builder) {
301
+        return collect($results)->map(function($item, $key) use ($builder) {
302 302
             return $builder->build($item);
303 303
         })->all();
304 304
     }
@@ -312,7 +312,7 @@  discard block
 block discarded – undo
312 312
      */
313 313
     protected function buildUsingSingleTableInheritance(array $results)
314 314
     {
315
-        return collect($results)->map(function ($item, $key) {
315
+        return collect($results)->map(function($item, $key) {
316 316
             $builder = $this->builderForResult($item);
317 317
 
318 318
             return $builder->build($item);
Please login to merge, or discard this patch.
src/Plugins/SoftDeletes/SoftDeletesPlugin.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
         $host = $this;
26 26
 
27 27
         // Hook any mapper init and check the mapping include soft deletes.
28
-        $this->manager->registerGlobalEvent('initialized', function ($event, $payload = null) use ($host) {
28
+        $this->manager->registerGlobalEvent('initialized', function($event, $payload = null) use ($host) {
29 29
 
30 30
             // Cross Compatible Event handling with 5.3
31 31
             // TODO : find a replacement event handler
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
         $host = $this;
64 64
 
65 65
         // Register 'deleting' events
66
-        $mapper->registerEvent('deleting', function ($entity) use ($entityMap, $host) {
66
+        $mapper->registerEvent('deleting', function($entity) use ($entityMap, $host) {
67 67
 
68 68
             // Convert Entity into an EntityWrapper
69 69
             $factory = new Factory();
Please login to merge, or discard this patch.
src/Plugins/Timestamps/TimestampsPlugin.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
      */
21 21
     public function register()
22 22
     {
23
-        $this->manager->registerGlobalEvent('initialized', function ($event, $payload = null) {
23
+        $this->manager->registerGlobalEvent('initialized', function($event, $payload = null) {
24 24
 
25 25
             // Cross Compatible Event handling with 5.3
26 26
             // TODO : find a replacement event handler
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
             $entityMap = $mapper->getEntityMap();
34 34
 
35 35
             if ($entityMap->usesTimestamps()) {
36
-                $mapper->registerEvent('creating', function ($entity) use ($entityMap) {
36
+                $mapper->registerEvent('creating', function($entity) use ($entityMap) {
37 37
                     $factory = new Factory();
38 38
                     $wrappedEntity = $factory->make($entity);
39 39
 
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
                     $wrappedEntity->setEntityAttribute($updatedAtField, $time);
47 47
                 });
48 48
 
49
-                $mapper->registerEvent('updating', function ($entity) use ($entityMap) {
49
+                $mapper->registerEvent('updating', function($entity) use ($entityMap) {
50 50
                     $factory = new Factory();
51 51
                     $wrappedEntity = $factory->make($entity);
52 52
 
Please login to merge, or discard this patch.
src/Relationships/EmbedsMany.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
      */
77 77
     public function normalize($objects) : array
78 78
     {
79
-    	if(! $this->asArray) {
79
+    	if (!$this->asArray) {
80 80
     		throw new MappingException("Cannot normalize an embedsMany relation as row columns");
81 81
     	}
82 82
 
@@ -93,17 +93,17 @@  discard block
 block discarded – undo
93 93
     {
94 94
     	$key = $this->relation;
95 95
 
96
-    	if(! is_array($objects) && ! $objects instanceof Collection) {
96
+    	if (!is_array($objects) && !$objects instanceof Collection) {
97 97
     		throw new MappingException("column '$key' should be of type array or collection");
98 98
     	}
99 99
 
100
-    	if($objects instanceof Collection ) {
100
+    	if ($objects instanceof Collection) {
101 101
     		$objects = $objects->all();
102 102
     	}
103 103
     	
104 104
     	$normalizedObjects = [];
105 105
 
106
-    	foreach($objects as $object) {
106
+    	foreach ($objects as $object) {
107 107
     		$wrapper = $this->factory->make($object);	
108 108
     		$normalizedObjects[] = $wrapper->getEntityAttributes();
109 109
     	}
Please login to merge, or discard this patch.
src/Commands/Store.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -231,7 +231,7 @@
 block discarded – undo
231 231
             $sequence = $aggregate->getEntityMap()->getSequence();
232 232
 
233 233
             // Prevent inserting with a null ID
234
-            if(array_key_exists($keyName, $attributes)) {
234
+            if (array_key_exists($keyName, $attributes)) {
235 235
                 unset($attributes[$keyName]);
236 236
             }
237 237
 
Please login to merge, or discard this patch.
src/EntityMap.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -935,7 +935,7 @@  discard block
 block discarded – undo
935 935
      */
936 936
     public function embedsOne($parent, string $relatedClass, $relation = null) : EmbedsOne
937 937
     {
938
-        if(is_null($relation)) {
938
+        if (is_null($relation)) {
939 939
             list(, $caller) = debug_backtrace(false);
940 940
             $relation = $caller['function'];
941 941
         }
@@ -956,7 +956,7 @@  discard block
 block discarded – undo
956 956
      */
957 957
     public function embedsMany($parent, string $relatedClass, $relation = null) : EmbedsMany
958 958
     {
959
-        if(is_null($relation)) {
959
+        if (is_null($relation)) {
960 960
             list(, $caller) = debug_backtrace(false);
961 961
             $relation = $caller['function'];
962 962
         }
Please login to merge, or discard this patch.