Skip to content

Commit 8428f73

Browse files
authored
Allow nullptr for all string types
1 parent 40a805a commit 8428f73

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Generator/TypeInfoGenerator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ private function apply(NamespaceNode $ctx, TypeInterface $type, TypeInfo $info):
146146
// The "char*" is looks like a string
147147
//
148148
if ($terminal instanceof FundamentalTypeNode && $terminal->name === 'char') {
149-
$info->phpTypes = $info->docTypes = ['string', '\FFI\CData'];
149+
$info->phpTypes = $info->docTypes = ['string', '\FFI\CData', 'null'];
150150
} elseif ($terminal instanceof FunctionTypeNode) {
151151
$info->phpTypes = ['\Closure', 'null'];
152152
$info->docTypes = ['FFI\CData', 'null', $childDocType];

0 commit comments

Comments
 (0)