swooletw / laravel-swoole

High performance HTTP server based on Swoole. Speed up your Laravel or Lumen applications.
MIT License
4.04k stars 390 forks source link

maybe a bug #473

Closed liamhao closed 3 years ago

liamhao commented 3 years ago

This style of function declaration has been deprecated in PHP 8.0. Writing functions like this has never made sense, since all parameters (up to the last required one) would need to be specified when the function was called.

Arkanius commented 3 years ago

Well, I agree that having null at $message seems quite redundant. Removing it otherwise, looks like a BC, isn't it? I don't know if $message should be a mixed type. I think it's always a string, in this case, we could do something like:

...
?string $message
liamhao commented 3 years ago

I think there will still be array type $message, such as an Illuminate\Database\Eloquent\Model. So that I can return multiple fields each time. By the way:

image image image image

Arkanius commented 3 years ago

You need to insert those headers with your nginx server. The nginx server will act as a proxy to swoole server. See: https://github.com/swooletw/laravel-swoole/wiki/9.-Nginx-Configuration

What does BC mean?

BC means breaking change :sweat_smile:

liamhao commented 3 years ago

Why not insert those headers to swoole server? This will omit nginx server.

Arkanius commented 3 years ago

I don't think it's a good idea. Using nginx you're free to use your own headers