Skip to content

Commit 50f79d0

Browse files
authored
Fixed bug that the type of $connection is not correct when creating models. (#7329)
1 parent 52ca85a commit 50f79d0

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/Commands/Ast/ModelRewriteConnectionVisitor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public function afterTraverse(array $nodes)
6464
foreach ($class->stmts as $property) {
6565
$flags = Node\Stmt\Class_::MODIFIER_PROTECTED;
6666
$prop = new Node\Stmt\PropertyProperty('connection', new Node\Scalar\String_($this->connection));
67-
$class->stmts[] = new Node\Stmt\Property($flags, [$prop]);
67+
$class->stmts[] = new Node\Stmt\Property($flags, [$prop], type: new Node\NullableType(new Identifier('string')));
6868
return null;
6969
}
7070
}

0 commit comments

Comments
 (0)