fennb / phirehose

PHP interface to Twitter Streaming API
709 stars 189 forks source link

Required parameter $params follows optional parameter $method #127

Open tonybyng opened 3 years ago

tonybyng commented 3 years ago

Hi

Im getting the error

Required parameter $params follows optional parameter $method

in a PHP 8 system

Its triggered from

https://github.com/fennb/phirehose/blob/1f7fe131cd07035e784d2c5b742070b702151114/lib/OauthPhirehose.php#L30

and you can no longer have required parameters appearing after optional parameters in PHP 8

I think adding a " = [] " after the array $params would solve the problem without requiring a change of parameter order and maybe an empty() check in the body of the method to ensure it is required ?

Tony