Passed
Pull Request — master (#29)
by
unknown
01:33 queued 11s
created
src/TypedCDataWrapper.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -37,36 +37,36 @@  discard block
 block discarded – undo
37 37
             $class = $parameter->getClass();
38 38
             if (!is_null($class) and $class->isSubclassOf(TypedCDataInterface::class)) {
39 39
                 $fromCData = $class->getMethod('fromCData');
40
-                $input_converters[] = function (CData $cdata) use ($fromCData): TypedCDataInterface {
40
+                $input_converters[] = function(CData $cdata) use ($fromCData): TypedCDataInterface {
41 41
                     /** @var TypedCDataInterface */
42 42
                     return $fromCData->invoke(null, $cdata);
43 43
                 };
44
-                $outout_converters[] = function (TypedCDataInterface $typed_c_data, CData $toCData): CData {
44
+                $outout_converters[] = function(TypedCDataInterface $typed_c_data, CData $toCData): CData {
45 45
                     return $typed_c_data->toCData($toCData);
46 46
                 };
47 47
             } elseif (!is_null($class) and $class->getName() === TypedCDataArray::class) {
48 48
                 $fromCData = $class->getMethod('fromCData');
49 49
                 $elementType = $this->getElementTypeForCDataArrayParameter($parameter);
50
-                $input_converters[] = function (CData $cdata) use ($fromCData, $elementType): TypedCDataArray {
50
+                $input_converters[] = function(CData $cdata) use ($fromCData, $elementType): TypedCDataArray {
51 51
                     /** @var TypedCDataArray */
52 52
                     return $fromCData->invoke(null, $cdata, $elementType);
53 53
                 };
54
-                $outout_converters[] = function (TypedCDataArray $typed_c_data_array, CData $toCData): CData {
54
+                $outout_converters[] = function(TypedCDataArray $typed_c_data_array, CData $toCData): CData {
55 55
                     return $typed_c_data_array->toCData($toCData);
56 56
                 };
57 57
             } elseif ($parameter->isPassedByReference()) {
58 58
                 $type = $parameter->getType();
59 59
                 if ($type instanceof \ReflectionNamedType and $type->getName() === 'string') {
60
-                    $input_converters[] = function (CData $cdata): string {
60
+                    $input_converters[] = function(CData $cdata): string {
61 61
                         return \FFI::string($cdata);
62 62
                     };
63 63
                     $outout_converters[] =
64
-                        function (string $value, CData $toCData): CData {
64
+                        function(string $value, CData $toCData): CData {
65 65
                             \FFI::memcpy($toCData, $value, strlen($value));
66 66
                             return $toCData;
67 67
                         };
68 68
                 } else {
69
-                    $input_converters[] = function (CData $cdata): CData {
69
+                    $input_converters[] = function(CData $cdata): CData {
70 70
                         /** @var \FFI\CDataArray $cdata */
71 71
                         return $cdata[0];
72 72
                     };
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
                          * @param \FFI\CDataArray $toCData
77 77
                          * @return mixed
78 78
                          */
79
-                        function ($value, CData $toCData) {
79
+                        function($value, CData $toCData) {
80 80
                             /** @psalm-suppress MixedAssignment */
81 81
                             return $toCData[0] = $value;
82 82
                         };
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 
101 101
         return
102 102
             /** @param mixed $args */
103
-            function (...$args) use ($input_converters, $outout_converters, $callable) {
103
+            function(...$args) use ($input_converters, $outout_converters, $callable) {
104 104
                 $new_args = [];
105 105
                 foreach ($input_converters as $key => $converter) {
106 106
                     if (is_null($args[$key])) {
Please login to merge, or discard this patch.