Skip to content

Optional Php and DocTypes in Type classes #12

@TiiFuchs

Description

@TiiFuchs

In the following example the PHP type is ?PhotoSize, but in the PhpDoc it only says PhotoSize.

https://github.com/telepath-php/telepath/blob/6fd31204b0969ab86e1b0a8fa4c9b1b4470ef0cb/src/Telegram/StickerSet.php#L41-L58

I think the ?PhotoSize comes from the Laravel Pint reformatting after generation, because it recognizes the = null and adjusts the type accordingly.

But it would be nice to be consistent with both.

Probably both can be achieved by checking if the type is optional in Type::buildPhpType and Type::buildDocType. (Needs to be passed in \App\Telegram\Types\Field)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions