webimpress / coding-standard

Webimpress Coding Standard for PHP_CodeSniffer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PHP 7.4 typed property questions

mrVrAlex opened this issue · comments

Hello,
First question about PropertyCommentWithAnyAnnotations and callable type:

Fatal error: Property PropertyCommentWithAnyAnnotations::$callback cannot have type callable in /in/XPBJE on line 35

Secondly, sniff WebimpressCodingStandard.Classes.NoNullValues.NullValue too aggresive with code like:

class PropertyWithNullableType
{
    public ?\DateTime $typed = null;
}

Maybe exclude checking null if property is nullable, because assign to null in this case not redundant?