swoole-src
swoole-src copied to clipboard
Method signature changes (setCookie)
Hello
In version 5, the Swoole\Http\Response->setCookie() changed from:
->setCookie(name: $name,value: $value, expires: $expires, path: $path, domain: $domain, secure: $secure, httponly: $httponly);
to
->setCookie(name: $name,value: $value, expire: $expires, path: $path, domain: $domain, secure: $secure, httponly: $httponly);
(notice the expire vs expires argument)
Since in PHP8 you can use named arguments, this is a braking change that should probably be documented, since allot of times methods can be called with ->setCookie(...$cookieArray), and that can introduce hidden bugs.
Also, since swoole/ide-helper and wiki.swoole.com is not being released in the same time as swoole-src tag, this adds to most complains people have about Swoole, "the documentation".
https://github.com/swoole/swoole-src/pull/4830
Thank you for renaming the parameter. in v 5.0.1 But please make sure to add it to the TAG release notes next time, since this is a breaking change...
@ValiDrv The renaming of the parameter name I think is just a typo fix, should not be a breaking change.
This may indeed be incompatible with named parameters. I'll add it to release note later.