diff --git a/composer.json b/composer.json index 65543ad..c13b320 100644 --- a/composer.json +++ b/composer.json @@ -21,7 +21,7 @@ "require": { "php": ">=8.0", "guzzlehttp/guzzle": "^7.5.0", - "firebase/php-jwt": "^v6.4.0" + "firebase/php-jwt": "^v7.0.2" }, "require-dev": { "friendsofphp/php-cs-fixer": "^3.14.0", diff --git a/lib/GetStream/Stream/Client.php b/lib/GetStream/Stream/Client.php index f2bcddd..ed4233c 100644 --- a/lib/GetStream/Stream/Client.php +++ b/lib/GetStream/Stream/Client.php @@ -132,7 +132,7 @@ public function setLocation($location) * @param ?array $extra_data * @return string */ - public function createUserSessionToken($user_id, array $extra_data=null) + public function createUserSessionToken($user_id, ?array $extra_data=null) { if (is_null($extra_data)) { $extra_data = []; @@ -145,7 +145,7 @@ public function createUserSessionToken($user_id, array $extra_data=null) * @param ?array $extra_data * @return string */ - public function createUserToken($user_id, array $extra_data=null) + public function createUserToken($user_id, ?array $extra_data=null) { if (is_null($extra_data)) { $extra_data = []; diff --git a/lib/GetStream/Stream/ClientInterface.php b/lib/GetStream/Stream/ClientInterface.php index 2cfa05f..fb45ee7 100644 --- a/lib/GetStream/Stream/ClientInterface.php +++ b/lib/GetStream/Stream/ClientInterface.php @@ -30,14 +30,14 @@ public function getCustomHttpHandlerStack(); * @param ?array $extra_data * @return string */ - public function createUserSessionToken($user_id, array $extra_data = null); + public function createUserSessionToken($user_id, ?array $extra_data = null); /** * @param string $user_id * @param ?array $extra_data * @return string */ - public function createUserToken($user_id, array $extra_data = null); + public function createUserToken($user_id, ?array $extra_data = null); /** * @param BaseFeedInterface $feed diff --git a/lib/GetStream/Stream/Reactions.php b/lib/GetStream/Stream/Reactions.php index 9350500..2e98058 100644 --- a/lib/GetStream/Stream/Reactions.php +++ b/lib/GetStream/Stream/Reactions.php @@ -71,7 +71,7 @@ private function doRequest($method, $endpoint, $params=null) * * @return array */ - public function add($kind, $activityId, $userId, array $data=null, array $targetFeeds=null, $targetFeedsExtraData=null) + public function add($kind, $activityId, $userId, ?array $data=null, ?array $targetFeeds=null, $targetFeedsExtraData=null) { $payload = [ 'kind' => $kind, @@ -102,7 +102,7 @@ public function add($kind, $activityId, $userId, array $data=null, array $target * * @return array */ - public function addChild($kind, $parentId, $userId, array $data=null, array $targetFeeds=null, $targetFeedsExtraData=null) + public function addChild($kind, $parentId, $userId, ?array $data=null, ?array $targetFeeds=null, $targetFeedsExtraData=null) { $payload = [ 'kind' => $kind, @@ -170,7 +170,7 @@ public function restore($reactionId) * * @return array */ - public function filter($lookupField, $lookupValue, $kind=null, array $params=null) + public function filter($lookupField, $lookupValue, $kind=null, ?array $params=null) { if (!in_array($lookupField, ["reaction_id", "activity_id", "user_id"])) { throw new StreamFeedException("Invalid request parameters"); @@ -205,7 +205,7 @@ public function get($reactionId) * * @return array */ - public function update($reactionId, array $data=null, array $targetFeeds=null, $targetFeedsExtraData=null) + public function update($reactionId, ?array $data=null, ?array $targetFeeds=null, $targetFeedsExtraData=null) { $payload = []; if ($data !== null) { diff --git a/lib/GetStream/Stream/Users.php b/lib/GetStream/Stream/Users.php index e04df20..003e1b3 100644 --- a/lib/GetStream/Stream/Users.php +++ b/lib/GetStream/Stream/Users.php @@ -65,7 +65,7 @@ private function doRequest($method, $endpoint, $params=null) * * @return array */ - public function add($userId, array $data=null, $getOrCreate=null) + public function add($userId, ?array $data=null, $getOrCreate=null) { $endpoint = 'user/'; $payload = [ @@ -126,7 +126,7 @@ public function get($userId) * @return array */ - public function update($userId, array $data=null) + public function update($userId, ?array $data=null) { $payload = []; if ($data !== null) { diff --git a/tests/unit/ClientTest.php b/tests/unit/ClientTest.php index f1ca1ab..3014f11 100644 --- a/tests/unit/ClientTest.php +++ b/tests/unit/ClientTest.php @@ -47,21 +47,21 @@ public function testClientSigning() public function testClientFeed() { - $client = new Client('key', 'secret', $location='qa'); + $client = new Client('key', str_repeat('s', 32), $location='qa'); $feed1 = $client->feed('flat', '1'); $this->assertSame($feed1->getId(), 'flat:1'); } public function testCreateReference() { - $client = new Client('key', 'secret', $location='qa'); + $client = new Client('key', str_repeat('s', 32), $location='qa'); $ref = $client->collections()->createReference("item", "42"); $this->assertEquals($ref, "SO:item:42"); } public function testCreateUserReference() { - $client = new Client('key', 'secret', $location='qa'); + $client = new Client('key', str_repeat('s', 32), $location='qa'); $ref = $client->users()->createReference("42"); $this->assertEquals($ref, "SU:42"); }