Passed
Push — master ( 15b189...2091ef )
by Pieter
01:42
created
src/ObjectAccess/FilteredObjectAccess.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
     public function getGetterFields(ReflectionClass $reflectionClass): array
33 33
     {
34 34
         $result = $this->objectAccess->getGetterFields($reflectionClass);
35
-        return array_values(array_filter($result, function (string $fieldName) {
35
+        return array_values(array_filter($result, function(string $fieldName) {
36 36
             return isset($this->filteredFields[$fieldName]);
37 37
         }));
38 38
     }
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
     public function getSetterFields(ReflectionClass $reflectionClass): array
41 41
     {
42 42
         $result = $this->objectAccess->getSetterFields($reflectionClass);
43
-        return array_values(array_filter($result, function (string $fieldName) {
43
+        return array_values(array_filter($result, function(string $fieldName) {
44 44
             return isset($this->filteredFields[$fieldName]);
45 45
         }));
46 46
     }
Please login to merge, or discard this patch.
src/ObjectAccess/CachedObjectAccess.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
     {
39 39
         return $this->cacheCheck(
40 40
             __FUNCTION__ . ',' . $reflectionClass->name,
41
-            function (ReflectionClass $reflectionClass) {
41
+            function(ReflectionClass $reflectionClass) {
42 42
                 return $this->internal->getGetterFields($reflectionClass);
43 43
             },
44 44
             $reflectionClass
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
     {
53 53
         return $this->cacheCheck(
54 54
             __FUNCTION__ . ',' . $reflectionClass->name,
55
-            function (ReflectionClass $reflectionClass) {
55
+            function(ReflectionClass $reflectionClass) {
56 56
                 return $this->internal->getSetterFields($reflectionClass);
57 57
             },
58 58
             $reflectionClass
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
     {
67 67
         return $this->cacheCheck(
68 68
             __FUNCTION__ . ',' . $reflectionClass->name . ',' . $fieldName,
69
-            function (ReflectionClass $reflectionClass, string $fieldName) {
69
+            function(ReflectionClass $reflectionClass, string $fieldName) {
70 70
                 return $this->internal->getGetterTypes($reflectionClass, $fieldName);
71 71
             },
72 72
             $reflectionClass,
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
     {
82 82
         return $this->cacheCheck(
83 83
             __FUNCTION__ . ',' . $reflectionClass->name . ',' . $fieldName,
84
-            function (ReflectionClass $reflectionClass, string $fieldName) {
84
+            function(ReflectionClass $reflectionClass, string $fieldName) {
85 85
                 return $this->internal->getSetterTypes($reflectionClass, $fieldName);
86 86
             },
87 87
             $reflectionClass,
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
     {
97 97
         return $this->cacheCheck(
98 98
             __FUNCTION__ . ',' . $reflectionClass->name,
99
-            function (ReflectionClass $reflectionClass) {
99
+            function(ReflectionClass $reflectionClass) {
100 100
                 return $this->internal->getConstructorArguments($reflectionClass);
101 101
             },
102 102
             $reflectionClass
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
     {
135 135
         return $this->cacheCheck(
136 136
             __FUNCTION__ . ',' . $reflectionClass->name . ',' . $fieldName . ',' . json_encode($preferGetters),
137
-            function (ReflectionClass $reflectionClass, string $fieldName, bool $preferGetters) {
137
+            function(ReflectionClass $reflectionClass, string $fieldName, bool $preferGetters) {
138 138
                 return $this->internal->getDescription($reflectionClass, $fieldName, $preferGetters);
139 139
             },
140 140
             $reflectionClass,
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
     {
151 151
         return $this->cacheCheck(
152 152
             __FUNCTION__ . ',' . $reflectionClass->name,
153
-            function (ReflectionClass $reflectionClass) {
153
+            function(ReflectionClass $reflectionClass) {
154 154
                 if ($this->internal instanceof ObjectAccessSupportedInterface) {
155 155
                     return $this->internal->isSupported($reflectionClass);
156 156
                 }
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
     {
169 169
         return $this->cacheCheck(
170 170
             __FUNCTION__ . ',' . $method->name . ',' . ($reflectionClass ? $reflectionClass->name : '(null)'),
171
-            function (ReflectionMethod $method, ?ReflectionClass $reflectionClass = null) {
171
+            function(ReflectionMethod $method, ?ReflectionClass $reflectionClass = null) {
172 172
                 return $this->internal->getMethodArguments($method, $reflectionClass);
173 173
             },
174 174
             $method,
Please login to merge, or discard this patch.
src/Normalizers/ApieObjectAccessNormalizer.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -251,7 +251,7 @@
 block discarded – undo
251 251
         $result = [];
252 252
         foreach ($objectAccess->getGetterFields($reflectionClass) as $denormalizedFieldName) {
253 253
             $fieldName = $this->nameConverter->normalize($denormalizedFieldName, $reflectionClass->name, $format, $context);
254
-            $value  = $objectAccess->getValue($object, $denormalizedFieldName);
254
+            $value = $objectAccess->getValue($object, $denormalizedFieldName);
255 255
             // circular reference
256 256
             if (is_object($value) && in_array($value, $context['object_hierarchy'], true)) {
257 257
                 continue;
Please login to merge, or discard this patch.
src/Exceptions/ValidationException.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@
 block discarded – undo
33 33
             $this->exceptions = $this->errors->getExceptions();
34 34
             $tmp = reset($this->exceptions);
35 35
             if ($tmp) {
36
-                $previous = reset($tmp) ? : null;
36
+                $previous = reset($tmp) ?: null;
37 37
             }
38 38
         }
39 39
         parent::__construct(422, 'A validation error occurred', $previous);
Please login to merge, or discard this patch.
src/Errors/ErrorBag.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -110,12 +110,12 @@  discard block
 block discarded – undo
110 110
     public function getErrors(?Closure $callback = null): array
111 111
     {
112 112
         if (!$callback) {
113
-            $callback = function (ErrorBagField $field) {
113
+            $callback = function(ErrorBagField $field) {
114 114
                 return $field->getMessage();
115 115
             };
116 116
         }
117 117
         return array_map(
118
-            function (array $errors) use (&$callback) {
118
+            function(array $errors) use (&$callback) {
119 119
                 return array_map($callback, $errors);
120 120
             },
121 121
             $this->errors
@@ -131,9 +131,9 @@  discard block
 block discarded – undo
131 131
     public function getExceptions(): array
132 132
     {
133 133
         return array_map(
134
-            function (array $errors) {
134
+            function(array $errors) {
135 135
                 return array_filter(array_map(
136
-                    function (ErrorBagField $field) {
136
+                    function(ErrorBagField $field) {
137 137
                         return $field->getSource();
138 138
                     },
139 139
                     $errors
Please login to merge, or discard this patch.
src/ObjectAccess/ObjectAccess.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -56,16 +56,16 @@  discard block
 block discarded – undo
56 56
     /**
57 57
      * @var bool
58 58
      */
59
-    private $disabledConstructor ;
59
+    private $disabledConstructor;
60 60
 
61 61
     public function __construct(bool $publicOnly = true, bool $disabledConstructor = false)
62 62
     {
63 63
         $this->methodFlags = $publicOnly
64 64
             ? ReflectionMethod::IS_PUBLIC
65
-            : (ReflectionMethod::IS_PUBLIC|ReflectionMethod::IS_PROTECTED|ReflectionMethod::IS_PRIVATE);
65
+            : (ReflectionMethod::IS_PUBLIC | ReflectionMethod::IS_PROTECTED | ReflectionMethod::IS_PRIVATE);
66 66
         $this->propertyFlags = $publicOnly
67 67
             ? ReflectionProperty::IS_PUBLIC
68
-            : (ReflectionProperty::IS_PUBLIC|ReflectionProperty::IS_PROTECTED|ReflectionProperty::IS_PRIVATE);
68
+            : (ReflectionProperty::IS_PUBLIC | ReflectionProperty::IS_PROTECTED | ReflectionProperty::IS_PRIVATE);
69 69
         $this->disabledConstructor = $disabledConstructor;
70 70
         $this->phpDocExtractor = new PhpDocExtractor();
71 71
     }
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
      */
78 78
     protected function sort(array& $options)
79 79
     {
80
-        usort($options, function (PriorityAwareInterface $a, PriorityAwareInterface $b) {
80
+        usort($options, function(PriorityAwareInterface $a, PriorityAwareInterface $b) {
81 81
             return $b->getPriority() <=> $a->getPriority();
82 82
         });
83 83
     }
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
      */
103 103
     protected function getGetterMapping(ReflectionClass $reflectionClass): array
104 104
     {
105
-        $className= $reflectionClass->getName();
105
+        $className = $reflectionClass->getName();
106 106
         if (isset($this->getterCache[$className])) {
107 107
             return $this->getterCache[$className];
108 108
         }
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
      */
141 141
     protected function getSetterMapping(ReflectionClass $reflectionClass): array
142 142
     {
143
-        $className= $reflectionClass->getName();
143
+        $className = $reflectionClass->getName();
144 144
         if (isset($this->setterCache[$className])) {
145 145
             return $this->setterCache[$className];
146 146
         }
@@ -386,7 +386,7 @@  discard block
 block discarded – undo
386 386
         } else {
387 387
             $res = $this->getGetterTypes($reflectionClass, $parameter->name);
388 388
         }
389
-        return reset($res) ? : null;
389
+        return reset($res) ?: null;
390 390
     }
391 391
 
392 392
     /**
Please login to merge, or discard this patch.
src/ObjectAccess/SimpleLocalizationObjectAccess.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
         bool $publicOnly = true,
14 14
         bool $disabledConstructor = false
15 15
     ) {
16
-        $conversionFn = static function ($locale) {
16
+        $conversionFn = static function($locale) {
17 17
             return $locale === null ? 'en' : ((string) $locale);
18 18
         };
19 19
         parent::__construct($localizationAware, $conversionFn, $publicOnly, $disabledConstructor);
Please login to merge, or discard this patch.
src/ObjectAccess/LocalizationAwareObjectAccess.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 
41 41
     protected function getGetterMapping(ReflectionClass $reflectionClass): array
42 42
     {
43
-        $className= $reflectionClass->getName();
43
+        $className = $reflectionClass->getName();
44 44
         if (isset($this->getterCache[$className])) {
45 45
             return $this->getterCache[$className];
46 46
         }
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 
71 71
     protected function getSetterMapping(ReflectionClass $reflectionClass): array
72 72
     {
73
-        $className= $reflectionClass->getName();
73
+        $className = $reflectionClass->getName();
74 74
         if (isset($this->setterCache[$className])) {
75 75
             return $this->setterCache[$className];
76 76
         }
Please login to merge, or discard this patch.