-
-
Notifications
You must be signed in to change notification settings - Fork 35
Closed
Description
In our application, we often times have to create Brick objects (LocalDate, Duration, TimeZone, etc) with code like this :
null !== $var ? Duration::parse($var) : nullIt would be nice if methods like parse-rs would allow null in input, and directly return it if it is null indeed. It would go along with a PHPDoc stating @return ($input is null ? null : self), so that static analysers can tell which result it will be. And that way, no more bloated ternaries at call-site.
WDYT ? I'd be willing to work on a pull request in the upcoming two weeks, if that's something you would accept in the library. Let me know!
Biganon
Metadata
Metadata
Assignees
Labels
No labels