jeremyvii / vs-docblockr

DocBlockr for Visual Studio Code
GNU Lesser General Public License v3.0
21 stars 8 forks source link

Wrong parameter, miss null #77

Closed dmitrach closed 3 years ago

dmitrach commented 4 years ago

Describe the bug Does not generate parameters with null.

To Reproduce

protected function checkPricingRule(PricingRule $pricingRule = null): ?bool {}

Expected behavior

    /**
     * [checkPricingRule description]
     *
     * @param   PricingRule|null  $pricingRule  [$pricingRule description]
     *
     * @return  bool|null                       [return description]
     */
    protected function checkPricingRule(PricingRule $pricingRule = null): ?bool

Code

/**
     * [checkPricingRule description]
     *
     * @param   PricingRule  $pricingRule  [$pricingRule description]
     * @param   null                       [ description]
     *
     * @return  bool                       [return description]
     */
    protected function checkPricingRule(PricingRule $pricingRule = null): ?bool

Screenshots Снимок экрана от 2020-06-04 17-58-41

Enviroment (please complete the following information): OS: Ubuntu 20.04 VS Code: 1.45.1, the extension: 1.1.2 Language: PHP

jeremyvii commented 3 years ago

The issue where the blank null parameter are being rendered will be fixed in the next release. I didn't include rendering a union type based on the parameters default value, as this will take some further thought. Feel free to create an issue using the feature request template for this.