Skip to content

Commit 9993377

Browse files
committed
fix(stubs): include doc comments in __construct() stubs
Refs: #497
1 parent 1de4bee commit 9993377

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

crates/macros/src/function.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,7 @@ impl<'a> Function<'a> {
337337
.variadic()
338338
}
339339
});
340+
let docs = &self.docs;
340341

341342
quote! {
342343
::ext_php_rs::class::ConstructorMeta {
@@ -359,6 +360,7 @@ impl<'a> Function<'a> {
359360
build_fn: {
360361
fn inner(func: ::ext_php_rs::builders::FunctionBuilder) -> ::ext_php_rs::builders::FunctionBuilder {
361362
func
363+
.docs(&[#(#docs),*])
362364
#(.arg(#required_args))*
363365
.not_required()
364366
#(.arg(#not_required_args))*

tests/src/integration/class/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ pub struct TestClassArrayAccess {}
5353

5454
#[php_impl]
5555
impl TestClassArrayAccess {
56+
/// Constructor
57+
/// doc
58+
/// comment
5659
pub fn __construct() -> Self {
5760
Self {}
5861
}

0 commit comments

Comments
 (0)