Skip to content

Stubs: missing doc comments for __construct() #497

@kakserpom

Description

@kakserpom

Example

Extension Code:

use ext_php_rs::prelude::*;

#[php_class]
struct Foo {}
#[php_impl]
impl Foo {
    /// Some docs
    ///
    /// Zzzz
    pub fn __construct(foo: &str) -> Self {
        Self {}
    }

    /// Some docs
    ///
    /// Zzzz
    pub fn someMethod() {}
}

#[php_module]
pub fn get_module(module: ModuleBuilder) -> ModuleBuilder {
    module.class::<Foo>()
}

Actual Behavior

<?php

// Stubs for untitled5

namespace {
    class Foo {
        /**
         * Some docs
         *
         * Zzzz
         */
        public static function someMethod() {}

        public function __construct(string $foo) {}
    }
}

PHP Version

PHP 8.4.8 (cli) (built: Jun  3 2025 16:29:26) (ZTS)
Copyright (c) The PHP Group
Built by Shivam Mathur
Zend Engine v4.4.8, Copyright (c) Zend Technologies
    with Zend OPcache v8.4.8, Copyright (c), by Zend Technologies

ext-php-rs Version

1de4bee

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingmacrosRelated to macrosstubsRelated to stub generation

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions