From 5471d511d2e2310388b8bb1ee64602d2a6bac128 Mon Sep 17 00:00:00 2001 From: tony Date: Wed, 23 Jun 2021 08:46:08 +0100 Subject: [PATCH 1/3] Fix PHP8 issue with required parameters --- lib/OauthPhirehose.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/OauthPhirehose.php b/lib/OauthPhirehose.php index 5b024df..7b36499 100644 --- a/lib/OauthPhirehose.php +++ b/lib/OauthPhirehose.php @@ -28,9 +28,9 @@ abstract class OauthPhirehose extends Phirehose /** */ protected function prepareParameters($method = null, $url = null, - array $params) + array $params= []) { - if (empty($method) || empty($url)) + if (empty($method) || empty($url) || empty ($params) ) return false; $oauth['oauth_consumer_key'] = $this->consumerKey?$this->consumerKey:TWITTER_CONSUMER_KEY; From 310770659410aa0c74031b85e6480a4fb06de695 Mon Sep 17 00:00:00 2001 From: Tony Byng Date: Wed, 23 Jun 2021 10:01:10 +0100 Subject: [PATCH 2/3] Removed overzealous check for an empty array --- lib/OauthPhirehose.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/OauthPhirehose.php b/lib/OauthPhirehose.php index 7b36499..5d1afc5 100644 --- a/lib/OauthPhirehose.php +++ b/lib/OauthPhirehose.php @@ -30,7 +30,7 @@ abstract class OauthPhirehose extends Phirehose protected function prepareParameters($method = null, $url = null, array $params= []) { - if (empty($method) || empty($url) || empty ($params) ) + if (empty($method) || empty($url) ) return false; $oauth['oauth_consumer_key'] = $this->consumerKey?$this->consumerKey:TWITTER_CONSUMER_KEY; From 520ab74a5c5213ee5e8c14c3b467f02b82bac115 Mon Sep 17 00:00:00 2001 From: Tony Byng Date: Thu, 24 Jun 2021 16:05:16 +0100 Subject: [PATCH 3/3] Update OauthPhirehose.php --- lib/OauthPhirehose.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/OauthPhirehose.php b/lib/OauthPhirehose.php index 5d1afc5..958fcda 100644 --- a/lib/OauthPhirehose.php +++ b/lib/OauthPhirehose.php @@ -30,7 +30,7 @@ abstract class OauthPhirehose extends Phirehose protected function prepareParameters($method = null, $url = null, array $params= []) { - if (empty($method) || empty($url) ) + if (empty($method) || empty($url)) return false; $oauth['oauth_consumer_key'] = $this->consumerKey?$this->consumerKey:TWITTER_CONSUMER_KEY;