swoole-src icon indicating copy to clipboard operation
swoole-src copied to clipboard

Method signature changes (setCookie)

Open ValiDrv opened this issue 3 years ago • 1 comments

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".

ValiDrv avatar Aug 01 '22 14:08 ValiDrv

https://github.com/swoole/swoole-src/pull/4830

NathanFreeman avatar Sep 10 '22 04:09 NathanFreeman

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 avatar Nov 09 '22 16:11 ValiDrv

@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.

matyhtf avatar Nov 12 '22 01:11 matyhtf