docs icon indicating copy to clipboard operation
docs copied to clipboard

Document explicit `null` type hint

Open arogachev opened this issue 3 years ago • 5 comments

Prefer string|null over ?string. Introduced in https://github.com/yiisoft/yii-widgets/pull/53.

arogachev avatar Sep 30 '22 11:09 arogachev

I like ? more but don't mind having a single style.

samdark avatar Oct 04 '22 08:10 samdark

So it's optional?

arogachev avatar Oct 04 '22 09:10 arogachev

It's OK to force a single style for Yii packages.

samdark avatar Oct 06 '22 20:10 samdark

Ideal solution — create rector rule. Unfortunately, there is no such thing among built-in rules.

vjik avatar Oct 13 '22 19:10 vjik

For php > 8.0

string|null its ideal, for explicit. (Union types).

terabytesoftw avatar Oct 13 '22 19:10 terabytesoftw