@@ -61,10 +61,10 @@ discard block |
||
61 | 61 | }; |
62 | 62 | $outout_converters[] = |
63 | 63 | /** |
64 | - * @param mixed $value |
|
65 | - * @param \FFI\CDataArray $toCData |
|
66 | - * @return mixed |
|
67 | - */ |
|
64 | + * @param mixed $value |
|
65 | + * @param \FFI\CDataArray $toCData |
|
66 | + * @return mixed |
|
67 | + */ |
|
68 | 68 | function ($value, CData $toCData) { |
69 | 69 | /** @psalm-suppress MixedAssignment */ |
70 | 70 | return $toCData[0] = $value; |
@@ -72,16 +72,16 @@ discard block |
||
72 | 72 | } else { |
73 | 73 | $input_converters[] = |
74 | 74 | /** |
75 | - * @param mixed $data |
|
76 | - * @return mixed |
|
77 | - */ |
|
75 | + * @param mixed $data |
|
76 | + * @return mixed |
|
77 | + */ |
|
78 | 78 | fn ($data) => $data; |
79 | 79 | $outout_converters[] = |
80 | 80 | /** |
81 | - * @param mixed $_1 |
|
82 | - * @param mixed $_2 |
|
83 | - * @return mixed |
|
84 | - */ |
|
81 | + * @param mixed $_1 |
|
82 | + * @param mixed $_2 |
|
83 | + * @return mixed |
|
84 | + */ |
|
85 | 85 | fn ($_1, $_2) => $_1; |
86 | 86 | } |
87 | 87 | } |
@@ -92,19 +92,19 @@ discard block |
||
92 | 92 | $new_args = []; |
93 | 93 | foreach ($input_converters as $key => $converter) { |
94 | 94 | /** |
95 | - * @psalm-suppress MixedArgument |
|
96 | - * @psalm-suppress MixedAssignment |
|
97 | - */ |
|
95 | + * @psalm-suppress MixedArgument |
|
96 | + * @psalm-suppress MixedAssignment |
|
97 | + */ |
|
98 | 98 | $new_args[$key] = $converter($args[$key]); |
99 | 99 | } |
100 | 100 | /** @psalm-suppress MixedAssignment */ |
101 | 101 | $result = $callable(...$new_args); |
102 | 102 | foreach ($outout_converters as $key => $converter) { |
103 | 103 | /** |
104 | - * @psalm-suppress PossiblyInvalidArgument |
|
105 | - * @psalm-suppress MixedArgument |
|
106 | - * @psalm-suppress MixedAssignment |
|
107 | - */ |
|
104 | + * @psalm-suppress PossiblyInvalidArgument |
|
105 | + * @psalm-suppress MixedArgument |
|
106 | + * @psalm-suppress MixedAssignment |
|
107 | + */ |
|
108 | 108 | $args[$key] = $converter($new_args[$key], $args[$key]); |
109 | 109 | } |
110 | 110 | if ($result instanceof TypedCDataInterface) { |
@@ -37,25 +37,25 @@ discard block |
||
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 | - $input_converters[] = function (CData $cdata): CData { |
|
58 | + $input_converters[] = function(CData $cdata): CData { |
|
59 | 59 | /** @var \FFI\CDataArray $cdata */ |
60 | 60 | return $cdata[0]; |
61 | 61 | }; |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | * @param \FFI\CDataArray $toCData |
66 | 66 | * @return mixed |
67 | 67 | */ |
68 | - function ($value, CData $toCData) { |
|
68 | + function($value, CData $toCData) { |
|
69 | 69 | /** @psalm-suppress MixedAssignment */ |
70 | 70 | return $toCData[0] = $value; |
71 | 71 | }; |
@@ -75,20 +75,20 @@ discard block |
||
75 | 75 | * @param mixed $data |
76 | 76 | * @return mixed |
77 | 77 | */ |
78 | - fn ($data) => $data; |
|
78 | + fn($data) => $data; |
|
79 | 79 | $outout_converters[] = |
80 | 80 | /** |
81 | 81 | * @param mixed $_1 |
82 | 82 | * @param mixed $_2 |
83 | 83 | * @return mixed |
84 | 84 | */ |
85 | - fn ($_1, $_2) => $_1; |
|
85 | + fn($_1, $_2) => $_1; |
|
86 | 86 | } |
87 | 87 | } |
88 | 88 | |
89 | 89 | return |
90 | 90 | /** @param mixed $args */ |
91 | - function (...$args) use ($input_converters, $outout_converters, $callable) { |
|
91 | + function(...$args) use ($input_converters, $outout_converters, $callable) { |
|
92 | 92 | $new_args = []; |
93 | 93 | foreach ($input_converters as $key => $converter) { |
94 | 94 | /** |