Skip to content

PHP: Generates the return type boolean instead of bool for a function in phpDoc #5284

@troizet

Description

@troizet

Apache NetBeans version

Apache NetBeans 16

What happened

Generates the return type boolean instead of bool for a function in phpDoc.
Php does not have a built-in boolean type: https://www.php.net/manual/en/language.types.intro.php
Also see the warning under "Scalar Types": https://www.php.net/manual/en/language.types.declarations.php

How to reproduce

  • Create a function that returns true or false:
function test() 
{
    return true;
}
  • Generate a phpDoc comment
  • The @return tag was received with the wrong return type:
/**
 * 
 * @return boolean
 */
function test() 
{
    return true;
}

instead of:

/**
 * 
 * @return bool
 */
function test() 
{
    return true;
}

Did this work correctly in an earlier version?

No / Don't know

Operating System

Debian 10

JDK

OpenJDK 64-Bit Server VM 11.0.16+8-post-Debian-1deb10u1

Apache NetBeans packaging

Apache NetBeans binary zip

Anything else

No response

Are you willing to submit a pull request?

Yes

Code of Conduct

Yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    PHP[ci] enable extra PHP tests (php/php.editor)kind:bugBug report or fix

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions