Skip to content

Type hinting: bool or boolean #1864

Open
@VijitCoder

Description

@VijitCoder

The sniffer makes a pretty strange requirement. He is always want to see the boolean as a type hint. But, at the same time PHP 7.1 supports only bool as a type hinting. So, to make everyone happy I need to write the hinting in two versions:

   /**
     * Some comment here
     *
     * @return boolean
     */
    public function isUserActive(): bool
    {
        return false;
    }

This is weird from the coding viewpoint.

Here is a discussion about the right hinting https://stackoverflow.com/a/44009101/5497749

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions