nette/http

setCookie() expire type issue

lukaspijak opened this issue ยท 3 comments

Version: 3.3.0

Bug Description

Hello @dg,

in interface Nette\Http\IResponse you add to setCookie method to expiration parameter union type ?int. But in documentation you can use string date representation. For example in Nette\Bridges\SecurityHttp\CookieStorage has property $cookieExpiration union type ?string, but on line 51 you use ?string in setCookie, it can cause type error.

Will it be possible to specify expiration using string|int|null in the future, or will everything be refactored to ?int?

mabar commented

Ideally it should be string|int|\DateTimeInterface|null, as in the Response implementation.
Or at least add it as a BC break in release notes, please

I have added the type back in #237, let's see if it will be merged and released :-)